-
Notifications
You must be signed in to change notification settings - Fork 144
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
@W-14016114: Merged storefront preview into develop (v3) #1413
Conversation
* setting cookies samesite conditionally
packages/template-retail-react-app/app/components/_app/index.jsx
Outdated
Show resolved
Hide resolved
packages/template-retail-react-app/app/components/_app/index.jsx
Outdated
Show resolved
Hide resolved
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.
I see now. This PR is simply merging the feature branch, which has PRs that have been approved already.
packages/template-retail-react-app/app/components/_app/index.jsx
Outdated
Show resolved
Hide resolved
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.
Have we considered adding the changes to pwa-kit-react-sdk?
The template files are overridable since V3, and _app
is THE mostly likely overridden component in projects.
The ideal solution should prevent customer from shooting their own foot, and the SDK is a great place to ensure storefront preview always work, regardless if you override _app
or not.
* Move storefront preview set up into the SDK
const getRuntimeEnv = () => { | ||
if (process.env.NODE_ENV !== 'production') return process.env.NODE_ENV ?? 'development' | ||
const origin = getAppOrigin() | ||
// mobify-storefront-staging sites have NODE_ENV set to production, but for the purposes | ||
// of CSP we consider the sites to be staging. | ||
return origin.endsWith('.mobify-storefront-staging.com') ? 'staging' : 'production' | ||
} |
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.
(no action needed) we are going to move this code into the SDK in a future ticket
* Create StorefrontPreview in the SDK, and set it up in the Retail app --------- Co-authored-by: Will Harney <[email protected]>
Description
Merging storefront preview for V3
Types of Changes
Changes
How to Test-Drive This PR
Checklists
General
Accessibility Compliance
You must check off all items in one of the follow two lists:
or...
Localization