From d00d5f7dc41f0b18dd0ab0d034b158bea0e8b877 Mon Sep 17 00:00:00 2001 From: Daniel Lautzenheiser Date: Wed, 18 Jan 2023 12:01:31 -0500 Subject: [PATCH] docs: update migration guide --- .../content/docs/add-to-your-site-cdn.mdx | 2 +- .../docs/content/docs/custom-previews.mdx | 2 +- packages/docs/content/docs/custom-widgets.mdx | 2 +- .../docs/netlify-cms-migration-guide.mdx | 48 ++++++++++++++++++- 4 files changed, 49 insertions(+), 5 deletions(-) diff --git a/packages/docs/content/docs/add-to-your-site-cdn.mdx b/packages/docs/content/docs/add-to-your-site-cdn.mdx index b1916ffe..b88b1e81 100644 --- a/packages/docs/content/docs/add-to-your-site-cdn.mdx +++ b/packages/docs/content/docs/add-to-your-site-cdn.mdx @@ -49,7 +49,7 @@ In this example, we pull the `admin/index.html` file from a public CDN. - + diff --git a/packages/docs/content/docs/custom-previews.mdx b/packages/docs/content/docs/custom-previews.mdx index 9667f3df..29b1fff3 100644 --- a/packages/docs/content/docs/custom-previews.mdx +++ b/packages/docs/content/docs/custom-previews.mdx @@ -35,7 +35,7 @@ The following parameters will be passed to your `react_component` during render: ### Example ```html - + + +``` + +Static CMS: + +```js + +``` + +### Bundling + +```bash +# Uninstall Netlify CMS +npm uninstall netlify-cms-app +npm uninstall netlify-cms-core + +# Install Static CMS +npm install @staticcms/core +``` + +#### Change your imports + +Netlify CMS: + +```js +import CMS from 'netlify-cms-app' +``` + +Static CMS: + +```js +import CMS from '@staticcms/core'; +``` + ## Changes - React `18.2.0` is now the minimum supported React version. If you are using Static CMS through a CDN, this comes bundled. - [Moment](https://momentjs.com/) has been dropped as the date library used. Instead we are now using [date-fns](https://date-fns.org/). Date formats in your configuration will need to be updated. See [format docs](https://date-fns.org/v2.29.3/docs/format). @@ -13,19 +56,20 @@ Static CMS is a fork of Netlify CMS. Many changes have been made, some big, some - Passing a config to `CMS.init()` will now completely override `config.yml` (they are now exclusive), instead of being merged with `config.yml` - A [new markdown editor](/docs/widget-markdown) has been added. It comes with a new [shortcode](/docs/widget-markdown#shortcodes) system, old editor components no longer work. - The `sortable_fields` configuration option has been slightly changed, as we now allow a [default sorting option](/docs/collection-overview#sortable_fields). - Migrate it by exchanging +

Netlify CMS: ```yaml sortable_fields: - field1 - field2 ``` - with +
Static CMS: ```yaml sortable_fields: fields: - field1 - field2 ``` +
- Support in the List Widget for the `field` property has been dropped. A single field in the `fields` property [achieves the same behavior](/docs/widget-list). - Custom widget creation has changed slightly. React class components have been deprecated. Widgets should all be [functional components](https://reactjs.org/docs/components-and-props.html#function-and-class-components) now. There have also been changes to how custom widgets are registered and the properties passed to the controls and previews. See [custom widgets](/docs/custom-widgets) for full details.