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

chore(v6): add codemod changing global to globalThis #8924

Merged
merged 2 commits into from
Jul 18, 2023

Conversation

jtoar
Copy link
Contributor

@jtoar jtoar commented Jul 18, 2023

The legacy Node.js global object is still supported in Webpack for compatiblity reasons (src: https://webpack.js.org/api/module-variables/#global-nodejs), and there's a good chance that some projects are still using it because an old project of @Tobbe's was.

Since this isn't supported in Vite, we should codemod it, especially since it's as simple as a find and replace which jscodeshift already has support for.

@jtoar jtoar added the release:chore This PR is a chore (means nothing for users) label Jul 18, 2023
@jtoar jtoar added this to the v6.0.0 milestone Jul 18, 2023
@jtoar jtoar requested a review from Tobbe July 18, 2023 00:16
@Tobbe Tobbe enabled auto-merge (squash) July 18, 2023 05:56
@Tobbe Tobbe merged commit 068387b into main Jul 18, 2023
@Tobbe Tobbe deleted the ds-v6/add-globalThis-codemod branch July 18, 2023 06:37
jtoar added a commit that referenced this pull request Jul 19, 2023
The legacy Node.js `global` object is still supported in Webpack for
compatiblity reasons (src:
https://webpack.js.org/api/module-variables/#global-nodejs), and there's
a good chance that some projects are still using it because an old
project of @Tobbe's was.

Since this isn't supported in Vite, we should codemod it, especially
since it's as simple as a find and replace which jscodeshift already has
support for.

Co-authored-by: Tobbe Lundberg <tobbe@tlundberg.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:chore This PR is a chore (means nothing for users)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants