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

add note about wp-editor dependancy #12731

Merged
merged 3 commits into from Jan 25, 2019

Conversation

Projects
None yet
4 participants
@greenhornet79
Copy link
Contributor

greenhornet79 commented Dec 9, 2018

If you don't add wp-editor as a dependency, the example code will throw an error.

Description

How has this been tested?

Screenshots

Types of changes

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
add note about wp-editor dependancy
If you don't add wp-editor as a dependency, the example code will throw an error.
@chrisvanpatten
Copy link
Member

chrisvanpatten left a comment

Small request for a code sample otherwise this is great! Thanks for the contribution :)

@@ -120,6 +120,8 @@ Earlier examples used the `createElement` function to create DOM nodes, but it's

The `RichText` component can be considered as a super-powered `textarea` element, enabling rich content editing including bold, italics, hyperlinks, etc. It is not too much unlike the single editor region of the legacy post editor, and is in fact powered by the same TinyMCE library.

To use the `RichText` component, add `wp-editor` to the array of registered script handles when calling `wp_register_script`.

This comment has been minimized.

@chrisvanpatten

chrisvanpatten Dec 10, 2018

Member

It would be awesome to get a code example here, if possible (presumably just taking the example from the first page in the tutorial and updating it)

This comment has been minimized.

@chrisvanpatten

chrisvanpatten Dec 15, 2018

Member

@greenhornet79 Could you put this code sample below the "To use the RichText component" sentence so it's a little clearer what the code sample is explaining?

I think also instead of the entire block registration function, it would be easier to just show the wp_register_script segment, calling out the change:

wp_register_script(
	'gutenberg-boilerplate-es5-step03',
	plugins_url( 'step-03/block.js', __FILE__ ),
	array(
		'wp-blocks',
		'wp-element'
		'wp-editor', // Note the addition of wp-editor to the dependencies
	)
);

@gziolo gziolo added this to the Documentation & Handbook milestone Dec 14, 2018

@gziolo

This comment has been minimized.

Copy link
Member

gziolo commented Dec 14, 2018

It should be good after the latest changes applied. I will leave it to @chrisvanpatten to make the final call as there might be some guidelines for the examples themselves. It seems like the slug for the script and block in the example could be shorter.

@chrisvanpatten
Copy link
Member

chrisvanpatten left a comment

Small changes; thanks for your patience and sorry for the delay!

@@ -120,6 +120,8 @@ Earlier examples used the `createElement` function to create DOM nodes, but it's

The `RichText` component can be considered as a super-powered `textarea` element, enabling rich content editing including bold, italics, hyperlinks, etc. It is not too much unlike the single editor region of the legacy post editor, and is in fact powered by the same TinyMCE library.

To use the `RichText` component, add `wp-editor` to the array of registered script handles when calling `wp_register_script`.

This comment has been minimized.

@chrisvanpatten

chrisvanpatten Dec 15, 2018

Member

@greenhornet79 Could you put this code sample below the "To use the RichText component" sentence so it's a little clearer what the code sample is explaining?

I think also instead of the entire block registration function, it would be easier to just show the wp_register_script segment, calling out the change:

wp_register_script(
	'gutenberg-boilerplate-es5-step03',
	plugins_url( 'step-03/block.js', __FILE__ ),
	array(
		'wp-blocks',
		'wp-element'
		'wp-editor', // Note the addition of wp-editor to the dependencies
	)
);
@chrisvanpatten

This comment has been minimized.

Copy link
Member

chrisvanpatten commented Dec 21, 2018

@greenhornet79 Just want to follow up and see if you're open to making this change :) Thanks!

@greenhornet79

This comment has been minimized.

Copy link
Contributor Author

greenhornet79 commented Dec 21, 2018

@chrisvanpatten Just pushed that change.

@gziolo

gziolo approved these changes Jan 25, 2019

Copy link
Member

gziolo left a comment

It looks like all feedback got addressed 👍

@gziolo gziolo merged commit 306f454 into WordPress:master Jan 25, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@gziolo

This comment has been minimized.

Copy link
Member

gziolo commented Jan 25, 2019

@greenhornet79 congrats on your first code contribution to this repository 🎉

@greenhornet79 greenhornet79 deleted the greenhornet79:patch-1 branch Jan 25, 2019

@greenhornet79

This comment has been minimized.

Copy link
Contributor Author

greenhornet79 commented Jan 25, 2019

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment