-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Getting Started with JavaScript #12689
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
Conversation
|
Please use standard practices, such as a consistent prefix, and one that is not just two letters (my). Also, please be consistent in the PHP with regard to order. Either function and then add_action, or add_action and then function, but use the same way every time. It keeps it easier to digest. I personally prefer to define the function and then add_action, but that's just how I think. You might ought to mention the version number parameter for enqueuing scripts, but especially for styles. This tutorial is for a script in the editor, but your style is loaded only on the front end. That will be confusing, unless your next section is about the different actions available for loading styles. |
|
@joyously Thanks for the feedback. I updated the prefix and ordering of the action/functions.
I was debating how much WordPress parts to go into, I ink out to the relevant documentation for each section. It's always a hard balance to keep things brief to not overwhelm people, but also complete.
The block style modification adds a class to blockquotes, which isn't really visisble unless you look at the source. So I thought it would be nice to be able to see it doing something, which is why I added the CSS part, not sure if that is overly confusing. As for next part, not sure how deep to go with it, the idea was to get setup and show an example of using the documentation to apply the change. I'm all for adding to it to help users further. |
I agree, however they will be confounded when they update and don't see the change because it's cached. I've seen so many theme authors leave version numbers off and then have to field support questions about clearing cache etc. so that their updates take effect.
It's not too confusing except that everyone always says they want the back to match the front, so why wouldn't you load the CSS in both? |
danielbachhuber
left a comment
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.
Great start! I've left some comments and suggestions.
If you have the bandwidth, it think it'd be really worthwhile to "user test" this documentation with a layperson at WCUS. Specifically, sit them down at a laptop, have them follow the documentation, and observe their usage to see what sort of questions they run into.
docs/designers-developers/developers/tutorials/javascript/readme.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/readme.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/readme.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/readme.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/readme.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/readme.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/readme.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/readme.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/readme.md
Outdated
Show resolved
Hide resolved
|
@danielbachhuber Thanks so much for all the feedback, I really appreciate it! I updated with your change suggestions. I'll take another pass through for the code docs and additional ideas.
Good suggestion, but I'm unfortunately not at WCUS. It would be great to see someone new walk through and see what additional questions they might have. It is always tricky trying to guess where someone might get stuck. |
docs/designers-developers/developers/tutorials/javascript/plugins-background.md
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/loading-javascript.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/loading-javascript.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/loading-javascript.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/loading-javascript.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/extending-the-block-editor.md
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/extending-the-block-editor.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/troubleshooting.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/versions-and-building.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/versions-and-building.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/versions-and-building.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/versions-and-building.md
Outdated
Show resolved
Hide resolved
aaeba92 to
f2b2dcb
Compare
oandregal
left a comment
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 great work, bravo!
|
Merging still seems to be blocked, so unsure how to go about this. cc @chrisvanpatten I'm tagging this as 4.8 in case we have to wait for landing this PR. |
|
All changes which are purely docs related should be under |
|
@mkaz - can we cross-link tutorial steps to make navigation easier? You can either copy the table of contents or link to the next part at the end of the page. By the way, it's a really nice idea to add this kind of tutorial. 💯 |
|
@gziolo The pages will be auto linked with prev/next links at the bottom when published in the handbook. You can see the Blocks Tutorial example here I updated the table of contents and generated the manifest which makes sure that happens. |
chrisvanpatten
left a comment
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 have a partial review here. More to review, but I have other things to work on this AM and wanted to get you as much as I could quicker :)
docs/designers-developers/developers/tutorials/javascript/extending-the-block-editor.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/versions-and-building.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/versions-and-building.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/versions-and-building.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/troubleshooting.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/troubleshooting.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/troubleshooting.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/troubleshooting.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/troubleshooting.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/troubleshooting.md
Outdated
Show resolved
Hide resolved
chrisvanpatten
left a comment
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.
Some language tweaks! Looking good and I think it'll be an easy approval after these are resolved.
docs/designers-developers/developers/tutorials/javascript/extending-the-block-editor.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/loading-javascript.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/loading-javascript.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/loading-javascript.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/loading-javascript.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/loading-javascript.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/plugins-background.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/javascript/plugins-background.md
Outdated
Show resolved
Hide resolved
chrisvanpatten
left a comment
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.
SO close. Images need to be full absolute URLs, not just paths. Otherwise, looking 💯
docs/designers-developers/developers/tutorials/javascript/loading-javascript.md
Outdated
Show resolved
Hide resolved
…ions-and-building.md Co-Authored-By: mkaz <[email protected]>
…nding-the-block-editor.md Co-Authored-By: mkaz <[email protected]>
…ing-javascript.md Co-Authored-By: mkaz <[email protected]>
…ing-javascript.md Co-Authored-By: mkaz <[email protected]>
…ing-javascript.md Co-Authored-By: mkaz <[email protected]>
…ins-background.md Co-Authored-By: mkaz <[email protected]>
…ins-background.md Co-Authored-By: mkaz <[email protected]>
30cea21 to
28f6e25
Compare
chrisvanpatten
left a comment
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 an awesome improvement. Thank you @mkaz!
|
Travis is ¯_(ツ)_/¯ so I'm going to merge… thanks for working on this @mkaz! |
* Getting Started with JavaScript * Reorder add_action/function * Update prefix to use myguten, instead of just my * Update docs/designers-developers/developers/tutorials/javascript/readme.md Co-Authored-By: mkaz <[email protected]> * Update to block_editor_assets * Updates per danielbachhuber review. * Updates, and broken up into sections * Add Troubleshooting * Updates with suggestion. Props to @nosolosw * Update docs/designers-developers/developers/tutorials/javascript/versions-and-building.md Co-Authored-By: mkaz <[email protected]> * Update docs/designers-developers/developers/tutorials/javascript/versions-and-building.md Co-Authored-By: mkaz <[email protected]> * Add screenshot with style * Reorder TOC, move versions to end * Update link for browser support * Add check for dependency to troubleshooting section * General edits for spelling and flow * Update Table of Contents and generated manifest * Fix up header tags consistency and spaces * Edits per @chrisvanpatten review * Update docs/designers-developers/developers/tutorials/javascript/extending-the-block-editor.md Co-Authored-By: mkaz <[email protected]> * Update docs/designers-developers/developers/tutorials/javascript/loading-javascript.md Co-Authored-By: mkaz <[email protected]> * Update docs/designers-developers/developers/tutorials/javascript/loading-javascript.md Co-Authored-By: mkaz <[email protected]> * Update docs/designers-developers/developers/tutorials/javascript/loading-javascript.md Co-Authored-By: mkaz <[email protected]> * Update docs/designers-developers/developers/tutorials/javascript/plugins-background.md Co-Authored-By: mkaz <[email protected]> * Update docs/designers-developers/developers/tutorials/javascript/plugins-background.md Co-Authored-By: mkaz <[email protected]> * Move screenshots to assets directory, add additional screenshot for success * Move block style variant to assets * Formating * Update images to full URLs * Fix titles
* Getting Started with JavaScript * Reorder add_action/function * Update prefix to use myguten, instead of just my * Update docs/designers-developers/developers/tutorials/javascript/readme.md Co-Authored-By: mkaz <[email protected]> * Update to block_editor_assets * Updates per danielbachhuber review. * Updates, and broken up into sections * Add Troubleshooting * Updates with suggestion. Props to @nosolosw * Update docs/designers-developers/developers/tutorials/javascript/versions-and-building.md Co-Authored-By: mkaz <[email protected]> * Update docs/designers-developers/developers/tutorials/javascript/versions-and-building.md Co-Authored-By: mkaz <[email protected]> * Add screenshot with style * Reorder TOC, move versions to end * Update link for browser support * Add check for dependency to troubleshooting section * General edits for spelling and flow * Update Table of Contents and generated manifest * Fix up header tags consistency and spaces * Edits per @chrisvanpatten review * Update docs/designers-developers/developers/tutorials/javascript/extending-the-block-editor.md Co-Authored-By: mkaz <[email protected]> * Update docs/designers-developers/developers/tutorials/javascript/loading-javascript.md Co-Authored-By: mkaz <[email protected]> * Update docs/designers-developers/developers/tutorials/javascript/loading-javascript.md Co-Authored-By: mkaz <[email protected]> * Update docs/designers-developers/developers/tutorials/javascript/loading-javascript.md Co-Authored-By: mkaz <[email protected]> * Update docs/designers-developers/developers/tutorials/javascript/plugins-background.md Co-Authored-By: mkaz <[email protected]> * Update docs/designers-developers/developers/tutorials/javascript/plugins-background.md Co-Authored-By: mkaz <[email protected]> * Move screenshots to assets directory, add additional screenshot for success * Move block style variant to assets * Formating * Update images to full URLs * Fix titles
Description
An introductory tutorial for getting started working with JavaScript and the Block Editor. A lot of the documentation is just snippets of JavaScript code assuming the developers know what to do with it. This tutorial aims to get developers who may not be familiar started off.
See #11392
I welcome any additional feedback, expanding, and building on this as a start.
Also, I am not sure how the documentation manages the multiple pages and navigation so this probably could be broken up into other pages like the block tutorial.
Online Preview: https://github.com/WordPress/gutenberg/tree/docs/11392/javascript/docs/designers-developers/developers/tutorials/javascript