Skip to content

Conversation

@mkaz
Copy link
Member

@mkaz mkaz commented Dec 7, 2018

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

@mkaz mkaz added the [Type] Developer Documentation Documentation for developers label Dec 7, 2018
@joyously
Copy link

joyously commented Dec 7, 2018

Please use standard practices, such as a consistent prefix, and one that is not just two letters (my).
People get confused with where prefixing is needed, and why the prefix can't have a dash.

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.

@mkaz
Copy link
Member Author

mkaz commented Dec 8, 2018

@joyously Thanks for the feedback. I updated the prefix and ordering of the action/functions.

You might ought to mention the version number parameter for enqueuing scripts, but especially for styles.

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.

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.

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.

@joyously
Copy link

joyously commented Dec 8, 2018

It's always a hard balance to keep things brief to not overwhelm people

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.

see it doing something, which is why I added the CSS part

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?

Copy link
Member

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

@mkaz
Copy link
Member Author

mkaz commented Dec 8, 2018

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

If you have the bandwidth, it think it'd be really worthwhile to "user test" this documentation with a layperson at WCUS.

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.

@mkaz mkaz force-pushed the docs/11392/javascript branch from aaeba92 to f2b2dcb Compare December 12, 2018 00:12
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.

This is great work, bravo!

@oandregal
Copy link
Member

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.

@oandregal oandregal added this to the 4.8 milestone Dec 12, 2018
@gziolo gziolo modified the milestones: 4.8, Documentation & Handbook Dec 14, 2018
@gziolo
Copy link
Member

gziolo commented Dec 14, 2018

All changes which are purely docs related should be under Documentation & Handbook milestone to simplify the process of plugin release :)

@gziolo
Copy link
Member

gziolo commented Dec 14, 2018

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

@mkaz
Copy link
Member Author

mkaz commented Dec 14, 2018

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

Copy link
Contributor

@chrisvanpatten chrisvanpatten left a 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 :)

Copy link
Contributor

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

Copy link
Contributor

@chrisvanpatten chrisvanpatten left a 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 💯

nosolosw and others added 19 commits December 14, 2018 09:33
@mkaz mkaz force-pushed the docs/11392/javascript branch from 30cea21 to 28f6e25 Compare December 14, 2018 17:34
Copy link
Contributor

@chrisvanpatten chrisvanpatten 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 an awesome improvement. Thank you @mkaz!

@chrisvanpatten
Copy link
Contributor

Travis is ¯_(ツ)_/¯ so I'm going to merge… thanks for working on this @mkaz!

@chrisvanpatten chrisvanpatten merged commit a155454 into master Dec 17, 2018
@chrisvanpatten chrisvanpatten deleted the docs/11392/javascript branch December 17, 2018 14:53
youknowriad pushed a commit that referenced this pull request Jan 9, 2019
* 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
youknowriad pushed a commit that referenced this pull request Jan 9, 2019
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Developer Documentation Documentation for developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants