Closed richtera closed 4 years ago
As mentioned in #1718, the CMS will always includes it's own peer dependencies - there's no reason that I'm aware of to avoid this. What we do need is for the core to load a set of dependencies that can then be shared by all extensions. Rather than satisfying this by introducing a new package, netlify-cms-core
should be outputting multiple builds, along with a global object of dependencies for consumers that use a script tag.
The CMS preview seems to break for react components that rely on reactDOM.findDOMNode
(e.g. reactstrap
components that use react-transition-group
), which I suspect is due to the presence of multiple versions of React: https://github.com/Pomax/react-onclickoutside/issues/231#issuecomment-333174275.
The preview pane code runs in an iframe, so shouldn't be an issue there.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
netlify-cms-app
can be used for applications that want to provide their own copy of React.
Describe the bug
When trying to use the custom mounting of the netlify-cms with the most recent code. There is a problem the way require is handled. The netlify-cms.js and cms.js compiles include all peer dependencies rather than declaring them as peer and requiring them.
When using something like this to mount the cms:
it causes multiple versions of the peer dependencies to be loaded (for example "react".) This causes various problems inside of the cms and outside of the cms in the mounting application.
To Reproduce
Use the above kind of view within a react application to boot up the CMS.
Expected behavior This should work normally.
Screenshots Errors like:
Applicable Versions:
CMS configuration I can provide in private.
Additional context It seems that the dist/netlify-cms.js is built with a CDN deploy in mind rather than for use as a normal npm module. I am thinking the default package.json main modules should not include peer dependencies but the dist/.js should. I am trying to make a PR.