-
Notifications
You must be signed in to change notification settings - Fork 46k
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 builds are not enabled on UNPKG #13450
Comments
Please see the discussion in #10597. It’s intentional. |
👎 This is anti-beginner in my opinion. It is standard for Unpkg URLs to point to development builds, and we are breaking user expectations. It's much worse for the default URL to literally error because browsers do not support common JS than to serve a development build, which will be displayed in the React Devtools extension anyway. |
By the way, if the concern is about the user not knowing the development build is provided by default (which they would probably already know by using other Unpkg packages), Unpkg redirects the user to the full UMD file path, making the path that is used by default clear. For example, https://unpkg.com/jquery redirects to https://unpkg.com/jquery@3.3.1/dist/jquery.js, which is clearly unminified and build for development. |
We've been there before. If React doesn't make this choice then it's "anti-beginner". If React does, then it'll be "anti-performance". Either way somebody will be unhappy. See discussion in #8784. We have to educate developers about the differences between builds, and the only way to do so is to force them to choose one or the other. I think that if you can drop a script tag on the page without thinking about whether it should be a dev or a prod build, we're going to keep seeing sites ship development versions to production, and hurting the user experience.
Only if you read the redirect result URL.
What do you mean by "standard"? Do all libraries do that? For libraries that do, are their DEV builds several times larger and smaller, like React DEV build is?
I agree! I don't know why |
Unpkg could provide first-class support for multiple explicitly chosen UMD versions. https://unpkg.com/react:development https://unpkg.com/react-dom:development This works with versions too: https://unpkg.com/react-dom:production@16.4.2 Since This could work by special fields in
For packages that opted into this, unpkg could display a better error page when you attempt to load https://unpkg.com/react directly — and show disambiguating links right there. Seems like best of both worlds to me. |
If unpkg is interested in implementing the above, we could do it. |
I still disagree with not using |
Sorry for commenting here, I meant to put it in a closed issue on unpkg mjackson/unpkg#38 if folks wouldn't mind letting it stay here for their reference? Otherwise I can delete and move it too. However, FWIW I was following directions here https://reactjs.org/docs/add-react-to-a-website.html |
There was a broken release. It's fixed now. |
Thank you for the update, and so quickly! I really appreciate that. Cheers |
Depends on mjackson/unpkg#93 |
The upstream Unpkg issue has been fixed. |
Visiting https://unpkg.com/react displays the CJS build (https://unpkg.com/react@16.4.2/index.js) when the UMD build (https://unpkg.com/react@16.4.2/umd/react.development.js) should be displayed instead. I also noticed this issue with react-dom, so I assume all packages need to be fixed.
Please refer to the usage instructions at the bottom of https://unpkg.com/.
The text was updated successfully, but these errors were encountered: