-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[V3][Hooks Integration 🪝] Replace last of the getProps
#1149
Conversation
Thanks for the contribution! It looks like @vmarta @kevinxh is an internal user so signing the CLA is not required. However, we need to confirm this. |
Thanks for the contribution! Before we can merge this, we need @vcua-mobify @bendvc @yunakim714 to sign the Salesforce Inc. Contributor License Agreement. |
packages/template-retail-react-app/app/components/_app/index.jsx
Outdated
Show resolved
Hide resolved
|
||
const hocs = AppConfig.getHOCsInUse() | ||
const getPropsEnabled = hocs.indexOf(withLegacyGetProps) >= 0 | ||
|
||
const extraArgs = getPropsEnabled ? AppConfig.extraGetPropsArgs(locals) : {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happens if getPropsEnabled
is true but extraGetPropsArgs
is not defined? Is there a default noop implementation for AppConfig.extraGetPropsArgs
? If not, maybe we should guard undefined extraGetPropsArgs
?
…xtensibility-algo-refactor * feature/template-extensibility: split ssr build on local (#1155) (#1156) [V3] Update Page Designer (#1128) bring back deleted package lockfiles fix bad merge conflict [V3][Hooks Integration 🪝] Replace last of the `getProps` (#1149) Fix Page Designer ImageWithText Link component (#1092) # Conflicts: # packages/internal-lib-build/package-lock.json # packages/pwa-kit-create-app/package-lock.json # packages/template-express-minimal/package-lock.json # packages/template-mrt-reference-app/package-lock.json # packages/template-retail-react-app/app/components/_app-config/index.jsx # packages/template-retail-react-app/app/components/_app/index.jsx # packages/template-retail-react-app/app/page-designer/core/component/index.jsx # packages/template-retail-react-app/app/page-designer/core/component/index.test.js # packages/template-retail-react-app/app/page-designer/core/page/index.jsx # packages/template-retail-react-app/app/page-designer/core/page/index.test.js # packages/template-retail-react-app/app/page-designer/core/region/index.jsx # packages/template-retail-react-app/app/page-designer/core/region/index.test.js # packages/template-retail-react-app/app/page-designer/layouts/carousel/index.jsx # packages/template-retail-react-app/app/page-designer/layouts/mobileGrid1r1c/index.jsx # packages/template-retail-react-app/app/page-designer/layouts/mobileGrid2r1c/index.jsx # packages/template-retail-react-app/app/page-designer/layouts/mobileGrid2r2c/index.jsx # packages/template-retail-react-app/app/page-designer/layouts/mobileGrid2r3c/index.jsx # packages/template-retail-react-app/app/page-designer/layouts/mobileGrid3r1c/index.jsx # packages/template-retail-react-app/app/page-designer/layouts/mobileGrid3r2c/index.jsx # packages/template-retail-react-app/app/pages/page-not-found/index.jsx # packages/template-retail-react-app/app/utils/test-utils.js # packages/template-typescript-minimal/package-lock.json # packages/test-commerce-sdk-react/package-lock.json
Description
There were a few places left in the
retail-react-template
where we were still usinggetProps
. A) in thepge-not-found
page and B) in the_app
component. In this PR I'm replacing those uses ofgetProps
with their non-getPropsreact-query
equivalent.NOTE: Because we use ssrPrepass to get hooks working server-side there was an issue where during prepass the messages aren't available, leading to warnings in the console for missing translations. To work around this I updated the custom error handler to only warn if there are messages defined/loaded and the individual message isn't found.
Types of Changes
Changes
withLegacyGetProps
HOCextraGetPropsArgs
implementation even when you aren't using getProps.getProps
HOC from test render function.How to Test-Drive This PR
Checklists
General