-
Notifications
You must be signed in to change notification settings - Fork 47.1k
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
UMD Production builds define global variables #10909
Comments
This is a bug. We should probably always wrap the UMD bundle into an IIFE. |
TBH, I've never built a JS project since I'm only doing Clojurescript so I have not the slightest clue where in the build process a fix would be necessary. :/ |
I sent #10933 to fix this but now realize it doesn't help because Rollup UMD wrapper relies on Now that I think of it, I'd like to know which tool is responsible for the top-level variable in the first place. I would expect Rollup to keep everything inside its wrapper. Is it Uglify then? Can we add an option to preserve top-level wrapper? |
Apparently it's GCC's doing. |
React |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
The UMD production build linked in the announcement ( https://unpkg.com/[email protected]/umd/react.production.min.js ) define global variables
y
andNb
(react-dom).If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template: https://jsfiddle.net/ebsrpraL/).
Use the build with an app that defined the function or variable
y
, loaded before react.What is the expected behavior?
React builds should not define any other global symbols other than
React
.Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
16.0.0. It worked fine with some betas of 16.0.0.
The text was updated successfully, but these errors were encountered: