-
Notifications
You must be signed in to change notification settings - Fork 210
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
Frosted promos + isite #9732
Frosted promos + isite #9732
Conversation
export default loadable( | ||
() => | ||
import( | ||
/* webpackChunkName: "frosted_promo" */ | ||
'.' | ||
), | ||
{ fallback: <span data-testid="frosted-promo-loader" /> }, |
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.
This looks cool. So the browser doesn't load the component chunk outlined until it comes into view?
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.
Ah I'm not sure Loadable cares about scroll position - but it does exclude the code from the bundle if the component is not actually invoked at runtime though.
eg, without loadable, this component and it's subtree (which is quite big because of the colour picker) would need included in the bundle, even if the component was toggled off on isite
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.
LGTM Just some added some suggestions
Resolves [No Issue]
Overall change:
Allows promos to be controlled by toggles.
Code changes:
cross-team
label to this PR if it requires visibility across World Service teamsTesting:
CYPRESS_APP_ENV=local CYPRESS_SMOKE=false yarn test:e2e:interactive
)