-
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
Move ESNext to default code example shown #17873
Conversation
Thanks @gziolo we are coordinating together. This PR was to start for tutorial section, while he was going to work on other doc sections. 👍 |
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.
Switch JS to JSX for code syntax
...designers-developers/developers/tutorials/block-tutorial/applying-styles-with-stylesheets.md
Outdated
Show resolved
Hide resolved
...signers-developers/developers/tutorials/block-tutorial/block-controls-toolbar-and-sidebar.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/block-tutorial/creating-dynamic-blocks.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/block-tutorial/creating-dynamic-blocks.md
Outdated
Show resolved
Hide resolved
...developers/developers/tutorials/block-tutorial/introducing-attributes-and-editable-fields.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/block-tutorial/writing-your-first-block-type.md
Outdated
Show resolved
Hide resolved
- Also remove 05 numbering of examples, does not exist in examples repo And 05 in the examples repo is the recipe card.
Update loading of dependencies and version to match examples repo, using the asset_file from build script.
Switch JS to JSX for code syntax
df0f4b2
to
6e1dbe1
Compare
docs/designers-developers/developers/tutorials/block-tutorial/creating-dynamic-blocks.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/block-tutorial/creating-dynamic-blocks.md
Outdated
Show resolved
Hide resolved
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've left a couple of suggestions. Other than that, this is ready to land.
…creating-dynamic-blocks.md Co-Authored-By: Andrés <[email protected]>
…creating-dynamic-blocks.md Co-Authored-By: Andrés <[email protected]>
Description
This changes the documentation in the block tutorials. It adds clarification around ES5 and ESNext and by default shows ESNext code. This sets the documentation for having ESNext as a more preferred syntax, but does not remove any of the ES5 examples.
The reasoning behind this change is that it can be quite confusing to see mostly ES5 code in the documentation but then it is not the primary use case "in the wild". This makes for an odd disconnect, and I think the docs should reflect the real usage.
For example, the core Gutenberg packages and block library are all in ESNext, as well as the readme.md examples for each component is only in ESNext syntax. This is easiest to see using the WP Storybook
Additionally the majority of plugins and blocks from other code bases are in ESNext syntax, people learning Gutenberg will use these as a reference which can be confusing. CoBlocks is just but one example of many.
Initially discussed in Editor Chat
How has this been tested?
Confirm documentation still makes sense and works as described. No real functional change, the majority is just reordering of ESNext code block ahead of ES5.
View live on the branch here
Types of changes
Documentation updates.