Skip to content
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

feat: add compatibility with window alias strategy #202

Merged
merged 1 commit into from
May 21, 2024
Merged

Conversation

dtjones404
Copy link
Contributor

@dtjones404 dtjones404 requested a review from a team as a code owner May 21, 2024 21:19
Copy link
Member

@jshawl jshawl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@@ -21,7 +22,13 @@ export function setupSDK(components: $ReadOnlyArray<SetupComponent<mixed>>) {
const existingVersion = existingNamespace && existingNamespace.version;

if (existingNamespace) {
if (existingNamespace[INTERNAL_DESTROY_KEY]) {
if (existingVersion.startsWith("6.")) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a scenario where a merchant's code could be using v6 on window.paypal, but then this changes it to window.paypal.v6 and breaks their code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, I think the tradeoff for v6 defaulting to window.paypal is that we have to teach merchants using both SDKs to access v6 through window.paypal.v6.

@dtjones404 dtjones404 merged commit 089a4bb into main May 21, 2024
2 checks passed
@dtjones404 dtjones404 deleted the window-alias branch May 21, 2024 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants