-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
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.
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.
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.
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.
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]>
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:
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