DO NOT MERGE: Lazy load gpay instead of baked in#2744
Draft
hartmannr76 wants to merge 1 commit intosubscriptions-project:mainfrom
Draft
DO NOT MERGE: Lazy load gpay instead of baked in#2744hartmannr76 wants to merge 1 commit intosubscriptions-project:mainfrom
hartmannr76 wants to merge 1 commit intosubscriptions-project:mainfrom
Conversation
Collaborator
|
Nice! |
ChrisAntaki
reviewed
Feb 18, 2023
| // so it can be passed to gpay_async.js and stored in payment clearcut log. | ||
| PaymentsAsyncClient.googleTransactionId_ = googleTransactionId; | ||
| return new PaymentsAsyncClient( | ||
| google.payments.api.PaymentsAsyncClient.googleTransactionId_ = |
Collaborator
There was a problem hiding this comment.
We might need to quote the googleTransactionId_ property name, so Terser doesn't mangle it in the new Vite build system
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FYI @fikus @ChrisAntaki @jpettitt
This is meant more of a demo for what lazily loading the pay.js script would look like.
Essentially:
Results:
Before:
dist/basic-subscriptions.js 199.02 kB │ gzip: 59.10 kBAfter:
dist/basic-subscriptions.js 163.02 kB │ gzip: 48.90 kBThats an 18% decrease in raw bundle size and a 17.26% decrease in zipped size. Thats fairly significant, plus it removes tech debt from our end on needing to maintain a copy of it
Complications:

If we want to just directly use it the way we currently do, the web-activities code in pay.js needs to expose its public methods since they are getting renamed at the moment