-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docs: Add available script handles #10510
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea for the handbook! Left some grammar notes and questions.
docs/reference/scripts.md
Outdated
@@ -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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small rewrite on this:
The editor provides several vendor and internal scripts to plugin developers. Script names, handles, and descriptions are documented in the table below.
docs/reference/scripts.md
Outdated
|
||
## 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Slightly simpler this way :)
docs/reference/scripts.md
Outdated
|
||
## 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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).
docs/reference/scripts.md
Outdated
| [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 | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should probably be ECMAScript
docs/reference/scripts.md
Outdated
| [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 | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TinyMCE
is capitalised wrong at the start here, and misspelled at the end :)
@chrisvanpatten thanks for the quick review have updated copy & typos :) |
@ajitbohra Looks great! I think my only reservation would be to get polyfills their own section, especially if they're things that users won't have to actively engage with. (I think most of them are just automatic, right? Except maybe the ES5 polyfill which works with babel, yes?) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small thing, then I think we're good 👍 Thanks @ajitbohra!
docs/reference/scripts.md
Outdated
|
||
## Polyfill Scripts | ||
|
||
The editor also uses some polyfill for compatibility with major browsers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The editor also provides polyfills for certain features that may not be available in all modern browsers.
Small change on this that also tries to address what a polyfill is.
@chrisvanpatten polyfill description updated 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 LGTM!
@@ -245,6 +245,12 @@ | |||
"markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/packages.md", | |||
"parent": null | |||
}, | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is meant to be added to root-manifest.json
. There are local changes on master (removing this) when running npm run docs:build
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my bad you are right needs to be added to root-manifest.json
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the difference between the two, just so I understand for the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The root-manifest.json
file contains all markdown files from the /docs
folder. The npm run docs:build
command generates the manifest.json
file from the root-manifest.json
file and adds docs from packages, data and components to it.
Maybe we should document it somewhere...
Nice work! Thanks for wrangling it 👍 Did we miss wp-polyfill? |
all let me know if we have missed any thing ? |
Yes, but we also expose |
can you help me with some info, i guess its here gutenberg/lib/client-assets.php Line 102 in 45bc8e4
Where should we add this under |
Inside Polyfill scripts, I think. Yes, it groups them together. /cc @aduth |
As mentioned in some previous #core-js meetings, we can look to encourage |
Missing |
Fixes #10005
Doc all available script handles under
References > Scripts