@jetshop/core 5.17.0-alpha.1295e0ab → 5.17.0-alpha.137fbbdd
Sign up to get free protection for your applications and to get access to all the features.
- package/ChannelHandler/redirectUtils.d.ts +1 -1
- package/ChannelHandler/redirectUtils.test.js +5 -5
- package/ChannelHandler/redirectUtilsGroupedChannels.test.js +5 -5
- package/boot/NetworkStatusNotifier.d.ts +2 -0
- package/boot/NetworkStatusNotifier.js +4 -0
- package/boot/NetworkStatusNotifier.js.map +1 -0
- package/boot/SharedTree.d.ts +1 -1
- package/boot/SharedTree.js +1 -1
- package/boot/SharedTree.js.map +1 -1
- package/boot/apollo.d.ts +1 -2
- package/boot/apollo.js +14 -9
- package/boot/apollo.js.map +1 -1
- package/boot/client/startClient.js +14 -5
- package/boot/client/startClient.js.map +1 -1
- package/boot/server/IntervalQuery.d.ts +1 -1
- package/boot/server/IntervalQuery.js +2 -2
- package/boot/server/IntervalQuery.js.map +1 -1
- package/boot/server/IntervalQuery.test.js +9 -13
- package/boot/server/PersistedApolloClient.test.js +8 -7
- package/boot/server/createApolloServer.d.ts +2 -1
- package/boot/server/createApolloServer.js +5 -5
- package/boot/server/createApolloServer.js.map +1 -1
- package/boot/server/createRenderer.js +4 -2
- package/boot/server/createRenderer.js.map +1 -1
- package/boot/server/entrypoint.js +7 -4
- package/boot/server/entrypoint.js.map +1 -1
- package/boot/server/persistedQueries/__tests__/getPersistedQueriesForRequest.test.js +1 -1
- package/boot/utils/queryLoggingMiddleware.d.ts +1 -1
- package/boot/utils/queryLoggingMiddleware.js +2 -2
- package/boot/utils/queryLoggingMiddleware.js.map +1 -1
- package/cart/AddToCartFormik.d.ts +2 -2
- package/cart/AddToCartFormik.js +2 -2
- package/cart/AddToCartFormik.js.map +1 -1
- package/cart/useAddToCart.d.ts +1 -1
- package/components/Auth/ForgotPasswordProvider.d.ts +4 -6
- package/components/Auth/ForgotPasswordProvider.js +18 -18
- package/components/Auth/ForgotPasswordProvider.js.map +1 -1
- package/components/Auth/ResetPasswordProvider.d.ts +5 -3
- package/components/Auth/ResetPasswordProvider.js +1 -1
- package/components/Auth/ResetPasswordProvider.js.map +1 -1
- package/components/Auth/SSN.js +4 -4
- package/components/Auth/SSN.js.map +1 -1
- package/components/Auth/SignupFormContainer.d.ts +2 -5
- package/components/Auth/SignupFormContainer.js.map +1 -1
- package/components/Auth/UpdatePasswordForm.js +6 -6
- package/components/Auth/UpdatePasswordForm.js.map +1 -1
- package/components/Auth/signup-context.d.ts +2 -2
- package/components/Auth/signup-context.js +2 -3
- package/components/Auth/signup-context.js.map +1 -1
- package/components/Auth/signupSubmit.js +4 -4
- package/components/Auth/signupSubmit.js.map +1 -1
- package/components/Auth/useAddressFields.js +3 -3
- package/components/Auth/useAddressFields.js.map +1 -1
- package/components/Auth/useAddressFields.test.js +10 -8
- package/components/Auth/useCustomer.d.ts +2 -2
- package/components/Auth/useCustomer.js +1 -1
- package/components/Auth/useCustomer.js.map +1 -1
- package/components/AuthContext/AuthProvider.js +2 -2
- package/components/AuthContext/AuthProvider.js.map +1 -1
- package/components/AuthContext/AuthProvider.test.js +1 -1
- package/components/AuthContext/LogOut.d.ts +2 -2
- package/components/ChannelContext/ChannelProvider.d.ts +1 -1
- package/components/ChannelContext/useCountrySettings.d.ts +1 -1
- package/components/ChannelContext/useCountrySettings.js +1 -1
- package/components/ChannelContext/useCountrySettings.js.map +1 -1
- package/components/DynamicRoute/ActiveFiltersQuery.gql +4 -4
- package/components/DynamicRoute/CategoryRoute.d.ts +3 -3
- package/components/DynamicRoute/CategoryRoute.js +6 -3
- package/components/DynamicRoute/CategoryRoute.js.map +1 -1
- package/components/DynamicRoute/ContentRoute.d.ts +1 -1
- package/components/DynamicRoute/GenericError.d.ts +18 -0
- package/components/DynamicRoute/GenericError.js +61 -0
- package/components/DynamicRoute/GenericError.js.map +1 -0
- package/components/DynamicRoute/PreviewRoute.d.ts +1 -1
- package/components/DynamicRoute/PreviewRoute.js +1 -1
- package/components/DynamicRoute/PreviewRoute.js.map +1 -1
- package/components/DynamicRoute/ProductByArticlenumber.d.ts +2 -2
- package/components/DynamicRoute/ProductByArticlenumber.js +2 -2
- package/components/DynamicRoute/ProductByArticlenumber.js.map +1 -1
- package/components/DynamicRoute/ProductRoute.d.ts +3 -3
- package/components/DynamicRoute/RouteResolver.d.ts +2 -2
- package/components/DynamicRoute/RouteResolver.js +1 -1
- package/components/DynamicRoute/RouteResolver.js.map +1 -1
- package/components/DynamicRoute/Status.d.ts +4 -3
- package/components/DynamicRoute/Status.js.map +1 -1
- package/components/DynamicRoute/index.d.ts +4 -4
- package/components/DynamicRoute/index.js +46 -42
- package/components/DynamicRoute/index.js.map +1 -1
- package/components/Filters/utils/replaceInSearch.d.ts +1 -1
- package/components/Filters/utils/replaceInSearch.js.map +1 -1
- package/components/Mutation/AddToCartFormik.d.ts +1 -1
- package/components/Mutation/AddToCartFormik.js +2 -2
- package/components/Mutation/AddToCartFormik.js.map +1 -1
- package/components/Mutation/DecrementQuantity.d.ts +2 -2
- package/components/Mutation/DecrementQuantity.js +1 -1
- package/components/Mutation/DecrementQuantity.js.map +1 -1
- package/components/Mutation/IncrementQuantity.d.ts +2 -2
- package/components/Mutation/IncrementQuantity.js +1 -1
- package/components/Mutation/IncrementQuantity.js.map +1 -1
- package/components/Mutation/RemoveFromCart.d.ts +2 -2
- package/components/Mutation/RemoveFromCart.js +1 -1
- package/components/Mutation/RemoveFromCart.js.map +1 -1
- package/components/Mutation/SetQuantity.d.ts +2 -2
- package/components/Mutation/SetQuantity.js +1 -1
- package/components/Mutation/SetQuantity.js.map +1 -1
- package/components/Mutation/SubscribeToNewsletter.d.ts +1 -1
- package/components/Mutation/SubscribeToNewsletter.js +1 -1
- package/components/Mutation/SubscribeToNewsletter.js.map +1 -1
- package/components/Mutation/SubscribeToStockNotifications.d.ts +1 -1
- package/components/Mutation/SubscribeToStockNotifications.js +6 -2
- package/components/Mutation/SubscribeToStockNotifications.js.map +1 -1
- package/components/Mutation/cartMutationUtils.d.ts +1 -2
- package/components/Mutation/cartMutationUtils.js.map +1 -1
- package/components/Mutation/useDecrementQuantity.d.ts +1 -1
- package/components/Mutation/useDecrementQuantity.js +1 -1
- package/components/Mutation/useDecrementQuantity.js.map +1 -1
- package/components/Mutation/useIncrementQuantity.d.ts +1 -1
- package/components/Mutation/useIncrementQuantity.js +1 -1
- package/components/Mutation/useIncrementQuantity.js.map +1 -1
- package/components/Mutation/useRemoveFromCart.d.ts +1 -1
- package/components/Mutation/useRemoveFromCart.js +1 -1
- package/components/Mutation/useRemoveFromCart.js.map +1 -1
- package/components/Mutation/useSetQuantity.d.ts +1 -1
- package/components/Mutation/useSetQuantity.js +1 -1
- package/components/Mutation/useSetQuantity.js.map +1 -1
- package/components/Notifications/Notifications.d.ts +3 -3
- package/components/Notifications/Notifications.js +2 -3
- package/components/Notifications/Notifications.js.map +1 -1
- package/components/ProductConfigurationProvider/ProductConfigurationProvider.js +6 -6
- package/components/ProductConfigurationProvider/ProductConfigurationProvider.js.map +1 -1
- package/components/Query/CartProvider.d.ts +1 -1
- package/components/Query/CartProvider.js +1 -1
- package/components/Query/CartProvider.js.map +1 -1
- package/components/SortOrder/SortOrderContainer.d.ts +1 -1
- package/components/StructuredData/StructuredBreadcrumbData.d.ts +2 -2
- package/data/cache.d.ts +1 -1
- package/data/cache.js +31 -12
- package/data/cache.js.map +1 -1
- package/global.d.ts +55 -1
- package/helpers/getErrorDetail.d.ts +1 -1
- package/helpers/getErrorDetail.js +2 -2
- package/helpers/getErrorDetail.js.map +1 -1
- package/hooks/Filters/useBooleanFilter.d.ts +1 -1
- package/hooks/Filters/useBooleanFilter.js +1 -2
- package/hooks/Filters/useBooleanFilter.js.map +1 -1
- package/hooks/Filters/useFilters.d.ts +1 -1
- package/hooks/Filters/useFilters.js +1 -2
- package/hooks/Filters/useFilters.js.map +1 -1
- package/hooks/Filters/useListFilter.d.ts +2 -2
- package/hooks/Filters/useListFilter.js +1 -2
- package/hooks/Filters/useListFilter.js.map +1 -1
- package/hooks/Filters/useMultiFilter.d.ts +3 -3
- package/hooks/Filters/useMultiFilter.js +1 -2
- package/hooks/Filters/useMultiFilter.js.map +1 -1
- package/hooks/Filters/useRangeFilter.d.ts +2 -2
- package/hooks/Filters/useRangeFilter.js +1 -2
- package/hooks/Filters/useRangeFilter.js.map +1 -1
- package/hooks/Filters/useSortOrder.d.ts +6 -1
- package/hooks/Filters/useSortOrder.js +4 -3
- package/hooks/Filters/useSortOrder.js.map +1 -1
- package/hooks/PackageProducts/usePackageProductItem.d.ts +1 -1
- package/hooks/PackageProducts/usePackageProductItem.js +1 -1
- package/hooks/PackageProducts/usePackageProductItem.js.map +1 -1
- package/hooks/PackageProducts/usePackageProducts.js +17 -17
- package/hooks/PackageProducts/usePackageProducts.js.map +1 -1
- package/hooks/PackageProducts/usePackageProducts.test.js +1 -1
- package/hooks/ProductList/ProductListContext.js +1 -1
- package/hooks/ProductList/ProductListContext.js.map +1 -1
- package/hooks/ProductList/action-creators.d.ts +1 -1
- package/hooks/ProductList/index.d.ts +1 -1
- package/hooks/ProductList/list-transforms.js +1 -1
- package/hooks/ProductList/list-transforms.js.map +1 -1
- package/hooks/ProductList/product-list-reducer.js +1 -1
- package/hooks/ProductList/product-list-reducer.js.map +1 -1
- package/hooks/ProductList/useProductList.js +1 -1
- package/hooks/ProductList/useProductList.js.map +1 -1
- package/hooks/ProductList/useProductListItems.js +1 -1
- package/hooks/ProductList/useProductListItems.js.map +1 -1
- package/hooks/Subscriptions/useNewsletterSubscription.js +3 -3
- package/hooks/Subscriptions/useNewsletterSubscription.js.map +1 -1
- package/hooks/Subscriptions/useStockNotifications.d.ts +1 -1
- package/hooks/Subscriptions/useStockNotifications.js +3 -3
- package/hooks/Subscriptions/useStockNotifications.js.map +1 -1
- package/hooks/Subscriptions/useStoreSubscriptions.d.ts +1 -1
- package/hooks/Subscriptions/useStoreSubscriptions.js +3 -6
- package/hooks/Subscriptions/useStoreSubscriptions.js.map +1 -1
- package/hooks/Subscriptions/useStoresubscriptions.test.js +5 -7
- package/hooks/useAddMultipleToCart.d.ts +1 -1
- package/hooks/useAddMultipleToCart.js +1 -1
- package/hooks/useAddMultipleToCart.js.map +1 -1
- package/hooks/useAddMultipleToCart.test.js +1 -1
- package/hooks/useCustomerOrders.test.js +7 -5
- package/hooks/useCustomerOrdersQuery.d.ts +2 -2
- package/hooks/useCustomerOrdersQuery.js +1 -1
- package/hooks/useCustomerOrdersQuery.js.map +1 -1
- package/hooks/useDeleteAccountMutation.js +3 -3
- package/hooks/useDeleteAccountMutation.js.map +1 -1
- package/hooks/useInfinitePagination.d.ts +1 -1
- package/hooks/useInfinitePagination.js +4 -1
- package/hooks/useInfinitePagination.js.map +1 -1
- package/hooks/useLoginMutation.d.ts +3 -3
- package/hooks/useLoginMutation.js +2 -2
- package/hooks/useLoginMutation.js.map +1 -1
- package/hooks/useLoginRedirect.js +2 -2
- package/hooks/useLoginRedirect.js.map +1 -1
- package/hooks/useOrderDetailQuery.d.ts +3 -3
- package/hooks/useOrderDetailQuery.js +1 -1
- package/hooks/useOrderDetailQuery.js.map +1 -1
- package/hooks/useRoutePreload.js +1 -1
- package/hooks/useRoutePreload.js.map +1 -1
- package/hooks/useStockStatus.d.ts +8 -0
- package/hooks/useStockStatus.js +26 -0
- package/hooks/useStockStatus.js.map +1 -0
- package/integrations/addwishSchemaExtension.js +3 -3
- package/integrations/addwishSchemaExtension.js.map +1 -1
- package/integrations/nostoSchemaExtension.js +2 -2
- package/integrations/nostoSchemaExtension.js.map +1 -1
- package/integrations/sluggishSchemaExtension.js +1 -1
- package/integrations/sluggishSchemaExtension.js.map +1 -1
- package/package.json +13 -29
- package/polyfills.js +0 -2
- package/polyfills.js.map +1 -1
- package/resolvers/filters/boolFilter.js +24 -27
- package/resolvers/filters/boolFilter.js.map +1 -1
- package/resolvers/filters/filterParams.js +8 -8
- package/resolvers/filters/filterParams.js.map +1 -1
- package/resolvers/filters/filters.js +5 -5
- package/resolvers/filters/filters.js.map +1 -1
- package/resolvers/filters/index.d.ts +0 -4
- package/resolvers/filters/listFilter.js +24 -29
- package/resolvers/filters/listFilter.js.map +1 -1
- package/resolvers/filters/listFilterItem.js +21 -27
- package/resolvers/filters/listFilterItem.js.map +1 -1
- package/resolvers/filters/multiListFilter.js +41 -42
- package/resolvers/filters/multiListFilter.js.map +1 -1
- package/resolvers/filters/multiListFilterList.js +1 -1
- package/resolvers/filters/multiListFilterList.js.map +1 -1
- package/resolvers/filters/rangeFilter.js +27 -43
- package/resolvers/filters/rangeFilter.js.map +1 -1
- package/test-utils/ProviderPyramid.js +1 -1
- package/types.d.ts +1820 -1955
- package/components/Fonts/GoogleFont.d.ts +0 -10
- package/components/Fonts/GoogleFont.js +0 -35
- package/components/Fonts/GoogleFont.js.map +0 -1
- package/components/Fonts/TypekitFont.d.ts +0 -16
- package/components/Fonts/TypekitFont.js +0 -25
- package/components/Fonts/TypekitFont.js.map +0 -1
@@ -1,4 +1,4 @@
|
|
1
|
-
import ApolloClient from 'apollo
|
1
|
+
import { ApolloClient } from '@apollo/client';
|
2
2
|
import { SelectedChannel } from '../components/ChannelContext/ChannelContext';
|
3
3
|
export type GetPrimaryRoutePath = (path: string, newChannel: SelectedChannel, setSelectedChannel: (selectedChannel: SelectedChannel) => void) => Promise<string>;
|
4
4
|
export declare function primaryRouteForPathFetcher(client: ApolloClient<any>): GetPrimaryRoutePath;
|
@@ -2,13 +2,13 @@ import {
|
|
2
2
|
createSelectedChannel,
|
3
3
|
getSelectedAndRecommendedChannel
|
4
4
|
} from './channelUtils';
|
5
|
-
import { MockLink } from 'apollo
|
5
|
+
import { MockLink } from '@apollo/client';
|
6
6
|
import {
|
7
|
+
ApolloClient,
|
7
8
|
InMemoryCache,
|
8
|
-
IntrospectionFragmentMatcher
|
9
|
-
|
10
|
-
|
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
|
5
|
+
import { MockLink } from '@apollo/client';
|
6
6
|
import {
|
7
|
+
ApolloClient,
|
7
8
|
InMemoryCache,
|
8
|
-
IntrospectionFragmentMatcher
|
9
|
-
|
10
|
-
|
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,
|
@@ -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"}
|
package/boot/SharedTree.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { AnalyticsConfig } from '@jetshop/core/analytics/AnalyticsProvider';
|
2
|
-
import ApolloClient from 'apollo
|
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';
|
package/boot/SharedTree.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import AnalyticsProvider from '@jetshop/core/analytics/AnalyticsProvider';
|
2
2
|
import React from 'react';
|
3
|
-
import { ApolloProvider } from '
|
3
|
+
import { ApolloProvider } from '@apollo/client';
|
4
4
|
// Cookies
|
5
5
|
import { CookiesProvider } from 'react-cookie';
|
6
6
|
// Metadata
|
package/boot/SharedTree.js.map
CHANGED
@@ -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,
|
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,gBAAgB,CAAC;AAChD,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,CAAC,EAClB,gBAAgB,EAChB,OAAO,EACP,aAAa,EACb,QAAQ,EACR,MAAM,EACN,MAAM,EACN,WAAW,EACX,MAAM,EACN,WAAW,EACX,QAAQ,EACR,cAAc,EACd,cAAc,EACE,EAAgB,EAAE;IAClC,OAAO,CACL,oBAAC,cAAc,IAAC,MAAM,EAAE,MAAM;QAC5B,oBAAC,qBAAqB;YACpB,oBAAC,eAAe,IAAC,OAAO,EAAE,OAAO;gBAC/B,oBAAC,cAAc,IAAC,OAAO,EAAE,aAAa;oBACpC,oBAAC,kBAAkB,IAAC,KAAK,EAAE,gBAAgB;wBACzC,oBAAC,cAAc,IAAC,MAAM,EAAE,MAAM;4BAC5B,oBAAC,eAAe,IACd,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,cAAc;gCAE9B,oBAAC,iBAAiB,IAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO;oCACrD,oBAAC,eAAe,IAAC,cAAc,EAAE,cAAc;wCAC7C,oBAAC,MAAM,kBACL,QAAQ,EACN,cAAc,CAAC,kBAAkB,EAAE,IAAI,SAAS,IAE9C,WAAW;4CAEf,oBAAC,YAAY,IAAC,IAAI,EAAE,WAAW,IAC5B,QAAQ,CACI,CACR,CACO,CACA,CACJ,CACH,CACE,CACN,CACD,CACI,CACT,CAClB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
package/boot/apollo.d.ts
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
import { NormalizedCacheObject } from 'apollo
|
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
|
13
|
-
import {
|
14
|
-
import {
|
15
|
-
import {
|
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/
|
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,17 +178,23 @@ export const createClient = ({ apolloConfig: { token, shopid, enableGateway, gra
|
|
179
178
|
links.unshift(logOperationTime);
|
180
179
|
}
|
181
180
|
if (enableGateway) {
|
182
|
-
links.unshift(createPersistedQueryLink({
|
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
|
191
196
|
: cache.restore(window.__APOLLO_STATE__),
|
192
|
-
ssrMode:
|
197
|
+
ssrMode: true,
|
193
198
|
resolvers: resolvers(qs.stringify(req === null || req === void 0 ? void 0 : req.query, { encode: true, encodeValuesOnly: true })),
|
194
199
|
typeDefs
|
195
200
|
});
|
package/boot/apollo.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"apollo.js","sourceRoot":"","sources":["apollo.ts"],"names":[],"mappings":";;;;;;;;;;;
|
1
|
+
{"version":3,"file":"apollo.js","sourceRoot":"","sources":["apollo.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EACL,YAAY,EAEZ,UAAU,EACV,cAAc,EACf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAGxD,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;AAElE,OAAO,EAAE,IAAI,IAAI,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAiBrF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAC3B,YAAY,EAAE,EACZ,KAAK,EACL,MAAM,EACN,aAAa,EACb,UAAU,EACV,qBAAqB,EACtB,EACD,MAAM,EACN,WAAW,EACX,cAAc,EACd,GAAG,EACH,cAAc,EACG,EAAE,EAAE;IACrB,IAAI,CAAC,KAAK,IAAI,CAAC,MAAM,EAAE;QACrB,MAAM,IAAI,KAAK,CAAC,WAAW,CAAC,KAAK,IAAI,OAAO,IAAI,CAAC,MAAM,IAAI,QAAQ,EAAE,CAAC,C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Ac,CAAC,gBAAgB,CAAC;QACnD,OAAO,EAAE,IAAI;QACb,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 {
|
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.
|
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.
|
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,8 +128,14 @@ const startClient = (tree, config) => {
|
|
125
128
|
})
|
126
129
|
.then((tree) => {
|
127
130
|
return loadableReady(() => {
|
128
|
-
|
129
|
-
|
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
|
+
root = hydrateRoot(document.getElementById('root'), tree);
|
138
|
+
}
|
130
139
|
});
|
131
140
|
});
|
132
141
|
};
|
@@ -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,
|
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,OAA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AAE;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,5 +1,5 @@
|
|
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
5
|
export type ErrorCallback = (err: Error) => void;
|
@@ -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 @@
|
|
1
|
-
{"version":3,"file":"IntervalQuery.js","sourceRoot":"","sources":["IntervalQuery.ts"],"names":[],"mappings":";;;;;;;;;
|
1
|
+
{"version":3,"file":"IntervalQuery.js","sourceRoot":"","sources":["IntervalQuery.ts"],"names":[],"mappings":";;;;;;;;;AAEA,OAAO,EAAE,YAAY,EAAoB,MAAM,WAAW,CAAC;AAa3D,MAAM,OAAO,aAAa;IAYxB,YAAY,EACV,KAAK,EACL,SAAS,EACT,gBAAgB,EAChB,YAAY,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@@ -1,14 +1,12 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
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
|
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,4 +1,5 @@
|
|
1
|
-
import { ApolloServer
|
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';
|
@@ -7,14 +7,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
8
8
|
});
|
9
9
|
};
|
10
|
-
import {
|
11
|
-
import {
|
12
|
-
import {
|
10
|
+
import { ApolloLink, HttpLink } from '@apollo/client';
|
11
|
+
import { ApolloServer } from 'apollo-server-express';
|
12
|
+
import { introspectSchema, makeRemoteExecutableSchema, mergeSchemas } from 'graphql-tools';
|
13
|
+
import { setContext } from '@apollo/client/link/context';
|
13
14
|
import fetch from 'node-fetch';
|
14
15
|
// import { specifiedRules } from 'graphql';
|
15
16
|
// import { OverlappingFieldsCanBeMerged } from 'graphql/validation/rules/OverlappingFieldsCanBeMerged';
|
16
17
|
import { InMemoryLRUCache } from 'apollo-server-caching';
|
17
|
-
import { ApolloLink } from 'apollo-link';
|
18
18
|
import https from 'https';
|
19
19
|
import dnscache from 'dnscache';
|
20
20
|
const pick = require('lodash.pick');
|
@@ -71,7 +71,7 @@ function getRemoteSchema({ apolloConfig: { graphQLURI, token, shopid } }) {
|
|
71
71
|
* @link https://github.com/apollographql/graphql-tools/issues/1046#issuecomment-457445794
|
72
72
|
*/
|
73
73
|
const errorLink = new ApolloLink((operation, forward) => {
|
74
|
-
return forward(operation).map(data => {
|
74
|
+
return forward(operation).map((data) => {
|
75
75
|
if (data.errors) {
|
76
76
|
for (const error of data.errors) {
|
77
77
|
if (!(error instanceof Error))
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"createApolloServer.js","sourceRoot":"","sources":["createApolloServer.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,
|
1
|
+
{"version":3,"file":"createApolloServer.js","sourceRoot":"","sources":["createApolloServer.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAY,UAAU,EAAa,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAEL,gBAAgB,EAChB,0BAA0B,EAC1B,YAAY,EACb,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,KAAK,MAAM,YAAY,CAAC;AAE/B,4CAA4C;AAC5C,wGAAwG;AACxG,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAIzD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,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C,CAAC;aAC7B;YACD,IAAI,MAAM,CAAC,SAAS,EAAE;gBACpB,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;aACpC;SACF;QAED,MAAM,MAAM,GAAG,YAAY,CAAC;YAC1B,OAAO;YACP,SAAS;SACV,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,YAAY,CAAC,YAAY;YACtC,CAAC,CAAC;gBACE,MAAM,EAAE,YAAY,CAAC,YAAY;aAClC;YACH,CAAC,CAAC,KAAK,CAAC;QAEV,MAAM,YAAY,GAAG,IAAI,YAAY,CAAC;YACpC,MAAM;YACN,sCAAsC;YACtC,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY;YACpD,OAAO,EAAE,CAAC,EAAE,GAAG,EAAqB,EAAW,EAAE;;gBAC/C,MAAM,eAAe,GAAwB,MAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,OAAO,mCAAI,EAAE,CAAC;gBAChE,MAAM,OAAO,GAAyB,IAAI,CACxC,eAAe,EACf,gBAAgB,CACjB,CAAC;gBAEF,OAAO;oBACL,OAAO;iBACR,CAAC;YACJ,CAAC;YACD,gBAAgB,EAAE;gBAChB,KAAK,EAAE,IAAI,gBAAgB,EAAE;aAC9B;YACD,OAAO,EAAE,KAAK;YACd,YAAY,EAAE,KAAK;YACnB,MAAM;YACN,OAAO;SACR,CAAC,CAAC;QAEH,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC;IAClC,CAAC;CAAA"}
|
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
8
8
|
});
|
9
9
|
};
|
10
|
-
import { getDataFromTree } from '@apollo/react
|
10
|
+
import { getDataFromTree } from '@apollo/client/react/ssr';
|
11
11
|
import { getSelectedAndRecommendedChannel } from '@jetshop/core/ChannelHandler/channelUtils';
|
12
12
|
import { setupIntl } from '@jetshop/intl/config';
|
13
13
|
import IntlContext from '@jetshop/intl/context';
|
@@ -30,6 +30,7 @@ import _merge from 'lodash.merge';
|
|
30
30
|
import { salesSourceMiddleware } from './salesSource';
|
31
31
|
import { getPreloadLinkHeaderString } from './getPreloadAssets';
|
32
32
|
import { primaryRouteForPathFetcher } from '../../../core/ChannelHandler/redirectUtils';
|
33
|
+
import ActiveFiltersQuery from '@jetshop/core/components/DynamicRoute/ActiveFiltersQuery.gql';
|
33
34
|
const injectDataIntoSlots = (template, data) => Object.keys(data).reduce((output, key) => key !== 'htmlAttributes'
|
34
35
|
? output.replace(`<slot name="${key}"/>`, data[key])
|
35
36
|
: output.replace('<html lang="en">', `<html ${data[key]}>`), template);
|
@@ -160,7 +161,8 @@ const createRenderer = (template, tree, options) => {
|
|
160
161
|
const combinedCache = _merge({}, cachedChannels, persistedQueries);
|
161
162
|
client.cache.restore(combinedCache);
|
162
163
|
// Initialise cache with active filters from the search params
|
163
|
-
client.cache.
|
164
|
+
client.cache.writeQuery({
|
165
|
+
query: ActiveFiltersQuery,
|
164
166
|
data: {
|
165
167
|
activeFilters: getActiveFiltersFromSearch(req.query)
|
166
168
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"createRenderer.js","sourceRoot":"","sources":["createRenderer.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"createRenderer.js","sourceRoot":"","sources":["createRenderer.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,gCAAgC,EAAE,MAAM,2CAA2C,CAAC;AAC7F,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAIhD,OAAO,KAAuB,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBA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,MAAM,uBAAuB,GAAG,4CAA4C,IAAI,CAAC,SAAS,CACxF,iBAAiB,CAClB,aAAa,CAAC;QACf,MAAM,gBAAgB,GAAG,qCAAqC,UAAU,aAAa,CAAC;QACtF,MAAM,IAAI,GAAG;YACX,WAAW,EAAE,WAAW;YACxB,QAAQ;YACR,YAAY;YACZ,cAAc,EACZ,kBAAkB;gBAClB,uBAAuB;gBACvB,gBAAgB;gBAChB,cAAc;YAChB,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE;YACvB,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE;YACvC,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE,GAAG,gBAAgB,GAAG,aAAa;YAC1D,cAAc,EAAE,cAAc,CAAC,QAAQ,EAAE;SAC1C,CAAC;QAEF,MAAM,IAAI,GAAG,mBAAmB,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACjD,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;QAEvD,aAAa,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;QACzC,GAAG,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,CAAC;QACvC,WAAW,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7B,CAAC,CAAA,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
@@ -13,12 +13,12 @@ import http from 'http';
|
|
13
13
|
const server = http.createServer(app);
|
14
14
|
let currentApp = app;
|
15
15
|
server.listen(process.env.PORT || 3000, () => {
|
16
|
-
console.log('🚀
|
16
|
+
console.log('🚀 Started');
|
17
17
|
});
|
18
18
|
if (module.hot) {
|
19
|
-
console.log('
|
19
|
+
console.log('🟢 HMR Server-side enabled!');
|
20
20
|
const reload = () => __awaiter(void 0, void 0, void 0, function* () {
|
21
|
-
console.log('
|
21
|
+
console.log('📦 HMR Server-side reloaded');
|
22
22
|
try {
|
23
23
|
app = yield require('src/server').default;
|
24
24
|
server.removeListener('request', currentApp);
|
@@ -26,11 +26,14 @@ import http from 'http';
|
|
26
26
|
currentApp = app;
|
27
27
|
}
|
28
28
|
catch (error) {
|
29
|
+
console.log('🔥 HMR Error: ', (error === null || error === void 0 ? void 0 : error.stack) || error);
|
29
30
|
console.error(error);
|
30
31
|
}
|
31
32
|
});
|
32
33
|
// Reload on HMR
|
33
|
-
module.hot.accept('src/server', reload)
|
34
|
+
module.hot.accept('src/server', reload, (err) => {
|
35
|
+
console.log('🔥 HMR Error: ', err);
|
36
|
+
});
|
34
37
|
}
|
35
38
|
}))();
|
36
39
|
//# sourceMappingURL=entrypoint.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"entrypoint.js","sourceRoot":"","sources":["entrypoint.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,CAAC,GAAS,EAAE;IACV,IAAI,GAAG,GAAG,MAAM,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC;IAC9C,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IACtC,IAAI,UAAU,GAAG,GAAG,CAAC;IAErB,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,EAAE,GAAG,EAAE;QAC3C,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,IAAK,MAAc,CAAC,GAAG,EAAE;QACvB,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;QAE3C,MAAM,MAAM,GAAG,GAAS,EAAE;YACxB,OAAO,CAAC,GAAG,CAAC,
|
1
|
+
{"version":3,"file":"entrypoint.js","sourceRoot":"","sources":["entrypoint.ts"],"names":[],"mappings":";;;;;;;;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;AACH,CAAC,CAAA,CAAC,EAAE,CAAC"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { getPersistedQueriesForRequest } from '../getPersistedQueriesForRequest';
|
2
2
|
import aQuery from './mockQuery.gql';
|
3
3
|
import nock from 'nock';
|
4
|
-
import { ApolloError } from 'apollo
|
4
|
+
import { ApolloError } from '@apollo/client';
|
5
5
|
import { ChannelHandler } from '../../../../ChannelHandler/ChannelHandler';
|
6
6
|
|
7
7
|
beforeAll(() => {
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { ApolloLink } from 'apollo
|
1
|
+
import { ApolloLink } from '@apollo/client';
|
2
2
|
export declare const logOperationTime: ApolloLink;
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import { ApolloLink } from 'apollo
|
1
|
+
import { ApolloLink } from '@apollo/client';
|
2
2
|
const timeStartLink = new ApolloLink((operation, forward) => {
|
3
3
|
operation.setContext({ start: Date.now() });
|
4
4
|
return forward(operation);
|
5
5
|
});
|
6
6
|
const logTimeLink = new ApolloLink((operation, forward) => {
|
7
|
-
return forward(operation).map(data => {
|
7
|
+
return forward(operation).map((data) => {
|
8
8
|
// data from a previous link
|
9
9
|
const time = Date.now() - operation.getContext().start;
|
10
10
|
console.log(new Date(), `operation ${operation.operationName} took ${time} to complete`);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"queryLoggingMiddleware.js","sourceRoot":"","sources":["queryLoggingMiddleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"queryLoggingMiddleware.js","sourceRoot":"","sources":["queryLoggingMiddleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,aAAa,GAAG,IAAI,UAAU,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,EAAE;IAC1D,SAAS,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAC5C,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC;AAC5B,CAAC,CAAC,CAAC;AAEH,MAAM,WAAW,GAAG,IAAI,UAAU,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,EAAE;IACxD,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACrC,4BAA4B;QAC5B,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC,UAAU,EAAE,CAAC,KAAK,CAAC;QACvD,OAAO,CAAC,GAAG,CACT,IAAI,IAAI,EAAE,EACV,aAAa,SAAS,CAAC,aAAa,SAAS,IAAI,cAAc,CAChE,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC"}
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
2
2
|
import { FormikProps } from 'formik';
|
3
3
|
import { Price, Product, ProductVariant, ProductVariantOption } from '../types';
|
4
4
|
import { DocumentNode } from 'graphql';
|
5
|
-
import { ApolloError } from 'apollo
|
5
|
+
import { ApolloError } from '@apollo/client';
|
6
6
|
type Comments = Record<string, string>;
|
7
7
|
type Options = Record<string, string>;
|
8
8
|
interface AddToCartFormikValues {
|
@@ -38,5 +38,5 @@ interface AddToCartFormikProps {
|
|
38
38
|
}) => void;
|
39
39
|
children: (props: FormikProps<AddToCartFormikValues>) => React.ReactNode;
|
40
40
|
}
|
41
|
-
export declare function AddToCartFormik({ product, variant, commentValidators, getMissingOptions, initialValues, onAddToCartInit, onAddToCartError, onAddToCartSuccess, cartQuery, cartMutation, children }: AddToCartFormikProps): JSX.Element;
|
41
|
+
export declare function AddToCartFormik({ product, variant, commentValidators, getMissingOptions, initialValues, onAddToCartInit, onAddToCartError, onAddToCartSuccess, cartQuery, cartMutation, children }: AddToCartFormikProps): React.JSX.Element;
|
42
42
|
export default AddToCartFormik;
|