@jetshop/core 5.17.0-minor.21477356 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (290) hide show
  1. package/ChannelHandler/ChannelHandler.js.map +1 -1
  2. package/ChannelHandler/PreserveRedirectRouteQuery.gql +4 -4
  3. package/ChannelHandler/redirectUtils.d.ts +2 -2
  4. package/ChannelHandler/redirectUtils.js +5 -3
  5. package/ChannelHandler/redirectUtils.js.map +1 -1
  6. package/ChannelHandler/redirectUtils.test.js +5 -5
  7. package/ChannelHandler/redirectUtilsGroupedChannels.test.js +5 -5
  8. package/analytics/Analytics.d.ts +3 -3
  9. package/analytics/Analytics.js.map +1 -1
  10. package/analytics/AnalyticsProvider.d.ts +2 -2
  11. package/analytics/trackerRegistry.d.ts +2 -2
  12. package/analytics/utils/script.d.ts +1 -1
  13. package/analytics/webVitals.js +5 -5
  14. package/analytics/webVitals.js.map +1 -1
  15. package/boot/NetworkStatusNotifier.d.ts +2 -0
  16. package/boot/NetworkStatusNotifier.js +4 -0
  17. package/boot/NetworkStatusNotifier.js.map +1 -0
  18. package/boot/SharedTree.d.ts +1 -1
  19. package/boot/SharedTree.js +1 -1
  20. package/boot/SharedTree.js.map +1 -1
  21. package/boot/apollo.d.ts +1 -2
  22. package/boot/apollo.js +13 -8
  23. package/boot/apollo.js.map +1 -1
  24. package/boot/client/startClient.js +18 -5
  25. package/boot/client/startClient.js.map +1 -1
  26. package/boot/server/IntervalQuery.d.ts +2 -2
  27. package/boot/server/IntervalQuery.js +2 -2
  28. package/boot/server/IntervalQuery.js.map +1 -1
  29. package/boot/server/IntervalQuery.test.js +9 -13
  30. package/boot/server/PersistedApolloClient.test.js +8 -7
  31. package/boot/server/breakpointMiddleware.d.ts +1 -1
  32. package/boot/server/createApolloServer.d.ts +4 -3
  33. package/boot/server/createApolloServer.js +5 -5
  34. package/boot/server/createApolloServer.js.map +1 -1
  35. package/boot/server/createRenderer.js +4 -2
  36. package/boot/server/createRenderer.js.map +1 -1
  37. package/boot/server/entrypoint.js +7 -4
  38. package/boot/server/entrypoint.js.map +1 -1
  39. package/boot/server/persistedQueries/PersistedClient.d.ts +3 -3
  40. package/boot/server/persistedQueries/__tests__/getPersistedQueriesForRequest.test.js +1 -1
  41. package/boot/utils/queryLoggingMiddleware.d.ts +1 -1
  42. package/boot/utils/queryLoggingMiddleware.js +2 -2
  43. package/boot/utils/queryLoggingMiddleware.js.map +1 -1
  44. package/cart/AddToCartFormik.d.ts +4 -4
  45. package/cart/AddToCartFormik.js +2 -2
  46. package/cart/AddToCartFormik.js.map +1 -1
  47. package/cart/useAddToCart.d.ts +4 -4
  48. package/components/Auth/CustomerUpdateForm.d.ts +1 -1
  49. package/components/Auth/ForgotPasswordProvider.d.ts +6 -8
  50. package/components/Auth/ForgotPasswordProvider.js +18 -18
  51. package/components/Auth/ForgotPasswordProvider.js.map +1 -1
  52. package/components/Auth/ResetPasswordProvider.d.ts +6 -4
  53. package/components/Auth/ResetPasswordProvider.js +1 -1
  54. package/components/Auth/ResetPasswordProvider.js.map +1 -1
  55. package/components/Auth/SSN.js +4 -4
  56. package/components/Auth/SSN.js.map +1 -1
  57. package/components/Auth/SSNLookupContainer.d.ts +1 -1
  58. package/components/Auth/SignupFormContainer.d.ts +3 -6
  59. package/components/Auth/SignupFormContainer.js.map +1 -1
  60. package/components/Auth/UpdatePasswordForm.d.ts +1 -1
  61. package/components/Auth/UpdatePasswordForm.js +6 -6
  62. package/components/Auth/UpdatePasswordForm.js.map +1 -1
  63. package/components/Auth/formatSignupInput.d.ts +1 -1
  64. package/components/Auth/signup-context.d.ts +2 -2
  65. package/components/Auth/signup-context.js +2 -3
  66. package/components/Auth/signup-context.js.map +1 -1
  67. package/components/Auth/signupSubmit.js +4 -4
  68. package/components/Auth/signupSubmit.js.map +1 -1
  69. package/components/Auth/useAddressFields.js +3 -3
  70. package/components/Auth/useAddressFields.js.map +1 -1
  71. package/components/Auth/useAddressFields.test.js +10 -8
  72. package/components/Auth/useCustomer.d.ts +3 -3
  73. package/components/Auth/useCustomer.js +1 -1
  74. package/components/Auth/useCustomer.js.map +1 -1
  75. package/components/AuthContext/AuthProvider.js +2 -2
  76. package/components/AuthContext/AuthProvider.js.map +1 -1
  77. package/components/AuthContext/AuthProvider.test.js +1 -1
  78. package/components/AuthContext/LogOut.d.ts +2 -2
  79. package/components/ChannelContext/ChannelProvider.d.ts +1 -1
  80. package/components/ChannelContext/useCountrySettings.d.ts +1 -1
  81. package/components/ChannelContext/useCountrySettings.js +1 -1
  82. package/components/ChannelContext/useCountrySettings.js.map +1 -1
  83. package/components/DynamicRoute/ActiveFiltersQuery.gql +4 -4
  84. package/components/DynamicRoute/CategoryRoute.d.ts +3 -3
  85. package/components/DynamicRoute/CategoryRoute.js +6 -3
  86. package/components/DynamicRoute/CategoryRoute.js.map +1 -1
  87. package/components/DynamicRoute/ContentRoute.d.ts +1 -1
  88. package/components/DynamicRoute/GenericError.d.ts +18 -0
  89. package/components/DynamicRoute/GenericError.js +61 -0
  90. package/components/DynamicRoute/GenericError.js.map +1 -0
  91. package/components/DynamicRoute/PreviewRoute.d.ts +1 -1
  92. package/components/DynamicRoute/PreviewRoute.js +1 -1
  93. package/components/DynamicRoute/PreviewRoute.js.map +1 -1
  94. package/components/DynamicRoute/ProductByArticlenumber.d.ts +2 -2
  95. package/components/DynamicRoute/ProductByArticlenumber.js +2 -2
  96. package/components/DynamicRoute/ProductByArticlenumber.js.map +1 -1
  97. package/components/DynamicRoute/ProductRoute.d.ts +3 -3
  98. package/components/DynamicRoute/ProductRoute.js.map +1 -1
  99. package/components/DynamicRoute/RouteResolver.d.ts +3 -3
  100. package/components/DynamicRoute/RouteResolver.js +2 -1
  101. package/components/DynamicRoute/RouteResolver.js.map +1 -1
  102. package/components/DynamicRoute/Status.d.ts +4 -3
  103. package/components/DynamicRoute/Status.js.map +1 -1
  104. package/components/DynamicRoute/index.d.ts +5 -5
  105. package/components/DynamicRoute/index.js +47 -42
  106. package/components/DynamicRoute/index.js.map +1 -1
  107. package/components/Filters/utils/replaceInSearch.d.ts +1 -1
  108. package/components/Filters/utils/replaceInSearch.js.map +1 -1
  109. package/components/Fonts/CustomFont.d.ts +1 -1
  110. package/components/Fonts/injectFont.d.ts +2 -2
  111. package/components/Fonts/injectFont.js +2 -2
  112. package/components/Fonts/injectFont.js.map +1 -1
  113. package/components/Mutation/AddToCartFormik.d.ts +1 -1
  114. package/components/Mutation/AddToCartFormik.js +2 -2
  115. package/components/Mutation/AddToCartFormik.js.map +1 -1
  116. package/components/Mutation/DecrementQuantity.d.ts +2 -2
  117. package/components/Mutation/DecrementQuantity.js +1 -1
  118. package/components/Mutation/DecrementQuantity.js.map +1 -1
  119. package/components/Mutation/IncrementQuantity.d.ts +2 -2
  120. package/components/Mutation/IncrementQuantity.js +1 -1
  121. package/components/Mutation/IncrementQuantity.js.map +1 -1
  122. package/components/Mutation/RemoveFromCart.d.ts +3 -3
  123. package/components/Mutation/RemoveFromCart.js +1 -1
  124. package/components/Mutation/RemoveFromCart.js.map +1 -1
  125. package/components/Mutation/SetQuantity.d.ts +2 -2
  126. package/components/Mutation/SetQuantity.js +1 -1
  127. package/components/Mutation/SetQuantity.js.map +1 -1
  128. package/components/Mutation/SubscribeToNewsletter.d.ts +1 -1
  129. package/components/Mutation/SubscribeToNewsletter.js +1 -1
  130. package/components/Mutation/SubscribeToNewsletter.js.map +1 -1
  131. package/components/Mutation/SubscribeToStockNotifications.d.ts +1 -1
  132. package/components/Mutation/SubscribeToStockNotifications.js +6 -2
  133. package/components/Mutation/SubscribeToStockNotifications.js.map +1 -1
  134. package/components/Mutation/cartMutationUtils.d.ts +1 -2
  135. package/components/Mutation/cartMutationUtils.js.map +1 -1
  136. package/components/Mutation/useDecrementQuantity.d.ts +1 -1
  137. package/components/Mutation/useDecrementQuantity.js +1 -1
  138. package/components/Mutation/useDecrementQuantity.js.map +1 -1
  139. package/components/Mutation/useIncrementQuantity.d.ts +1 -1
  140. package/components/Mutation/useIncrementQuantity.js +1 -1
  141. package/components/Mutation/useIncrementQuantity.js.map +1 -1
  142. package/components/Mutation/useRemoveFromCart.d.ts +1 -1
  143. package/components/Mutation/useRemoveFromCart.js +1 -1
  144. package/components/Mutation/useRemoveFromCart.js.map +1 -1
  145. package/components/Mutation/useSetQuantity.d.ts +1 -1
  146. package/components/Mutation/useSetQuantity.js +1 -1
  147. package/components/Mutation/useSetQuantity.js.map +1 -1
  148. package/components/Notifications/Notifications.d.ts +3 -3
  149. package/components/Notifications/Notifications.js +2 -3
  150. package/components/Notifications/Notifications.js.map +1 -1
  151. package/components/Notifications/notificationMachine.d.ts +1 -1
  152. package/components/Notifications/notificationsMachine.d.ts +3 -3
  153. package/components/Notifications/useNotification.d.ts +1 -1
  154. package/components/OpenGraph/OpenGraphGeneralPageData.d.ts +1 -1
  155. package/components/Pagination/PaginationProvider.d.ts +1 -1
  156. package/components/ProductConfigurationProvider/ProductConfigurationProvider.js +6 -6
  157. package/components/ProductConfigurationProvider/ProductConfigurationProvider.js.map +1 -1
  158. package/components/Query/CartProvider.d.ts +1 -1
  159. package/components/Query/CartProvider.js +1 -1
  160. package/components/Query/CartProvider.js.map +1 -1
  161. package/components/SortOrder/SortOrderContainer.d.ts +1 -1
  162. package/components/SortOrder/SortOrderContext.d.ts +1 -1
  163. package/components/StructuredData/StructuredBreadcrumbData.d.ts +2 -2
  164. package/data/cache.d.ts +1 -1
  165. package/data/cache.js +62 -12
  166. package/data/cache.js.map +1 -1
  167. package/data/fragments/ProductListsFragments.gql +8 -8
  168. package/errorReporting.shared.d.ts +1 -1
  169. package/global.d.ts +80 -2
  170. package/helpers/getErrorDetail.d.ts +1 -1
  171. package/helpers/getErrorDetail.js +2 -2
  172. package/helpers/getErrorDetail.js.map +1 -1
  173. package/helpers/getHeaders.d.ts +1 -1
  174. package/hooks/Filters/useBooleanFilter.d.ts +1 -1
  175. package/hooks/Filters/useBooleanFilter.js +1 -2
  176. package/hooks/Filters/useBooleanFilter.js.map +1 -1
  177. package/hooks/Filters/useFilters.d.ts +1 -1
  178. package/hooks/Filters/useFilters.js +1 -2
  179. package/hooks/Filters/useFilters.js.map +1 -1
  180. package/hooks/Filters/useListFilter.d.ts +2 -2
  181. package/hooks/Filters/useListFilter.js +1 -2
  182. package/hooks/Filters/useListFilter.js.map +1 -1
  183. package/hooks/Filters/useMultiFilter.d.ts +3 -3
  184. package/hooks/Filters/useMultiFilter.js +1 -2
  185. package/hooks/Filters/useMultiFilter.js.map +1 -1
  186. package/hooks/Filters/useRangeFilter.d.ts +2 -2
  187. package/hooks/Filters/useRangeFilter.js +1 -2
  188. package/hooks/Filters/useRangeFilter.js.map +1 -1
  189. package/hooks/Filters/useSortOrder.d.ts +6 -1
  190. package/hooks/Filters/useSortOrder.js +4 -3
  191. package/hooks/Filters/useSortOrder.js.map +1 -1
  192. package/hooks/PackageProducts/usePackageProductItem.d.ts +2 -2
  193. package/hooks/PackageProducts/usePackageProductItem.js +1 -1
  194. package/hooks/PackageProducts/usePackageProductItem.js.map +1 -1
  195. package/hooks/PackageProducts/usePackageProducts.js +17 -17
  196. package/hooks/PackageProducts/usePackageProducts.js.map +1 -1
  197. package/hooks/PackageProducts/usePackageProducts.test.js +1 -1
  198. package/hooks/ProductList/ProductListContext.js +1 -1
  199. package/hooks/ProductList/ProductListContext.js.map +1 -1
  200. package/hooks/ProductList/action-creators.d.ts +1 -1
  201. package/hooks/ProductList/index.d.ts +11 -11
  202. package/hooks/ProductList/list-transforms.js +1 -1
  203. package/hooks/ProductList/list-transforms.js.map +1 -1
  204. package/hooks/ProductList/product-list-reducer.d.ts +1 -1
  205. package/hooks/ProductList/product-list-reducer.js +1 -1
  206. package/hooks/ProductList/product-list-reducer.js.map +1 -1
  207. package/hooks/ProductList/useProductList.js +1 -1
  208. package/hooks/ProductList/useProductList.js.map +1 -1
  209. package/hooks/ProductList/useProductListItems.js +1 -1
  210. package/hooks/ProductList/useProductListItems.js.map +1 -1
  211. package/hooks/Subscriptions/useNewsletterSubscription.js +3 -3
  212. package/hooks/Subscriptions/useNewsletterSubscription.js.map +1 -1
  213. package/hooks/Subscriptions/useStockNotifications.d.ts +1 -1
  214. package/hooks/Subscriptions/useStockNotifications.js +3 -3
  215. package/hooks/Subscriptions/useStockNotifications.js.map +1 -1
  216. package/hooks/Subscriptions/useStoreSubscriptions.d.ts +1 -1
  217. package/hooks/Subscriptions/useStoreSubscriptions.js +3 -6
  218. package/hooks/Subscriptions/useStoreSubscriptions.js.map +1 -1
  219. package/hooks/Subscriptions/useStoresubscriptions.test.js +5 -7
  220. package/hooks/useAddMultipleToCart.d.ts +4 -4
  221. package/hooks/useAddMultipleToCart.js +1 -1
  222. package/hooks/useAddMultipleToCart.js.map +1 -1
  223. package/hooks/useAddMultipleToCart.test.js +1 -1
  224. package/hooks/useCustomerOrders.test.js +7 -5
  225. package/hooks/useCustomerOrdersQuery.d.ts +2 -2
  226. package/hooks/useCustomerOrdersQuery.js +1 -1
  227. package/hooks/useCustomerOrdersQuery.js.map +1 -1
  228. package/hooks/useDeleteAccountMutation.d.ts +1 -1
  229. package/hooks/useDeleteAccountMutation.js +3 -3
  230. package/hooks/useDeleteAccountMutation.js.map +1 -1
  231. package/hooks/useInfinitePagination.d.ts +1 -1
  232. package/hooks/useInfinitePagination.js +4 -1
  233. package/hooks/useInfinitePagination.js.map +1 -1
  234. package/hooks/useLoginMutation.d.ts +3 -3
  235. package/hooks/useLoginMutation.js +2 -2
  236. package/hooks/useLoginMutation.js.map +1 -1
  237. package/hooks/useLoginRedirect.js +2 -2
  238. package/hooks/useLoginRedirect.js.map +1 -1
  239. package/hooks/useOrderDetailQuery.d.ts +3 -3
  240. package/hooks/useOrderDetailQuery.js +1 -1
  241. package/hooks/useOrderDetailQuery.js.map +1 -1
  242. package/hooks/usePreconnectLinks.d.ts +1 -1
  243. package/hooks/usePreconnectLinks.js +1 -1
  244. package/hooks/usePreconnectLinks.js.map +1 -1
  245. package/hooks/useProductVariants/useProductVariants.d.ts +1 -1
  246. package/hooks/useRoutePreload.js +1 -1
  247. package/hooks/useRoutePreload.js.map +1 -1
  248. package/hooks/useStockStatus.d.ts +8 -0
  249. package/hooks/useStockStatus.js +26 -0
  250. package/hooks/useStockStatus.js.map +1 -0
  251. package/hooks/useThunkReducer.d.ts +1 -1
  252. package/integrations/sluggishSchemaExtension.js +1 -1
  253. package/integrations/sluggishSchemaExtension.js.map +1 -1
  254. package/package.json +24 -42
  255. package/polyfills.js +0 -2
  256. package/polyfills.js.map +1 -1
  257. package/resolvers/filters/boolFilter.js +24 -27
  258. package/resolvers/filters/boolFilter.js.map +1 -1
  259. package/resolvers/filters/filterParams.js +8 -8
  260. package/resolvers/filters/filterParams.js.map +1 -1
  261. package/resolvers/filters/filters.js +5 -5
  262. package/resolvers/filters/filters.js.map +1 -1
  263. package/resolvers/filters/index.d.ts +0 -4
  264. package/resolvers/filters/listFilter.js +24 -29
  265. package/resolvers/filters/listFilter.js.map +1 -1
  266. package/resolvers/filters/listFilterItem.js +31 -36
  267. package/resolvers/filters/listFilterItem.js.map +1 -1
  268. package/resolvers/filters/multiListFilter.js +41 -42
  269. package/resolvers/filters/multiListFilter.js.map +1 -1
  270. package/resolvers/filters/multiListFilterList.js +1 -1
  271. package/resolvers/filters/multiListFilterList.js.map +1 -1
  272. package/resolvers/filters/rangeFilter.js +27 -43
  273. package/resolvers/filters/rangeFilter.js.map +1 -1
  274. package/resolvers/index.d.ts +1 -1
  275. package/server/graphql.js +6 -7
  276. package/server/graphql.js.map +1 -1
  277. package/test-utils/ProviderPyramid.js +1 -1
  278. package/types.d.ts +1820 -1955
  279. package/components/Fonts/GoogleFont.d.ts +0 -10
  280. package/components/Fonts/GoogleFont.js +0 -35
  281. package/components/Fonts/GoogleFont.js.map +0 -1
  282. package/components/Fonts/TypekitFont.d.ts +0 -16
  283. package/components/Fonts/TypekitFont.js +0 -25
  284. package/components/Fonts/TypekitFont.js.map +0 -1
  285. package/integrations/addwishSchemaExtension.d.ts +0 -35
  286. package/integrations/addwishSchemaExtension.js +0 -141
  287. package/integrations/addwishSchemaExtension.js.map +0 -1
  288. package/integrations/nostoSchemaExtension.d.ts +0 -5
  289. package/integrations/nostoSchemaExtension.js +0 -77
  290. package/integrations/nostoSchemaExtension.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ChannelHandler.js","sourceRoot":"","sources":["ChannelHandler.ts"],"names":[],"mappings":";;;;;;;;;;;AAEA,OAAO,EAAE,MAAM,IAAI,CAAC;AAGpB,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,OAAO,EACR,MAAM,gBAAgB,CAAC;AAGxB,MAAM,OAAO,cAAc;IAOzB,YACE,OAMI;QACF,eAAe,EAAE,SAAS;QAC1B,kBAAkB,EAAE,SAAS;QAC7B,QAAQ,EAAE,SAAS;QACnB,mBAAmB,EAAE,SAAS;QAC9B,oBAAoB,EAAE,SAAS;KAChC;QAgBH,2BAAsB,GAAG,CAAC,mBAAwC,EAAE,EAAE,CACpE,CAAC,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAC,CAAC;QAEnD,uBAAkB,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC;QAEhD,uBAAkB,GAAG,CAAC,eAAgC,EAAE,EAAE;YACxD,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACzC,CAAC,CAAC;QAEF,0BAAqB,GAAG,CAAC,kBAAmC,EAAE,EAAE;YAC9D,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;QAC/C,CAAC,CAAC;QAEF,0BAAqB,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC;QAEtD,gBAAW,GAAG,CAAC,QAAmB,EAAE,EAAE;YACpC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC3B,CAAC,CAAC;QAEF,oBAAe,GAAG,CAAC,QAAmB,EAAE,EAAE;YACxC,IAAI,CAAC,oBAAoB,GAAG,QAAQ,CAAC;QACvC,CAAC,CAAC;QAEF,gBAAW,GAAG,GAAG,EAAE,CAAC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AAC,mBAAmB,GAAG,mBAAmB,CAAC;QAC/C,IAAI,CAAC,oBAAoB,GAAG,oBAAoB,CAAC;IACnD,CAAC;IAsIO,sBAAsB,CAAC,GAAW;QACxC,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;QAC/B,MAAM,QAAQ,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC3C,MAAM,aAAa,GAAG,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,KAAK,CAAC,GAAG,CAAC,KAAI,EAAE,CAAC;QACjD,aAAa,CAAC,KAAK,EAAE,CAAC;QACtB,IAAI,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAC;QAC9B,aAAa,CAAC,OAAO,CACnB,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAC7D,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
@@ -3,16 +3,16 @@ query preserveRedirectRouteQuery($path: String!) {
3
3
  id
4
4
  object {
5
5
  ... on Category {
6
- id
6
+ _id: id
7
7
  }
8
8
  ... on Product {
9
- id
9
+ _id: id
10
10
  }
11
11
  ... on Page {
12
- id
12
+ _id: id
13
13
  }
14
14
  ... on StartPage {
15
- id
15
+ _id: id
16
16
  }
17
17
  }
18
18
  }
@@ -1,4 +1,4 @@
1
- import ApolloClient from 'apollo-client';
1
+ import { ApolloClient } from '@apollo/client';
2
2
  import { SelectedChannel } from '../components/ChannelContext/ChannelContext';
3
- export declare type GetPrimaryRoutePath = (path: string, newChannel: SelectedChannel, setSelectedChannel: (selectedChannel: SelectedChannel) => void) => Promise<string>;
3
+ export type GetPrimaryRoutePath = (path: string, newChannel: SelectedChannel, setSelectedChannel: (selectedChannel: SelectedChannel) => void) => Promise<string>;
4
4
  export declare function primaryRouteForPathFetcher(client: ApolloClient<any>): GetPrimaryRoutePath;
@@ -28,10 +28,11 @@ export function primaryRouteForPathFetcher(client) {
28
28
  query: preserveRedirectRouteQuery,
29
29
  variables: {
30
30
  path
31
- }
31
+ },
32
+ fetchPolicy: 'network-only'
32
33
  });
33
- const { id, __typename, pageId } = routeQueryResult.data.route.object;
34
- const idUesdForRedirect = id || pageId;
34
+ const { _id, __typename, pageId } = routeQueryResult.data.route.object;
35
+ const idUesdForRedirect = _id || pageId;
35
36
  setSelectedChannel(newChannel);
36
37
  const pathnameQueryResult = yield client.query({
37
38
  fetchPolicy: 'network-only',
@@ -43,6 +44,7 @@ export function primaryRouteForPathFetcher(client) {
43
44
  return pathnameQueryResult.data[__typename].primaryRoute.path;
44
45
  }
45
46
  catch (e) {
47
+ console.log('Error in PrimaryRouteForPathFetcher: ', e);
46
48
  return '/';
47
49
  }
48
50
  });
@@ -1 +1 @@
1
- {"version":3,"file":"redirectUtils.js","sourceRoot":"","sources":["redirectUtils.ts"],"names":[],"mappings":";;;;;;;;;AASA,OAAO,0BAA0B,MAAM,kCAAkC,CAAC;AAC1E,OAAO,4BAA4B,MAAM,oCAAoC,CAAC;AAC9E,OAAO,6BAA6B,MAAM,qCAAqC,CAAC;AAChF,OAAO,8BAA8B,MAAM,sCAAsC,CAAC;AAClF,OAAO,yBAAyB,MAAM,iCAAiC,CAAC;AAGxE,MAAM,wBAAwB,GAAG;IAC/B,OAAO,EAAE,4BAA4B;IACrC,QAAQ,EAAE,6BAA6B;IACvC,SAAS,EAAE,8BAA8B;IACzC,IAAI,EAAE,yBAAyB;CAChC,CAAC;AASF,MAAM,UAAU,0BAA0B,CACxC,MAAyB;IAEzB,OAAO,CAAO,IAAI,EAAE,UAAU,EAAE,kBAAkB,EAAE,EAAE;QACpD,IAAI;YACF,IAAI,CAAC,IAAI,EAAE;gBACT,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;aACzC;YAED,MAAM,gBAAgB,GAAG,MAAM,MAAM,CAAC,KAAK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AAI,EAAE;gBACT,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;aACzC;YAED,MAAM,gBAAgB,GAAG,MAAM,MAAM,CAAC,KAAK,CAQxC;gBACD,KAAK,EAAE,0BAA0B;gBACjC,SAAS,EAAE;oBACT,IAAI;iBACL;gBACD,WAAW,EAAE,cAAc;aAC5B,CAAC,CAAC;YAEH,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;YACvE,MAAM,iBAAiB,GAAG,GAAG,IAAI,MAAM,CAAC;YACxC,kBAAkB,CAAC,UAAU,CAAC,CAAC;YAE/B,MAAM,mBAAmB,GAAG,MAAM,MAAM,CAAC,KAAK,CAK3C;gBACD,WAAW,EAAE,cAAc;gBAC3B,KAAK,EAAE,wBAAwB,CAAC,UAAU,CAAC;gBAC3C,SAAS,EAAE;oBACT,EAAE,EAAE,iBAAiB;iBACtB;aACF,CAAC,CAAC;YACH,OAAO,mBAAmB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC;SAC/D;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,CAAC,GAAG,CAAC,uCAAuC,EAAE,CAAC,CAAC,CAAC;YACxD,OAAO,GAAG,CAAC;SACZ;IACH,CAAC,CAAA,CAAC;AACJ,CAAC"}
@@ -2,13 +2,13 @@ import {
2
2
  createSelectedChannel,
3
3
  getSelectedAndRecommendedChannel
4
4
  } from './channelUtils';
5
- import { MockLink } from 'apollo-link-mock';
5
+ import { MockLink } from '@apollo/client';
6
6
  import {
7
+ ApolloClient,
7
8
  InMemoryCache,
8
- IntrospectionFragmentMatcher
9
- } from 'apollo-cache-inmemory';
10
- import ApolloClient from 'apollo-client';
11
- import gql from 'graphql-tag';
9
+ IntrospectionFragmentMatcher,
10
+ gql
11
+ } from '@apollo/client';
12
12
  import { ChannelHandler } from './ChannelHandler';
13
13
  import { channels, singleDomainChannels } from '../test-utils/variables';
14
14
  import { Cookies } from 'react-cookie';
@@ -2,13 +2,13 @@ import {
2
2
  createSelectedChannel,
3
3
  getSelectedAndRecommendedChannel
4
4
  } from './channelUtils';
5
- import { MockLink } from 'apollo-link-mock';
5
+ import { MockLink } from '@apollo/client';
6
6
  import {
7
+ ApolloClient,
7
8
  InMemoryCache,
8
- IntrospectionFragmentMatcher
9
- } from 'apollo-cache-inmemory';
10
- import ApolloClient from 'apollo-client';
11
- import gql from 'graphql-tag';
9
+ IntrospectionFragmentMatcher,
10
+ gql
11
+ } from '@apollo/client';
12
12
  import { ChannelHandler } from './ChannelHandler';
13
13
  import {
14
14
  groupedChannels as channels,
@@ -5,14 +5,14 @@ export interface TrackingEvent {
5
5
  payload?: any;
6
6
  id: string;
7
7
  }
8
- export declare type TrackingCallback = (context: TrackingFunctionContext) => void;
9
- export declare type LegacyTrackingFunction = (cb: TrackingCallback) => void;
8
+ export type TrackingCallback = (context: TrackingFunctionContext) => void;
9
+ export type LegacyTrackingFunction = (cb: TrackingCallback) => void;
10
10
  export interface AnalyticsProps {
11
11
  children?: (track: LegacyTrackingFunction) => React.ReactNode;
12
12
  event?: TrackingEvent;
13
13
  }
14
14
  declare function Analytics(props: AnalyticsProps): any;
15
- export declare type TrackingFunction = (event: TrackingEvent) => void;
15
+ export type TrackingFunction = (event: TrackingEvent) => void;
16
16
  declare function useTracker(): TrackingFunction;
17
17
  export default Analytics;
18
18
  export { useTracker };
@@ -1 +1 @@
1
- {"version":3,"file":"Analytics.js","sourceRoot":"","sources":["Analytics.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAE7E,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACnE,OAAO,eAAe,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAe3C,SAAS,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eAAe,EAAE,MAAM,CAAC,eAAe,CAAC,CAC1C,CAAC;AACJ,CAAC;AAED,eAAe,SAAS,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -47,8 +47,8 @@ export interface AnalyticsProviderProps {
47
47
  cookies: Cookies;
48
48
  }
49
49
  export declare const getFacebookCapi: (selectedChannel: SelectedChannel) => {
50
- token: string;
51
- pixelId: string;
50
+ token: any;
51
+ pixelId: any;
52
52
  };
53
53
  declare const AnalyticsProvider: React.FC<AnalyticsProviderProps>;
54
54
  export default AnalyticsProvider;
@@ -6,7 +6,7 @@ export interface TrackingFunctionContext {
6
6
  emit: (event: string, props: any) => void;
7
7
  list?: string;
8
8
  }
9
- declare type Consent = 'granted' | 'denied';
9
+ type Consent = 'granted' | 'denied';
10
10
  interface BaseConsentEvents {
11
11
  ad_storage: Consent;
12
12
  analytics_storage: Consent;
@@ -86,7 +86,7 @@ export interface Tracker extends Partial<BaseTrackingEvents> {
86
86
  name: string;
87
87
  initBrowser?: (opts: InitOptions) => void;
88
88
  }
89
- export declare type TrackerRegistryEventEmitter = TypedEventEmitter<TrackingEvents>;
89
+ export type TrackerRegistryEventEmitter = TypedEventEmitter<TrackingEvents>;
90
90
  export interface TrackerRegistry {
91
91
  on<E extends keyof TrackingEvents>(event: E, args: TrackingEvents[E], opts?: {
92
92
  name?: string;
@@ -1,4 +1,4 @@
1
- declare type ScriptProps = {
1
+ type ScriptProps = {
2
2
  src: string;
3
3
  async?: boolean;
4
4
  defer?: boolean;
@@ -1,4 +1,4 @@
1
- import { getCLS, getFID, getLCP } from 'web-vitals';
1
+ import { onCLS, onLCP, onFID } from 'web-vitals';
2
2
  import { createApiReporter, getDeviceInfo } from 'web-vitals-reporter';
3
3
  import { routeList } from '../boot/addMissingConfig';
4
4
  let globalPageType = undefined;
@@ -11,7 +11,7 @@ export function webVitals({ shopId, apiUrl }) {
11
11
  var _a;
12
12
  // Init report callback with information about the browser.
13
13
  const deviceInfo = getDeviceInfo();
14
- Object.keys(routeList).forEach(route => {
14
+ Object.keys(routeList).forEach((route) => {
15
15
  var _a;
16
16
  if ((_a = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.url) === null || _a === void 0 ? void 0 : _a.includes(routeList[route])) {
17
17
  globalPageType = route;
@@ -32,8 +32,8 @@ export function webVitals({ shopId, apiUrl }) {
32
32
  }
33
33
  });
34
34
  // Setup web-vitals
35
- getLCP(sendToAnalytics);
36
- getFID(sendToAnalytics);
37
- getCLS(sendToAnalytics);
35
+ onLCP(sendToAnalytics);
36
+ onFID(sendToAnalytics);
37
+ onCLS(sendToAnalytics);
38
38
  }
39
39
  //# sourceMappingURL=webVitals.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"webVitals.js","sourceRoot":"","sources":["webVitals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,IAAI,cAAc,GAAuB,SAAS,CAAC;AAEnD,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,IAAI,CAAC,cAAc,EAAE;QACnB,cAAc,GAAG,IAAI,CAAC;KACvB;AACH,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,EACxB,MAAM,EACN,MAAM,EAIP;;IACC,2DAA2D;IAC3D,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IACnC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;;QACrC,IAAI,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,GAAG,0CAAE,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE;YAC/C,cAAc,GAAG,KAAK,CAAC;SACxB;IACH,CAAC,CAAC,CAAC;IACH,MAAM,eA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AAC,CAAC,KAAK,EAAE,EAAE;;QACvC,IAAI,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,GAAG,0CAAE,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE;YAC/C,cAAc,GAAG,KAAK,CAAC;SACxB;IACH,CAAC,CAAC,CAAC;IACH,MAAM,eAAe,GAAG,iBAAiB,CAAC,GAAG,MAAM,mBAAmB,EAAE;QACtE,OAAO,EAAE;YACP,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,QAAQ;YACjB,QAAQ,EAAE,cAAc;YACxB,SAAS,EAAE,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,SAAS;YAChC,MAAM,EAAE,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,MAAM;YAC1B,IAAI,EAAE,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,IAAI;YACtB,UAAU,EAAE,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,UAAU,0CAAE,aAAa;SAClD;QACD,UAAU,EAAE,GAAG,EAAE;YACf,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC;QACtC,CAAC;KACF,CAAC,CAAC;IAEH,mBAAmB;IACnB,KAAK,CAAC,eAAe,CAAC,CAAC;IACvB,KAAK,CAAC,eAAe,CAAC,CAAC;IACvB,KAAK,CAAC,eAAe,CAAC,CAAC;AACzB,CAAC"}
@@ -0,0 +1,2 @@
1
+ declare const link: any, useApolloNetworkStatus: any;
2
+ export { link, useApolloNetworkStatus };
@@ -0,0 +1,4 @@
1
+ import { createNetworkStatusNotifier } from 'react-apollo-network-status';
2
+ const { link, useApolloNetworkStatus } = createNetworkStatusNotifier();
3
+ export { link, useApolloNetworkStatus };
4
+ //# sourceMappingURL=NetworkStatusNotifier.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NetworkStatusNotifier.js","sourceRoot":"","sources":["NetworkStatusNotifier.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAE1E,MAAM,EAAE,IAAI,EAAE,sBAAsB,EAAE,GAAG,2BAA2B,EAAE,CAAC;AAEvE,OAAO,EAAE,IAAI,EAAE,sBAAsB,EAAE,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { AnalyticsConfig } from '@jetshop/core/analytics/AnalyticsProvider';
2
- import ApolloClient from 'apollo-client';
2
+ import { ApolloClient } from '@apollo/client';
3
3
  import React, { ReactElement } from 'react';
4
4
  import { Cookies } from 'react-cookie';
5
5
  import { StaticRouterProps } from 'react-router';
@@ -1,6 +1,6 @@
1
1
  import AnalyticsProvider from '@jetshop/core/analytics/AnalyticsProvider';
2
2
  import React from 'react';
3
- import { ApolloProvider } from 'react-apollo';
3
+ import { ApolloProvider } from '@apollo/client';
4
4
  // Cookies
5
5
  import { CookiesProvider } from 'react-cookie';
6
6
  // Metadata
@@ -1 +1 @@
1
- {"version":3,"file":"SharedTree.js","sourceRoot":"","sources":["SharedTree.tsx"],"names":[],"mappings":"AAAA,OAAO,iBAEN,MAAM,2CAA2C,CAAC;AAEnD,OAAO,KAAuB,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,UAAU;AACV,OAAO,EAAW,eAAe,EAAE,MAAM,cAAc,CAAC;AACxD,WAAW;AACX,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,YAAY,MAAM,wCAAwC,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,mBAAmB;AACnB,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAe,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAG3E,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAgBpE,MAAM,UAAU,GAAG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ollo-cache-inmemory';
2
- import { ApolloClient } from 'apollo-client';
1
+ import { ApolloClient, NormalizedCacheObject } from '@apollo/client';
3
2
  import { Request } from 'express';
4
3
  import { GraphQLSchema } from 'graphql';
5
4
  import { ApolloConfig } from '../components/ConfigProvider';
package/boot/apollo.js CHANGED
@@ -9,19 +9,17 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import { ApolloClient } from 'apollo-client';
13
- import { ApolloLink } from 'apollo-link';
14
- import { onError } from 'apollo-link-error';
15
- import { createHttpLink } from 'apollo-link-http';
16
- import { createPersistedQueryLink } from 'apollo-link-persisted-queries';
17
- import { SchemaLink } from 'apollo-link-schema';
12
+ import { ApolloClient, ApolloLink, createHttpLink } from '@apollo/client';
13
+ import { onError } from '@apollo/client/link/error';
14
+ import { createPersistedQueryLink } from '@apollo/client/link/persisted-queries';
15
+ import { SchemaLink } from '@apollo/client/link/schema';
18
16
  import qs from 'qs';
19
17
  import createCache from '../data/cache';
20
18
  import report from '../errorReporting';
21
19
  import { resolvers } from '../resolvers';
22
20
  import typeDefs from './client-schema.gql';
23
21
  import { logOperationTime } from './utils/queryLoggingMiddleware';
24
- import { link as networkStatusLink } from '@jetshop/ui/Loading/NetworkStatusNotifier';
22
+ import { link as networkStatusLink } from '@jetshop/core/boot/NetworkStatusNotifier';
25
23
  export const createClient = ({ apolloConfig: { token, shopid, enableGateway, graphQLURI, useGraphQLProxyServer }, schema, authHandler, previewHandler, req, channelHandler }) => {
26
24
  if (!token || !shopid) {
27
25
  throw new Error(`Missing ${!token && `token`} ${!shopid && `shopid`}`);
@@ -151,6 +149,7 @@ export const createClient = ({ apolloConfig: { token, shopid, enableGateway, gra
151
149
  }
152
150
  // 503
153
151
  if (networkError) {
152
+ // This is a hack, does it work? Todo eli5
154
153
  const errors = (_b = networkError === null || networkError === void 0 ? void 0 : networkError.result) === null || _b === void 0 ? void 0 : _b.Errors;
155
154
  if (errors) {
156
155
  errors.forEach((error) => {
@@ -179,12 +178,18 @@ export const createClient = ({ apolloConfig: { token, shopid, enableGateway, gra
179
178
  links.unshift(logOperationTime);
180
179
  }
181
180
  if (enableGateway) {
182
- links.unshift(createPersistedQueryLink({ useGETForHashedQueries: true }));
181
+ links.unshift(createPersistedQueryLink({
182
+ useGETForHashedQueries: true,
183
+ generateHash: () => {
184
+ return '';
185
+ }
186
+ }));
183
187
  }
184
188
  const link = ApolloLink.from(links);
185
189
  const cache = createCache();
186
190
  const client = new ApolloClient({
187
191
  link,
192
+ connectToDevTools: process.env.NODE_ENV !== 'production',
188
193
  assumeImmutableResults: true,
189
194
  cache: __IN_SERVER__
190
195
  ? cache
@@ -1 +1 @@
1
- {"version":3,"file":"apollo.js","sourceRoot":"","sources":["apollo.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,QAAQ,MAAM,qBAAqB,CAAC;AAE3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAGlE,OAAO,EAAE,IAAI,IAAI,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAiBtF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAC3B,YAAY,EAAE,EACZ,KAAK,EACL,MAAM,EACN,aAAa,EACb,UAAU,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AE,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY;QACxD,sBAAsB,EAAE,IAAI;QAC5B,KAAK,EAAE,aAAa;YAClB,CAAC,CAAC,KAAK;YACP,CAAC,CAAC,KAAK,CAAC,OAAO,CAAE,MAAc,CAAC,gBAAgB,CAAC;QACnD,OAAO,EAAE,CAAC,CAAC,aAAa;QACxB,SAAS,EAAE,SAAS,CAClB,EAAE,CAAC,SAAS,CAAC,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CACnE;QACD,QAAQ;KACT,CAAC,CAAC;IAEH,OAAO,EAAE,MAAM,EAAE,CAAC;AACpB,CAAC,CAAC"}
@@ -11,7 +11,7 @@ import { setupIntl } from '@jetshop/intl/config';
11
11
  import * as Sentry from '../../sentry/client';
12
12
  import React from 'react';
13
13
  import { Cookies } from 'react-cookie';
14
- import { hydrate as renderToDOM } from 'react-dom';
14
+ import { hydrateRoot } from 'react-dom/client';
15
15
  import { loadableReady } from '@loadable/component';
16
16
  import { BrowserRouter } from 'react-router-dom';
17
17
  import { ChannelHandler } from '../../ChannelHandler/ChannelHandler';
@@ -28,15 +28,18 @@ import createIntlOptions from '../utils/createIntOptions';
28
28
  import { setUID } from '../utils/uid';
29
29
  import { webVitals } from '../../analytics/webVitals';
30
30
  import { primaryRouteForPathFetcher } from '../../../core/ChannelHandler/redirectUtils';
31
+ import ActiveFiltersQuery from '@jetshop/core/components/DynamicRoute/ActiveFiltersQuery.gql';
31
32
  // Instantiate this here, since we need to read cookies outside of React.
32
33
  const cookies = new Cookies();
33
34
  function getInitialCacheData() {
34
35
  return {
36
+ query: ActiveFiltersQuery,
35
37
  data: {
36
38
  activeFilters: getActiveFiltersFromSearch(document.location.search)
37
39
  }
38
40
  };
39
41
  }
42
+ let root;
40
43
  const startClient = (tree, config) => {
41
44
  if (!config.apolloConfig.channelsQuery) {
42
45
  logWarningInDev(true, `No channelsQuery was provided in the apolloConfig, which is a
@@ -71,9 +74,9 @@ const startClient = (tree, config) => {
71
74
  channelHandler.setGetPrimaryRoutePath(primaryRouteForPathFetcher(client));
72
75
  const initialCacheData = getInitialCacheData();
73
76
  // Initialise cache with active filters from the search params
74
- client.cache.writeData(initialCacheData);
77
+ client.cache.writeQuery(initialCacheData);
75
78
  // If cache is reseted, we reset the initial cache data
76
- client.onResetStore(() => __awaiter(void 0, void 0, void 0, function* () { return client.cache.writeData(initialCacheData); }));
79
+ client.onResetStore(() => __awaiter(void 0, void 0, void 0, function* () { return client.cache.writeQuery(initialCacheData); }));
77
80
  client
78
81
  .query({
79
82
  query: config.apolloConfig.channelsQuery || channelsQuery
@@ -125,9 +128,19 @@ const startClient = (tree, config) => {
125
128
  })
126
129
  .then((tree) => {
127
130
  return loadableReady(() => {
128
- const root = document.getElementById('root');
129
- renderToDOM(tree, root, () => void (client.disableNetworkFetches = false));
131
+ if (root) {
132
+ // If the root is already set,
133
+ // we know that we are in a hot reload and we want to render the new tree into the existing root.
134
+ root.render(tree);
135
+ }
136
+ else {
137
+ // client.disableNetworkFetches = false;
138
+ root = hydrateRoot(document.getElementById('root'), tree);
139
+ }
130
140
  });
141
+ })
142
+ .finally(() => {
143
+ client.disableNetworkFetches = false;
131
144
  });
132
145
  };
133
146
  const main = (tree, config) => {
@@ -1 +1 @@
1
- {"version":3,"file":"startClient.js","sourceRoot":"","sources":["startClient.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,KAAuB,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,O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B;iBAAM;gBACL,wCAAwC;gBACxC,IAAI,GAAG,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC;aAC3D;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;SACD,OAAO,CAAC,GAAG,EAAE;QACZ,MAAM,CAAC,qBAAqB,GAAG,KAAK,CAAC;IACvC,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AAEF,MAAM,IAAI,GAAG,CAAC,IAAkB,EAAE,MAAmB,EAAE,EAAE;IACvD,2HAA2H;IAC3H,IAAK,MAAc,CAAC,eAAe,EAAE;QACnC,OAAO,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;KAClC;SAAM;QACL,2KAA2K;QAC1K,MAAc,CAAC,QAAQ,GAAG,GAAG,EAAE,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;KAC5D;AACH,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -1,8 +1,8 @@
1
+ import { OperationVariables } from '@apollo/client';
1
2
  import { DocumentNode } from 'graphql';
2
- import { OperationVariables } from 'react-apollo';
3
3
  import { CreateClientOpts } from '../apollo';
4
4
  import { ChannelHeaders } from './persistedQueries/PersistedClient';
5
- export declare type ErrorCallback = (err: Error) => void;
5
+ export type ErrorCallback = (err: Error) => void;
6
6
  export interface IntervalQueryOptions {
7
7
  query: DocumentNode;
8
8
  pollInterval: number;
@@ -42,7 +42,7 @@ export class IntervalQuery {
42
42
  headers: this.channelHeaders
43
43
  }
44
44
  })
45
- .then(resp => {
45
+ .then((resp) => {
46
46
  const { data } = resp;
47
47
  if (pendingResponse !== this.pendingResponse) {
48
48
  // response expired
@@ -56,7 +56,7 @@ export class IntervalQuery {
56
56
  this.client = client;
57
57
  return data;
58
58
  });
59
- pendingResponse.catch(err => {
59
+ pendingResponse.catch((err) => {
60
60
  if (pendingResponse !== this.pendingResponse) {
61
61
  // response expired
62
62
  return;
@@ -1 +1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I,CAAC,YAAY,CAAC;aAC1B;YACD,IAAI,IAAI,CAAC,eAAe,EAAE;gBACxB,OAAO,IAAI,CAAC,eAAe,CAAC;aAC7B;YACD,OAAO,IAAI,CAAC,YAAY,EAAE,CAAC;QAC7B,CAAC;KAAA;IAEK,kBAAkB;;YACtB,OAAO,IAAI,CAAC,eAAe,CAAC;QAC9B,CAAC;KAAA;IAED,YAAY;QACV,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YAChB,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;SACjD;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;IAC/B,CAAC;CACF"}
@@ -1,14 +1,12 @@
1
- // TODO
2
- // File reverted from TypeScript, should be reverted when pipeline supports it
3
- // https://gitlab.jetshop.se/jetshop/flight/merge_requests/409/diffs?commit_id=d30490f833ec2d2eec94e5a75ed99de71e666377
4
- // https://gitlab.jetshop.se/jetshop/flight/blob/94b6108017f6205e7d31f6bedb19c14f278d227a/packages/core/boot/server/IntervalQuery.test.ts
5
-
6
- import { InMemoryCache } from 'apollo-cache-inmemory';
7
- import { HttpLink } from 'apollo-link-http';
8
- import ApolloClient, { ApolloError } from 'apollo-client';
1
+ import {
2
+ ApolloClient,
3
+ ApolloError,
4
+ InMemoryCache,
5
+ HttpLink,
6
+ gql
7
+ } from '@apollo/client';
9
8
  import { IntervalQuery } from './IntervalQuery';
10
9
  import nock from 'nock';
11
- import gql from 'graphql-tag';
12
10
  beforeAll(() => {
13
11
  jest.useFakeTimers();
14
12
  nock.disableNetConnect();
@@ -46,16 +44,14 @@ function mockResponse({ channels = null, statusCode = 200, errors }) {
46
44
  errors,
47
45
  data: {
48
46
  channels: Array.isArray(channels)
49
- ? channels.map(channel =>
47
+ ? channels.map((channel) =>
50
48
  Object.assign({ __typename: 'Channel' }, channel)
51
49
  )
52
50
  : null
53
51
  }
54
52
  };
55
53
  const res = jest.fn(() => data);
56
- nock('http://localhost')
57
- .post('/graphql')
58
- .reply(statusCode, res);
54
+ nock('http://localhost').post('/graphql').reply(statusCode, res);
59
55
  return res;
60
56
  }
61
57
  test('does request on init', async () => {
@@ -3,11 +3,14 @@
3
3
  // https://gitlab.jetshop.se/jetshop/flight/merge_requests/409/diffs?commit_id=d30490f833ec2d2eec94e5a75ed99de71e666377
4
4
  // https://gitlab.jetshop.se/jetshop/flight/blob/94b6108017f6205e7d31f6bedb19c14f278d227a/packages/core/boot/server/PersistedApolloClient.test.ts
5
5
 
6
- import ApolloClient, { ApolloError } from 'apollo-client';
6
+ import {
7
+ ApolloClient,
8
+ ApolloError,
9
+ InMemoryCache,
10
+ HttpLink
11
+ } from '@apollo/client';
7
12
  import { PersistedApolloClient } from './PersistedApolloClient';
8
13
  import nock from 'nock';
9
- import { HttpLink } from 'apollo-link-http';
10
- import { InMemoryCache } from 'apollo-cache-inmemory';
11
14
  import channelsQuery from '../ChannelsQuery.gql';
12
15
 
13
16
  global.__IN_SERVER__ = true;
@@ -41,7 +44,7 @@ function mockResponse({ channels = null, statusCode = 200, errors }) {
41
44
  errors,
42
45
  data: {
43
46
  channels: Array.isArray(channels)
44
- ? channels.map(channel =>
47
+ ? channels.map((channel) =>
45
48
  Object.assign(
46
49
  {
47
50
  __typename: 'Channel',
@@ -66,9 +69,7 @@ function mockResponse({ channels = null, statusCode = 200, errors }) {
66
69
  }
67
70
  };
68
71
  const res = jest.fn(() => data);
69
- nock('http://localhost')
70
- .post('/graphql')
71
- .reply(statusCode, res);
72
+ nock('http://localhost').post('/graphql').reply(statusCode, res);
72
73
  return res;
73
74
  }
74
75
  test('does request on init', async () => {
@@ -1,3 +1,3 @@
1
- export declare type BreakpointMW = (req: any, res: any, next: any) => void;
1
+ export type BreakpointMW = (req: any, res: any, next: any) => void;
2
2
  declare const breakpointMiddleware: BreakpointMW;
3
3
  export default breakpointMiddleware;
@@ -1,4 +1,5 @@
1
- import { ApolloServer, IResolversParameter } from 'apollo-server-express';
1
+ import { ApolloServer } from 'apollo-server-express';
2
+ import { IResolversParameter } from 'graphql-tools';
2
3
  import { GraphQLSchema } from 'graphql';
3
4
  import { ApolloConfig } from '../../components/ConfigProvider';
4
5
  import { PluginDefinition } from 'apollo-server-core';
@@ -15,8 +16,8 @@ export interface SchemaExtensionResult {
15
16
  schema?: GraphQLSchema | string;
16
17
  resolvers?: IResolversParameter;
17
18
  }
18
- export declare type SchemaExtension = (opts: SchemaExtensionOptions) => PromiseLike<SchemaExtensionResult> | SchemaExtensionResult;
19
- export declare type SchemaExtensions = SchemaExtension[];
19
+ export type SchemaExtension = (opts: SchemaExtensionOptions) => PromiseLike<SchemaExtensionResult> | SchemaExtensionResult;
20
+ export type SchemaExtensions = SchemaExtension[];
20
21
  export interface CreateApolloServerOptions {
21
22
  apolloConfig: ApolloConfig;
22
23
  extensions?: SchemaExtensions;