Netlify-cms: Stop exposing `createClass` and `createElement` directly.

Created on 10 Sep 2017  路  6Comments  路  Source: netlify/netlify-cms

React's createClass and createElement methods are exposed directly on the Window object by the CMS, for building extensions. This isn't very clean, and could possibly result in conflicts. Also, we have the user using the React class methods (render, handleChange) directly, which ties us to that specific implementation.

https://github.com/netlify/netlify-cms/blob/6ad6bfd094b78696744f87ffd8038656a2922f7a/src/index.js#L58-L62

Related to #571.

deprecation chore discussion pinned

Most helpful comment

Just a heads up, there are a few code examples using these methods in the Netlify CMS docs.

All 6 comments

We should deprecate and update the CMS object to contain these references, agreed.

For deprecation, would you just suggest adding a console error or something more visible?

If a console error, would you make it a warning or an error (since errors sometimes throw build systems).

Just a heads up, there are a few code examples using these methods in the Netlify CMS docs.

RE: @tech4him1's comment, a console warning should work for this.

Do we want these nested under a CMS.lib or just CMS? They are integral to how the CMS works, so maybe just on the main registry.

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.

Was this page helpful?
0 / 5 - 0 ratings