From fa7da679deb0a2528e34ffd6b7bbd0dc10d37cf4 Mon Sep 17 00:00:00 2001 From: devbucket Date: Mon, 8 Apr 2019 15:01:38 -0500 Subject: [PATCH 1/9] PWA-1618 Implemented react hook for custom routes. --- libraries/engage/core/hooks/README.md | 38 +++++++++++++++++++ libraries/engage/core/hooks/useCustomRoute.js | 20 ++++++++++ libraries/engage/core/index.js | 6 +++ yarn.lock | 5 +++ 4 files changed, 69 insertions(+) create mode 100644 libraries/engage/core/hooks/README.md create mode 100644 libraries/engage/core/hooks/useCustomRoute.js diff --git a/libraries/engage/core/hooks/README.md b/libraries/engage/core/hooks/README.md new file mode 100644 index 0000000000..70d3b6c752 --- /dev/null +++ b/libraries/engage/core/hooks/README.md @@ -0,0 +1,38 @@ +# Shopgate ENGAGE React Hooks + +This library provides you with a collecton of usefull React Hooks that you can use to build out new features in Shopgate ENGAGE. + +## Content + +### `useCustomRoute` + +This Hook returns all necessary React elements that you need to build a custom route: + +* `View` - The view component that you should wrap around your view content +* `Appbar` - The app bar component for the appropriate theme (GMD or iOS), +* `params` - The current Route's parameters. + +#### Usage + +```jsx +import { useCustomRoute, Route } from '@shopgate/engage/core'; + +function MyCustomView() { + const { View, AppBar, params } = useCustomRoute(); + + return ( + + + {/* ... your custom content goes here */} + + ) +} + +function MyCustomRoute() { + return ( + + ); +} + +export default MyCustomRoute; +``` diff --git a/libraries/engage/core/hooks/useCustomRoute.js b/libraries/engage/core/hooks/useCustomRoute.js new file mode 100644 index 0000000000..4b8c89191c --- /dev/null +++ b/libraries/engage/core/hooks/useCustomRoute.js @@ -0,0 +1,20 @@ +import { useContext } from 'react'; +import { ThemeContext, RouteContext } from '@shopgate/pwa-common/context'; + +/** + * Gives the ability to access the theme and route context via a single hook. + * Example Usage: + * ```js + * const { View, AppBar, params } = useCustomRoute(); + * ``` + * @returns {Object} + */ +export function useCustomRoute() { + const themeContext = useContext(ThemeContext); + const routeContext = useContext(RouteContext); + + return { + ...themeContext, + ...routeContext, + }; +} diff --git a/libraries/engage/core/index.js b/libraries/engage/core/index.js index 078be4ca3e..8241d6eb18 100644 --- a/libraries/engage/core/index.js +++ b/libraries/engage/core/index.js @@ -208,3 +208,9 @@ export { default as withShowModal } from '@shopgate/pwa-common/helpers/modal/wit // SELECTORS export * from '@shopgate/pwa-common/selectors/modal'; + +// --------------- HOOKS --------------- // + +export { useCustomRoute } from './hooks/useCustomRoute'; + +// --------------- HOCs --------------- // diff --git a/yarn.lock b/yarn.lock index 23d9ea50b4..8d1dc955de 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2116,6 +2116,11 @@ compare-func@^1.3.1: array-ify "^1.0.0" dot-prop "^3.0.0" +compare-versions@^3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-3.4.0.tgz#e0747df5c9cb7f054d6d3dc3e1dbc444f9e92b26" + integrity sha512-tK69D7oNXXqUW3ZNo/z7NXTEz22TCF0pTE+YF9cxvaAM9XnkLo1fV621xCLrRR6aevJlKxExkss0vWqUCUpqdg== + component-emitter@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" From ffdd4c775f7258a5292bc7b43ef866182ce1b4fb Mon Sep 17 00:00:00 2001 From: devbucket Date: Tue, 9 Apr 2019 12:35:16 -0500 Subject: [PATCH 2/9] PWA-1618 Implemented hoc --- .../extension-config.json | 6 ++++++ .../frontend/package.json | 1 + libraries/engage/core/hocs/withCustomRoute.jsx | 15 +++++++++++++++ libraries/engage/core/index.js | 2 ++ 4 files changed, 24 insertions(+) create mode 100644 libraries/engage/core/hocs/withCustomRoute.jsx diff --git a/extensions/@shopgate-product-reviews/extension-config.json b/extensions/@shopgate-product-reviews/extension-config.json index dd8e715196..17aa3c22e5 100644 --- a/extensions/@shopgate-product-reviews/extension-config.json +++ b/extensions/@shopgate-product-reviews/extension-config.json @@ -7,6 +7,12 @@ "path": "frontend/RatingStars/index.jsx", "target": "product-item.name.before", "type": "portals" + }, + { + "id": "CustomRoute1", + "path": "frontend/UsingHOC/index.jsx", + "target": "app.routes", + "type": "portals" } ], "configuration": {} diff --git a/extensions/@shopgate-product-reviews/frontend/package.json b/extensions/@shopgate-product-reviews/frontend/package.json index 44347558d7..e41d654fe3 100644 --- a/extensions/@shopgate-product-reviews/frontend/package.json +++ b/extensions/@shopgate-product-reviews/frontend/package.json @@ -19,6 +19,7 @@ } }, "devDependencies": { + "@shopgate/engage": "6.3.1", "@shopgate/eslint-config": "6.3.1", "@shopgate/pwa-common": "6.3.1", "@shopgate/pwa-common-commerce": "6.3.1", diff --git a/libraries/engage/core/hocs/withCustomRoute.jsx b/libraries/engage/core/hocs/withCustomRoute.jsx new file mode 100644 index 0000000000..728ce6ca52 --- /dev/null +++ b/libraries/engage/core/hocs/withCustomRoute.jsx @@ -0,0 +1,15 @@ +import React, { useContext } from 'react'; +import { ThemeContext, RouteContext } from '@shopgate/pwa-common/context'; + +/** + * @param {Function} WrappedComponent The react component to wrap. + * @returns {JSX} + */ +export function withCustomRoute(WrappedComponent) { + const themeContext = useContext(ThemeContext); + const routeContext = useContext(RouteContext); + + return props => ( + + ); +} diff --git a/libraries/engage/core/index.js b/libraries/engage/core/index.js index 8241d6eb18..b157d44d74 100644 --- a/libraries/engage/core/index.js +++ b/libraries/engage/core/index.js @@ -214,3 +214,5 @@ export * from '@shopgate/pwa-common/selectors/modal'; export { useCustomRoute } from './hooks/useCustomRoute'; // --------------- HOCs --------------- // + +export { withCustomRoute } from './hocs/withCustomRoute'; From d21b62c35f272f477f939185da1231fb0ad8eaf5 Mon Sep 17 00:00:00 2001 From: devbucket Date: Wed, 10 Apr 2019 11:59:05 -0500 Subject: [PATCH 3/9] PWA-1618 Fixed the engage package versioning. --- libraries/engage/package.json | 12 ++++++------ themes/theme-gmd/package.json | 1 + themes/theme-ios11/package.json | 1 + 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/libraries/engage/package.json b/libraries/engage/package.json index 784642c01b..387bcbfa3c 100644 --- a/libraries/engage/package.json +++ b/libraries/engage/package.json @@ -15,11 +15,11 @@ "connect" ], "dependencies": { - "@shopgate/pwa-common": "^6.3.1", - "@shopgate/pwa-common-commerce": "^6.3.1", - "@shopgate/pwa-core": "^6.3.1", - "@shopgate/pwa-ui-ios": "^6.3.1", - "@shopgate/pwa-ui-material": "^6.3.1", - "@shopgate/pwa-ui-shared": "^6.3.1" + "@shopgate/pwa-common": "6.3.1", + "@shopgate/pwa-common-commerce": "6.3.1", + "@shopgate/pwa-core": "6.3.1", + "@shopgate/pwa-ui-ios": "6.3.1", + "@shopgate/pwa-ui-material": "6.3.1", + "@shopgate/pwa-ui-shared": "6.3.1" } } diff --git a/themes/theme-gmd/package.json b/themes/theme-gmd/package.json index 9716ee53eb..07b8f06566 100644 --- a/themes/theme-gmd/package.json +++ b/themes/theme-gmd/package.json @@ -16,6 +16,7 @@ "e2e:user": "cypress open -P ./e2e/extensions/user" }, "dependencies": { + "@shopgate/engage": "6.3.1", "@shopgate/pwa-common": "6.3.1", "@shopgate/pwa-common-commerce": "6.3.1", "@shopgate/pwa-core": "6.3.1", diff --git a/themes/theme-ios11/package.json b/themes/theme-ios11/package.json index 95491a9662..645fd15e82 100644 --- a/themes/theme-ios11/package.json +++ b/themes/theme-ios11/package.json @@ -15,6 +15,7 @@ "e2e:checkout": "cypress open -P ./e2e/extensions/checkout" }, "dependencies": { + "@shopgate/engage": "6.3.1", "@shopgate/pwa-common": "6.3.1", "@shopgate/pwa-common-commerce": "6.3.1", "@shopgate/pwa-core": "6.3.1", From 3c0b08b07914431281ddebfde768d503ca6d0689 Mon Sep 17 00:00:00 2001 From: devbucket Date: Wed, 10 Apr 2019 11:59:31 -0500 Subject: [PATCH 4/9] PWA-1618 Removed the test component. --- extensions/@shopgate-product-reviews/extension-config.json | 6 ------ 1 file changed, 6 deletions(-) diff --git a/extensions/@shopgate-product-reviews/extension-config.json b/extensions/@shopgate-product-reviews/extension-config.json index 17aa3c22e5..dd8e715196 100644 --- a/extensions/@shopgate-product-reviews/extension-config.json +++ b/extensions/@shopgate-product-reviews/extension-config.json @@ -7,12 +7,6 @@ "path": "frontend/RatingStars/index.jsx", "target": "product-item.name.before", "type": "portals" - }, - { - "id": "CustomRoute1", - "path": "frontend/UsingHOC/index.jsx", - "target": "app.routes", - "type": "portals" } ], "configuration": {} From 22055117aa7dd0e47d64e7b42f41d13a2c6fbf4a Mon Sep 17 00:00:00 2001 From: devbucket Date: Wed, 10 Apr 2019 12:47:56 -0500 Subject: [PATCH 5/9] PWA-1618 Added hooks and HOCs to easily access Theme, Route and Product related information. --- .../engage/core/hocs/withCustomRoute.jsx | 15 -------- libraries/engage/core/hocs/withProduct.jsx | 19 ++++++++++ libraries/engage/core/hocs/withRoute.jsx | 17 +++++++++ libraries/engage/core/hocs/withTheme.jsx | 17 +++++++++ libraries/engage/core/hooks/README.md | 38 ------------------- libraries/engage/core/hooks/useCustomRoute.js | 20 ---------- libraries/engage/core/hooks/useProduct.js | 13 +++++++ libraries/engage/core/hooks/useRoute.js | 11 ++++++ libraries/engage/core/hooks/useTheme.js | 12 ++++++ libraries/engage/core/index.js | 13 +++++-- 10 files changed, 99 insertions(+), 76 deletions(-) delete mode 100644 libraries/engage/core/hocs/withCustomRoute.jsx create mode 100644 libraries/engage/core/hocs/withProduct.jsx create mode 100644 libraries/engage/core/hocs/withRoute.jsx create mode 100644 libraries/engage/core/hocs/withTheme.jsx delete mode 100644 libraries/engage/core/hooks/README.md delete mode 100644 libraries/engage/core/hooks/useCustomRoute.js create mode 100644 libraries/engage/core/hooks/useProduct.js create mode 100644 libraries/engage/core/hooks/useRoute.js create mode 100644 libraries/engage/core/hooks/useTheme.js diff --git a/libraries/engage/core/hocs/withCustomRoute.jsx b/libraries/engage/core/hocs/withCustomRoute.jsx deleted file mode 100644 index 728ce6ca52..0000000000 --- a/libraries/engage/core/hocs/withCustomRoute.jsx +++ /dev/null @@ -1,15 +0,0 @@ -import React, { useContext } from 'react'; -import { ThemeContext, RouteContext } from '@shopgate/pwa-common/context'; - -/** - * @param {Function} WrappedComponent The react component to wrap. - * @returns {JSX} - */ -export function withCustomRoute(WrappedComponent) { - const themeContext = useContext(ThemeContext); - const routeContext = useContext(RouteContext); - - return props => ( - - ); -} diff --git a/libraries/engage/core/hocs/withProduct.jsx b/libraries/engage/core/hocs/withProduct.jsx new file mode 100644 index 0000000000..abb62a4bf1 --- /dev/null +++ b/libraries/engage/core/hocs/withProduct.jsx @@ -0,0 +1,19 @@ +import React from 'react'; +import { ThemeContext } from '@shopgate/pwa-common/context'; + +/** + * Injects the Product Context information into the desired component. + * @param {Function} WrappedComponent The react component to wrap. + * @returns {JSX} + */ +export function withProduct(WrappedComponent) { + return props => ( + + {({ contexts: { ProductContext } }) => ( + + {productProps => } + + )} + + ); +} diff --git a/libraries/engage/core/hocs/withRoute.jsx b/libraries/engage/core/hocs/withRoute.jsx new file mode 100644 index 0000000000..a532516745 --- /dev/null +++ b/libraries/engage/core/hocs/withRoute.jsx @@ -0,0 +1,17 @@ +import React from 'react'; +import { RouteContext } from '@shopgate/pwa-common/context'; + +/** + * Injects the route properties into the desired component. + * @param {Function} WrappedComponent The react component to wrap. + * @returns {JSX} + */ +export function withRoute(WrappedComponent) { + return props => ( + + {routeContext => ( + + )} + + ); +} diff --git a/libraries/engage/core/hocs/withTheme.jsx b/libraries/engage/core/hocs/withTheme.jsx new file mode 100644 index 0000000000..f840179f87 --- /dev/null +++ b/libraries/engage/core/hocs/withTheme.jsx @@ -0,0 +1,17 @@ +import React from 'react'; +import { ThemeContext } from '@shopgate/pwa-common/context'; + +/** + * Injects the theme API into the desired component. This does not include the contexts. + * @param {Function} WrappedComponent The react component to wrap. + * @returns {JSX} + */ +export function withTheme(WrappedComponent) { + return props => ( + + {({ contexts, ...themeContext }) => ( // The contexts are left out in favor of other HOCs. + + )} + + ); +} diff --git a/libraries/engage/core/hooks/README.md b/libraries/engage/core/hooks/README.md deleted file mode 100644 index 70d3b6c752..0000000000 --- a/libraries/engage/core/hooks/README.md +++ /dev/null @@ -1,38 +0,0 @@ -# Shopgate ENGAGE React Hooks - -This library provides you with a collecton of usefull React Hooks that you can use to build out new features in Shopgate ENGAGE. - -## Content - -### `useCustomRoute` - -This Hook returns all necessary React elements that you need to build a custom route: - -* `View` - The view component that you should wrap around your view content -* `Appbar` - The app bar component for the appropriate theme (GMD or iOS), -* `params` - The current Route's parameters. - -#### Usage - -```jsx -import { useCustomRoute, Route } from '@shopgate/engage/core'; - -function MyCustomView() { - const { View, AppBar, params } = useCustomRoute(); - - return ( - - - {/* ... your custom content goes here */} - - ) -} - -function MyCustomRoute() { - return ( - - ); -} - -export default MyCustomRoute; -``` diff --git a/libraries/engage/core/hooks/useCustomRoute.js b/libraries/engage/core/hooks/useCustomRoute.js deleted file mode 100644 index 4b8c89191c..0000000000 --- a/libraries/engage/core/hooks/useCustomRoute.js +++ /dev/null @@ -1,20 +0,0 @@ -import { useContext } from 'react'; -import { ThemeContext, RouteContext } from '@shopgate/pwa-common/context'; - -/** - * Gives the ability to access the theme and route context via a single hook. - * Example Usage: - * ```js - * const { View, AppBar, params } = useCustomRoute(); - * ``` - * @returns {Object} - */ -export function useCustomRoute() { - const themeContext = useContext(ThemeContext); - const routeContext = useContext(RouteContext); - - return { - ...themeContext, - ...routeContext, - }; -} diff --git a/libraries/engage/core/hooks/useProduct.js b/libraries/engage/core/hooks/useProduct.js new file mode 100644 index 0000000000..ac65b75a6f --- /dev/null +++ b/libraries/engage/core/hooks/useProduct.js @@ -0,0 +1,13 @@ +import { useContext } from 'react'; +import { ThemeContext } from '@shopgate/pwa-common/context'; + +/** + * Provides the product props. + * @returns {Object} + */ +export function useProduct() { + // The contexts are left out in favor of other hooks. + const { contexts: { ProductContext } } = useContext(ThemeContext); + const productProps = useContext(ProductContext); + return productProps; +} diff --git a/libraries/engage/core/hooks/useRoute.js b/libraries/engage/core/hooks/useRoute.js new file mode 100644 index 0000000000..fb897a2dbf --- /dev/null +++ b/libraries/engage/core/hooks/useRoute.js @@ -0,0 +1,11 @@ +import { useContext } from 'react'; +import { RouteContext } from '@shopgate/pwa-common/context'; + +/** + * Provides the route parameters. + * @returns {Object} + */ +export function useRoute() { + const routeContext = useContext(RouteContext); + return routeContext; +} diff --git a/libraries/engage/core/hooks/useTheme.js b/libraries/engage/core/hooks/useTheme.js new file mode 100644 index 0000000000..413a2cac33 --- /dev/null +++ b/libraries/engage/core/hooks/useTheme.js @@ -0,0 +1,12 @@ +import { useContext } from 'react'; +import { ThemeContext } from '@shopgate/pwa-common/context'; + +/** + * Provides the theme API. This does not include the contexts. + * @returns {Object} + */ +export function useTheme() { + // The contexts are left out in favor of other hooks. + const { contexts, ...themeContext } = useContext(ThemeContext); + return themeContext; +} diff --git a/libraries/engage/core/index.js b/libraries/engage/core/index.js index b157d44d74..5ffabe4485 100644 --- a/libraries/engage/core/index.js +++ b/libraries/engage/core/index.js @@ -91,8 +91,11 @@ export { default as getDateFormatter } from '@shopgate/pwa-common/helpers/i18n/g export { default as getTimeFormatter } from '@shopgate/pwa-common/helpers/i18n/getTimeFormatter'; export { default as getNumberFormatter } from '@shopgate/pwa-common/helpers/i18n/getNumberFormatter'; export * from '@shopgate/pwa-common/helpers/legacy'; +// TODO: Can only be exported once the theme uses it. causes issues with the custom routes feature. +/* export { default as portalCollection } from '@shopgate/pwa-common/helpers/portals/portalCollection'; export { default as routePortals } from '@shopgate/pwa-common/helpers/portals/routePortals'; +*/ export * from '@shopgate/pwa-common/helpers/redux'; export * from '@shopgate/pwa-common/helpers/style'; export * from '@shopgate/pwa-common/helpers/tracking'; @@ -140,7 +143,7 @@ export { default as YouTube } from '@shopgate/pwa-common/collections/media-provi // --------------- CONTEXTS --------------- // -export * from '@shopgate/pwa-common/context'; +export { RouterContext, RouteContext, AppContext, App, ThemeContext, Theme } from '@shopgate/pwa-common/context'; // --------------- PROVIDERS --------------- // @@ -211,8 +214,12 @@ export * from '@shopgate/pwa-common/selectors/modal'; // --------------- HOOKS --------------- // -export { useCustomRoute } from './hooks/useCustomRoute'; +export { useRoute } from './hooks/useRoute'; +export { useTheme } from './hooks/useTheme'; +export { useProduct } from './hooks/useProduct'; // --------------- HOCs --------------- // -export { withCustomRoute } from './hocs/withCustomRoute'; +export { withTheme } from './hocs/withTheme'; +export { withRoute } from './hocs/withRoute'; +export { withProduct } from './hocs/withProduct'; From 866743272d5c4d6c1b7dfb51e5ae4cb512c74e95 Mon Sep 17 00:00:00 2001 From: devbucket Date: Wed, 10 Apr 2019 13:01:58 -0500 Subject: [PATCH 6/9] PWA-1618 Renamed product helpers to *CurrentProduct. --- .../core/hocs/{withProduct.jsx => withCurrentProduct.jsx} | 4 ++-- .../engage/core/hooks/{useProduct.js => useCurrentProduct.js} | 4 ++-- libraries/engage/core/index.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) rename libraries/engage/core/hocs/{withProduct.jsx => withCurrentProduct.jsx} (77%) rename libraries/engage/core/hooks/{useProduct.js => useCurrentProduct.js} (79%) diff --git a/libraries/engage/core/hocs/withProduct.jsx b/libraries/engage/core/hocs/withCurrentProduct.jsx similarity index 77% rename from libraries/engage/core/hocs/withProduct.jsx rename to libraries/engage/core/hocs/withCurrentProduct.jsx index abb62a4bf1..2bba875d05 100644 --- a/libraries/engage/core/hocs/withProduct.jsx +++ b/libraries/engage/core/hocs/withCurrentProduct.jsx @@ -2,11 +2,11 @@ import React from 'react'; import { ThemeContext } from '@shopgate/pwa-common/context'; /** - * Injects the Product Context information into the desired component. + * Injects the current Product Context information into the desired component. * @param {Function} WrappedComponent The react component to wrap. * @returns {JSX} */ -export function withProduct(WrappedComponent) { +export function withCurrentProduct(WrappedComponent) { return props => ( {({ contexts: { ProductContext } }) => ( diff --git a/libraries/engage/core/hooks/useProduct.js b/libraries/engage/core/hooks/useCurrentProduct.js similarity index 79% rename from libraries/engage/core/hooks/useProduct.js rename to libraries/engage/core/hooks/useCurrentProduct.js index ac65b75a6f..d853b4a224 100644 --- a/libraries/engage/core/hooks/useProduct.js +++ b/libraries/engage/core/hooks/useCurrentProduct.js @@ -2,10 +2,10 @@ import { useContext } from 'react'; import { ThemeContext } from '@shopgate/pwa-common/context'; /** - * Provides the product props. + * Provides the current product context props. * @returns {Object} */ -export function useProduct() { +export function useCurrentProduct() { // The contexts are left out in favor of other hooks. const { contexts: { ProductContext } } = useContext(ThemeContext); const productProps = useContext(ProductContext); diff --git a/libraries/engage/core/index.js b/libraries/engage/core/index.js index 5ffabe4485..db901cc47c 100644 --- a/libraries/engage/core/index.js +++ b/libraries/engage/core/index.js @@ -216,10 +216,10 @@ export * from '@shopgate/pwa-common/selectors/modal'; export { useRoute } from './hooks/useRoute'; export { useTheme } from './hooks/useTheme'; -export { useProduct } from './hooks/useProduct'; +export { useCurrentProduct } from './hooks/useCurrentProduct'; // --------------- HOCs --------------- // export { withTheme } from './hocs/withTheme'; export { withRoute } from './hocs/withRoute'; -export { withProduct } from './hocs/withProduct'; +export { withCurrentProduct } from './hocs/withCurrentProduct'; From 8b280a4f2818274a4951fd885525b6bf4e4b90f4 Mon Sep 17 00:00:00 2001 From: devbucket Date: Wed, 10 Apr 2019 13:20:38 -0500 Subject: [PATCH 7/9] PWA-1618 Fixed unit tests. --- libraries/engage/core/index.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/libraries/engage/core/index.js b/libraries/engage/core/index.js index db901cc47c..6390be37a3 100644 --- a/libraries/engage/core/index.js +++ b/libraries/engage/core/index.js @@ -11,7 +11,8 @@ import { INDEX_PATH, INDEX_PATH_DEEPLINK } from '@shopgate/pwa-common/constants/ // --------------- CORE --------------- // // Classes -export { default as AppCommand } from '@shopgate/pwa-core/classes/AppCommand'; +// TODO: Contains circular dependency! +// export { default as AppCommand } from '@shopgate/pwa-core/classes/AppCommand'; export { default as GetAppPermissionsRequest } from '@shopgate/pwa-core/classes/AppPermissionsRequest/GetAppPermissionsRequest'; export { default as RequestAppPermissionsRequest } from '@shopgate/pwa-core/classes/AppPermissionsRequest/RequestAppPermissionsRequest'; export { default as BrightnessRequest } from '@shopgate/pwa-core/classes/BrightnessRequest'; @@ -54,7 +55,8 @@ export { default as setScrollingEnabled } from '@shopgate/pwa-core/commands/setS export { default as showNavigationBar } from '@shopgate/pwa-core/commands/showNavigationBar'; export { default as showTab } from '@shopgate/pwa-core/commands/showTab'; export * from '@shopgate/pwa-core/commands/unifiedTracking'; -export * from '@shopgate/pwa-core/commands/webStorage'; +// TODO: Contains circular dependency! +// export * from '@shopgate/pwa-core/commands/webStorage'; // Constants export * from '@shopgate/pwa-core/constants/AppEvents'; @@ -143,7 +145,7 @@ export { default as YouTube } from '@shopgate/pwa-common/collections/media-provi // --------------- CONTEXTS --------------- // -export { RouterContext, RouteContext, AppContext, App, ThemeContext, Theme } from '@shopgate/pwa-common/context'; +// export { RouteContext, ThemeContext } from '@shopgate/pwa-common/context'; // --------------- PROVIDERS --------------- // @@ -155,11 +157,11 @@ export { default as ToastContext } from '@shopgate/pwa-common/providers/toast/co // --------------- ROUTER --------------- // // ACTIONS -export * from '@shopgate/pwa-common/actions/router/historyPop'; -export * from '@shopgate/pwa-common/actions/router/historyPush'; -export * from '@shopgate/pwa-common/actions/router/historyRedirect'; -export * from '@shopgate/pwa-common/actions/router/historyReplace'; -export * from '@shopgate/pwa-common/actions/router/historyReset'; +export { historyPop } from '@shopgate/pwa-common/actions/router/historyPop'; +export { historyPush } from '@shopgate/pwa-common/actions/router/historyPush'; +export { historyRedirect } from '@shopgate/pwa-common/actions/router/historyRedirect'; +export { historyReplace } from '@shopgate/pwa-common/actions/router/historyReplace'; +export { historyReset } from '@shopgate/pwa-common/actions/router/historyReset'; // HELPERS export { From 232600e436fe8e1f35802983677874ff06b8836a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frithjof=20Klo=CC=88s?= Date: Thu, 11 Apr 2019 09:48:03 +0200 Subject: [PATCH 8/9] PWA-1618 Updated engage package versions --- .../frontend/package.json | 2 +- libraries/engage/package.json | 14 +++++++------- themes/theme-gmd/package.json | 2 +- themes/theme-ios11/package.json | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/extensions/@shopgate-product-reviews/frontend/package.json b/extensions/@shopgate-product-reviews/frontend/package.json index 256ee31970..7a39893414 100644 --- a/extensions/@shopgate-product-reviews/frontend/package.json +++ b/extensions/@shopgate-product-reviews/frontend/package.json @@ -19,7 +19,7 @@ } }, "devDependencies": { - "@shopgate/engage": "6.3.1", + "@shopgate/engage": "6.3.2", "@shopgate/eslint-config": "6.3.2", "@shopgate/pwa-common": "6.3.2", "@shopgate/pwa-common-commerce": "6.3.2", diff --git a/libraries/engage/package.json b/libraries/engage/package.json index 387bcbfa3c..a46991b184 100644 --- a/libraries/engage/package.json +++ b/libraries/engage/package.json @@ -1,6 +1,6 @@ { "name": "@shopgate/engage", - "version": "6.3.1", + "version": "6.3.2", "description": "Shopgate's ENGAGE library.", "license": "Apache-2.0", "author": "Shopgate ", @@ -15,11 +15,11 @@ "connect" ], "dependencies": { - "@shopgate/pwa-common": "6.3.1", - "@shopgate/pwa-common-commerce": "6.3.1", - "@shopgate/pwa-core": "6.3.1", - "@shopgate/pwa-ui-ios": "6.3.1", - "@shopgate/pwa-ui-material": "6.3.1", - "@shopgate/pwa-ui-shared": "6.3.1" + "@shopgate/pwa-common": "6.3.2", + "@shopgate/pwa-common-commerce": "6.3.2", + "@shopgate/pwa-core": "6.3.2", + "@shopgate/pwa-ui-ios": "6.3.2", + "@shopgate/pwa-ui-material": "6.3.2", + "@shopgate/pwa-ui-shared": "6.3.2" } } diff --git a/themes/theme-gmd/package.json b/themes/theme-gmd/package.json index 2b5b2d1bc7..b4c87e1d23 100644 --- a/themes/theme-gmd/package.json +++ b/themes/theme-gmd/package.json @@ -16,7 +16,7 @@ "e2e:user": "cypress open -P ./e2e/extensions/user" }, "dependencies": { - "@shopgate/engage": "6.3.1", + "@shopgate/engage": "6.3.2", "@shopgate/pwa-common": "6.3.2", "@shopgate/pwa-common-commerce": "6.3.2", "@shopgate/pwa-core": "6.3.2", diff --git a/themes/theme-ios11/package.json b/themes/theme-ios11/package.json index e36da4feff..c983639344 100644 --- a/themes/theme-ios11/package.json +++ b/themes/theme-ios11/package.json @@ -15,7 +15,7 @@ "e2e:checkout": "cypress open -P ./e2e/extensions/checkout" }, "dependencies": { - "@shopgate/engage": "6.3.1", + "@shopgate/engage": "6.3.2", "@shopgate/pwa-common": "6.3.2", "@shopgate/pwa-common-commerce": "6.3.2", "@shopgate/pwa-core": "6.3.2", From 5f200065c5b9081343b7bfd305c5a5bab7219c1e Mon Sep 17 00:00:00 2001 From: devbucket Date: Thu, 11 Apr 2019 12:06:39 -0500 Subject: [PATCH 9/9] PWA-1618 Reverted commented out code. --- libraries/engage/core/index.js | 2 +- libraries/engage/package.json | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/engage/core/index.js b/libraries/engage/core/index.js index 6390be37a3..0a98e848bb 100644 --- a/libraries/engage/core/index.js +++ b/libraries/engage/core/index.js @@ -145,7 +145,7 @@ export { default as YouTube } from '@shopgate/pwa-common/collections/media-provi // --------------- CONTEXTS --------------- // -// export { RouteContext, ThemeContext } from '@shopgate/pwa-common/context'; +export * from '@shopgate/pwa-common/context'; // --------------- PROVIDERS --------------- // diff --git a/libraries/engage/package.json b/libraries/engage/package.json index a46991b184..657f4599c1 100644 --- a/libraries/engage/package.json +++ b/libraries/engage/package.json @@ -21,5 +21,8 @@ "@shopgate/pwa-ui-ios": "6.3.2", "@shopgate/pwa-ui-material": "6.3.2", "@shopgate/pwa-ui-shared": "6.3.2" + }, + "devDependencies": { + "react": "~16.8.4" } }