diff --git a/packages/a11y/README.md b/packages/a11y/README.md index b0a51047c73dc4..7e5261adaae167 100644 --- a/packages/a11y/README.md +++ b/packages/a11y/README.md @@ -10,7 +10,7 @@ Install the module npm install @wordpress/a11y --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## API diff --git a/packages/annotations/README.md b/packages/annotations/README.md index 5c3f3b59d6d7cd..96233b9a7c12c6 100644 --- a/packages/annotations/README.md +++ b/packages/annotations/README.md @@ -10,7 +10,7 @@ Install the module npm install @wordpress/annotations --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## Getting Started diff --git a/packages/api-fetch/README.md b/packages/api-fetch/README.md index 077226667109a4..055cd1a0368835 100644 --- a/packages/api-fetch/README.md +++ b/packages/api-fetch/README.md @@ -10,7 +10,7 @@ Install the module npm install @wordpress/api-fetch --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## Usage @@ -56,28 +56,28 @@ Shorthand to be used in place of `body`, accepts an object value to be stringifi ### Aborting a request -Aborting a request can be achieved through the use of [`AbortController`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) in the same way as you would when using the native `fetch` API. +Aborting a request can be achieved through the use of [`AbortController`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) in the same way as you would when using the native `fetch` API. For legacy browsers that don't support `AbortController`, you can either: -* Provide your own polyfill of `AbortController` if you still want it to be abortable. -* Ignore it as shown in the example below. +- Provide your own polyfill of `AbortController` if you still want it to be abortable. +- Ignore it as shown in the example below. **Example** ```js -const controller = typeof AbortController === 'undefined' - ? undefined - : new AbortController(); +const controller = + typeof AbortController === 'undefined' ? undefined : new AbortController(); -apiFetch( { path: '/wp/v2/posts', signal: controller?.signal } ) - .catch( ( error ) => { +apiFetch( { path: '/wp/v2/posts', signal: controller?.signal } ).catch( + ( error ) => { // If the browser doesn't support AbortController then the code below will never log. // However, in most cases this should be fine as it can be considered to be a progressive enhancement. if ( error.name === 'AbortError' ) { console.log( 'Request has been aborted' ); } - } ); + } +); controller?.abort(); ``` diff --git a/packages/autop/README.md b/packages/autop/README.md index 1bc8b5495db6c1..1e5d75e20b15fd 100644 --- a/packages/autop/README.md +++ b/packages/autop/README.md @@ -10,7 +10,7 @@ Install the module npm install @wordpress/autop --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ### API diff --git a/packages/block-directory/README.md b/packages/block-directory/README.md index 35d58dd5b5e2a7..d17aae691f767c 100644 --- a/packages/block-directory/README.md +++ b/packages/block-directory/README.md @@ -12,7 +12,7 @@ Install the module npm install @wordpress/block-directory --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## Usage diff --git a/packages/block-editor/README.md b/packages/block-editor/README.md index b742a81e3dc8a0..78376d8f806d37 100644 --- a/packages/block-editor/README.md +++ b/packages/block-editor/README.md @@ -10,7 +10,7 @@ Install the module npm install @wordpress/block-editor --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## Usage diff --git a/packages/block-library/README.md b/packages/block-library/README.md index c10c1a44b27bbc..ba9f3d954b4922 100644 --- a/packages/block-library/README.md +++ b/packages/block-library/README.md @@ -10,7 +10,7 @@ Install the module npm install @wordpress/block-library --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## Building JavaScript for the browser diff --git a/packages/block-serialization-default-parser/README.md b/packages/block-serialization-default-parser/README.md index 9627f88faed270..aedbed8d952442 100644 --- a/packages/block-serialization-default-parser/README.md +++ b/packages/block-serialization-default-parser/README.md @@ -10,7 +10,7 @@ Install the module npm install @wordpress/block-serialization-default-parser --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## API diff --git a/packages/blocks/README.md b/packages/blocks/README.md index aabe50096d62c3..295cb258962efb 100644 --- a/packages/blocks/README.md +++ b/packages/blocks/README.md @@ -14,7 +14,7 @@ Install the module npm install @wordpress/blocks --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## Getting Started diff --git a/packages/components/README.md b/packages/components/README.md index 3c89d0092dc4f2..ecc4cfdc2367ce 100644 --- a/packages/components/README.md +++ b/packages/components/README.md @@ -10,7 +10,7 @@ Install the module npm install @wordpress/components --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](/packages/babel-preset-default#polyfill) in your code._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## Usage diff --git a/packages/compose/README.md b/packages/compose/README.md index d392378713824e..32c8abb4e3bd05 100644 --- a/packages/compose/README.md +++ b/packages/compose/README.md @@ -53,7 +53,7 @@ Install the module npm install @wordpress/compose --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## API diff --git a/packages/core-data/README.md b/packages/core-data/README.md index 5d9ee318a0af8c..f51e091eef84a3 100644 --- a/packages/core-data/README.md +++ b/packages/core-data/README.md @@ -12,7 +12,7 @@ Install the module npm install @wordpress/core-data --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## Example diff --git a/packages/customize-widgets/README.md b/packages/customize-widgets/README.md index f99d5b945cd179..d5fb6b36f5a93a 100644 --- a/packages/customize-widgets/README.md +++ b/packages/customize-widgets/README.md @@ -12,7 +12,7 @@ Install the module npm install @wordpress/customize-widgets ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## Technical implementation details @@ -20,11 +20,11 @@ The new Widgets Customizer replaces `Appearance > Customize > Widgets` with bloc We extend the Customizer's sections and controls in the `/controls` directory and inject some custom logic for the editor. We use React portal to render each editor in its section to reuse most of the styles and scripts provided by the Customizer. -`components/sidebar-block-editor` is the entry point for each widget area's block editor. `component/sidebar-block-editor/sidebar-adapter.js` is an adapter to talk to [the Customize API](https://developer.wordpress.org/themes/customize-api/) and transform widget objects into widget instances. +`components/sidebar-block-editor` is the entry point for each widget area's block editor. `component/sidebar-block-editor/sidebar-adapter.js` is an adapter to talk to [the Customize API](https://developer.wordpress.org/themes/customize-api/) and transform widget objects into widget instances. `components/sidebar-block-editor/use-sidebar-block-editor.js` is a custom React Hook to integrate the adapter into React and handle most of the translations between blocks and widgets. These allow us to implement basic editing features as well as real-time preview in a backwards-compatible way. -Whenever the blocks change, we run through each block to determine if there are created, edited, or deleted blocks. We then convert them to their widget counterparts and call the Customize API to update them. +Whenever the blocks change, we run through each block to determine if there are created, edited, or deleted blocks. We then convert them to their widget counterparts and call the Customize API to update them. For React developers, this can be thought of as a custom reconciler or a custom renderer for the Customizer. But instead of targeting DOM as the render target, we are targeting WordPress widgets using the Customize API. diff --git a/packages/data-controls/README.md b/packages/data-controls/README.md index 3089cf5c2a4c3c..ba7f4679a6c4b5 100644 --- a/packages/data-controls/README.md +++ b/packages/data-controls/README.md @@ -12,7 +12,7 @@ Install the module npm install @wordpress/data-controls --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ The following controls are available on the object returned by the module: diff --git a/packages/data/README.md b/packages/data/README.md index 394bb116a4a90e..a7cd203fc8100d 100644 --- a/packages/data/README.md +++ b/packages/data/README.md @@ -12,7 +12,7 @@ Install the module npm install @wordpress/data --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## Registering a Store diff --git a/packages/date/README.md b/packages/date/README.md index 3f6c266aa5b59b..f71e2a54b199a7 100644 --- a/packages/date/README.md +++ b/packages/date/README.md @@ -10,7 +10,7 @@ Install the module npm install @wordpress/date --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## API diff --git a/packages/deprecated/README.md b/packages/deprecated/README.md index 22fa761c8b942c..f259e4e48afe84 100644 --- a/packages/deprecated/README.md +++ b/packages/deprecated/README.md @@ -10,7 +10,7 @@ Install the module npm install @wordpress/deprecated --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## Hook diff --git a/packages/dom-ready/README.md b/packages/dom-ready/README.md index 08ca78f382c756..9b9f04cd363b16 100644 --- a/packages/dom-ready/README.md +++ b/packages/dom-ready/README.md @@ -10,7 +10,7 @@ Install the module npm install @wordpress/dom-ready --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## API diff --git a/packages/edit-navigation/README.md b/packages/edit-navigation/README.md index 1a405fdd4f1e2d..5d4aa0fc9184f7 100644 --- a/packages/edit-navigation/README.md +++ b/packages/edit-navigation/README.md @@ -41,7 +41,7 @@ Moreover, when the navigation is rendered on the front of the site the system co ### Block-based Mode -**Important**: block-based mode has been temporarily ***disabled*** until it becomes stable. So, if a theme declares support for the `block-nav-menus` feature it will not affect the frontend. +**Important**: block-based mode has been temporarily **_disabled_** until it becomes stable. So, if a theme declares support for the `block-nav-menus` feature it will not affect the frontend. If desired, themes are able to opt into _rendering_ complete block-based menus using the Navigation Editor. This allows for arbitrarily complex navigation block structures to be used in an existing theme whilst still ensuring the navigation data is still _saved_ to the existing (post type powered) Menus system. @@ -165,6 +165,6 @@ return ( - **Navigation editor / screen** - the new screen provided by Gutenberg to allow the user to edit navigations using a block-based UI. - **Menus screen** - the current/existing [interface/screen for managing Menus](https://codex.wordpress.org/WordPress_Menu_User_Guide) in WordPress WPAdmin. -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._

Code is Poetry.

diff --git a/packages/edit-post/README.md b/packages/edit-post/README.md index 677e0c8257aa05..d8b3233e1e73f0 100644 --- a/packages/edit-post/README.md +++ b/packages/edit-post/README.md @@ -12,7 +12,7 @@ Install the module npm install @wordpress/edit-post ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## Extending the post editor UI diff --git a/packages/edit-site/README.md b/packages/edit-site/README.md index 84cbeccee52c4a..7891425a9b4d36 100644 --- a/packages/edit-site/README.md +++ b/packages/edit-site/README.md @@ -26,6 +26,6 @@ import blockEditorSettings from './block-editor-settings'; initialize( '#editor-root', blockEditorSettings ); ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._

Code is Poetry.

diff --git a/packages/edit-widgets/README.md b/packages/edit-widgets/README.md index 9dbada72717b5d..65788e53d86cb1 100644 --- a/packages/edit-widgets/README.md +++ b/packages/edit-widgets/README.md @@ -16,7 +16,7 @@ Install the module npm install @wordpress/edit-widgets ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._

Code is Poetry.

diff --git a/packages/editor/README.md b/packages/editor/README.md index 46a35fd648f6c7..b760d80385001a 100644 --- a/packages/editor/README.md +++ b/packages/editor/README.md @@ -10,7 +10,7 @@ Install the module npm install @wordpress/editor --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## How it works diff --git a/packages/element/README.md b/packages/element/README.md index 6dcd2155d44e12..c258b04facd6e3 100755 --- a/packages/element/README.md +++ b/packages/element/README.md @@ -21,7 +21,7 @@ Install the module npm install @wordpress/element --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## Usage diff --git a/packages/escape-html/README.md b/packages/escape-html/README.md index e1fc36d503fc55..c91b942a6a02f4 100644 --- a/packages/escape-html/README.md +++ b/packages/escape-html/README.md @@ -10,7 +10,7 @@ Install the module npm install @wordpress/escape-html ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## API diff --git a/packages/format-library/README.md b/packages/format-library/README.md index 8615dfcfda9bf3..4937ff2722fb26 100644 --- a/packages/format-library/README.md +++ b/packages/format-library/README.md @@ -10,6 +10,6 @@ Install the module npm install @wordpress/format-library --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._

Code is Poetry.

diff --git a/packages/hooks/README.md b/packages/hooks/README.md index 3b780a8dd52c7a..306d17734b0cf7 100644 --- a/packages/hooks/README.md +++ b/packages/hooks/README.md @@ -10,7 +10,7 @@ Install the module npm install @wordpress/hooks --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ### Usage diff --git a/packages/html-entities/README.md b/packages/html-entities/README.md index 66d07432f563f2..e7f5a18c38c884 100644 --- a/packages/html-entities/README.md +++ b/packages/html-entities/README.md @@ -10,7 +10,7 @@ Install the module npm install @wordpress/html-entities --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## API diff --git a/packages/i18n/README.md b/packages/i18n/README.md index 548cc5e67d3198..35f869a9052fee 100644 --- a/packages/i18n/README.md +++ b/packages/i18n/README.md @@ -10,7 +10,7 @@ Install the module: npm install @wordpress/i18n --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## Usage diff --git a/packages/icons/README.md b/packages/icons/README.md index 825bd1b1fc086b..b31e9f20a6cc03 100644 --- a/packages/icons/README.md +++ b/packages/icons/README.md @@ -10,7 +10,7 @@ Install the module: npm install @wordpress/icons --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## Usage diff --git a/packages/interface/README.md b/packages/interface/README.md index 0c045049d7d360..50b88e3a5462c3 100644 --- a/packages/interface/README.md +++ b/packages/interface/README.md @@ -10,7 +10,7 @@ Install the module npm install @wordpress/interface --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## API Usage @@ -88,9 +88,12 @@ import { store as interfaceStore } from '@wordpress/interface'; function initialize() { // ... - dispatch( interfaceStore ).setFeatureDefaults( 'namespace/editor-or-plugin-name', { - myFeatureName: true - } ); + dispatch( interfaceStore ).setFeatureDefaults( + 'namespace/editor-or-plugin-name', + { + myFeatureName: true, + } + ); // ... } @@ -99,9 +102,15 @@ function initialize() { Use the `toggleFeature` action and the `isFeatureActive` selector to toggle features within your app: ```js -wp.data.select( 'core/interface' ).isFeatureActive( 'namespace/editor-or-plugin-name', 'myFeatureName' ); // true -wp.data.dispatch( 'core/interface' ).toggleFeature( 'namespace/editor-or-plugin-name', 'myFeatureName' ); -wp.data.select( 'core/interface' ).isFeatureActive( 'namespace/editor-or-plugin-name', 'myFeatureName' ); // false +wp.data + .select( 'core/interface' ) + .isFeatureActive( 'namespace/editor-or-plugin-name', 'myFeatureName' ); // true +wp.data + .dispatch( 'core/interface' ) + .toggleFeature( 'namespace/editor-or-plugin-name', 'myFeatureName' ); +wp.data + .select( 'core/interface' ) + .isFeatureActive( 'namespace/editor-or-plugin-name', 'myFeatureName' ); // false ``` The `MoreMenuDropdown` and `MoreMenuFeatureToggle` components help to implement an editor menu for changing preferences and feature values. @@ -117,8 +126,8 @@ function MyEditorMenu() { feature="myFeatureName" label={ __( 'My feature' ) } info={ __( 'A really awesome feature' ) } - messageActivated={ __( 'My feature activated' )} - messageDeactivated={ __( 'My feature deactivated' )} + messageActivated={ __( 'My feature activated' ) } + messageDeactivated={ __( 'My feature deactivated' ) } /> ) } @@ -126,4 +135,3 @@ function MyEditorMenu() { ); } ``` - diff --git a/packages/keyboard-shortcuts/README.md b/packages/keyboard-shortcuts/README.md index 89d20406992336..57eb1ad1907078 100644 --- a/packages/keyboard-shortcuts/README.md +++ b/packages/keyboard-shortcuts/README.md @@ -10,7 +10,7 @@ Install the module npm install @wordpress/keyboard-shortcuts --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## API diff --git a/packages/keycodes/README.md b/packages/keycodes/README.md index b4ea9697460d7b..084686a0337305 100644 --- a/packages/keycodes/README.md +++ b/packages/keycodes/README.md @@ -10,7 +10,7 @@ Install the module npm install @wordpress/keycodes --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## Usage diff --git a/packages/lazy-import/README.md b/packages/lazy-import/README.md index 396e5cc2248e1c..e9faecb5b33815 100644 --- a/packages/lazy-import/README.md +++ b/packages/lazy-import/README.md @@ -10,7 +10,7 @@ Install the module npm install @wordpress/lazy-import --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## Requirements diff --git a/packages/list-reusable-blocks/README.md b/packages/list-reusable-blocks/README.md index 5021be6b4608f4..ec27702eaee3d5 100644 --- a/packages/list-reusable-blocks/README.md +++ b/packages/list-reusable-blocks/README.md @@ -12,6 +12,6 @@ Install the module npm install @wordpress/list-reusable-blocks --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._

Code is Poetry.

diff --git a/packages/media-utils/README.md b/packages/media-utils/README.md index 818d17dce6340a..80c34e21608e2e 100644 --- a/packages/media-utils/README.md +++ b/packages/media-utils/README.md @@ -11,7 +11,7 @@ Install the module npm install @wordpress/media-utils --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## Usage diff --git a/packages/notices/README.md b/packages/notices/README.md index bce5583c71ab6d..21d845e3caa7f5 100644 --- a/packages/notices/README.md +++ b/packages/notices/README.md @@ -10,7 +10,7 @@ Install the module npm install @wordpress/notices ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## Usage diff --git a/packages/nux/README.md b/packages/nux/README.md index 1c234c87350a36..5405757c0e73c4 100644 --- a/packages/nux/README.md +++ b/packages/nux/README.md @@ -14,7 +14,7 @@ Install the module npm install @wordpress/nux --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## DotTip diff --git a/packages/plugins/README.md b/packages/plugins/README.md index 94f0bd2b0071a2..9f976eb20982fb 100644 --- a/packages/plugins/README.md +++ b/packages/plugins/README.md @@ -10,7 +10,7 @@ Install the module npm install @wordpress/plugins --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ### Plugins API diff --git a/packages/primitives/README.md b/packages/primitives/README.md index 1056276d289061..6f78930f30e737 100644 --- a/packages/primitives/README.md +++ b/packages/primitives/README.md @@ -27,6 +27,6 @@ const myElement = ( ); ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._

Code is Poetry.

diff --git a/packages/priority-queue/README.md b/packages/priority-queue/README.md index 43f5f725161895..cf5a5fa121c31c 100644 --- a/packages/priority-queue/README.md +++ b/packages/priority-queue/README.md @@ -10,7 +10,7 @@ Install the module npm install @wordpress/priority-queue --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## API diff --git a/packages/react-i18n/README.md b/packages/react-i18n/README.md index 1386b4c045dce9..5444f5b97e7ed9 100644 --- a/packages/react-i18n/README.md +++ b/packages/react-i18n/README.md @@ -10,7 +10,7 @@ Install the module: npm install @wordpress/react-i18n ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## API diff --git a/packages/reusable-blocks/README.md b/packages/reusable-blocks/README.md index 20aa4982e1c343..2733d7a22e69c3 100644 --- a/packages/reusable-blocks/README.md +++ b/packages/reusable-blocks/README.md @@ -10,7 +10,7 @@ Install the module npm install @wordpress/reusable-blocks --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## How it works diff --git a/packages/rich-text/README.md b/packages/rich-text/README.md index c3bb074551d202..9261dd3d660e72 100644 --- a/packages/rich-text/README.md +++ b/packages/rich-text/README.md @@ -10,7 +10,7 @@ Install the module npm install @wordpress/rich-text ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## API diff --git a/packages/server-side-render/README.md b/packages/server-side-render/README.md index 46e4b30fd549a3..39ae91658b7a46 100644 --- a/packages/server-side-render/README.md +++ b/packages/server-side-render/README.md @@ -18,7 +18,7 @@ Install the module npm install @wordpress/server-side-render --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## Usage @@ -58,6 +58,7 @@ The HTTP request method to use, either 'GET' or 'POST'. It's 'GET' by default. T - Required: No #### Example: + ```php function add_rest_method( $endpoints ) { if ( is_wp_version_compatible( '5.5' ) ) { @@ -108,9 +109,7 @@ The component is rendered while the API request is being processed (loading stat ```jsx const MyServerSideRender = () => ( - + ); ``` diff --git a/packages/shortcode/README.md b/packages/shortcode/README.md index fda45bc1e0328b..e731d44189bf2d 100644 --- a/packages/shortcode/README.md +++ b/packages/shortcode/README.md @@ -10,7 +10,7 @@ Install the module npm install @wordpress/shortcode --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## API diff --git a/packages/token-list/README.md b/packages/token-list/README.md index e47cc35e04101b..3b25bad86a8419 100644 --- a/packages/token-list/README.md +++ b/packages/token-list/README.md @@ -10,7 +10,7 @@ Install the module npm install @wordpress/token-list ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## Usage diff --git a/packages/url/README.md b/packages/url/README.md index 367ba4c0675677..5ab853cf64e9cb 100644 --- a/packages/url/README.md +++ b/packages/url/README.md @@ -10,7 +10,7 @@ Install the module npm install @wordpress/url --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## Usage diff --git a/packages/viewport/README.md b/packages/viewport/README.md index d3c185ae94e25a..8f247b51f6aafb 100644 --- a/packages/viewport/README.md +++ b/packages/viewport/README.md @@ -10,7 +10,7 @@ Install the module npm install @wordpress/viewport --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## Usage diff --git a/packages/warning/README.md b/packages/warning/README.md index db403d47b28093..768b3bc63fc367 100644 --- a/packages/warning/README.md +++ b/packages/warning/README.md @@ -10,7 +10,7 @@ Install the module npm install @wordpress/warning --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## Reducing bundle size diff --git a/packages/widgets/README.md b/packages/widgets/README.md index 7d0351464e1dae..adf82996c5982f 100644 --- a/packages/widgets/README.md +++ b/packages/widgets/README.md @@ -12,6 +12,6 @@ Install the module npm install @wordpress/widgets ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._

Code is Poetry.

diff --git a/packages/wordcount/README.md b/packages/wordcount/README.md index 7f8ee0b094b792..17b35180f2bb07 100644 --- a/packages/wordcount/README.md +++ b/packages/wordcount/README.md @@ -10,7 +10,7 @@ Install the module npm install @wordpress/wordcount --save ``` -_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._ +_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._ ## API