@shopify/hydrogen 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) hide show
  1. package/CHANGELOG.md +310 -26
  2. package/dist/esnext/client.d.ts +2 -0
  3. package/dist/esnext/client.js +2 -0
  4. package/dist/esnext/components/CartLineProvider/context.d.ts +10 -10
  5. package/dist/esnext/components/CartProvider/CartProvider.client.d.ts +1 -1
  6. package/dist/esnext/components/CartProvider/CartProvider.client.js +2 -1
  7. package/dist/esnext/components/CartProvider/cart-queries.d.ts +9 -0
  8. package/dist/esnext/components/CartProvider/cart-queries.js +876 -0
  9. package/dist/esnext/components/CartProvider/graphql/CartAttributesUpdateMutation.d.ts +1 -1
  10. package/dist/esnext/components/CartProvider/graphql/CartBuyerIdentityUpdateMutation.d.ts +1 -1
  11. package/dist/esnext/components/CartProvider/graphql/CartCreateMutation.d.ts +1 -1
  12. package/dist/esnext/components/CartProvider/graphql/CartDiscountCodesUpdateMutation.d.ts +1 -1
  13. package/dist/esnext/components/CartProvider/graphql/CartFragment.d.ts +1 -1
  14. package/dist/esnext/components/CartProvider/graphql/CartLineAddMutation.d.ts +1 -1
  15. package/dist/esnext/components/CartProvider/graphql/CartLineRemoveMutation.d.ts +1 -1
  16. package/dist/esnext/components/CartProvider/graphql/CartLineUpdateMutation.d.ts +1 -1
  17. package/dist/esnext/components/CartProvider/graphql/CartNoteUpdateMutation.d.ts +1 -1
  18. package/dist/esnext/components/CartProvider/graphql/CartQuery.d.ts +1 -1
  19. package/dist/esnext/components/CartProvider/hooks.d.ts +1 -1
  20. package/dist/esnext/components/CartProvider/hooks.js +4 -1
  21. package/dist/esnext/components/CartProvider/types.d.ts +1 -1
  22. package/dist/esnext/components/ExternalVideo/ExternalVideo.d.ts +6 -5
  23. package/dist/esnext/components/ExternalVideo/ExternalVideo.js +5 -2
  24. package/dist/esnext/components/Image/Image.d.ts +14 -12
  25. package/dist/esnext/components/Image/Image.js +17 -14
  26. package/dist/esnext/components/Link/Link.client.d.ts +4 -5
  27. package/dist/esnext/components/Link/Link.client.js +5 -4
  28. package/dist/esnext/components/LocalizationProvider/LocalizationClientProvider.client.js +1 -3
  29. package/dist/esnext/components/LocalizationProvider/LocalizationContext.client.d.ts +0 -1
  30. package/dist/esnext/components/LocalizationProvider/LocalizationProvider.server.d.ts +2 -2
  31. package/dist/esnext/components/LocalizationProvider/LocalizationProvider.server.js +15 -4
  32. package/dist/esnext/components/LocalizationProvider/LocalizationQuery.d.ts +1 -8
  33. package/dist/esnext/components/LocalizationProvider/index.d.ts +0 -1
  34. package/dist/esnext/components/LocalizationProvider/index.js +0 -1
  35. package/dist/esnext/components/MediaFile/MediaFile.d.ts +4 -3
  36. package/dist/esnext/components/Metafield/Metafield.client.d.ts +2 -2
  37. package/dist/esnext/components/Metafield/Metafield.client.js +8 -5
  38. package/dist/esnext/components/Metafield/types.d.ts +1 -1
  39. package/dist/esnext/components/ModelViewer/ModelViewer.client.d.ts +57 -56
  40. package/dist/esnext/components/ModelViewer/ModelViewer.client.js +10 -4
  41. package/dist/esnext/components/Money/Money.client.d.ts +5 -4
  42. package/dist/esnext/components/Money/Money.client.js +1 -1
  43. package/dist/esnext/components/ProductDescription/ProductDescription.client.d.ts +9 -4
  44. package/dist/esnext/components/ProductDescription/ProductDescription.client.js +4 -3
  45. package/dist/esnext/components/ProductMetafield/ProductMetafield.client.js +3 -3
  46. package/dist/esnext/components/ProductPrice/ProductPrice.client.js +2 -2
  47. package/dist/esnext/components/ProductProvider/ProductProvider.client.d.ts +3 -2
  48. package/dist/esnext/components/ProductProvider/ProductProvider.client.js +1 -0
  49. package/dist/esnext/components/ProductProvider/context.d.ts +23 -14
  50. package/dist/esnext/components/Seo/CollectionSeo.client.d.ts +3 -2
  51. package/dist/esnext/components/Seo/CollectionSeo.client.js +2 -2
  52. package/dist/esnext/components/Seo/DefaultPageSeo.client.d.ts +3 -2
  53. package/dist/esnext/components/Seo/DescriptionSeo.client.d.ts +2 -2
  54. package/dist/esnext/components/Seo/HomePageSeo.client.d.ts +1 -1
  55. package/dist/esnext/components/Seo/ImageSeo.client.d.ts +3 -2
  56. package/dist/esnext/components/Seo/ImageSeo.client.js +1 -1
  57. package/dist/esnext/components/Seo/PageSeo.client.d.ts +3 -2
  58. package/dist/esnext/components/Seo/ProductSeo.client.d.ts +3 -3
  59. package/dist/esnext/components/Seo/ProductSeo.client.js +10 -5
  60. package/dist/esnext/components/Seo/Seo.client.d.ts +10 -7
  61. package/dist/esnext/components/Seo/TitleSeo.client.d.ts +3 -4
  62. package/dist/esnext/components/Seo/TwitterSeo.client.d.ts +1 -1
  63. package/dist/esnext/components/Seo/seo-types.d.ts +17 -0
  64. package/dist/esnext/components/{ExternalVideo/ExternalVideoFragment.js → Seo/seo-types.js} +0 -0
  65. package/dist/esnext/components/UnitPrice/UnitPrice.client.d.ts +7 -6
  66. package/dist/esnext/components/UnitPrice/UnitPrice.client.js +1 -1
  67. package/dist/esnext/components/Video/Video.d.ts +5 -4
  68. package/dist/esnext/components/Video/Video.js +10 -2
  69. package/dist/esnext/components/index.d.ts +0 -3
  70. package/dist/esnext/components/index.js +0 -3
  71. package/dist/esnext/entry-client.js +9 -4
  72. package/dist/esnext/entry-server.js +99 -87
  73. package/dist/esnext/foundation/FileRoutes/FileRoutes.server.d.ts +22 -0
  74. package/dist/esnext/foundation/{Router/FileRoutes.js → FileRoutes/FileRoutes.server.js} +20 -10
  75. package/dist/esnext/foundation/Redirect/Redirect.client.d.ts +5 -0
  76. package/dist/esnext/foundation/Redirect/Redirect.client.js +14 -0
  77. package/dist/esnext/foundation/Route/Route.server.d.ts +12 -0
  78. package/dist/esnext/foundation/Route/Route.server.js +33 -0
  79. package/dist/esnext/foundation/Router/{Router.d.ts → BrowserRouter.client.d.ts} +3 -2
  80. package/dist/esnext/foundation/Router/{Router.js → BrowserRouter.client.js} +7 -5
  81. package/dist/esnext/foundation/Router/Router.server.d.ts +5 -3
  82. package/dist/esnext/foundation/Router/Router.server.js +7 -22
  83. package/dist/esnext/foundation/ServerRequestProvider/ServerRequestProvider.js +19 -24
  84. package/dist/esnext/foundation/ShopifyProvider/index.d.ts +0 -1
  85. package/dist/esnext/foundation/ShopifyProvider/index.js +0 -1
  86. package/dist/esnext/foundation/index.d.ts +0 -1
  87. package/dist/esnext/foundation/index.js +0 -1
  88. package/dist/esnext/{hooks → foundation}/useNavigate/useNavigate.d.ts +6 -3
  89. package/dist/esnext/{hooks → foundation}/useNavigate/useNavigate.js +4 -1
  90. package/dist/esnext/foundation/useQuery/hooks.d.ts +2 -4
  91. package/dist/esnext/foundation/useQuery/hooks.js +5 -2
  92. package/dist/esnext/foundation/useRouteParams/RouteParamsProvider.client.d.ts +9 -0
  93. package/dist/esnext/foundation/useRouteParams/RouteParamsProvider.client.js +7 -0
  94. package/dist/esnext/foundation/useRouteParams/useRouteParams.d.ts +4 -0
  95. package/dist/esnext/foundation/useRouteParams/useRouteParams.js +9 -0
  96. package/dist/esnext/foundation/useUrl/useUrl.js +1 -1
  97. package/dist/esnext/framework/Hydration/ServerComponentRequest.server.d.ts +6 -0
  98. package/dist/esnext/framework/Hydration/ServerComponentRequest.server.js +5 -0
  99. package/dist/esnext/framework/Hydration/ServerComponentResponse.server.d.ts +4 -1
  100. package/dist/esnext/framework/Hydration/ServerComponentResponse.server.js +5 -0
  101. package/dist/esnext/framework/middleware.js +25 -3
  102. package/dist/esnext/framework/plugin.js +6 -1
  103. package/dist/esnext/framework/plugins/vite-plugin-css-modules-rsc.d.ts +2 -0
  104. package/dist/esnext/framework/plugins/vite-plugin-css-modules-rsc.js +28 -0
  105. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-config.js +61 -75
  106. package/dist/esnext/framework/plugins/vite-plugin-platform-entry.js +1 -1
  107. package/dist/esnext/hooks/index.d.ts +0 -1
  108. package/dist/esnext/hooks/index.js +0 -1
  109. package/dist/esnext/hooks/useCartLine/useCartLine.d.ts +10 -10
  110. package/dist/esnext/hooks/useCountry/useCountry.d.ts +4 -4
  111. package/dist/esnext/hooks/useMoney/hooks.d.ts +3 -3
  112. package/dist/esnext/hooks/useMoney/hooks.js +2 -2
  113. package/dist/esnext/hooks/useParsedMetafields/useParsedMetafields.d.ts +17 -2
  114. package/dist/esnext/hooks/useParsedMetafields/useParsedMetafields.js +7 -3
  115. package/dist/esnext/hooks/useProduct/useProduct.d.ts +34 -96
  116. package/dist/esnext/hooks/useProductOptions/helpers.d.ts +6 -4
  117. package/dist/esnext/hooks/useProductOptions/helpers.js +13 -6
  118. package/dist/esnext/hooks/useProductOptions/types.d.ts +15 -35
  119. package/dist/esnext/hooks/useProductOptions/useProductOptions.d.ts +6 -5
  120. package/dist/esnext/hooks/useProductOptions/useProductOptions.js +13 -3
  121. package/dist/esnext/hooks/useShopQuery/hooks.js +47 -7
  122. package/dist/esnext/index.d.ts +7 -5
  123. package/dist/esnext/index.js +7 -5
  124. package/dist/esnext/platforms/worker-event.d.ts +0 -8
  125. package/dist/esnext/platforms/worker-event.js +2 -23
  126. package/dist/esnext/platforms/worker.d.ts +14 -0
  127. package/dist/esnext/platforms/worker.js +24 -0
  128. package/dist/esnext/{graphql/types/types.d.ts → storefront-api-types.d.ts} +389 -32
  129. package/dist/esnext/{graphql/types/types.js → storefront-api-types.js} +326 -30
  130. package/dist/esnext/streaming.server.d.ts +9 -5
  131. package/dist/esnext/streaming.server.js +2 -18
  132. package/dist/esnext/types.d.ts +1 -16
  133. package/dist/esnext/utilities/apiRoutes.d.ts +5 -1
  134. package/dist/esnext/utilities/apiRoutes.js +2 -3
  135. package/dist/esnext/utilities/devtools.d.ts +11 -0
  136. package/dist/esnext/utilities/devtools.js +11 -0
  137. package/dist/esnext/utilities/fetch.d.ts +7 -1
  138. package/dist/esnext/utilities/fetch.js +9 -10
  139. package/dist/esnext/utilities/flattenConnection/flattenConnection.d.ts +3 -2
  140. package/dist/esnext/utilities/flattenConnection/flattenConnection.js +9 -2
  141. package/dist/esnext/utilities/graphql-tracker.d.ts +17 -0
  142. package/dist/esnext/utilities/graphql-tracker.js +119 -0
  143. package/dist/esnext/utilities/image_size.d.ts +5 -4
  144. package/dist/esnext/utilities/log/log-query-timeline.d.ts +1 -1
  145. package/dist/esnext/utilities/log/log-query-timeline.js +1 -2
  146. package/dist/esnext/utilities/log/log.d.ts +1 -0
  147. package/dist/esnext/utilities/log/utils.js +3 -0
  148. package/dist/esnext/utilities/parseMetafieldValue/parseMetafieldValue.d.ts +3 -2
  149. package/dist/esnext/version.d.ts +1 -1
  150. package/dist/esnext/version.js +1 -1
  151. package/dist/node/entry-server.js +104 -88
  152. package/dist/node/foundation/Redirect/Redirect.client.d.ts +5 -0
  153. package/dist/node/foundation/Redirect/Redirect.client.js +17 -0
  154. package/dist/node/foundation/Router/BrowserRouter.client.d.ts +13 -0
  155. package/dist/node/foundation/Router/BrowserRouter.client.js +77 -0
  156. package/dist/node/foundation/ServerRequestProvider/ServerRequestProvider.js +24 -25
  157. package/dist/node/foundation/ServerRequestProvider/index.js +5 -1
  158. package/dist/node/foundation/ServerStateProvider/ServerStateProvider.js +5 -1
  159. package/dist/node/foundation/ssr-interop.d.ts +29 -0
  160. package/dist/node/foundation/ssr-interop.js +39 -0
  161. package/dist/node/foundation/useNavigate/useNavigate.d.ts +13 -0
  162. package/dist/node/foundation/useNavigate/useNavigate.js +18 -0
  163. package/dist/node/foundation/useServerState/index.d.ts +1 -0
  164. package/dist/node/foundation/useServerState/index.js +5 -0
  165. package/dist/node/foundation/useServerState/use-server-state.d.ts +16 -0
  166. package/dist/node/foundation/useServerState/use-server-state.js +24 -0
  167. package/dist/node/framework/Hydration/ServerComponentRequest.server.d.ts +6 -0
  168. package/dist/node/framework/Hydration/ServerComponentRequest.server.js +5 -0
  169. package/dist/node/framework/Hydration/ServerComponentResponse.server.d.ts +4 -1
  170. package/dist/node/framework/Hydration/ServerComponentResponse.server.js +8 -0
  171. package/dist/node/framework/middleware.js +30 -4
  172. package/dist/node/framework/plugin.js +11 -2
  173. package/dist/node/framework/plugins/vite-plugin-css-modules-rsc.d.ts +2 -0
  174. package/dist/node/framework/plugins/vite-plugin-css-modules-rsc.js +31 -0
  175. package/dist/node/framework/plugins/vite-plugin-hydrogen-config.js +61 -75
  176. package/dist/node/framework/plugins/vite-plugin-platform-entry.js +1 -1
  177. package/dist/node/{graphql/types/types.d.ts → storefront-api-types.d.ts} +389 -32
  178. package/dist/node/{graphql/types/types.js → storefront-api-types.js} +327 -31
  179. package/dist/node/streaming.server.d.ts +9 -5
  180. package/dist/node/streaming.server.js +2 -18
  181. package/dist/node/types.d.ts +1 -16
  182. package/dist/node/utilities/apiRoutes.d.ts +5 -1
  183. package/dist/node/utilities/apiRoutes.js +2 -3
  184. package/dist/node/utilities/fetch.d.ts +7 -1
  185. package/dist/node/utilities/fetch.js +9 -10
  186. package/dist/node/utilities/log/log-query-timeline.d.ts +1 -1
  187. package/dist/node/utilities/log/log-query-timeline.js +1 -2
  188. package/dist/node/utilities/log/log.d.ts +1 -0
  189. package/dist/node/utilities/log/utils.js +3 -0
  190. package/dist/node/utilities/web-api-polyfill.js +5 -1
  191. package/dist/node/version.d.ts +1 -1
  192. package/dist/node/version.js +1 -1
  193. package/package.json +9 -12
  194. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-plugin.js +43 -104
  195. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.browser.development.server.js +1566 -848
  196. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.browser.production.min.server.js +36 -421
  197. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.node.development.server.js +1523 -864
  198. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.node.production.min.server.js +35 -437
  199. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite.development.js +507 -517
  200. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite.production.min.js +10 -246
  201. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-client-proxy.js +16 -23
  202. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-plugin.js +47 -108
  203. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-writer.browser.server.js +1033 -306
  204. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-writer.node.server.js +965 -293
  205. package/vendor/react-server-dom-vite/esm/react-server-dom-vite.js +98 -108
  206. package/vendor/react-server-dom-vite/package.json +0 -2
  207. package/dist/esnext/components/ExternalVideo/ExternalVideoFragment.d.ts +0 -8
  208. package/dist/esnext/components/Image/ImageFragment.d.ts +0 -8
  209. package/dist/esnext/components/Image/ImageFragment.js +0 -1
  210. package/dist/esnext/components/MediaFile/MediaFileFragment.d.ts +0 -36
  211. package/dist/esnext/components/MediaFile/MediaFileFragment.js +0 -1
  212. package/dist/esnext/components/Metafield/MetafieldFragment.d.ts +0 -22
  213. package/dist/esnext/components/Metafield/MetafieldFragment.js +0 -1
  214. package/dist/esnext/components/ModelViewer/Model3DFragment.d.ts +0 -15
  215. package/dist/esnext/components/ModelViewer/Model3DFragment.js +0 -1
  216. package/dist/esnext/components/Money/MoneyFragment.d.ts +0 -8
  217. package/dist/esnext/components/Money/MoneyFragment.js +0 -1
  218. package/dist/esnext/components/ProductProvider/ProductProviderFragment.d.ts +0 -247
  219. package/dist/esnext/components/ProductProvider/ProductProviderFragment.js +0 -1
  220. package/dist/esnext/components/ProductProvider/types.d.ts +0 -19
  221. package/dist/esnext/components/ProductProvider/types.js +0 -1
  222. package/dist/esnext/components/RawHtml/RawHtml.d.ts +0 -17
  223. package/dist/esnext/components/RawHtml/RawHtml.js +0 -21
  224. package/dist/esnext/components/RawHtml/index.d.ts +0 -1
  225. package/dist/esnext/components/RawHtml/index.js +0 -1
  226. package/dist/esnext/components/Seo/SeoFragment.d.ts +0 -66
  227. package/dist/esnext/components/Seo/SeoFragment.js +0 -1
  228. package/dist/esnext/components/Seo/types.d.ts +0 -15
  229. package/dist/esnext/components/Seo/types.js +0 -1
  230. package/dist/esnext/components/UnitPrice/UnitPriceFragment.d.ts +0 -15
  231. package/dist/esnext/components/UnitPrice/UnitPriceFragment.js +0 -1
  232. package/dist/esnext/components/Video/VideoFragment.d.ts +0 -15
  233. package/dist/esnext/components/Video/VideoFragment.js +0 -1
  234. package/dist/esnext/foundation/Router/FileRoutes.d.ts +0 -18
  235. package/dist/esnext/foundation/Router/Route.server.d.ts +0 -9
  236. package/dist/esnext/foundation/Router/Route.server.js +0 -6
  237. package/dist/esnext/foundation/Router/useParams.d.ts +0 -1
  238. package/dist/esnext/foundation/Router/useParams.js +0 -5
  239. package/dist/esnext/fragments.d.ts +0 -20
  240. package/dist/esnext/fragments.js +0 -10
  241. package/dist/esnext/graphql/graphql-constants.d.ts +0 -1756
  242. package/dist/esnext/graphql/graphql-constants.js +0 -3447
  243. package/dist/esnext/hooks/useAvailableCountries/index.d.ts +0 -1
  244. package/dist/esnext/hooks/useAvailableCountries/index.js +0 -1
  245. package/dist/esnext/hooks/useAvailableCountries/useAvailableCountries.d.ts +0 -11
  246. package/dist/esnext/hooks/useAvailableCountries/useAvailableCountries.js +0 -17
  247. package/dist/esnext/hooks/useNavigate/index.d.ts +0 -1
  248. package/dist/esnext/hooks/useNavigate/index.js +0 -1
  249. package/dist/esnext/hooks/useProductOptions/SellingPlanFragment.d.ts +0 -31
  250. package/dist/esnext/hooks/useProductOptions/SellingPlanFragment.js +0 -1
  251. package/dist/esnext/hooks/useProductOptions/SellingPlanGroupsFragment.d.ts +0 -46
  252. package/dist/esnext/hooks/useProductOptions/SellingPlanGroupsFragment.js +0 -1
  253. package/dist/esnext/hooks/useProductOptions/VariantFragment.d.ts +0 -106
  254. package/dist/esnext/hooks/useProductOptions/VariantFragment.js +0 -1
  255. package/fragments.d.ts +0 -1
  256. package/fragments.js +0 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license React
2
+ * @license React
3
3
  * react-server-dom-vite.js
4
4
  *
5
5
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -8,11 +8,13 @@
8
8
  * LICENSE file in the root directory of this source tree.
9
9
  */
10
10
 
11
+ import { __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, createServerContext } from 'react';
12
+
11
13
  function createStringDecoder() {
12
14
  return new TextDecoder();
13
15
  }
14
16
  var decoderOptions = {
15
- stream: true,
17
+ stream: true
16
18
  };
17
19
  function readPartialStringChunk(decoder, buffer) {
18
20
  return decoder.decode(buffer, decoderOptions);
@@ -31,7 +33,7 @@ function resolveModuleReference(moduleData) {
31
33
  } // Vite import globs will be injected here.
32
34
 
33
35
  var allClientComponents = {
34
- __INJECTED_CLIENT_IMPORTERS__: null,
36
+ __INJECTED_CLIENT_IMPORTERS__: null
35
37
  }; // Mock client component imports during testing
36
38
 
37
39
  if (typeof jest !== 'undefined') {
@@ -42,17 +44,14 @@ function importClientComponent(moduleId) {
42
44
  var modImport = allClientComponents[moduleId];
43
45
 
44
46
  if (!modImport) {
45
- return Promise.reject(
46
- new Error('Could not find client component ' + moduleId)
47
- );
47
+ return Promise.reject(new Error("Could not find client component " + moduleId));
48
48
  }
49
49
 
50
- return typeof modImport === 'function'
51
- ? modImport()
52
- : Promise.resolve(modImport);
50
+ return typeof modImport === 'function' ? modImport() : Promise.resolve(modImport);
53
51
  } // The module cache contains all the modules we've preloaded so far.
54
52
  // If they're still pending they're a thenable.
55
53
 
54
+
56
55
  var moduleCache = new Map(); // Start preloading the modules since we might need them soon.
57
56
  // This function doesn't suspend.
58
57
 
@@ -65,6 +64,7 @@ function preloadModule(_ref) {
65
64
  return mod;
66
65
  } // Store the original promise first, then override cache with its result.
67
66
 
67
+
68
68
  var promise = importClientComponent(id);
69
69
  cacheResult(promise);
70
70
  promise.then(cacheResult, cacheResult);
@@ -73,7 +73,7 @@ function preloadModule(_ref) {
73
73
 
74
74
  function requireModule(_ref2) {
75
75
  var id = _ref2.id,
76
- name = _ref2.name;
76
+ name = _ref2.name;
77
77
  var mod = moduleCache.get(id);
78
78
 
79
79
  if (!mod || mod instanceof Promise || mod instanceof Error) {
@@ -88,45 +88,20 @@ function requireModule(_ref2) {
88
88
  // ATTENTION
89
89
  // When adding new symbols to this file,
90
90
  // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
91
- // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
92
- // nor polyfill, then a plain number is used for performance.
93
- var REACT_ELEMENT_TYPE = 0xeac7;
94
- var REACT_PORTAL_TYPE = 0xeaca;
95
- var REACT_FRAGMENT_TYPE = 0xeacb;
96
- var REACT_STRICT_MODE_TYPE = 0xeacc;
97
- var REACT_PROFILER_TYPE = 0xead2;
98
- var REACT_PROVIDER_TYPE = 0xeacd;
99
- var REACT_CONTEXT_TYPE = 0xeace;
100
- var REACT_FORWARD_REF_TYPE = 0xead0;
101
- var REACT_SUSPENSE_TYPE = 0xead1;
102
- var REACT_SUSPENSE_LIST_TYPE = 0xead8;
103
- var REACT_MEMO_TYPE = 0xead3;
104
- var REACT_LAZY_TYPE = 0xead4;
105
- var REACT_SCOPE_TYPE = 0xead7;
106
- var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
107
- var REACT_OFFSCREEN_TYPE = 0xeae2;
108
- var REACT_LEGACY_HIDDEN_TYPE = 0xeae3;
109
- var REACT_CACHE_TYPE = 0xeae4;
110
-
111
- if (typeof Symbol === 'function' && Symbol.for) {
112
- var symbolFor = Symbol.for;
113
- REACT_ELEMENT_TYPE = symbolFor('react.element');
114
- REACT_PORTAL_TYPE = symbolFor('react.portal');
115
- REACT_FRAGMENT_TYPE = symbolFor('react.fragment');
116
- REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode');
117
- REACT_PROFILER_TYPE = symbolFor('react.profiler');
118
- REACT_PROVIDER_TYPE = symbolFor('react.provider');
119
- REACT_CONTEXT_TYPE = symbolFor('react.context');
120
- REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');
121
- REACT_SUSPENSE_TYPE = symbolFor('react.suspense');
122
- REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');
123
- REACT_MEMO_TYPE = symbolFor('react.memo');
124
- REACT_LAZY_TYPE = symbolFor('react.lazy');
125
- REACT_SCOPE_TYPE = symbolFor('react.scope');
126
- REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');
127
- REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen');
128
- REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');
129
- REACT_CACHE_TYPE = symbolFor('react.cache');
91
+ // The Symbol used to tag the ReactElement-like types.
92
+ var REACT_ELEMENT_TYPE = Symbol.for('react.element');
93
+ var REACT_LAZY_TYPE = Symbol.for('react.lazy');
94
+ var REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED = Symbol.for('react.default_value');
95
+
96
+ var ReactSharedInternals = __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
97
+
98
+ var ContextRegistry = ReactSharedInternals.ContextRegistry;
99
+ function getOrCreateServerContext(globalName) {
100
+ if (!ContextRegistry[globalName]) {
101
+ ContextRegistry[globalName] = createServerContext(globalName, REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED);
102
+ }
103
+
104
+ return ContextRegistry[globalName];
130
105
  }
131
106
 
132
107
  var PENDING = 0;
@@ -266,6 +241,7 @@ function initializeModuleChunk(chunk) {
266
241
  } // Report that any missing chunks in the model is now going to throw this
267
242
  // error upon read. Also notify any pending promises.
268
243
 
244
+
269
245
  function reportGlobalError(response, error) {
270
246
  response._chunks.forEach(function (chunk) {
271
247
  // If this chunk was already resolved or errored, it won't
@@ -285,7 +261,7 @@ function createElement(type, key, props) {
285
261
  ref: null,
286
262
  props: props,
287
263
  // Record the component responsible for creating this element.
288
- _owner: null,
264
+ _owner: null
289
265
  };
290
266
 
291
267
  {
@@ -297,19 +273,20 @@ function createElement(type, key, props) {
297
273
  configurable: false,
298
274
  enumerable: false,
299
275
  writable: true,
300
- value: true, // This element has already been validated on the server.
276
+ value: true // This element has already been validated on the server.
277
+
301
278
  });
302
279
  Object.defineProperty(element, '_self', {
303
280
  configurable: false,
304
281
  enumerable: false,
305
282
  writable: false,
306
- value: null,
283
+ value: null
307
284
  });
308
285
  Object.defineProperty(element, '_source', {
309
286
  configurable: false,
310
287
  enumerable: false,
311
288
  writable: false,
312
- value: null,
289
+ value: null
313
290
  });
314
291
  }
315
292
 
@@ -320,7 +297,7 @@ function createLazyChunkWrapper(chunk) {
320
297
  var lazyType = {
321
298
  $$typeof: REACT_LAZY_TYPE,
322
299
  _payload: chunk,
323
- _init: readChunk,
300
+ _init: readChunk
324
301
  };
325
302
  return lazyType;
326
303
  }
@@ -339,27 +316,30 @@ function getChunk(response, id) {
339
316
 
340
317
  function parseModelString(response, parentObject, value) {
341
318
  switch (value[0]) {
342
- case '$': {
343
- if (value === '$') {
344
- return REACT_ELEMENT_TYPE;
345
- } else if (value[1] === '$' || value[1] === '@') {
346
- // This was an escaped string value.
347
- return value.substring(1);
348
- } else {
349
- var id = parseInt(value.substring(1), 16);
350
- var chunk = getChunk(response, id);
351
- return readChunk(chunk);
319
+ case '$':
320
+ {
321
+ if (value === '$') {
322
+ return REACT_ELEMENT_TYPE;
323
+ } else if (value[1] === '$' || value[1] === '@') {
324
+ // This was an escaped string value.
325
+ return value.substring(1);
326
+ } else {
327
+ var id = parseInt(value.substring(1), 16);
328
+ var chunk = getChunk(response, id);
329
+ return readChunk(chunk);
330
+ }
352
331
  }
353
- }
354
332
 
355
- case '@': {
356
- var _id = parseInt(value.substring(1), 16);
333
+ case '@':
334
+ {
335
+ var _id = parseInt(value.substring(1), 16);
357
336
 
358
- var _chunk = getChunk(response, _id); // We create a React.lazy wrapper around any lazy values.
359
- // When passed into React, we'll know how to suspend on this.
337
+ var _chunk = getChunk(response, _id); // We create a React.lazy wrapper around any lazy values.
338
+ // When passed into React, we'll know how to suspend on this.
360
339
 
361
- return createLazyChunkWrapper(_chunk);
362
- }
340
+
341
+ return createLazyChunkWrapper(_chunk);
342
+ }
363
343
  }
364
344
 
365
345
  return value;
@@ -379,7 +359,7 @@ function createResponse() {
379
359
  var chunks = new Map();
380
360
  var response = {
381
361
  _chunks: chunks,
382
- readRoot: readRoot,
362
+ readRoot: readRoot
383
363
  };
384
364
  return response;
385
365
  }
@@ -393,6 +373,10 @@ function resolveModel(response, id, model) {
393
373
  resolveModelChunk(chunk, model);
394
374
  }
395
375
  }
376
+ function resolveProvider(response, id, contextName) {
377
+ var chunks = response._chunks;
378
+ chunks.set(id, createInitializedChunk(response, getOrCreateServerContext(contextName).Provider));
379
+ }
396
380
  function resolveModule(response, id, model) {
397
381
  var chunks = response._chunks;
398
382
  var chunk = chunks.get(id);
@@ -451,32 +435,41 @@ function processFullRow(response, row) {
451
435
  var text = row.substring(colon + 1);
452
436
 
453
437
  switch (tag) {
454
- case 'J': {
455
- resolveModel(response, id, text);
456
- return;
457
- }
438
+ case 'J':
439
+ {
440
+ resolveModel(response, id, text);
441
+ return;
442
+ }
458
443
 
459
- case 'M': {
460
- resolveModule(response, id, text);
461
- return;
462
- }
444
+ case 'M':
445
+ {
446
+ resolveModule(response, id, text);
447
+ return;
448
+ }
463
449
 
464
- case 'S': {
465
- resolveSymbol(response, id, JSON.parse(text));
466
- return;
467
- }
450
+ case 'P':
451
+ {
452
+ resolveProvider(response, id, text);
453
+ return;
454
+ }
468
455
 
469
- case 'E': {
470
- var errorInfo = JSON.parse(text);
471
- resolveError(response, id, errorInfo.message, errorInfo.stack);
472
- return;
473
- }
456
+ case 'S':
457
+ {
458
+ resolveSymbol(response, id, JSON.parse(text));
459
+ return;
460
+ }
474
461
 
475
- default: {
476
- throw new Error(
477
- "Error parsing the data. It's probably an error code or network corruption."
478
- );
479
- }
462
+ case 'E':
463
+ {
464
+ var errorInfo = JSON.parse(text);
465
+ resolveError(response, id, errorInfo.message, errorInfo.stack);
466
+ return;
467
+ }
468
+
469
+ default:
470
+ {
471
+ throw new Error("Error parsing the data. It's probably an error code or network corruption.");
472
+ }
480
473
  }
481
474
  }
482
475
 
@@ -494,13 +487,12 @@ function processStringChunk(response, chunk, offset) {
494
487
  response._partialRow += chunk.substring(offset);
495
488
  }
496
489
  function processBinaryChunk(response, chunk) {
490
+
497
491
  var stringDecoder = response._stringDecoder;
498
492
  var linebreak = chunk.indexOf(10); // newline
499
493
 
500
494
  while (linebreak > -1) {
501
- var fullrow =
502
- response._partialRow +
503
- readFinalStringChunk(stringDecoder, chunk.subarray(0, linebreak));
495
+ var fullrow = response._partialRow + readFinalStringChunk(stringDecoder, chunk.subarray(0, linebreak));
504
496
  processFullRow(response, fullrow);
505
497
  response._partialRow = '';
506
498
  chunk = chunk.subarray(linebreak + 1);
@@ -528,7 +520,7 @@ function createFromJSONCallback(response) {
528
520
  function createResponse$1() {
529
521
  // NOTE: CHECK THE COMPILER OUTPUT EACH TIME YOU CHANGE THIS.
530
522
  // It should be inlined to one object literal but minor changes can break it.
531
- var stringDecoder = createStringDecoder();
523
+ var stringDecoder = createStringDecoder() ;
532
524
  var response = createResponse();
533
525
  response._partialRow = '';
534
526
 
@@ -536,6 +528,7 @@ function createResponse$1() {
536
528
  response._stringDecoder = stringDecoder;
537
529
  } // Don't inline this call because it causes closure to outline the call above.
538
530
 
531
+
539
532
  response._fromJSON = createFromJSONCallback(response);
540
533
  return response;
541
534
  }
@@ -545,7 +538,7 @@ function startReadingFromStream(response, stream) {
545
538
 
546
539
  function progress(_ref) {
547
540
  var done = _ref.done,
548
- value = _ref.value;
541
+ value = _ref.value;
549
542
 
550
543
  if (done) {
551
544
  close(response);
@@ -572,14 +565,11 @@ function createFromReadableStream(stream) {
572
565
 
573
566
  function createFromFetch(promiseForResponse) {
574
567
  var response = createResponse$1();
575
- promiseForResponse.then(
576
- function (r) {
577
- startReadingFromStream(response, r.body);
578
- },
579
- function (e) {
580
- reportGlobalError(response, e);
581
- }
582
- );
568
+ promiseForResponse.then(function (r) {
569
+ startReadingFromStream(response, r.body);
570
+ }, function (e) {
571
+ reportGlobalError(response, e);
572
+ });
583
573
  return response;
584
574
  }
585
575
 
@@ -610,4 +600,4 @@ function createFromXHR(request) {
610
600
  return response;
611
601
  }
612
602
 
613
- export {createFromFetch, createFromReadableStream, createFromXHR};
603
+ export { createFromFetch, createFromReadableStream, createFromXHR };
@@ -11,7 +11,6 @@
11
11
  "files": [
12
12
  "LICENSE",
13
13
  "README.md",
14
- "build-info.json",
15
14
  "index.js",
16
15
  "plugin.js",
17
16
  "writer.browser.server.js",
@@ -56,7 +55,6 @@
56
55
  },
57
56
  "peerDependencies": {
58
57
  "react": "^17.0.0",
59
- "react-dom": "^17.0.0",
60
58
  "vite": "^2.7.1"
61
59
  },
62
60
  "dependencies": {
@@ -1,8 +0,0 @@
1
- /**
2
- * THIS FILE IS AUTO-GENERATED, DO NOT EDIT.
3
- * Instead, you can edit the associated .graphql file to query for additional fields and this file will be updated when you run `yarn graphql-types`
4
- */
5
- import * as Types from '../../graphql/types/types';
6
- export declare type ExternalVideoFragmentFragment = {
7
- __typename?: 'ExternalVideo';
8
- } & Pick<Types.ExternalVideo, 'id' | 'embedUrl' | 'host'>;
@@ -1,8 +0,0 @@
1
- /**
2
- * THIS FILE IS AUTO-GENERATED, DO NOT EDIT.
3
- * Instead, you can edit the associated .graphql file to query for additional fields and this file will be updated when you run `yarn graphql-types`
4
- */
5
- import * as Types from '../../graphql/types/types';
6
- export declare type ImageFragmentFragment = {
7
- __typename?: 'Image';
8
- } & Pick<Types.Image, 'id' | 'url' | 'altText' | 'width' | 'height'>;
@@ -1 +0,0 @@
1
- export {};
@@ -1,36 +0,0 @@
1
- /**
2
- * THIS FILE IS AUTO-GENERATED, DO NOT EDIT.
3
- * Instead, you can edit the associated .graphql file to query for additional fields and this file will be updated when you run `yarn graphql-types`
4
- */
5
- import * as Types from '../../graphql/types/types';
6
- export declare type MediaFileFragment_ExternalVideo_Fragment = {
7
- __typename?: 'ExternalVideo';
8
- } & Pick<Types.ExternalVideo, 'mediaContentType' | 'id' | 'embedUrl' | 'host'>;
9
- export declare type MediaFileFragment_MediaImage_Fragment = {
10
- __typename?: 'MediaImage';
11
- } & Pick<Types.MediaImage, 'mediaContentType'> & {
12
- image?: Types.Maybe<{
13
- __typename?: 'Image';
14
- } & Pick<Types.Image, 'id' | 'url' | 'altText' | 'width' | 'height'>>;
15
- };
16
- export declare type MediaFileFragment_Model3d_Fragment = {
17
- __typename?: 'Model3d';
18
- } & Pick<Types.Model3d, 'mediaContentType' | 'id' | 'alt'> & {
19
- previewImage?: Types.Maybe<{
20
- __typename?: 'Image';
21
- } & Pick<Types.Image, 'url'>>;
22
- sources: Array<{
23
- __typename?: 'Model3dSource';
24
- } & Pick<Types.Model3dSource, 'url'>>;
25
- };
26
- export declare type MediaFileFragment_Video_Fragment = {
27
- __typename?: 'Video';
28
- } & Pick<Types.Video, 'mediaContentType' | 'id'> & {
29
- previewImage?: Types.Maybe<{
30
- __typename?: 'Image';
31
- } & Pick<Types.Image, 'url'>>;
32
- sources: Array<{
33
- __typename?: 'VideoSource';
34
- } & Pick<Types.VideoSource, 'mimeType' | 'url'>>;
35
- };
36
- export declare type MediaFileFragmentFragment = MediaFileFragment_ExternalVideo_Fragment | MediaFileFragment_MediaImage_Fragment | MediaFileFragment_Model3d_Fragment | MediaFileFragment_Video_Fragment;
@@ -1 +0,0 @@
1
- export {};
@@ -1,22 +0,0 @@
1
- /**
2
- * THIS FILE IS AUTO-GENERATED, DO NOT EDIT.
3
- * Instead, you can edit the associated .graphql file to query for additional fields and this file will be updated when you run `yarn graphql-types`
4
- */
5
- import * as Types from '../../graphql/types/types';
6
- export declare type MetafieldFragmentFragment = {
7
- __typename?: 'Metafield';
8
- } & Pick<Types.Metafield, 'id' | 'type' | 'namespace' | 'key' | 'value' | 'createdAt' | 'updatedAt' | 'description'> & {
9
- reference?: Types.Maybe<({
10
- __typename: 'MediaImage';
11
- } & Pick<Types.MediaImage, 'id' | 'mediaContentType'> & {
12
- image?: Types.Maybe<{
13
- __typename?: 'Image';
14
- } & Pick<Types.Image, 'id' | 'url' | 'altText' | 'width' | 'height'>>;
15
- }) | {
16
- __typename: 'Page';
17
- } | {
18
- __typename: 'Product';
19
- } | {
20
- __typename: 'ProductVariant';
21
- }>;
22
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,15 +0,0 @@
1
- /**
2
- * THIS FILE IS AUTO-GENERATED, DO NOT EDIT.
3
- * Instead, you can edit the associated .graphql file to query for additional fields and this file will be updated when you run `yarn graphql-types`
4
- */
5
- import * as Types from '../../graphql/types/types';
6
- export declare type Model3DFragmentFragment = {
7
- __typename?: 'Model3d';
8
- } & Pick<Types.Model3d, 'id' | 'alt' | 'mediaContentType'> & {
9
- previewImage?: Types.Maybe<{
10
- __typename?: 'Image';
11
- } & Pick<Types.Image, 'url'>>;
12
- sources: Array<{
13
- __typename?: 'Model3dSource';
14
- } & Pick<Types.Model3dSource, 'url'>>;
15
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,8 +0,0 @@
1
- /**
2
- * THIS FILE IS AUTO-GENERATED, DO NOT EDIT.
3
- * Instead, you can edit the associated .graphql file to query for additional fields and this file will be updated when you run `yarn graphql-types`
4
- */
5
- import * as Types from '../../graphql/types/types';
6
- export declare type MoneyFragmentFragment = {
7
- __typename?: 'MoneyV2';
8
- } & Pick<Types.MoneyV2, 'currencyCode' | 'amount'>;
@@ -1 +0,0 @@
1
- export {};