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

Conversation

mkaz
Copy link
Member

@mkaz 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.

@mkaz mkaz added the [Type] Developer Documentation Documentation for developers label Oct 9, 2019
@gziolo gziolo added the [Feature] Block API API that allows to express the block paradigm. label Oct 10, 2019
@gziolo gziolo mentioned this pull request Oct 10, 2019
5 tasks
@gziolo
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
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. 👍

Copy link
Member Author

@mkaz mkaz left a 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

- 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
Copy link
Member

@oandregal oandregal left a 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.

mkaz and others added 2 commits December 18, 2019 13:38
…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
@mkaz mkaz deleted the docs/esnext-block-tutorial branch December 18, 2019 22:20
@youknowriad youknowriad added this to the Gutenberg 7.2 milestone Jan 6, 2020
mkaz added a commit that referenced this pull request May 29, 2020
Minor change switching order code toggle so ESNext is first.

Per #22151 and #17873
mkaz added a commit that referenced this pull request Jun 3, 2020
Minor change switching order code toggle so ESNext is first.

Per #22151 and #17873
mkaz added a commit that referenced this pull request Jun 4, 2020
Minor change switching order code toggle so ESNext is first.

Per #22151 and #17873
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Block API API that allows to express the block paradigm. [Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants