[{"data":1,"prerenderedAt":2047},["ShallowReactive",2],{"knowledge-routes":3,"zh:footer-pages":643,"zh:\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fcomponent-base":656,"zh:\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fcomponent-base:navigation":2011,"zh:related:\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fsection-rendering-morph,\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fkeyed-hydration,\u002Fshopify\u002Fthemes\u002Fhorizon\u002Farchitecture,\u002Fshopify\u002Fthemes\u002Fhorizon\u002Freading-source":2016,"zh:graph:\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fcomponent-base":2025},{"en":4,"zh":32},[5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31],"\u002Fshopify\u002Fshopify-app-boundaries","\u002Fshopify\u002Fshopify-app-distribution","\u002Fshopify\u002Fshopify-app-environment-strategy","\u002Fshopify\u002Fshopify-app-review-access","\u002Fshopify\u002Fshopify-app-usage-billing","\u002Fshopify\u002Fshopify-multiple-apps-shared-backend","\u002Fshopify\u002Fshopify-oauth-redirect-callback","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fadd-to-cart-race","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fcomponent-base","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fkeyed-hydration","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Flayout-thrashing","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fliquid-smart-contrast","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fsection-rendering-morph","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fview-transitions","\u002Fshopify\u002Ftopics\u002Fapps-integrations","\u002Fdomains\u002Facquisition-marketing","\u002Fdomains\u002Fcustomer-service","\u002Fdomains\u002Fdata-analytics","\u002Fdomains\u002Ffinance-compliance","\u002Fdomains\u002Ffulfillment-logistics","\u002Fdomains\u002Fpayments","\u002Fdomains\u002Fplatform-development","\u002Fdomains\u002Fproduct-pricing","\u002Fdomains\u002Fretention","\u002Fdomains\u002Fstorefront-experience","\u002Fjourney\u002Fconvert","\u002Ffunnel\u002Fintent",[33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,5,6,7,8,9,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,10,328,329,11,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,12,387,388,389,390,391,13,392,393,394,14,395,15,16,396,397,398,399,400,401,402,17,403,404,405,18,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,490,491,492,493,494,495,496,497,498,499,500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546,547,548,549,550,551,552,553,554,555,556,557,558,559,560,561,562,563,564,565,566,567,568,569,570,571,572,573,574,575,576,577,578,579,580,581,582,583,584,585,586,587,588,589,590,19,591,592,593,594,595,596,597,598,599,600,601,602,603,604,605,606,607,608,609,610,611,612,613,614,615,616,617,618,619,620,621,622,623,624,625,626,627,628,629,630,631,20,21,22,23,24,25,26,27,28,29,632,633,30,634,635,636,637,638,639,640,31,641,642],"\u002Fcommerce\u002Faccessibility-compliance-baseline","\u002Fcommerce\u002Fad-creative-testing","\u002Fcommerce\u002Fapi-authentication","\u002Fcommerce\u002Fapp-distribution-models","\u002Fcommerce\u002Fassortment-planning","\u002Fcommerce\u002Fattribution-basics","\u002Fcommerce\u002Faudiences-remarketing","\u002Fcommerce\u002Fcampaign-formats","\u002Fcommerce\u002Fcheckout-design","\u002Fcommerce\u002Fcheckout-funnel","\u002Fcommerce\u002Fclearance-sales","\u002Fcommerce\u002Fcohort-analysis","\u002Fcommerce\u002Fconsent-and-advertising","\u002Fcommerce\u002Fconsumer-protection-basics","\u002Fcommerce\u002Fcontent-acquisition","\u002Fcommerce\u002Fcontent-localization","\u002Fcommerce\u002Fcontent-repurposing","\u002Fcommerce\u002Fcross-border-basics","\u002Fcommerce\u002Fcustom-data-modeling","\u002Fcommerce\u002Fcustomer-account-access","\u002Fcommerce\u002Fcustomer-data-platform","\u002Fcommerce\u002Fcustomer-demand-validation","\u002Fcommerce\u002Fcustomer-feedback-analysis","\u002Fcommerce\u002Fcustomer-journey-models","\u002Fcommerce\u002Fcustomer-lifecycle-segmentation","\u002Fcommerce\u002Fcustomer-support-channels","\u002Fcommerce\u002Fdata-collection","\u002Fcommerce\u002Fdata-quality","\u002Fcommerce\u002Fdelivery-promise","\u002Fcommerce\u002Fdomain-dns-tls","\u002Fcommerce\u002Fdtc-customer-journey","\u002Fcommerce\u002Femail-sms-marketing","\u002Fcommerce\u002Fenvironments-permissions","\u002Fcommerce\u002Fevent-tracking-plan","\u002Fcommerce\u002Fexperimentation","\u002Fcommerce\u002Fflash-sales","\u002Fcommerce\u002Ffulfillment-delivery","\u002Fcommerce\u002Fgift-with-purchase-bundles","\u002Fcommerce\u002Fgiveaways-contests","\u002Fcommerce\u002Fheadless-commerce","\u002Fcommerce\u002Fidentity-resolution","\u002Fcommerce\u002Finfluencer-collaborations","\u002Fcommerce\u002Finventory-accuracy","\u002Fcommerce\u002Finventory-basics","\u002Fcommerce\u002Finventory-replenishment","\u002Fcommerce\u002Fjourney-stage-alignment","\u002Fcommerce\u002Floyalty-programs","\u002Fcommerce\u002Fmarketing-budget-pacing","\u002Fcommerce\u002Fmarketing-campaign-review","\u002Fcommerce\u002Fmarketing-contact-frequency","\u002Fcommerce\u002Fmarketing-funnel","\u002Fcommerce\u002Fmedia-asset-management","\u002Fcommerce\u002Fmetric-definitions","\u002Fcommerce\u002Forder-event-ad-spend-grain","\u002Fcommerce\u002Forder-unit-economics","\u002Fcommerce\u002Fpaid-acquisition-signals","\u002Fcommerce\u002Fpartial-page-updates","\u002Fcommerce\u002Fpayment-methods","\u002Fcommerce\u002Fpayments-chargebacks","\u002Fcommerce\u002Fpeak-season-campaigns","\u002Fcommerce\u002Fplatform-extension-points","\u002Fcommerce\u002Fpost-purchase-education","\u002Fcommerce\u002Fpre-orders","\u002Fcommerce\u002Fpricing-discounts","\u002Fcommerce\u002Fprivacy-consent-basics","\u002Fcommerce\u002Fproduct-information","\u002Fcommerce\u002Fproduct-launches-drops","\u002Fcommerce\u002Fproduct-search-visibility","\u002Fcommerce\u002Freferral-programs","\u002Fcommerce\u002Frepeat-purchase-retention","\u002Fcommerce\u002Freturns-refunds","\u002Fcommerce\u002Freverse-logistics","\u002Fcommerce\u002Freview-collection","\u002Fcommerce\u002Fsales-channel-publishing","\u002Fcommerce\u002Fsales-tax-vat-basics","\u002Fcommerce\u002Fshipping-rates-strategy","\u002Fcommerce\u002Fstaff-access-control","\u002Fcommerce\u002Fstorefront-component-lifecycle","\u002Fcommerce\u002Fstorefront-design-tokens","\u002Fcommerce\u002Fstorefront-release-validation","\u002Fcommerce\u002Fstorefront-rendering-performance","\u002Fcommerce\u002Fsubscription-commerce","\u002Fcommerce\u002Fthreshold-promotions","\u002Fcommerce\u002Ftransactional-notifications","\u002Fcommerce\u002Furl-redirects","\u002Fcommerce\u002Fusage-based-billing","\u002Fcommerce\u002Fwebhooks","\u002Fcommerce\u002Fwin-back","\u002Fcontent-types\u002Fbrand-story","\u002Fcontent-types\u002Fbrand-values","\u002Fcontent-types\u002Fcore-message","\u002Fcontent-types\u002Fcustomer-reviews","\u002Fcontent-types\u002Fcustomer-testimonials","\u002Fcontent-types\u002Femail-signup","\u002Fcontent-types\u002Ffaq","\u002Fcontent-types\u002Ffeatured-products","\u002Fcontent-types\u002Fguarantee","\u002Fcontent-types\u002Floyalty-rewards","\u002Fcontent-types\u002Fmedia-coverage","\u002Fcontent-types\u002Fpackage-contents","\u002Fcontent-types\u002Fpayment-options","\u002Fcontent-types\u002Fproduct-categories","\u002Fcontent-types\u002Fproduct-overview","\u002Fcontent-types\u002Fproduct-showcase","\u002Fcontent-types\u002Fproduct-specifications","\u002Fcontent-types\u002Fproduct-video","\u002Fcontent-types\u002Fpromotions","\u002Fcontent-types\u002Fproof-metrics","\u002Fcontent-types\u002Frelated-products","\u002Fcontent-types\u002Fresources","\u002Fcontent-types\u002Fshipping-delivery-info","\u002Fcontent-types\u002Fsocial-follow","\u002Fcontent-types\u002Fsupport-contact","\u002Fcontent-types\u002Fthird-party-reviews","\u002Fcontent-types\u002Ftrust-marks","\u002Fcontent-types\u002Ftypes","\u002Fcontent-types\u002Fuser-generated-content","\u002Felevar\u002Fshopify-delivery-chain","\u002Fgoogle-ads\u002Fdynamic-remarketing-feed","\u002Fgoogle-ads\u002Fenhanced-conversions-boundaries","\u002Fgoogle-ads\u002Ftransaction-id-and-reconciliation","\u002Fgoogle-analytics\u002Fcustom-dimensions-and-reconciliation","\u002Fgoogle-analytics\u002Fecommerce-event-mapping","\u002Fgoogle-analytics\u002Fmeasurement-protocol","\u002Fgoogle-analytics\u002Fpage-view-and-spa","\u002Fgoogle-analytics\u002Fproperty-stream-debugging","\u002Fgoogle-merchant-center\u002Fgoogle-ads-linking","\u002Fgoogle-merchant-center\u002Fproduct-feed-review","\u002Fgoogle-tag-manager\u002Fconsent-trigger-troubleshooting","\u002Fgoogle-tag-manager\u002Fcontainers-and-publishing","\u002Fgoogle-tag-manager\u002Fdata-layer-events","\u002Fgoogle-tag-manager\u002Ftag-stack","\u002Fgorgias\u002Fmacros-automation","\u002Fgorgias\u002Ftickets-orders","\u002Fjudge-me\u002Freview-request-scheduling","\u002Fjudge-me\u002Freview-widget-verification","\u002Fklaviyo\u002Fdelivery-unsubscribe-troubleshooting","\u002Fklaviyo\u002Fflow-triggers-and-filters","\u002Fklaviyo\u002Fsubscription-consent-sources","\u002Fmeta-ads\u002Fcustomer-audience-sync","\u002Fmeta-ads\u002Fpixel-capi-event-mapping","\u002Fmeta-ads\u002Fpurchase-event-duplicates","\u002Fmodules\u002Favailability-notification","\u002Fmodules\u002Fbuy-box","\u002Fmodules\u002Fcart-summary","\u002Fmodules\u002Fcollection-browse-filter","\u002Fmodules\u002Fcookie-consent","\u002Fmodules\u002Fcross-sell-upsell","\u002Fmodules\u002Ffit-guidance","\u002Fmodules\u002Fpage-composition","\u002Fmodules\u002Fpatterns","\u002Fmodules\u002Fproduct-selection","\u002Fmodules\u002Fproduct-support-navigation","\u002Fmodules\u002Fpromotion-redemption","\u002Fmodules\u002Freview-display","\u002Fmodules\u002Fsignup-capture","\u002Fmodules\u002Fsite-search","\u002Fmodules\u002Fsocial-proof-strip","\u002Fmodules\u002Fsubscription-terms-summary","\u002Fmodules\u002Fvariant-media-gallery","\u002Fpaypal\u002Fcheckout-disputes","\u002Fpaypal\u002Frefund-not-received","\u002Fpaypal\u002Fsettlement-reconciliation","\u002Fpresentation\u002Faccordion","\u002Fpresentation\u002Fbadge","\u002Fpresentation\u002Fbanner","\u002Fpresentation\u002Fbefore-after","\u002Fpresentation\u002Fcallout","\u002Fpresentation\u002Fcards","\u002Fpresentation\u002Fcarousel","\u002Fpresentation\u002Fcomparison","\u002Fpresentation\u002Fcountdown-timer","\u002Fpresentation\u002Fdrawer","\u002Fpresentation\u002Fempty-state","\u002Fpresentation\u002Fgrid","\u002Fpresentation\u002Fhero","\u002Fpresentation\u002Fhotspot","\u002Fpresentation\u002Finline-form","\u002Fpresentation\u002Flist","\u002Fpresentation\u002Fmarquee","\u002Fpresentation\u002Fmasonry","\u002Fpresentation\u002Fmedia-gallery","\u002Fpresentation\u002Fmodal","\u002Fpresentation\u002Fnavigation-menu","\u002Fpresentation\u002Foverlay","\u002Fpresentation\u002Fpagination","\u002Fpresentation\u002Fpatterns","\u002Fpresentation\u002Fpopover","\u002Fpresentation\u002Fprogress-bar","\u002Fpresentation\u002Frating-stars","\u002Fpresentation\u002Fscroll-reveal","\u002Fpresentation\u002Fsingle-column","\u002Fpresentation\u002Fskeleton-loader","\u002Fpresentation\u002Fsplit","\u002Fpresentation\u002Fstepper","\u002Fpresentation\u002Fsticky-bar","\u002Fpresentation\u002Fswatch","\u002Fpresentation\u002Ftable","\u002Fpresentation\u002Ftabs","\u002Fpresentation\u002Ftimeline","\u002Fpresentation\u002Ftoast","\u002Fregulations\u002Fca-casl","\u002Fregulations\u002Fca-pipeda-consent","\u002Fregulations\u002Feu-accessibility-act","\u002Fregulations\u002Feu-consumer-rights","\u002Fregulations\u002Feu-gdpr-eprivacy-consent","\u002Fregulations\u002Feu-price-reduction-indication","\u002Fregulations\u002Feu-psd2-sca","\u002Fregulations\u002Feu-ucpd-reviews-ranking","\u002Fregulations\u002Feu-vat-oss-ioss","\u002Fregulations\u002Fuk-consumer-contracts","\u002Fregulations\u002Fuk-consumer-rights","\u002Fregulations\u002Fuk-dmcc-reviews-pricing","\u002Fregulations\u002Fuk-gdpr-pecr-consent","\u002Fregulations\u002Fuk-vat-overseas-sellers","\u002Fregulations\u002Fus-can-spam","\u002Fregulations\u002Fus-consumer-reviews-testimonials","\u002Fregulations\u002Fus-endorsement-guides","\u002Fregulations\u002Fus-mail-order-rule","\u002Fregulations\u002Fus-tcpa-text-consent","\u002Fshopify\u002Farticle","\u002Fshopify\u002Farticle\u002Fbuying-guide-article","\u002Fshopify\u002Farticle\u002Fhow-to-article","\u002Fshopify\u002Fblog","\u002Fshopify\u002Fcart","\u002Fshopify\u002Fcollection","\u002Fshopify\u002Fcollection\u002Fcampaign-collection-page","\u002Fshopify\u002Fcollection\u002Fcategory-collection-page","\u002Fshopify\u002Fdawn-vs-horizon","\u002Fshopify\u002Fdiscount-troubleshooting","\u002Fshopify\u002Femail-platform-comparison","\u002Fshopify\u002Fhomepage","\u002Fshopify\u002Finventory-mismatch","\u002Fshopify\u002Flist-collections","\u002Fshopify\u002Forder-analytics-reconciliation","\u002Fshopify\u002Fpage","\u002Fshopify\u002Fpage\u002Fabout-us","\u002Fshopify\u002Fpage\u002Fbrand-story","\u002Fshopify\u002Fpage\u002Fcampaign-landing","\u002Fshopify\u002Fpage\u002Fcontact-us","\u002Fshopify\u002Fpage\u002Ffaq","\u002Fshopify\u002Fpage\u002Fgiveaway","\u002Fshopify\u002Fpage\u002Floyalty-program","\u002Fshopify\u002Fpage\u002Forder-tracking","\u002Fshopify\u002Fpage\u002Fpolicies","\u002Fshopify\u002Fpage\u002Fpress","\u002Fshopify\u002Fpage\u002Freviews","\u002Fshopify\u002Fpage\u002Fshipping-returns","\u002Fshopify\u002Fpage\u002Fsize-guide","\u002Fshopify\u002Fpage\u002Fstore-locator","\u002Fshopify\u002Fpayment-gateway-comparison","\u002Fshopify\u002Fpreorder-delay-troubleshooting","\u002Fshopify\u002Fproduct","\u002Fshopify\u002Fproduct\u002Ffit-sensitive-product-page","\u002Fshopify\u002Fproduct\u002Fpreorder-subscription-page","\u002Fshopify\u002Fproduct\u002Fproduct-drop-page","\u002Fshopify\u002Fproduct\u002Fstandard-product-page","\u002Fshopify\u002Freview-options-comparison","\u002Fshopify\u002Fsearch","\u002Fshopify\u002Fshipping-rate-troubleshooting","\u002Fshopify\u002Fshopify-admin-api-graphql","\u002Fshopify\u002Fshopify-admin-map","\u002Fshopify\u002Fshopify-amount-check","\u002Fshopify\u002Fshopify-analytics-reports","\u002Fshopify\u002Fshopify-b2b","\u002Fshopify\u002Fshopify-bundles","\u002Fshopify\u002Fshopify-checkout-customization","\u002Fshopify\u002Fshopify-collections-publishing","\u002Fshopify\u002Fshopify-custom-data","\u002Fshopify\u002Fshopify-customer-accounts","\u002Fshopify\u002Fshopify-customer-privacy","\u002Fshopify\u002Fshopify-customer-segments","\u002Fshopify\u002Fshopify-discounts","\u002Fshopify\u002Fshopify-domains-dns","\u002Fshopify\u002Fshopify-ecosystem","\u002Fshopify\u002Fshopify-ecosystem-analysis","\u002Fshopify\u002Fshopify-entry-map","\u002Fshopify\u002Fshopify-file-sync-diff","\u002Fshopify\u002Fshopify-files-media","\u002Fshopify\u002Fshopify-flow","\u002Fshopify\u002Fshopify-follow-on-shop","\u002Fshopify\u002Fshopify-fraud-disputes","\u002Fshopify\u002Fshopify-fulfillment-delivery","\u002Fshopify\u002Fshopify-functions-extensions","\u002Fshopify\u002Fshopify-gift-cards","\u002Fshopify\u002Fshopify-headless","\u002Fshopify\u002Fshopify-identities-permissions","\u002Fshopify\u002Fshopify-inventory-locations","\u002Fshopify\u002Fshopify-knowledge-base-method","\u002Fshopify\u002Fshopify-knowledge-source-inventory","\u002Fshopify\u002Fshopify-local-delivery-pickup","\u002Fshopify\u002Fshopify-marketing-channels","\u002Fshopify\u002Fshopify-marketing-messaging","\u002Fshopify\u002Fshopify-markets-shipping","\u002Fshopify\u002Fshopify-multi-currency-pricing","\u002Fshopify\u002Fshopify-navigation-menus","\u002Fshopify\u002Fshopify-notifications-emails","\u002Fshopify\u002Fshopify-online-store-preferences","\u002Fshopify\u002Fshopify-order-payment-status","\u002Fshopify\u002Fshopify-orders-management","\u002Fshopify\u002Fshopify-payments-checkout","\u002Fshopify\u002Fshopify-plans","\u002Fshopify\u002Fshopify-pos","\u002Fshopify\u002Fshopify-product-import-export","\u002Fshopify\u002Fshopify-products-variants","\u002Fshopify\u002Fshopify-purchase-journey","\u002Fshopify\u002Fshopify-purchase-validation","\u002Fshopify\u002Fshopify-returns-refunds","\u002Fshopify\u002Fshopify-sales-channels","\u002Fshopify\u002Fshopify-search-and-discovery","\u002Fshopify\u002Fshopify-selling-plans","\u002Fshopify\u002Fshopify-shipping-rates-labels","\u002Fshopify\u002Fshopify-storefront","\u002Fshopify\u002Fshopify-storefront-performance","\u002Fshopify\u002Fshopify-storefront-seo-framework","\u002Fshopify\u002Fshopify-tagging-options","\u002Fshopify\u002Fshopify-taxes-duties","\u002Fshopify\u002Fshopify-theme-management","\u002Fshopify\u002Fshopify-translation-localization","\u002Fshopify\u002Fshopify-url-redirects","\u002Fshopify\u002Fshopify-verification-priorities","\u002Fshopify\u002Fshopify-web-pixels","\u002Fshopify\u002Fshopify-webhooks-events","\u002Fshopify\u002Fsubscription-app-comparison","\u002Fshopify\u002Ftheme\u002Farchitecture","\u002Fshopify\u002Ftheme\u002Fcapability-modules","\u002Fshopify\u002Ftheme\u002Fcontent-architecture","\u002Fshopify\u002Ftheme\u002Fdecision-patterns-and-states","\u002Fshopify\u002Ftheme\u002Fdelivery-framework","\u002Fshopify\u002Ftheme\u002Fglobal-regions","\u002Fshopify\u002Ftheme\u002Flayout","\u002Fshopify\u002Ftheme\u002Flocales","\u002Fshopify\u002Ftheme\u002Fsettings","\u002Fshopify\u002Ftheme\u002Ftemplates","\u002Fshopify\u002Fthemes\u002Fdawn\u002Faccessibility-patterns","\u002Fshopify\u002Fthemes\u002Fdawn\u002Farchitecture","\u002Fshopify\u002Fthemes\u002Fdawn\u002Fbuy-form-and-availability","\u002Fshopify\u002Fthemes\u002Fdawn\u002Fcart-drawer-notification","\u002Fshopify\u002Fthemes\u002Fdawn\u002Fcolor-schemes","\u002Fshopify\u002Fthemes\u002Fdawn\u002Fcontent-sections-and-animations","\u002Fshopify\u002Fthemes\u002Fdawn\u002Fcountdown-timer","\u002Fshopify\u002Fthemes\u002Fdawn\u002Fcustom-elements-pubsub","\u002Fshopify\u002Fthemes\u002Fdawn\u002Ffacets-and-pagination","\u002Fshopify\u002Fthemes\u002Fdawn\u002Fheader-navigation","\u002Fshopify\u002Fthemes\u002Fdawn\u002Fhtml-update-utility","\u002Fshopify\u002Fthemes\u002Fdawn\u002Floading-performance","\u002Fshopify\u002Fthemes\u002Fdawn\u002Fnewsletter-and-badges","\u002Fshopify\u002Fthemes\u002Fdawn\u002Fpredictive-search","\u002Fshopify\u002Fthemes\u002Fdawn\u002Fproduct-media","\u002Fshopify\u002Fthemes\u002Fdawn\u002Fquantity-input","\u002Fshopify\u002Fthemes\u002Fdawn\u002Frecommendations","\u002Fshopify\u002Fthemes\u002Fdawn\u002Fsection-rendering","\u002Fshopify\u002Fthemes\u002Fdawn\u002Ftheme-editor-events","\u002Fshopify\u002Fthemes\u002Fdawn\u002Fvariant-update-protocol","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Farchitecture","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fbadges-reviews-signup","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fbuying","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fcart","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fcollection-search","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fcontent-modules","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Ffacets-and-pagination","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fheader-navigation","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Flayout","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fmarquee-slideshow-animations","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fmedia-zoom-and-hotspots","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fpredictive-search","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fproduct-cards","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fproduct-page","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Freading-source","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Frecommendations","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fsticky-add-to-cart-and-availability","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fstyles","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fvariants","\u002Fshopify\u002Fthemes\u002Fimpact\u002Fbehavior-components","\u002Fshopify\u002Fthemes\u002Fimpact\u002Fcart-events","\u002Fshopify\u002Fthemes\u002Fimpact\u002Fdialog-element","\u002Fshopify\u002Fthemes\u002Fimpact","\u002Fshopify\u002Fthemes\u002Fimpact\u002Flazy-media-player","\u002Fshopify\u002Fthemes\u002Fimpact\u002Fsection-spacing-collapsing","\u002Fshopify\u002Fthemes\u002Fimpact\u002Fvariant-picker-rerender","\u002Fshopify\u002Fthemes","\u002Fshopify\u002Fthemes\u002Fpattern-coverage","\u002Fshopify\u002Fwebhook-delivery-troubleshooting","\u002Ftasks\u002Fadd-product-custom-fields","\u002Ftasks\u002Fanalyse-a-repeat-purchase-cohort","\u002Ftasks\u002Fanalyze-customer-feedback","\u002Ftasks\u002Fanswer-order-status-inquiries","\u002Ftasks\u002Faudit-marketing-contact-pressure","\u002Ftasks\u002Fbuild-a-content-calendar","\u002Ftasks\u002Fcalculate-order-contribution","\u002Ftasks\u002Fcalculate-promotion-margin","\u002Ftasks\u002Fclean-up-a-marketing-list","\u002Ftasks\u002Fcollect-and-display-customer-reviews","\u002Ftasks\u002Fconfigure-sales-tax-or-vat","\u002Ftasks\u002Fconfigure-site-search-and-filters","\u002Ftasks\u002Fdefine-repeat-purchase-metrics","\u002Ftasks\u002Fdesign-loyalty-points-rules","\u002Ftasks\u002Fdiagnose-storefront-performance","\u002Ftasks\u002Fenable-and-test-a-payment-method","\u002Ftasks\u002Fevaluate-and-install-an-app","\u002Ftasks\u002Fhandle-a-delayed-order","\u002Ftasks\u002Fhandle-subscription-pause-and-cancellation","\u002Ftasks\u002Fintegrate-and-verify-a-webhook","\u002Ftasks\u002Flaunch-a-referral-program","\u002Ftasks\u002Fplan-a-discount-campaign","\u002Ftasks\u002Fplan-a-peak-season-campaign","\u002Ftasks\u002Fplan-a-product-assortment","\u002Ftasks\u002Fplan-a-win-back-campaign","\u002Ftasks\u002Fplan-an-ad-creative-test","\u002Ftasks\u002Fplan-inventory-replenishment","\u002Ftasks\u002Fplan-post-purchase-education","\u002Ftasks\u002Fprocess-a-refund","\u002Ftasks\u002Fprocess-returned-goods","\u002Ftasks\u002Fpublish-privacy-notice","\u002Ftasks\u002Freconcile-orders-and-analytics","\u002Ftasks\u002Frespond-to-a-chargeback","\u002Ftasks\u002Frespond-to-a-negative-review","\u002Ftasks\u002Freview-a-marketing-campaign","\u002Ftasks\u002Freview-creator-deliverables","\u002Ftasks\u002Freview-marketing-budget-pacing","\u002Ftasks\u002Freview-product-page-module-order","\u002Ftasks\u002Frun-a-cycle-count","\u002Ftasks\u002Frun-a-giveaway","\u002Ftasks\u002Frun-a-post-purchase-survey","\u002Ftasks\u002Frun-an-accessibility-baseline","\u002Ftasks\u002Fsend-back-in-stock-notifications","\u002Ftasks\u002Fseparate-development-environments","\u002Ftasks\u002Fset-shipping-rates","\u002Ftasks\u002Fset-up-a-pre-order","\u002Ftasks\u002Fset-up-a-welcome-flow","\u002Ftasks\u002Fset-up-conversion-tracking","\u002Ftasks\u002Fset-up-cookie-consent","\u002Ftasks\u002Fset-up-presales-support","\u002Ftasks\u002Ftag-campaign-links","\u002Ftasks\u002Ftest-a-purchase","\u002Ftasks\u002Fvalidate-a-customer-need","\u002Ftasks\u002Fvalidate-audience-sync","\u002Ftasks\u002Fwrite-a-creator-brief","\u002Ftasks\u002Fwrite-a-return-policy","\u002Ftasks\u002Fwrite-an-event-tracking-plan","\u002Ftasks\u002Fwrite-product-use-and-care-guide","\u002Fterms\u002Fabove-the-fold","\u002Fterms\u002Faccess-scope","\u002Fterms\u002Faccessible-rich-internet-applications","\u002Fterms\u002Famericans-with-disabilities-act","\u002Fterms\u002Fapi-versioning","\u002Fterms\u002Fattribution-model","\u002Fterms\u002Fattribution-window","\u002Fterms\u002Faverage-order-value","\u002Fterms\u002Faverage-resolution-time","\u002Fterms\u002Fbackorder","\u002Fterms\u002Fblack-friday-cyber-monday","\u002Fterms\u002Fbreak-even-point","\u002Fterms\u002Fbusiness-to-business","\u002Fterms\u002Fbusiness-to-consumer","\u002Fterms\u002Fbuy-now-pay-later","\u002Fterms\u002Fcall-to-action","\u002Fterms\u002Fcart-abandonment-rate","\u002Fterms\u002Fcash-flow","\u002Fterms\u002Fcash-on-delivery","\u002Fterms\u002Fchargeback","\u002Fterms\u002Fclick-through-rate","\u002Fterms\u002Fcohort","\u002Fterms\u002Fcontent-delivery-network","\u002Fterms\u002Fcontent-security-policy","\u002Fterms\u002Fcontribution-margin","\u002Fterms\u002Fconversion-rate","\u002Fterms\u002Fconversion-rate-optimization","\u002Fterms\u002Fcost-of-goods-sold","\u002Fterms\u002Fcost-per-action","\u002Fterms\u002Fcost-per-click","\u002Fterms\u002Fcost-per-mille","\u002Fterms\u002Fcross-selling","\u002Fterms\u002Fcumulative-layout-shift","\u002Fterms\u002Fcustomer-acquisition-cost","\u002Fterms\u002Fcustomer-churn-rate","\u002Fterms\u002Fcustomer-effort-score","\u002Fterms\u002Fcustomer-lifetime-value","\u002Fterms\u002Fcustomer-relationship-management","\u002Fterms\u002Fcustomer-retention-rate","\u002Fterms\u002Fcustomer-satisfaction-score","\u002Fterms\u002Fdays-of-supply","\u002Fterms\u002Fdelivered-at-place","\u002Fterms\u002Fdelivered-duty-paid","\u002Fterms\u002Fdirect-to-consumer","\u002Fterms\u002Fdomain-name-system-record","\u002Fterms\u002Femail-delivery-rate","\u002Fterms\u002Feuropean-accessibility-act","\u002Fterms\u002Fevent","\u002Fterms\u002Ffeature-flag","\u002Fterms\u002Ffirst-contact-resolution","\u002Fterms\u002Ffirst-response-time","\u002Fterms\u002Fgeneral-data-protection-regulation","\u002Fterms\u002Fglobal-trade-item-number","\u002Fterms\u002Fgross-margin","\u002Fterms\u002Fgross-merchandise-value","\u002Fterms\u002Fgross-profit","\u002Fterms\u002Fharmonized-system-code","\u002Fterms\u002Fhash-based-message-authentication-code","\u002Fterms\u002Fideal-customer-profile","\u002Fterms\u002Fidempotency-key","\u002Fterms\u002Fimport-one-stop-shop","\u002Fterms\u002Finteraction-to-next-paint","\u002Fterms\u002Finventory-record-accuracy","\u002Fterms\u002Flanded-cost","\u002Fterms\u002Flargest-contentful-paint","\u002Fterms\u002Flead-time","\u002Fterms\u002Fminimum-order-quantity","\u002Fterms\u002Fmonth-to-date","\u002Fterms\u002Fmonthly-recurring-revenue","\u002Fterms\u002Fnet-promoter-score","\u002Fterms\u002Fnet-sales","\u002Fterms\u002Foauth-2-authorization-framework","\u002Fterms\u002Fpayment-authorization","\u002Fterms\u002Fpayment-capture","\u002Fterms\u002Fpayment-settlement","\u002Fterms\u002Fpoint-of-sale","\u002Fterms\u002Fpre-order","\u002Fterms\u002Fproduct-bundle","\u002Fterms\u002Fproduct-detail-page","\u002Fterms\u002Fproduct-market-fit","\u002Fterms\u002Fproduct-variant","\u002Fterms\u002Frate-limiting","\u002Fterms\u002Freactivation-rate","\u002Fterms\u002Frecency-frequency-monetary","\u002Fterms\u002Frefund","\u002Fterms\u002Freorder-point","\u002Fterms\u002Frepeat-purchase-rate","\u002Fterms\u002Fresponsive-web-design","\u002Fterms\u002Freturn-on-ad-spend","\u002Fterms\u002Freturn-rate","\u002Fterms\u002Frevenue-per-session","\u002Fterms\u002Fsafety-stock","\u002Fterms\u002Fsearch-engine-marketing","\u002Fterms\u002Fsearch-engine-optimization","\u002Fterms\u002Fsell-through-rate","\u002Fterms\u002Fservice-level-agreement","\u002Fterms\u002Fsession","\u002Fterms\u002Fstaging-environment","\u002Fterms\u002Fstock-keeping-unit","\u002Fterms\u002Fstrong-customer-authentication","\u002Fterms\u002Fsubscription-churn-rate","\u002Fterms\u002Ftelevision-commercial","\u002Fterms\u002Fthird-party-logistics","\u002Fterms\u002Fthree-domain-secure","\u002Fterms\u002Fticket-backlog","\u002Fterms\u002Ftls-certificate","\u002Fterms\u002Funique-selling-proposition","\u002Fterms\u002Funsubscribe-rate","\u002Fterms\u002Fup-selling","\u002Fterms\u002Furchin-tracking-module","\u002Fterms\u002Fuser","\u002Fterms\u002Fuser-generated-content","\u002Fterms\u002Fvalue-added-tax","\u002Fterms\u002Fweb-content-accessibility-guidelines","\u002Fterms\u002Fwebhook","\u002Fwordpress\u002Ftemplates-and-content","\u002Fwordpress\u002Ftheme-json-and-patterns","\u002Fshopify\u002Ftopics\u002Fcustomers","\u002Fshopify\u002Ftopics\u002Fdata-automation","\u002Fshopify\u002Ftopics\u002Fecosystem","\u002Fshopify\u002Ftopics\u002Fofficial-themes","\u002Fshopify\u002Ftopics\u002Fpage-composition-patterns","\u002Fshopify\u002Ftopics\u002Fproducts-content","\u002Fshopify\u002Ftopics\u002Fstore-management","\u002Fshopify\u002Ftopics\u002Fstorefront","\u002Fshopify\u002Ftopics\u002Fstorefront-content-types","\u002Fshopify\u002Ftopics\u002Fstorefront-modules","\u002Fshopify\u002Ftopics\u002Fstorefront-pages","\u002Fshopify\u002Ftopics\u002Ftransactions","\u002Fcommerce\u002Fpaths\u002Fcampaign-planning","\u002Fcommerce\u002Fpaths\u002Fcampaign-tracking","\u002Fcommerce\u002Fpaths\u002Fcommerce-concepts","\u002Fcommerce\u002Fpaths\u002Fcommerce-terms-foundation","\u002Fcommerce\u002Fpaths\u002Fcompliance-baseline","\u002Fcommerce\u002Fpaths\u002Fconsent-and-tracking","\u002Fcommerce\u002Fpaths\u002Fcustomer-demand-validation","\u002Fcommerce\u002Fpaths\u002Fecommerce-tracking-implementation","\u002Fcommerce\u002Fpaths\u002Fmarketing-measurement","\u002Fcommerce\u002Fpaths\u002Forder-unit-economics","\u002Fcommerce\u002Fpaths\u002Fplatform-development-foundations","\u002Fcommerce\u002Fpaths\u002Fplatform-integration-foundations","\u002Fcommerce\u002Fpaths\u002Fpost-purchase-operations","\u002Fcommerce\u002Fpaths\u002Fproduct-to-purchase","\u002Fcommerce\u002Fpaths\u002Frepeat-purchase-cohorts","\u002Fcommerce\u002Fpaths\u002Fretention-operations","\u002Fcommerce\u002Fpaths\u002Fshipping-and-service","\u002Fcommerce\u002Fpaths\u002Ftrustworthy-commerce-data","\u002Fshopify\u002Fpaths\u002Fbuild-your-store","\u002Fshopify\u002Fpaths\u002Fcontent-foundations","\u002Fshopify\u002Fpaths\u002Fdawn","\u002Fshopify\u002Fpaths\u002Fofficial-themes","\u002Fshopify\u002Fpaths\u002Fpage-recipes","\u002Fshopify\u002Fpaths\u002Fplatform-basics","\u002Fshopify\u002Fpaths\u002Fpresentation-accessibility","\u002Fshopify\u002Fpaths\u002Fstorefront-platform-mechanisms","\u002Fshopify\u002Fpaths\u002Ftheme-foundations","\u002Fshopify\u002Fpaths\u002Ftheme-pattern-audit","\u002Fshopify\u002Fpaths\u002Fvalidate-purchase-tracking","\u002Fjourney\u002Fdiscover","\u002Fjourney\u002Fevaluate","\u002Fjourney\u002Frepurchase","\u002Fjourney\u002Fuse","\u002Fjourney\u002Fengage","\u002Fjourney\u002Fdeliver","\u002Ffunnel\u002Fawareness","\u002Ffunnel\u002Finterest","\u002Ffunnel\u002Fconsideration","\u002Ffunnel\u002Fpurchase","\u002Ffunnel\u002Fengage",[644,648,652],{"id":645,"path":646,"title":647},"zh_sitePages\u002Fabout.md","\u002Fabout","关于 WooDawn",{"id":649,"path":650,"title":651},"zh_sitePages\u002Flegal\u002Fprivacy.md","\u002Flegal\u002Fprivacy","隐私说明",{"id":653,"path":654,"title":655},"zh_sitePages\u002Flegal\u002Fterms.md","\u002Flegal\u002Fterms","内容使用说明",{"document":657,"isArticle":1979},{"id":658,"title":659,"abbreviations":660,"aliases":661,"answers":662,"appliesTo":663,"articleType":664,"body":665,"businessModel":1969,"constrainedBy":1970,"currency":1971,"description":1972,"discussionUrl":663,"domains":1973,"evidenceStatus":1975,"extension":1976,"funnel":1977,"implements":1978,"indexable":1979,"measuredBy":1980,"meta":1981,"metric":663,"navigation":1979,"needs":1982,"originalSources":1983,"path":13,"regions":1984,"related":1985,"reviewAfter":663,"roles":1986,"seo":1988,"seoImage":663,"seoTitle":663,"sources":1989,"stages":1990,"status":1991,"stem":1992,"supersededBy":663,"tags":1993,"term":663,"themeSources":2000,"tools":2004,"updatedAt":2006,"uses":2007,"verification":2008,"verifiedAt":2009,"__hash__":2010},"zh_articles\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fcomponent-base.md","Horizon 的 Web Components 基类：ref 收集、on: 事件委托与升级竞态",[],[],[],null,"guide",{"type":666,"value":667,"toc":1956},"minimark",[668,683,696,700,703,716,721,729,737,778,793,796,866,874,899,906,1006,1021,1024,1060,1191,1227,1231,1242,1245,1396,1407,1420,1423,1539,1543,1551,1668,1696,1703,1714,1759,1769,1829,1883,1886,1928,1931,1940,1943,1952],[669,670,671,672,682],"p",{},"本文基于 Horizon 4.2.0，源码固定到 ",[673,674,678],"a",{"href":675,"rel":676},"https:\u002F\u002Fgithub.com\u002FShopify\u002Fhorizon\u002Ftree\u002F5acd1b6b66c02f61d3216e3adace5dd9e0404fc9",[677],"nofollow",[679,680,681],"code",{},"5acd1b6","（核验于 2026-10-07）。结论限于此提交；本篇为静态源码分析，未在店铺中实测。",[669,684,685,686,689,690,695],{},"Horizon 的前端没有用 Alpine、Stimulus 或任何框架，仓库里也没有构建配置。交互组件都继承同一个基类 ",[679,687,688],{},"Component","，定义在 ",[673,691,694],{"href":692,"rel":693},"https:\u002F\u002Fgithub.com\u002FShopify\u002Fhorizon\u002Fblob\u002F5acd1b6b66c02f61d3216e3adace5dd9e0404fc9\u002Fassets\u002Fcomponent.js",[677],"assets\u002Fcomponent.js","，整个文件 392 行。",[697,698,699],"h2",{"id":699},"它解决什么问题",[669,701,702],{},"Liquid 在服务端输出 HTML，JS 只负责\"认领\"已有的 DOM 并挂上行为。这类场景下，虚拟 DOM、响应式渲染等框架能力用不上，真正需要的只有三件事：",[704,705,706,710,713],"ol",{},[707,708,709],"li",{},"方便地拿到子元素引用；",[707,711,712],{},"把 DOM 事件绑定到组件方法上；",[707,714,715],{},"DOM 被服务端重新渲染替换后，上面两件事仍然成立。",[669,717,718,720],{},[679,719,688],{}," 就是这三件事的最小实现。",[697,722,724,725,728],{"id":723},"一ref声明式子元素引用","一、",[679,726,727],{},"ref","：声明式子元素引用",[669,730,731,736],{},[673,732,735],{"href":733,"rel":734},"https:\u002F\u002Fgithub.com\u002FShopify\u002Fhorizon\u002Fblob\u002F5acd1b6b66c02f61d3216e3adace5dd9e0404fc9\u002Fsnippets\u002Fquantity-selector.liquid",[677],"snippets\u002Fquantity-selector.liquid"," 的写法，简化后如下：",[738,739,744],"pre",{"className":740,"code":741,"language":742,"meta":743,"style":743},"language-liquid shiki shiki-themes github-light","\u003Cquantity-selector-component>\n  \u003Cbutton ref=\"minusButton\" on:click=\"\u002FdecreaseQuantity\">-\u003C\u002Fbutton>\n  \u003Cinput ref=\"quantityInput\">\n  \u003Cbutton ref=\"plusButton\" on:click=\"\u002FincreaseQuantity\">+\u003C\u002Fbutton>\n\u003C\u002Fquantity-selector-component>\n","liquid","",[679,745,746,754,760,766,772],{"__ignoreMap":743},[747,748,751],"span",{"class":749,"line":750},"line",1,[747,752,753],{},"\u003Cquantity-selector-component>\n",[747,755,757],{"class":749,"line":756},2,[747,758,759],{},"  \u003Cbutton ref=\"minusButton\" on:click=\"\u002FdecreaseQuantity\">-\u003C\u002Fbutton>\n",[747,761,763],{"class":749,"line":762},3,[747,764,765],{},"  \u003Cinput ref=\"quantityInput\">\n",[747,767,769],{"class":749,"line":768},4,[747,770,771],{},"  \u003Cbutton ref=\"plusButton\" on:click=\"\u002FincreaseQuantity\">+\u003C\u002Fbutton>\n",[747,773,775],{"class":749,"line":774},5,[747,776,777],{},"\u003C\u002Fquantity-selector-component>\n",[669,779,780,781,784,785,788,789,792],{},"JS 里直接用 ",[679,782,783],{},"this.refs.quantityInput","。属性值以 ",[679,786,787],{},"[]"," 结尾（如 ",[679,790,791],{},"ref=\"quantitySelectors[]\"","）时，收集为数组。",[669,794,795],{},"实现上有几个值得注意的点：",[797,798,799,818,828,853],"ul",{},[707,800,801,805,806,809,810,813,814,817],{},[802,803,804],"strong",{},"归属判断","：收集 ",[679,807,808],{},"[ref]"," 时，只保留\"最近的 Component 祖先就是自己\"的元素，组件嵌套时内层组件的 ref 不会泄漏到外层。判断函数 ",[679,811,812],{},"getClosestComponent"," 借助 ",[679,815,816],{},"getAncestor"," 在遇到 Shadow Root 时跳到宿主元素继续向上找。",[707,819,820,823,824,827],{},[802,821,822],{},"按约定识别未升级组件","：标签名以 ",[679,825,826],{},"-component"," 结尾的元素，即使 JS 还没执行，也被视为组件边界。这样，模块加载顺序不会影响 ref 的归属。",[707,829,830,836,837,840,841,844,845,848,849,852],{},[802,831,832,835],{},[679,833,834],{},"requiredRefs"," 快速失败","：子类声明 ",[679,838,839],{},"requiredRefs = ['quantityInput', 'minusButton', 'plusButton']","（",[679,842,843],{},"component-quantity-selector.js"," 就是这样写的），缺失时直接抛出 ",[679,846,847],{},"MissingRefError","，错误信息带组件标签名，不会等到运行时才报 ",[679,850,851],{},"undefined","。",[707,854,855,858,859,862,863,865],{},[802,856,857],{},"延迟挂观察器","：MutationObserver 在 ",[679,860,861],{},"requestIdleCallback"," 里才开始观察，首屏不承担这部分开销。观察范围只限 ",[679,864,727],{}," 属性和子节点增删。",[697,867,869,870,873],{"id":868},"二on事件全局事件委托","二、",[679,871,872],{},"on:事件","：全局事件委托",[738,875,877],{"className":740,"code":876,"language":742,"meta":743,"style":743},"\u003Cbutton on:click=\"\u002FdecreaseQuantity\">\n\u003Cbutton on:click=\"#cart-drawer\u002Fclose\">\n\u003Cimg on:click=\"#zoom-dialog-{{ block_id }}\u002Fopen\u002F{{ forloop.index0 }}\">\n\u003Cbutton on:click=\"\u002FremoveFilter?form=\">\n",[679,878,879,884,889,894],{"__ignoreMap":743},[747,880,881],{"class":749,"line":750},[747,882,883],{},"\u003Cbutton on:click=\"\u002FdecreaseQuantity\">\n",[747,885,886],{"class":749,"line":756},[747,887,888],{},"\u003Cbutton on:click=\"#cart-drawer\u002Fclose\">\n",[747,890,891],{"class":749,"line":762},[747,892,893],{},"\u003Cimg on:click=\"#zoom-dialog-{{ block_id }}\u002Fopen\u002F{{ forloop.index0 }}\">\n",[747,895,896],{"class":749,"line":768},[747,897,898],{},"\u003Cbutton on:click=\"\u002FremoveFilter?form=\">\n",[669,900,901,902,905],{},"属性值的语法是 ",[679,903,904],{},"[选择器]\u002F方法名[\u002F数据 或 ?查询串]","：",[907,908,909,925],"table",{},[910,911,912],"thead",{},[913,914,915,919,922],"tr",{},[916,917,918],"th",{},"写法",[916,920,921],{},"目标组件",[916,923,924],{},"方法参数",[926,927,928,944,960,976,992],"tbody",{},[913,929,930,936,939],{},[931,932,933],"td",{},[679,934,935],{},"\u002Fclose",[931,937,938],{},"最近的 Component 祖先",[931,940,941],{},[679,942,943],{},"(event)",[913,945,946,951,956],{},[931,947,948],{},[679,949,950],{},"#cart-drawer\u002Fclose",[931,952,953],{},[679,954,955],{},"document.querySelector('#cart-drawer')",[931,957,958],{},[679,959,943],{},[913,961,962,967,972],{},[931,963,964],{},[679,965,966],{},".card\u002Fselect",[931,968,969],{},[679,970,971],{},"element.closest('.card')",[931,973,974],{},[679,975,943],{},[913,977,978,983,986],{},[931,979,980],{},[679,981,982],{},"\u002Fopen\u002F3",[931,984,985],{},"最近的祖先",[931,987,988,991],{},[679,989,990],{},"(3, event)","，数字自动转换",[913,993,994,999,1001],{},[931,995,996],{},[679,997,998],{},"\u002Fremove?form=a&x=true",[931,1000,985],{},[931,1002,1003],{},[679,1004,1005],{},"({form:'a', x:true}, event)",[669,1007,1008,1009,1012,1013,1016,1017,1020],{},"实现方式是：",[802,1010,1011],{},"整个 document 只注册一次监听","，每种事件类型一个捕获阶段监听器。事件到达时，先看事件目标自身是否带 ",[679,1014,1015],{},"on:\u003C类型>","，否则用 ",[679,1018,1019],{},"closest('[on\\\\:click]')"," 向上找声明元素，再解析属性值、定位组件、调用方法。",[669,1022,1023],{},"两个细节值得学：",[669,1025,1026,1032,1033,1036,1037,1039,1040,1043,1044,1047,1048,1051,1052,1055,1056,1059],{},[802,1027,1028,1029,852],{},"用 Proxy 改写 ",[679,1030,1031],{},"event.target"," 用户点的可能是按钮里的 ",[679,1034,1035],{},"\u003Csvg>","，但方法里通常希望 ",[679,1038,1031],{}," 就是声明了 ",[679,1041,1042],{},"on:click"," 的那个按钮。当两者不同时，Horizon 不新建事件对象，而是包一层 Proxy，只拦截 ",[679,1045,1046],{},"target","，其余属性透传。方法类属性（",[679,1049,1050],{},"preventDefault"," 等）会 ",[679,1053,1054],{},"bind"," 回原事件，否则调用时 ",[679,1057,1058],{},"this"," 会指向 Proxy 并报 Illegal invocation：",[738,1061,1065],{"className":1062,"code":1063,"language":1064,"meta":743,"style":743},"language-js shiki shiki-themes github-light","new Proxy(event, {\n  get(target, property) {\n    if (property === 'target') return element;\n    const value = Reflect.get(target, property);\n    return typeof value === 'function' ? value.bind(target) : value;\n  },\n});\n","js",[679,1066,1067,1081,1101,1125,1146,1179,1185],{"__ignoreMap":743},[747,1068,1069,1073,1077],{"class":749,"line":750},[747,1070,1072],{"class":1071},"sD7c4","new",[747,1074,1076],{"class":1075},"s7eDp"," Proxy",[747,1078,1080],{"class":1079},"sgsFI","(event, {\n",[747,1082,1083,1086,1089,1092,1095,1098],{"class":749,"line":756},[747,1084,1085],{"class":1075},"  get",[747,1087,1088],{"class":1079},"(",[747,1090,1046],{"class":1091},"sqxcx",[747,1093,1094],{"class":1079},", ",[747,1096,1097],{"class":1091},"property",[747,1099,1100],{"class":1079},") {\n",[747,1102,1103,1106,1109,1112,1116,1119,1122],{"class":749,"line":762},[747,1104,1105],{"class":1071},"    if",[747,1107,1108],{"class":1079}," (property ",[747,1110,1111],{"class":1071},"===",[747,1113,1115],{"class":1114},"sYBdl"," 'target'",[747,1117,1118],{"class":1079},") ",[747,1120,1121],{"class":1071},"return",[747,1123,1124],{"class":1079}," element;\n",[747,1126,1127,1130,1134,1137,1140,1143],{"class":749,"line":768},[747,1128,1129],{"class":1071},"    const",[747,1131,1133],{"class":1132},"sYu0t"," value",[747,1135,1136],{"class":1071}," =",[747,1138,1139],{"class":1079}," Reflect.",[747,1141,1142],{"class":1075},"get",[747,1144,1145],{"class":1079},"(target, property);\n",[747,1147,1148,1151,1154,1157,1159,1162,1165,1168,1170,1173,1176],{"class":749,"line":774},[747,1149,1150],{"class":1071},"    return",[747,1152,1153],{"class":1071}," typeof",[747,1155,1156],{"class":1079}," value ",[747,1158,1111],{"class":1071},[747,1160,1161],{"class":1114}," 'function'",[747,1163,1164],{"class":1071}," ?",[747,1166,1167],{"class":1079}," value.",[747,1169,1054],{"class":1075},[747,1171,1172],{"class":1079},"(target) ",[747,1174,1175],{"class":1071},":",[747,1177,1178],{"class":1079}," value;\n",[747,1180,1182],{"class":749,"line":1181},6,[747,1183,1184],{"class":1079},"  },\n",[747,1186,1188],{"class":749,"line":1187},7,[747,1189,1190],{"class":1079},"});\n",[669,1192,1193,1196,1197,1200,1201,1204,1205,1208,1209,1212,1213,1200,1216,1219,1220,1223,1224,1226],{},[802,1194,1195],{},"区分冒泡和不冒泡的事件。"," ",[679,1198,1199],{},"focus","、",[679,1202,1203],{},"blur"," 不冒泡，但在捕获阶段仍能在 document 上收到，所以单独列入 ",[679,1206,1207],{},"shouldBubble","，照样用 ",[679,1210,1211],{},"closest"," 向上查找。",[679,1214,1215],{},"pointerenter",[679,1217,1218],{},"pointerleave"," 被列为 ",[679,1221,1222],{},"expensiveEvents","：只匹配事件目标本身，不做 ",[679,1225,1211],{}," 查找，避免指针移动时频繁遍历 DOM。",[697,1228,1230],{"id":1229},"三自定义元素升级竞态","三、自定义元素升级竞态",[669,1232,1233,1234,1237,1238,1241],{},"页面上 ",[679,1235,1236],{},"\u003Ccart-drawer-component>"," 已经存在，但定义它的模块还没执行完，此时用户点击了按钮。",[679,1239,1240],{},"instance instanceof Component"," 为 false，事件就被静默丢掉了，网络慢的用户会遇到\"点了没反应\"。",[669,1243,1244],{},"Horizon 的处理：",[738,1246,1248],{"className":1062,"code":1247,"language":1064,"meta":743,"style":743},"if (\n  !(instance instanceof Component) &&\n  instance instanceof HTMLElement &&\n  instance.tagName.toLowerCase().endsWith('-component')\n) {\n  customElements.upgrade(instance);\n  if (!(instance instanceof Component)) {\n    console.warn(`[component] Dropped \"${event.type}\" on \u003C...> — element not yet upgraded`);\n    return;\n  }\n}\n",[679,1249,1250,1258,1277,1290,1312,1316,1327,1347,1376,1384,1390],{"__ignoreMap":743},[747,1251,1252,1255],{"class":749,"line":750},[747,1253,1254],{"class":1071},"if",[747,1256,1257],{"class":1079}," (\n",[747,1259,1260,1263,1266,1269,1272,1274],{"class":749,"line":756},[747,1261,1262],{"class":1071},"  !",[747,1264,1265],{"class":1079},"(instance ",[747,1267,1268],{"class":1071},"instanceof",[747,1270,1271],{"class":1075}," Component",[747,1273,1118],{"class":1079},[747,1275,1276],{"class":1071},"&&\n",[747,1278,1279,1282,1284,1287],{"class":749,"line":762},[747,1280,1281],{"class":1079},"  instance ",[747,1283,1268],{"class":1071},[747,1285,1286],{"class":1075}," HTMLElement",[747,1288,1289],{"class":1071}," &&\n",[747,1291,1292,1295,1298,1301,1304,1306,1309],{"class":749,"line":768},[747,1293,1294],{"class":1079},"  instance.tagName.",[747,1296,1297],{"class":1075},"toLowerCase",[747,1299,1300],{"class":1079},"().",[747,1302,1303],{"class":1075},"endsWith",[747,1305,1088],{"class":1079},[747,1307,1308],{"class":1114},"'-component'",[747,1310,1311],{"class":1079},")\n",[747,1313,1314],{"class":749,"line":774},[747,1315,1100],{"class":1079},[747,1317,1318,1321,1324],{"class":749,"line":1181},[747,1319,1320],{"class":1079},"  customElements.",[747,1322,1323],{"class":1075},"upgrade",[747,1325,1326],{"class":1079},"(instance);\n",[747,1328,1329,1332,1335,1338,1340,1342,1344],{"class":749,"line":1187},[747,1330,1331],{"class":1071},"  if",[747,1333,1334],{"class":1079}," (",[747,1336,1337],{"class":1071},"!",[747,1339,1265],{"class":1079},[747,1341,1268],{"class":1071},[747,1343,1271],{"class":1075},[747,1345,1346],{"class":1079},")) {\n",[747,1348,1350,1353,1356,1358,1361,1364,1367,1370,1373],{"class":749,"line":1349},8,[747,1351,1352],{"class":1079},"    console.",[747,1354,1355],{"class":1075},"warn",[747,1357,1088],{"class":1079},[747,1359,1360],{"class":1114},"`[component] Dropped \"${",[747,1362,1363],{"class":1079},"event",[747,1365,1366],{"class":1114},".",[747,1368,1369],{"class":1079},"type",[747,1371,1372],{"class":1114},"}\" on \u003C...> — element not yet upgraded`",[747,1374,1375],{"class":1079},");\n",[747,1377,1379,1381],{"class":749,"line":1378},9,[747,1380,1150],{"class":1071},[747,1382,1383],{"class":1079},";\n",[747,1385,1387],{"class":749,"line":1386},10,[747,1388,1389],{"class":1079},"  }\n",[747,1391,1393],{"class":749,"line":1392},11,[747,1394,1395],{"class":1079},"}\n",[669,1397,1398,1399,1402,1403,1406],{},"源码注释说明 ",[679,1400,1401],{},"customElements.upgrade"," 是同步、幂等的：类已注册但元素还没升级时立即升级；元素已升级或类还没注册时什么也不做。如果仍然失败，就打一条 warn，",[802,1404,1405],{},"不静默吞掉","。注释还提到，这类静默失败是他们近期 Playwright 测试不稳定的主要来源。",[669,1408,1409,1410,1413,1414,1416,1417,1419],{},"兜底块之后还有一道 ",[679,1411,1412],{},"if (!(instance instanceof Component)) return;","：目标不是 ",[679,1415,688],{},"（例如选择器定位到普通元素、标签不以 ",[679,1418,826],{}," 结尾，或没有找到实例）时直接返回，既不 warn 也不调用方法。",[669,1421,1422],{},"事件委托加模块异步加载的架构，都要考虑\"DOM 先到、行为后到\"这个窗口期。",[738,1424,1428],{"className":1425,"code":1426,"language":1427,"meta":743,"style":743},"language-mermaid shiki shiki-themes github-light","flowchart TB\n  accTitle: Horizon 4.2.0 Component 的全局事件委托与升级兜底\n  accDescr: document 上每种事件类型一个捕获阶段监听器；先找声明 on 属性的元素，解析属性值并定位组件；组件未升级且标签以 -component 结尾时先同步升级，仍失败就 warn 并丢弃；目标不是 Component 时静默返回；方法名不是函数时静默跳过。\n  listen[\"document 上每种事件类型\u003Cbr\u002F>一个捕获阶段监听器\"] --> self{\"事件目标自身带 on:类型？\"}\n  self -->|是| decl[\"得到声明元素\"]\n  self -->|否| expensive{\"pointerenter 或 pointerleave？\u003Cbr\u002F>（expensiveEvents）\"}\n  expensive -->|是| noLookup[\"只匹配目标本身，\u003Cbr\u002F>不做 closest 查找\"]\n  expensive -->|否| closest[\"closest 向上找声明元素\"]\n  closest --> decl\n  decl --> parse[\"解析属性值，\u003Cbr\u002F>定位目标组件\"]\n  parse --> notUpgraded{\"不是 Component 实例\u003Cbr\u002F>且标签名以 -component 结尾？\"}\n  notUpgraded -->|是| upgrade[\"customElements.upgrade(instance)\"]\n  upgrade --> still{\"升级后是 Component？\"}\n  still -->|否| warn[\"console.warn 后丢弃事件\"]\n  still -->|是| callable\n  notUpgraded -->|否| isComp{\"instance 是 Component？\"}\n  isComp -->|否| silent[\"静默返回，没有 warn\"]\n  isComp -->|是| callable{\"typeof callback === 'function'？\"}\n  callable -->|否| skip[\"静默跳过，没有 warn\"]\n  callable -->|是| invoke[\"调用方法；声明元素与目标不同时\u003Cbr\u002F>用 Proxy 改写 event.target\"]\n","mermaid",[679,1429,1430,1435,1440,1445,1450,1455,1460,1465,1470,1475,1480,1485,1491,1497,1503,1509,1515,1521,1527,1533],{"__ignoreMap":743},[747,1431,1432],{"class":749,"line":750},[747,1433,1434],{},"flowchart TB\n",[747,1436,1437],{"class":749,"line":756},[747,1438,1439],{},"  accTitle: Horizon 4.2.0 Component 的全局事件委托与升级兜底\n",[747,1441,1442],{"class":749,"line":762},[747,1443,1444],{},"  accDescr: document 上每种事件类型一个捕获阶段监听器；先找声明 on 属性的元素，解析属性值并定位组件；组件未升级且标签以 -component 结尾时先同步升级，仍失败就 warn 并丢弃；目标不是 Component 时静默返回；方法名不是函数时静默跳过。\n",[747,1446,1447],{"class":749,"line":768},[747,1448,1449],{},"  listen[\"document 上每种事件类型\u003Cbr\u002F>一个捕获阶段监听器\"] --> self{\"事件目标自身带 on:类型？\"}\n",[747,1451,1452],{"class":749,"line":774},[747,1453,1454],{},"  self -->|是| decl[\"得到声明元素\"]\n",[747,1456,1457],{"class":749,"line":1181},[747,1458,1459],{},"  self -->|否| expensive{\"pointerenter 或 pointerleave？\u003Cbr\u002F>（expensiveEvents）\"}\n",[747,1461,1462],{"class":749,"line":1187},[747,1463,1464],{},"  expensive -->|是| noLookup[\"只匹配目标本身，\u003Cbr\u002F>不做 closest 查找\"]\n",[747,1466,1467],{"class":749,"line":1349},[747,1468,1469],{},"  expensive -->|否| closest[\"closest 向上找声明元素\"]\n",[747,1471,1472],{"class":749,"line":1378},[747,1473,1474],{},"  closest --> decl\n",[747,1476,1477],{"class":749,"line":1386},[747,1478,1479],{},"  decl --> parse[\"解析属性值，\u003Cbr\u002F>定位目标组件\"]\n",[747,1481,1482],{"class":749,"line":1392},[747,1483,1484],{},"  parse --> notUpgraded{\"不是 Component 实例\u003Cbr\u002F>且标签名以 -component 结尾？\"}\n",[747,1486,1488],{"class":749,"line":1487},12,[747,1489,1490],{},"  notUpgraded -->|是| upgrade[\"customElements.upgrade(instance)\"]\n",[747,1492,1494],{"class":749,"line":1493},13,[747,1495,1496],{},"  upgrade --> still{\"升级后是 Component？\"}\n",[747,1498,1500],{"class":749,"line":1499},14,[747,1501,1502],{},"  still -->|否| warn[\"console.warn 后丢弃事件\"]\n",[747,1504,1506],{"class":749,"line":1505},15,[747,1507,1508],{},"  still -->|是| callable\n",[747,1510,1512],{"class":749,"line":1511},16,[747,1513,1514],{},"  notUpgraded -->|否| isComp{\"instance 是 Component？\"}\n",[747,1516,1518],{"class":749,"line":1517},17,[747,1519,1520],{},"  isComp -->|否| silent[\"静默返回，没有 warn\"]\n",[747,1522,1524],{"class":749,"line":1523},18,[747,1525,1526],{},"  isComp -->|是| callable{\"typeof callback === 'function'？\"}\n",[747,1528,1530],{"class":749,"line":1529},19,[747,1531,1532],{},"  callable -->|否| skip[\"静默跳过，没有 warn\"]\n",[747,1534,1536],{"class":749,"line":1535},20,[747,1537,1538],{},"  callable -->|是| invoke[\"调用方法；声明元素与目标不同时\u003Cbr\u002F>用 Proxy 改写 event.target\"]\n",[697,1540,1542],{"id":1541},"四声明式-shadow-dom-的补水","四、声明式 Shadow DOM 的补水",[669,1544,1545,1547,1548,905],{},[679,1546,688],{}," 继承自同一文件里的 ",[679,1549,1550],{},"DeclarativeShadowElement",[738,1552,1554],{"className":1062,"code":1553,"language":1064,"meta":743,"style":743},"connectedCallback() {\n  if (!this.shadowRoot) {\n    const template = this.querySelector(':scope > template[shadowrootmode=\"open\"]');\n    if (!(template instanceof HTMLTemplateElement)) return;\n    this.attachShadow({ mode: 'open' }).append(template.content.cloneNode(true));\n  }\n}\n",[679,1555,1556,1564,1577,1601,1624,1660,1664],{"__ignoreMap":743},[747,1557,1558,1561],{"class":749,"line":750},[747,1559,1560],{"class":1075},"connectedCallback",[747,1562,1563],{"class":1079},"() {\n",[747,1565,1566,1568,1570,1572,1574],{"class":749,"line":756},[747,1567,1331],{"class":1071},[747,1569,1334],{"class":1079},[747,1571,1337],{"class":1071},[747,1573,1058],{"class":1132},[747,1575,1576],{"class":1079},".shadowRoot) {\n",[747,1578,1579,1581,1584,1586,1589,1591,1594,1596,1599],{"class":749,"line":762},[747,1580,1129],{"class":1071},[747,1582,1583],{"class":1132}," template",[747,1585,1136],{"class":1071},[747,1587,1588],{"class":1132}," this",[747,1590,1366],{"class":1079},[747,1592,1593],{"class":1075},"querySelector",[747,1595,1088],{"class":1079},[747,1597,1598],{"class":1114},"':scope > template[shadowrootmode=\"open\"]'",[747,1600,1375],{"class":1079},[747,1602,1603,1605,1607,1609,1612,1614,1617,1620,1622],{"class":749,"line":768},[747,1604,1105],{"class":1071},[747,1606,1334],{"class":1079},[747,1608,1337],{"class":1071},[747,1610,1611],{"class":1079},"(template ",[747,1613,1268],{"class":1071},[747,1615,1616],{"class":1075}," HTMLTemplateElement",[747,1618,1619],{"class":1079},")) ",[747,1621,1121],{"class":1071},[747,1623,1383],{"class":1079},[747,1625,1626,1629,1631,1634,1637,1640,1643,1646,1649,1652,1654,1657],{"class":749,"line":774},[747,1627,1628],{"class":1132},"    this",[747,1630,1366],{"class":1079},[747,1632,1633],{"class":1075},"attachShadow",[747,1635,1636],{"class":1079},"({ mode: ",[747,1638,1639],{"class":1114},"'open'",[747,1641,1642],{"class":1079}," }).",[747,1644,1645],{"class":1075},"append",[747,1647,1648],{"class":1079},"(template.content.",[747,1650,1651],{"class":1075},"cloneNode",[747,1653,1088],{"class":1079},[747,1655,1656],{"class":1132},"true",[747,1658,1659],{"class":1079},"));\n",[747,1661,1662],{"class":749,"line":1181},[747,1663,1389],{"class":1079},[747,1665,1666],{"class":749,"line":1187},[747,1667,1395],{"class":1079},[669,1669,1670,1673,1674,1200,1677,1680,1681,1688,1689,1692,1693,1695],{},[679,1671,1672],{},"\u003Ctemplate shadowrootmode=\"open\">"," 只在 HTML 首次解析时由浏览器转换成 Shadow Root（文件头注释也这样说明）。通过 ",[679,1675,1676],{},"innerHTML",[679,1678,1679],{},"DOMParser"," 或 morph 插入的组件不会自动转换，必须手动 attach。Horizon 大量依赖 Section Rendering API 局部刷新，这一步不可或缺。",[673,1682,1685],{"href":1683,"rel":1684},"https:\u002F\u002Fgithub.com\u002FShopify\u002Fhorizon\u002Fblob\u002F5acd1b6b66c02f61d3216e3adace5dd9e0404fc9\u002Fassets\u002Foverflow-list.js",[677],[679,1686,1687],{},"overflow-list.js"," 里的 ",[679,1690,1691],{},"OverflowList"," 直接继承 ",[679,1694,1550],{},"，就靠它工作。",[697,1697,1699,1700],{"id":1698},"五与-morph-配合updatedcallback","五、与 morph 配合：",[679,1701,1702],{},"updatedCallback",[669,1704,1705,1706,1710,1711,905],{},"Horizon 用自研的 morph 做局部更新（见 ",[673,1707,1709],{"href":1708},"\u002Fzh\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fsection-rendering-morph","分区刷新与 morph","）。按设计，morph 修改组件子树后，会在微任务里调用组件的 ",[679,1712,1713],{},"updatedCallback()",[738,1715,1717],{"className":1062,"code":1716,"language":1064,"meta":743,"style":743},"updatedCallback() {\n  this.#mutationObserver.takeRecords(); \u002F\u002F 丢弃积压的 mutation，避免重复刷新\n  this.#updateRefs();\n}\n",[679,1718,1719,1725,1743,1755],{"__ignoreMap":743},[747,1720,1721,1723],{"class":749,"line":750},[747,1722,1702],{"class":1075},[747,1724,1563],{"class":1079},[747,1726,1727,1730,1733,1736,1739],{"class":749,"line":756},[747,1728,1729],{"class":1132},"  this",[747,1731,1732],{"class":1079},".#mutationObserver.",[747,1734,1735],{"class":1075},"takeRecords",[747,1737,1738],{"class":1079},"(); ",[747,1740,1742],{"class":1741},"sAwPA","\u002F\u002F 丢弃积压的 mutation，避免重复刷新\n",[747,1744,1745,1747,1749,1752],{"class":749,"line":762},[747,1746,1729],{"class":1132},[747,1748,1366],{"class":1079},[747,1750,1751],{"class":1075},"#updateRefs",[747,1753,1754],{"class":1079},"();\n",[747,1756,1757],{"class":749,"line":768},[747,1758,1395],{"class":1079},[669,1760,1761,1762,1765,1766,1768],{},"morph 判断子树没有变化（",[679,1763,1764],{},"isEqualNode","）时整棵跳过，",[679,1767,1702],{}," 也不会触发。这是有意为之：子树没变，ref 自然也不需要重建。",[669,1770,1771,1772,1777,1778,1781,1782,1785,1786,1789,1790,1793,1794,1797,1798,1800,1801,1777,1806,1809,1810,1812,1813,1815,1816,1818,1819,1821,1822,1200,1825,1828],{},"但按静态阅读，这个回调在分区刷新路径上可能根本不会被调用。",[673,1773,1776],{"href":1774,"rel":1775},"https:\u002F\u002Fgithub.com\u002FShopify\u002Fhorizon\u002Fblob\u002F5acd1b6b66c02f61d3216e3adace5dd9e0404fc9\u002Fassets\u002Fmorph.js",[677],"morph.js"," 的 ",[679,1779,1780],{},"walk"," 最后执行的是 ",[679,1783,1784],{},"options.onAfterUpdate?.(newNode)","，传入的是",[802,1787,1788],{},"新树","里的节点；",[679,1791,1792],{},"MORPH_OPTIONS.onAfterUpdate"," 只在 ",[679,1795,1796],{},"node instanceof Component"," 时排队调用 ",[679,1799,1702],{},"。而 ",[673,1802,1805],{"href":1803,"rel":1804},"https:\u002F\u002Fgithub.com\u002FShopify\u002Fhorizon\u002Fblob\u002F5acd1b6b66c02f61d3216e3adace5dd9e0404fc9\u002Fassets\u002Fsection-renderer.js",[677],"section-renderer.js",[679,1807,1808],{},"morphSection"," 用 ",[679,1811,1679],{}," 解析响应，按 HTML 规范，这种没有浏览上下文的文档里不会升级自定义元素，新树节点不是 ",[679,1814,688],{}," 实例。ref 的同步在多数情况下仍由 MutationObserver 兜住（子节点增删会触发 ",[679,1817,1751],{},"），受影响的主要是覆写了 ",[679,1820,1702],{}," 的子类，如 ",[679,1823,1824],{},"results-list.js",[679,1826,1827],{},"disclosures-summary-fit.js","。这一点未在浏览器中验证。",[738,1830,1832],{"className":1425,"code":1831,"language":1427,"meta":743,"style":743},"flowchart TB\n  accTitle: Horizon 4.2.0 分区刷新路径上 updatedCallback 是否被调用\n  accDescr: 按静态阅读，morphSection 用 DOMParser 解析响应，新树里的自定义元素不会升级，onAfterUpdate 收到的节点不是 Component 实例，updatedCallback 因此不被调用，ref 同步主要靠 MutationObserver 兜底；未在浏览器中验证。\n  parse[\"morphSection 用 DOMParser 解析响应\"] --> equal{\"子树 isEqualNode？\"}\n  equal -->|是| skip[\"整棵跳过，\u003Cbr\u002F>updatedCallback 不触发\"]\n  equal -->|否| walk[\"morph.js 的 walk 修改子树，最后执行\u003Cbr\u002F>options.onAfterUpdate?.(newNode)\"]\n  walk --> isComp{\"传入的新树节点\u003Cbr\u002F>instanceof Component？\"}\n  isComp -->|\"是：按设计\"| queue[\"微任务里调用 updatedCallback()\u003Cbr\u002F>takeRecords 后 #updateRefs\"]\n  isComp -->|\"否：DOMParser 文档里\u003Cbr\u002F>自定义元素不升级\"| missed[\"updatedCallback 不被调用\"]\n  missed --> observer[\"子节点增删触发 MutationObserver\u003Cbr\u002F>由 #updateRefs 兜住 ref 同步\"]\n",[679,1833,1834,1838,1843,1848,1853,1858,1863,1868,1873,1878],{"__ignoreMap":743},[747,1835,1836],{"class":749,"line":750},[747,1837,1434],{},[747,1839,1840],{"class":749,"line":756},[747,1841,1842],{},"  accTitle: Horizon 4.2.0 分区刷新路径上 updatedCallback 是否被调用\n",[747,1844,1845],{"class":749,"line":762},[747,1846,1847],{},"  accDescr: 按静态阅读，morphSection 用 DOMParser 解析响应，新树里的自定义元素不会升级，onAfterUpdate 收到的节点不是 Component 实例，updatedCallback 因此不被调用，ref 同步主要靠 MutationObserver 兜底；未在浏览器中验证。\n",[747,1849,1850],{"class":749,"line":768},[747,1851,1852],{},"  parse[\"morphSection 用 DOMParser 解析响应\"] --> equal{\"子树 isEqualNode？\"}\n",[747,1854,1855],{"class":749,"line":774},[747,1856,1857],{},"  equal -->|是| skip[\"整棵跳过，\u003Cbr\u002F>updatedCallback 不触发\"]\n",[747,1859,1860],{"class":749,"line":1181},[747,1861,1862],{},"  equal -->|否| walk[\"morph.js 的 walk 修改子树，最后执行\u003Cbr\u002F>options.onAfterUpdate?.(newNode)\"]\n",[747,1864,1865],{"class":749,"line":1187},[747,1866,1867],{},"  walk --> isComp{\"传入的新树节点\u003Cbr\u002F>instanceof Component？\"}\n",[747,1869,1870],{"class":749,"line":1349},[747,1871,1872],{},"  isComp -->|\"是：按设计\"| queue[\"微任务里调用 updatedCallback()\u003Cbr\u002F>takeRecords 后 #updateRefs\"]\n",[747,1874,1875],{"class":749,"line":1378},[747,1876,1877],{},"  isComp -->|\"否：DOMParser 文档里\u003Cbr\u002F>自定义元素不升级\"| missed[\"updatedCallback 不被调用\"]\n",[747,1879,1880],{"class":749,"line":1386},[747,1881,1882],{},"  missed --> observer[\"子节点增删触发 MutationObserver\u003Cbr\u002F>由 #updateRefs 兜住 ref 同步\"]\n",[697,1884,1885],{"id":1885},"值得商榷的地方",[797,1887,1888,1901,1910],{},[707,1889,1890,852,1893,1896,1897,1900],{},[802,1891,1892],{},"字符串 DSL 没有类型检查",[679,1894,1895],{},"on:click=\"\u002FdecreaseQuantity\""," 拼错了方法名，只会静默不执行（",[679,1898,1899],{},"typeof callback === 'function'"," 为 false 时直接跳过），连 warn 都没有。前面费心处理了升级竞态，这里却没提示，标准不一致。",[707,1902,1903,1906,1907,1909],{},[802,1904,1905],{},"约定大于配置的代价","。\"",[679,1908,826],{}," 结尾的标签就是组件边界\"是隐式约定，不读源码很难知道。",[707,1911,1912,1915,1916,1200,1918,1920,1921,1200,1924,1927],{},[802,1913,1914],{},"全局监听的事件是写死的 13 种","（11 种常规事件加 ",[679,1917,1215],{},[679,1919,1218],{},"）。想用 ",[679,1922,1923],{},"dblclick",[679,1925,1926],{},"scroll"," 等，得改基类。",[697,1929,1930],{"id":1930},"小结",[669,1932,1933,1935,1936,1939],{},[679,1934,688],{}," 的设计取舍很清楚：",[802,1937,1938],{},"HTML 是唯一的状态来源，JS 只做认领和绑定","。它放弃了响应式，换来零依赖、零构建，以及与服务端整段重新渲染的天然兼容。",[669,1941,1942],{},"对 Liquid 主题来说，这比引入 Alpine 后再处理\"服务端 HTML 替换导致 Alpine 状态丢失\"更省事。代价是：一旦需要客户端状态驱动 UI，就只能手写 DOM 操作。",[669,1944,1945,1946,1951],{},"Horizon 的 ",[673,1947,1950],{"href":1948,"rel":1949},"https:\u002F\u002Fgithub.com\u002FShopify\u002Fhorizon\u002Fblob\u002F5acd1b6b66c02f61d3216e3adace5dd9e0404fc9\u002FLICENSE.md",[677],"LICENSE.md"," 禁止通过 Theme Store 或任何其他渠道分发基于其代码的衍生主题，只允许在服务项目中直接交付给商家自用。本文只做源码分析，借鉴思路请自行实现。",[1953,1954,1955],"style",{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sD7c4, html code.shiki .sD7c4{--shiki-default:#D73A49}html pre.shiki code .s7eDp, html code.shiki .s7eDp{--shiki-default:#6F42C1}html pre.shiki code .sgsFI, html code.shiki .sgsFI{--shiki-default:#24292E}html pre.shiki code .sqxcx, html code.shiki .sqxcx{--shiki-default:#E36209}html pre.shiki code .sYBdl, html code.shiki .sYBdl{--shiki-default:#032F62}html pre.shiki code .sYu0t, html code.shiki .sYu0t{--shiki-default:#005CC5}html pre.shiki code .sAwPA, html code.shiki .sAwPA{--shiki-default:#6A737D}",{"title":743,"searchDepth":756,"depth":756,"links":1957},[1958,1959,1961,1963,1964,1965,1967,1968],{"id":699,"depth":756,"text":699},{"id":723,"depth":756,"text":1960},"一、ref：声明式子元素引用",{"id":868,"depth":756,"text":1962},"二、on:事件：全局事件委托",{"id":1229,"depth":756,"text":1230},{"id":1541,"depth":756,"text":1542},{"id":1698,"depth":756,"text":1966},"五、与 morph 配合：updatedCallback",{"id":1885,"depth":756,"text":1885},{"id":1930,"depth":756,"text":1930},"dtc",[],"historical","基于 Horizon 4.2.0 源码，拆解不依赖框架的 Component 基类：ref 自动收集与归属判断、on: 属性的全局事件委托、自定义元素升级竞态、声明式 Shadow DOM 补水，以及 updatedCallback 与 morph 的配合和其中的疑点。",[1974],"storefront-experience","partial","md",[],[110],true,[],{},[],[],[],[17,14,387,401],[1987],"developer",{"title":659,"description":1972},[692,1774,1803,1683,733,1948],[],"published","shopify\u002Fthemes\u002Fhorizon\u002Fcomponent-base",[1994,1995,1996,1997,1998,1999],"Horizon","Shopify","源码解析","4.2.0","Web Components","事件委托",[2001],{"theme":2002,"version":2003,"url":675},"horizon","4.2.0 · 5acd1b6b66c02f61d3216e3adace5dd9e0404fc9",[2005],"shopify","2026-10-22",[],"依据所列固定提交分析源码；版本差异、独立实验和店铺集成验证的范围分别见正文，不将旧版结果直接用于其他版本。","2026-10-07","jXgDbbgLcLcvme61xFTKQnuoqmeKkvrsEF0gvDub6Cw",{"topic":2012,"paths":2015},{"featured":2013,"title":2014,"path":594},[413,368,382,387,400,389,405,399,391,390,395,404,392,401,370,369,383,380,375,376,381,379,372,384,386,377,374,371,378,367,385,373,398,393,402,394,403,397,396,388,414,13,17,14,18,12,16,15,361],"官方主题解析",[],[2017,2019,2021,2023],{"title":2018,"path":17},"Horizon 的分区刷新与 morph：SectionRenderer 的并发控制和 DOM 合并",{"title":2020,"path":14},"Horizon 的带键延迟水合：只更新 data-hydration-key 标记的节点",{"title":2022,"path":387},"Horizon 架构：从页面组合追到浏览器行为",{"title":2024,"path":401},"Horizon 源码阅读：固定版本、条件分支与证据边界",{"titles":2026,"toolNames":2028,"domainPaths":2041,"reverse":2042},{"\u002Fcommerce\u002Fstorefront-component-lifecycle":2027},"店面组件生命周期：初始化、更新与清理",{"elevar":2029,"google-ads":2030,"google-analytics":2031,"google-merchant-center":2032,"google-tag-manager":2033,"gorgias":2034,"judge-me":2035,"klaviyo":2036,"meta-ads":2037,"paypal":2038,"shopify":1995,"woocommerce":2039,"wordpress":2040},"Elevar","Google Ads","Google Analytics","Google Merchant Center","Google Tag Manager","Gorgias","Judge.me","Klaviyo","Meta Ads","PayPal","WooCommerce","WordPress",[20,21,22,23,24,25,26,27,28,29],{"implements":2043,"measuredBy":2044,"needs":2045,"constrainedBy":2046},[],[],[],[],1792741343853]