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

Docs: Switch code distinction to JSX & Plain #37348

Merged
merged 3 commits into from
Dec 17, 2021
Merged

Docs: Switch code distinction to JSX & Plain #37348

merged 3 commits into from
Dec 17, 2021

Conversation

mkaz
Copy link
Member

@mkaz mkaz commented Dec 14, 2021

Description

The distinction between JavaScript examples shown in code is no longer between JavaScript syntaxes, ESNext and ES5, since we dropped IE11 support; but between code that requires a build due to JSX and Plain JavaScript that does not require a build.

  • Update codetabs changing lables from ESNext & ES5 to JSX & Plain.

  • Updates various pages and descriptions of what version to show, including documentation guide.

  • Updates block-transforms docs to remove ES5 code examples. The code examples are duplicated with the basic differences being destructuring and function definitions, no JSX code used. So with the dropping of IE11 support, our minimum targeted browser supports the ES6 code that is being used, so we don't need both examples.

How has this been tested?

Documentation changes, check for:

  • Clarity: content makes sense and accurate,
  • Mistakes: Typos or spelling issues
  • Complete: Anything missing?

Note: I did not change the examples code that use -esnext suffix, those changes will probably need to be coordinated with the gutenberg-examples repo and make sure any links are also updated.

Types of changes

Documentation updates.

Closes #35776

@mkaz mkaz requested a review from ajitbohra as a code owner December 14, 2021 03:39
@mkaz mkaz added the [Type] Developer Documentation Documentation for developers label Dec 14, 2021
@mkaz mkaz requested a review from ryanwelcher December 14, 2021 03:39
Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome. I like how the new strategy allows removing several duplicated examples of the same code written in ESNext and ES5 which are now identical. In fact, as long as we don't deal with React components you don't need to have two versions of the same example anymore which removes a lot of overhead for both the documentation authors and the consumers of the handbook.

Great work wrangling all the changes. I haven't verified very carefully the individual examples because it's too many of them, but I verified all changes to how we present JSX and Plain version of code examples and it looks great from my perspective.

@gziolo gziolo added the Developer Experience Ideas about improving block and theme developer experience label Dec 17, 2021
@gziolo gziolo requested a review from juanmaguitar December 17, 2021 09:08
Copy link
Contributor

@ryanwelcher ryanwelcher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks great! I have added a few suggestions to keep our terminology consistent and to soften some language around what developers like. Just an FYI, I didn't check the code examples to ensure they work as expected.

docs/contributors/documentation/README.md Outdated Show resolved Hide resolved
docs/how-to-guides/block-tutorial/README.md Outdated Show resolved Hide resolved
docs/how-to-guides/javascript/versions-and-building.md Outdated Show resolved Hide resolved
docs/how-to-guides/javascript/versions-and-building.md Outdated Show resolved Hide resolved
docs/how-to-guides/platform/custom-block-editor/README.md Outdated Show resolved Hide resolved
mkaz and others added 3 commits December 17, 2021 14:01
The distinction between JavaScript examples shown in code is not really
between the JavaScript syntax, ESNext and ES5, since we dropped IE11
support; but between code that requires a build due to JSX and Plain
JavaScript that does not require a build.
The code examples are duplicated with the basic differences being
destructuring and function definitions, no JSX code used.

With the dropping of IE11 support, the minimum targeted browser supports
the ES6 code that is being used, so we don't need both examples.
Thanks Ryan for the additions, they all look good 👍

Co-authored-by: Ryan Welcher <[email protected]>
@mkaz mkaz merged commit b72113b into trunk Dec 17, 2021
@mkaz mkaz deleted the docs/jsx-plain branch December 17, 2021 22:50
@github-actions github-actions bot added this to the Gutenberg 12.3 milestone Dec 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Developer Experience Ideas about improving block and theme developer experience [Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs: Rename code example toggles to better represent current state
3 participants