-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Move the HTML block into the blocks library package #10396
Conversation
924b0e5
to
febc7dc
Compare
febc7dc
to
0df814a
Compare
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.
|
||
deprecated( 'wp.components.CodeEditor', { | ||
version: '4.2', | ||
alternative: 'wp.codeEditor directly or any alternative React component for syntax highlighting', |
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 going to be confusing in the context of npm package which is out of WordPress context. Not sure if this is bad or not, just noting.
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.
yes, we have a bunch of those and we need to experiment with making the messages opt-in or something and only enable in WP
Sad to lose syntax highlighting but it looks good to me, especially since it mirrors the code block. Hopefully in Phase 2 it'll be possible to get a better code editing solution in place across the board. Only thing to wonder about is whether custom HTML and code will get confused for each other but honestly I think we have that problem either way. 👍 from me! |
I'm worried that people are going to complain a lot about the loss of functionality. It is easy to explain to a developer why the syntax highlighting may have to be removed for now, but it is far harder to explain to the end user. To some, I am sure this will seem like a sign that Gutenberg is cutting corners to try and meet the deadline. Personally, I really like the syntax highlighting and would not like to see it be removed at all. If anything, I wish the standard Edit as HTML option and Code Editor mode used syntax highlighting. |
Agreed, it would be great to have syntax Highlighting but personally, I do think the current syntax highlighting is not great anyway and should be improved. We should explore alternatives to CodeMirror. (Monaco Editor is a very good option these days). Removing this from the npm package (where shipping Lazy Loading in a generic way is not really possible) doesn't mean we can't intergrate it back from Core Side but I do think we gain clarity by doing so as the HTML block is something any Gutenberg install (CMS agnostic) could benefit from. |
Thanks for working on this. This is an interesting crossroads to face. The syntax highlighter is delicious and wonderful, but at the same time if we can't lazy-load it now, it comes with a performance hit. Difficult. But in order to not stall momentum, I think we should do this:
This is the difficulty of making software. On one hand there's a great desire to have "everything ready" for the first version. On the other hand, the longer we wait to ship, the longer we deny ourselves the much needed testing surface that is the entire web. Although Gutenberg at the time of writing is on 530.000 sites, there are still many rough corners we need to sand off before shipping, which means we need to make tough decisions related to focus. In that vein, the most important thing is to ship a 1.0. On the flipside, if we all pull together and ship the 1.0, then the 1.1 can hopefully be released as early as March 2019. |
I created this issue to track it #10423 |
* Move the Classic block to the packages * Rename freeform => classic * Update the changelog of the block library package * Fix classic block editor styles
In order to merge Gutenberg into Core easily, all the Gutenberg JavaScript Core must be shared a reusable npm package. This PR updates the HTML block to avoid relying on
wp.codeEditor
for now because there's no easy way to lazy-load WordPress scrips yet and move theHTML
block into the blocks library.The
wp.components.CodeEditor
has also been deprecated with this change.Testing instructions