From cac0308279cbfcdd315c8e1b7622908d06d9ecb0 Mon Sep 17 00:00:00 2001 From: Ajit Bohra Date: Thu, 11 Oct 2018 18:01:55 +0530 Subject: [PATCH 1/4] Docs: Add available script handles --- docs/manifest.json | 8 +++++- docs/reference/scripts.md | 60 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 docs/reference/scripts.md diff --git a/docs/manifest.json b/docs/manifest.json index e7a8c37501d6dd..f73aa3ccd74171 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -245,6 +245,12 @@ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/packages.md", "parent": null }, + { + "title": "Scripts", + "slug": "packages", + "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/reference/scripts.md", + "parent": "reference" + }, { "title": "@wordpress/a11y", "slug": "packages-a11y", @@ -929,4 +935,4 @@ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/data/data-core-viewport.md", "parent": "data" } -] \ No newline at end of file +] diff --git a/docs/reference/scripts.md b/docs/reference/scripts.md new file mode 100644 index 00000000000000..62c3e4c2bf2ad1 --- /dev/null +++ b/docs/reference/scripts.md @@ -0,0 +1,60 @@ +# Scripts + +Editor provides several vendor and custom script to plugin developers. Script name, handle and usage are mentioned in below table. + +## WP Scripts + +Editor includes number of custom scripts to enable various funcationality and utilities. Plugin developers can utilize them to create blocks, editor plugins or generic plugings utilizing them. All the avilable scripts are listed in below table. + +| Script Name | Handle | Description | +|-------------|--------|-------------| +| [Blob](https://wordpress.org/gutenberg/handbook/packages/packages-blob/) | wp-blob | Blob utilities | +| [Block Library](https://wordpress.org/gutenberg/handbook/packages/packages-block-library/) | wp-block-library | Block library for the editor | +| [Blocks](https://wordpress.org/gutenberg/handbook/packages/packages-blocks/) | wp-blocks | Block creations | +| [Block Serialization Default Parser](https://wordpress.org/gutenberg/handbook/packages/packages-block-serialization-default-parser/) | wp-block-serialization-default-parser | Default block serialization parser implementations for WordPress documents | +| [Block Serialization Spec Parser](https://wordpress.org/gutenberg/handbook/packages/packages-block-serialization-spec-parser/) | wp-block-serialization-spec-parser | Grammar file (grammar.pegjs) for WordPress posts | +| [Components](https://wordpress.org/gutenberg/handbook/packages/packages-components/) | wp-components | Generic components to be used for creating common UI elements | +| [Compose](https://wordpress.org/gutenberg/handbook/packages/packages-compose/) | wp-compose | Collection of handy Higher Order Components (HOCs) | +| [Core Data](https://wordpress.org/gutenberg/handbook/packages/packages-core-data/) | wp-core-data | Simplify access to and manipulation of core WordPress entities | +| [Data](https://wordpress.org/gutenberg/handbook/packages/packages-data/) | wp-data | Data module serves as a hub to manage application state for both plugins and WordPress itself | +| [Date](https://wordpress.org/gutenberg/handbook/packages/packages-date/) | wp-date | Date module for WordPress | +| [Deprecated](https://wordpress.org/gutenberg/handbook/packages/packages-deprecated/) | wp-deprecated | Utility to log a message to notify developers about a deprecated feature | +| [Dom](https://wordpress.org/gutenberg/handbook/packages/packages-dom/) | wp-dom | DOM utilities module for WordPress | +| [Dom Ready](https://wordpress.org/gutenberg/handbook/packages/packages-dom-ready/) | wp-dom-ready | Execute callback after the DOM is loaded | +| [Editor](https://wordpress.org/gutenberg/handbook/packages/packages-editor/) | wp-editor | Building blocks for WordPress editors | +| [Edit Post](https://wordpress.org/gutenberg/handbook/packages/packages-edit-post/) | wp-edit-post | Edit Post Module for WordPress | +| [Element](https://wordpress.org/gutenberg/handbook/packages/packages-element/) | wp-element |Element is, quite simply, an abstraction layer atop [React](https://reactjs.org/) | +| [Escape Html](https://wordpress.org/gutenberg/handbook/packages/packages-escape-html/) | wp-escape-html | Escape HTML utils | +| [Hooks](https://wordpress.org/gutenberg/handbook/packages/packages-hooks/) | wp-hooks | A lightweight and efficient EventManager for JavaScript | +| [Html Entities](https://wordpress.org/gutenberg/handbook/packages/packages-html-entities/) | wo-html-entities | HTML entity utilities for WordPress | +| [I18N](https://wordpress.org/gutenberg/handbook/packages/packages-i18n/) | wp-i18n | Internationalization utilities for client-side localization | +| [Is Shallow Equal](https://wordpress.org/gutenberg/handbook/packages/packages-is-shallow-equal/) | wp-is-shallow-equal | A function for performing a shallow comparison between two objects or arrays | +| [Keycodes](https://wordpress.org/gutenberg/handbook/packages/packages-keycodes/) | wp-keycodes | Keycodes utilities for WordPress, used to check the key pressed in events like `onKeyDown` | +| [List Reusable Bocks](https://wordpress.org/gutenberg/handbook/packages/packages-list-reusable-blocks/) | wp-list-resuable-blocks | Package used to add import/export links to the listing page of the reusable blocks | +| [NUX](https://wordpress.org/gutenberg/handbook/packages/packages-nux/) | wp-nux | Components, and wp.data methods useful for onboarding a new user to the WordPress admin interface | +| [Plugins](https://wordpress.org/gutenberg/handbook/packages/packages-plugins/) | wp-plugins | Plugins module for WordPress | +| [Redux Routine](https://wordpress.org/gutenberg/handbook/packages/packages-redux-routine/) | wp-redux-routine | Redux middleware for generator coroutines | +| [Rich Text](https://wordpress.org/gutenberg/handbook/packages/packages-rich-text/) | wp-rich-text | Helper functions to convert HTML or a DOM tree into a rich text value and back | +| [Shortcode](https://wordpress.org/gutenberg/handbook/packages/packages-shortcode/) | wp-shortcode | Shortcode module for WordPress | +| [Token List](https://wordpress.org/gutenberg/handbook/packages/packages-token-list/) | wp-token-list | Constructable, plain JavaScript [DOMTokenList](https://developer.mozilla.org/en-US/docs/Web/API/DOMTokenList) implementation, supporting non-browser runtimes | +| [URL](https://wordpress.org/gutenberg/handbook/packages/packages-url/) | wp-url | A collection of utilities to manipulate URLs | +| [Viewport](https://wordpress.org/gutenberg/handbook/packages/packages-viewport/) | wp-viewport | Module for responding to changes in the browser viewport size | +| [Wordcount](https://wordpress.org/gutenberg/handbook/packages/packages-wordcount/) | wp-wordcount | WordPress word count utility | + +## Vendor Script + +By default, editor includes some popular scripts commonly used by web developers and editor itself. All of them are listed in the table below. Plugin developers can utilize these scripts without adding up to bundle size + +| Script Name | Handle | Description | +|-------------|--------|-------------| +| [React](https://reactjs.org) | react | React is a JavaScript library for building user interfaces | +| [React Dom](https://reactjs.org/docs/react-dom.html) | react-dom | Serves as the entry point to the DOM and server renderers for React, intended to be paired with React | +| [Moment](https://momentjs.com/) | moment| Parse, validate, manipulate, and display dates and times in JavaScript | +| [Tinymce Lists](https://www.tiny.cloud/docs/plugins/lists/) | tinymce-latest-lists| The `lists` plugin allows you to add numbered and bulleted lists to TinyMC | +| [Lodash](https://lodash.com) | lodash| Lodash is a JavaScript library which provides utility functions for common programming tasks | +| [Fetch Polyfill](https://www.npmjs.com/package/whatwg-fetch) | wp-polyfill-fetch | Polyfill that implements a subset of the standard Fetch specification | +| [Promise Polyfill](https://www.npmjs.com/package/promise-polyfill) | wp-polyfill-promise| Lightweight ES6 Promise polyfill for the browser and node | +| [Formdata Polyfill](https://www.npmjs.com/package/formdata-polyfill) | wp-polyfill-formdata| Polyfill conditionally replaces the native implementation | +| [Node Contains Polyfill](https://polyfill.io) | wp-polyfill-node-contains |Polyfill for Node.contains | +| [Element Closest Polyfill](https://www.npmjs.com/package/element-closest) | wp-polyfill-element-closest| Return the closest element matching a selector up the DOM tree | +| [Ecmascript Polyfill](https://babeljs.io/docs/en/babel-polyfill) | wp-polyfill-ecmascript | Emulate a full ES2015+ environment | From a52eaa96b69109fe44fcb26a611ecae147188197 Mon Sep 17 00:00:00 2001 From: Ajit Bohra Date: Thu, 11 Oct 2018 18:47:51 +0530 Subject: [PATCH 2/4] Fix: Copy --- docs/reference/scripts.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/reference/scripts.md b/docs/reference/scripts.md index 62c3e4c2bf2ad1..b515cfe5e623ef 100644 --- a/docs/reference/scripts.md +++ b/docs/reference/scripts.md @@ -1,10 +1,10 @@ # Scripts -Editor provides several vendor and custom script to plugin developers. Script name, handle and usage are mentioned in below table. +The editor provides several vendor and internal scripts to plugin developers. Script names, handles, and descriptions are documented in the table below. ## WP Scripts -Editor includes number of custom scripts to enable various funcationality and utilities. Plugin developers can utilize them to create blocks, editor plugins or generic plugings utilizing them. All the avilable scripts are listed in below table. +The editor includes a number of packages to enable various pieces of functionality. Plugin developers can utilize them to create blocks, editor plugins, or generic plugins. | Script Name | Handle | Description | |-------------|--------|-------------| @@ -43,18 +43,18 @@ Editor includes number of custom scripts to enable various funcationality and ut ## Vendor Script -By default, editor includes some popular scripts commonly used by web developers and editor itself. All of them are listed in the table below. Plugin developers can utilize these scripts without adding up to bundle size +The editor also uses some popular third-party packages and scripts. Plugin developers can use these scripts as well without bundling them in their code (and increasing file sizes). | Script Name | Handle | Description | |-------------|--------|-------------| | [React](https://reactjs.org) | react | React is a JavaScript library for building user interfaces | | [React Dom](https://reactjs.org/docs/react-dom.html) | react-dom | Serves as the entry point to the DOM and server renderers for React, intended to be paired with React | | [Moment](https://momentjs.com/) | moment| Parse, validate, manipulate, and display dates and times in JavaScript | -| [Tinymce Lists](https://www.tiny.cloud/docs/plugins/lists/) | tinymce-latest-lists| The `lists` plugin allows you to add numbered and bulleted lists to TinyMC | +| [TinyMCE Lists](https://www.tiny.cloud/docs/plugins/lists/) | tinymce-latest-lists| The `lists` plugin allows you to add numbered and bulleted lists to TinyMCE | | [Lodash](https://lodash.com) | lodash| Lodash is a JavaScript library which provides utility functions for common programming tasks | | [Fetch Polyfill](https://www.npmjs.com/package/whatwg-fetch) | wp-polyfill-fetch | Polyfill that implements a subset of the standard Fetch specification | | [Promise Polyfill](https://www.npmjs.com/package/promise-polyfill) | wp-polyfill-promise| Lightweight ES6 Promise polyfill for the browser and node | | [Formdata Polyfill](https://www.npmjs.com/package/formdata-polyfill) | wp-polyfill-formdata| Polyfill conditionally replaces the native implementation | | [Node Contains Polyfill](https://polyfill.io) | wp-polyfill-node-contains |Polyfill for Node.contains | | [Element Closest Polyfill](https://www.npmjs.com/package/element-closest) | wp-polyfill-element-closest| Return the closest element matching a selector up the DOM tree | -| [Ecmascript Polyfill](https://babeljs.io/docs/en/babel-polyfill) | wp-polyfill-ecmascript | Emulate a full ES2015+ environment | +| [ECMAScript Polyfill](https://babeljs.io/docs/en/babel-polyfill) | wp-polyfill-ecmascript | Emulate a full ES2015+ environment | From 07e52b80cf6439e8f9bd734529c1955c3ebaa646 Mon Sep 17 00:00:00 2001 From: Ajit Bohra Date: Thu, 11 Oct 2018 22:40:37 +0530 Subject: [PATCH 3/4] Fix: Seperate polyfill into new section --- docs/reference/scripts.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/reference/scripts.md b/docs/reference/scripts.md index b515cfe5e623ef..82f9b5b1f847df 100644 --- a/docs/reference/scripts.md +++ b/docs/reference/scripts.md @@ -41,7 +41,7 @@ The editor includes a number of packages to enable various pieces of functionali | [Viewport](https://wordpress.org/gutenberg/handbook/packages/packages-viewport/) | wp-viewport | Module for responding to changes in the browser viewport size | | [Wordcount](https://wordpress.org/gutenberg/handbook/packages/packages-wordcount/) | wp-wordcount | WordPress word count utility | -## Vendor Script +## Vendor Scripts The editor also uses some popular third-party packages and scripts. Plugin developers can use these scripts as well without bundling them in their code (and increasing file sizes). @@ -52,6 +52,13 @@ The editor also uses some popular third-party packages and scripts. Plugin devel | [Moment](https://momentjs.com/) | moment| Parse, validate, manipulate, and display dates and times in JavaScript | | [TinyMCE Lists](https://www.tiny.cloud/docs/plugins/lists/) | tinymce-latest-lists| The `lists` plugin allows you to add numbered and bulleted lists to TinyMCE | | [Lodash](https://lodash.com) | lodash| Lodash is a JavaScript library which provides utility functions for common programming tasks | + +## Polyfill Scripts + +The editor also uses some polyfill for compatibility with major browsers. + +| Script Name | Handle | Description | +|-------------|--------|-------------| | [Fetch Polyfill](https://www.npmjs.com/package/whatwg-fetch) | wp-polyfill-fetch | Polyfill that implements a subset of the standard Fetch specification | | [Promise Polyfill](https://www.npmjs.com/package/promise-polyfill) | wp-polyfill-promise| Lightweight ES6 Promise polyfill for the browser and node | | [Formdata Polyfill](https://www.npmjs.com/package/formdata-polyfill) | wp-polyfill-formdata| Polyfill conditionally replaces the native implementation | From 6da6d69fee01e0e38828f4ac20ea5a8ad72a5ca4 Mon Sep 17 00:00:00 2001 From: Ajit Bohra Date: Fri, 12 Oct 2018 17:36:15 +0530 Subject: [PATCH 4/4] Docs: Update polyfill description copy --- docs/reference/scripts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/scripts.md b/docs/reference/scripts.md index 82f9b5b1f847df..dd43dd3c19e55e 100644 --- a/docs/reference/scripts.md +++ b/docs/reference/scripts.md @@ -55,7 +55,7 @@ The editor also uses some popular third-party packages and scripts. Plugin devel ## Polyfill Scripts -The editor also uses some polyfill for compatibility with major browsers. +The editor also provides polyfills for certain features that may not be available in all modern browsers | Script Name | Handle | Description | |-------------|--------|-------------|