-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Allow publish bundle to have React as external peer dependencies #2097
Conversation
Preview proposed changes to netlifycms.org in the link below: Built with commit 275c7a6 |
Preview proposed changes to the CMS demo site in the link below: Built with commit 275c7a6 |
Discussed testing w/ @talves in Gitter, good to merge once confirmed working locally. |
@erquhart Making some changes to the build setup. I have some concerns/questions for you. In the PR bundle My proposed changes (local: not pushed) solve the externals issue for using scripts.
I would like to take the globals into the CMS global (i.e. CMS.init, CMS.createClass) and leave the createElement on the React global. @erquhart Any objections? Do you think not having the peer deps in the After thinking hard on this, I really believe this change should:
I can't think of a better way to handle this without creating a huge mess and support being a nightmare to track down issues. |
I commented a bit on this in the hooks issue, but one more question from your last comment here.
How does this work if someone wants to include netlify cms with a script tag and have it auto run as an SPA? And when using the script tag/SPA approach, would it be compatible with components using hooks? |
I have done extensive tests and spent quite a bit of time on it. I cannot find a solution that works without issues. This solution alone will not work with the script layout above. I tried a few things and none of them to my liking.
I envisioned it still existing in the solution. I don't think it would be an issue. |
Summary
Closes #2026
Changes:
Create new bundle in
netlify-cms
to use react and react-dom as externalsTest plan
Make sure netlify-cms works as espected.
Use new bundle in projects importing cms (like Gatsby starter)
A picture of a cute animal (not mandatory but encouraged)
🐶