Skip to content
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

Merged
merged 9 commits into from Dec 18, 2019
Merged

Move ESNext to default code example shown #17873

merged 9 commits into from Dec 18, 2019

Conversation

@mkaz
Copy link
Member

mkaz commented Oct 9, 2019

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.

@gziolo gziolo mentioned this pull request Oct 10, 2019
0 of 5 tasks complete
@gziolo

This comment has been minimized.

Copy link
Member

gziolo commented Oct 10, 2019

I just wanted to make sure you are aware of #17866 from @pbrocks. You should coordinate efforts 😄

@mkaz

This comment has been minimized.

Copy link
Member Author

mkaz commented Oct 10, 2019

Thanks @gziolo we are coordinating together. This PR was to start for tutorial section, while he was going to work on other doc sections. 👍

mkaz added 7 commits Oct 9, 2019
- 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
@mkaz mkaz force-pushed the docs/esnext-block-tutorial branch from df0f4b2 to 6e1dbe1 Dec 14, 2019
Copy link
Member

nosolosw left a comment

I've left a couple of suggestions. Other than that, this is ready to land.

mkaz and others added 2 commits Dec 18, 2019
…creating-dynamic-blocks.md

Co-Authored-By: Andrés <nosolosw@users.noreply.github.com>
…creating-dynamic-blocks.md

Co-Authored-By: Andrés <nosolosw@users.noreply.github.com>
@mkaz mkaz merged commit 9c660bf into master Dec 18, 2019
2 checks passed
2 checks passed
pull-request-automation
Details
Travis CI - Pull Request Build Passed
Details
@mkaz mkaz deleted the docs/esnext-block-tutorial branch Dec 18, 2019
@youknowriad youknowriad added this to the Gutenberg 7.2 milestone Jan 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.