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

fix: remove global in favor of globalThis for better compatibility #11976

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

natew
Copy link

@natew natew commented May 5, 2024

Please provide enough information so that others can review your pull request.

Motivation

I'm using react-navigation with Vite (browser-loaded esm) and this is actually really tricky to fix because imports are always hoisted above code, so my polyfill attempts get pushed below the react-navigation import unless I literally add a script tag above the app entrypoint.

Moving to globalThis should be safe and supported in most node/react-native/browsers from the last few years.

Test plan

I haven't tested thoroughly.

Copy link

github-actions bot commented May 5, 2024

Hey @natew! Thanks for opening your first pull request in this repo. If you haven't already, make sure to read our contribution guidelines.

Copy link

github-actions bot commented May 5, 2024

Hey @autofix-ci[bot]! Thanks for opening your first pull request in this repo. If you haven't already, make sure to read our contribution guidelines.

Copy link

netlify bot commented May 5, 2024

Deploy Preview for react-navigation-example ready!

Name Link
🔨 Latest commit d0304ae
🔍 Latest deploy log https://app.netlify.com/sites/react-navigation-example/deploys/6637dfadc261600008972312
😎 Deploy Preview https://deploy-preview-11976--react-navigation-example.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented May 5, 2024

Deploy Preview for react-navigation-example ready!

Name Link
🔨 Latest commit ad8a378
🔍 Latest deploy log https://app.netlify.com/sites/react-navigation-example/deploys/6637dff94ac3d10008a8209c
😎 Deploy Preview https://deploy-preview-11976--react-navigation-example.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant