-
Notifications
You must be signed in to change notification settings - Fork 69
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
Use @stripe/connect-js/pure #9674
Conversation
To prevent it from loading the external script until it's actually used.
Test the buildOption 1. Jetpack Beta
Option 2. Jurassic Ninja - available for logged-in A12s🚀 Launch a JN site with this branch 🚀 ℹ️ Install this Tampermonkey script to get more options. Build info:
Note: the build is updated when a new commit is pushed to this PR. |
Size Change: -165 B (0%) Total Size: 1.33 MB
ℹ️ View Unchanged
|
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, thanks for addressing this! I tested and can see the _
refers correctly to underscore, and the onboarding still works as expected. Let's ship it! 🚢
Fixed #9675
Fixes woocommerce/google-listings-and-ads#2652
Changes proposed in this Pull Request
Import
loadConnectAndInitialize
from@stripe/connect-js/pure
instead of@stripe/connect-js
, to ensurehttps://connect-js.stripe.com/v1.0/connect.js
script is only loaded when needed. Otherwise, it can cause issues with other WC plugins usingunderscore
.The pure version loads the script when
loadConnectAndInitialize
is called, while the non-pure version loads it as soon as the JS code gets loaded. And as the code using it is part of the WooPaymentsindex.js
bundle, just by having the plugin enabled we were loading it.Testing instructions
Embedded components
more than 100 M
and time to go livemore than 6m
you should see an embedded onboarding component.Lodash/Underscore
npm run start
trunk
and go to a WC admin page.console.log(_)
on the browser console.lodash
.fix/stripe-connect-breaks-underscore
and go to a WC admin page.console.log(_)
on the browser console.underscore
.npm run changelog
to add a changelog file, choosepatch
to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.Post merge