Skip to content

Scripts: Simplify scripts registration and remove useless jetpack fix#4754

Merged
youknowriad merged 1 commit intomasterfrom
refactor/editor-script
Feb 7, 2018
Merged

Scripts: Simplify scripts registration and remove useless jetpack fix#4754
youknowriad merged 1 commit intomasterfrom
refactor/editor-script

Conversation

@youknowriad
Copy link
Copy Markdown
Contributor

This PR refactors a little bit the way we enqueue Gutenberg scripts to clarify the dependency we have between the "blocks" module and the classic "editor" script.

It also fixes the classic editor where we were using an id starting with a numeric character (this is not valid).

It also removes a useless jetpack fix. The right fix has been included in Jetpack in 5.2.2 see #2229

Testing instructions

  • Open Gutenberg
  • Add a classic block
  • It should work

@youknowriad youknowriad self-assigned this Jan 30, 2018
@aduth
Copy link
Copy Markdown
Member

aduth commented Jan 30, 2018

Looks like a snapshot test needs to be updated.

@youknowriad youknowriad force-pushed the refactor/editor-script branch 2 times, most recently from d288ac4 to f5643e9 Compare February 1, 2018 11:47
@youknowriad
Copy link
Copy Markdown
Contributor Author

This should be ready to go

aduth
aduth previously requested changes Feb 2, 2018
Copy link
Copy Markdown
Member

@aduth aduth left a comment

Choose a reason for hiding this comment

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

I think this line in componentWillUnmount needs to be updated with the prefix?

wp.oldEditor.remove( this.props.id );

@aduth aduth changed the title Scrips: Simplify scripts registration and remove useless jetpack fix Scripts: Simplify scripts registration and remove useless jetpack fix Feb 2, 2018
@youknowriad youknowriad force-pushed the refactor/editor-script branch from f5643e9 to 87837f0 Compare February 2, 2018 13:51
@youknowriad youknowriad force-pushed the refactor/editor-script branch from 87837f0 to 19149c7 Compare February 7, 2018 13:23
id={ id }
className={ classnames( className, 'blocks-rich-text__tinymce' ) }
id={ `editor-${ id }` }
className="wp-block-freeform blocks-rich-text__tinymce"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

restored the wp-block-freeform className to fix the editor stylesheets. This has broken in a recent PR removing className support

@youknowriad youknowriad merged commit f598c96 into master Feb 7, 2018
@youknowriad youknowriad deleted the refactor/editor-script branch February 7, 2018 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants