Skip to content
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

FSE: Use older editor package for better Gutenberg compatibility. #34096

Merged
merged 4 commits into from
Jun 20, 2019

Conversation

kwight
Copy link
Contributor

@kwight kwight commented Jun 18, 2019

Changes proposed in this Pull Request

Stick with the older editor package in case we need to accommodate older versions of Gutenberg. See #33720 (comment).

Testing instructions

  • Add a Site Description block and verify it continues to work normally.

@kwight kwight requested review from a team as code owners June 18, 2019 17:23
@matticbot
Copy link
Contributor

@kwight kwight self-assigned this Jun 18, 2019
@kwight kwight added [Goal] Full Site Editing [Pri] Normal Schedule for the next available opportuinity. [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it labels Jun 18, 2019
@matticbot
Copy link
Contributor

This PR does not affect the size of JS and CSS bundles shipped to the user's browser.

Generated by performance advisor bot at iscalypsofastyet.com.

@kwight kwight added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jun 18, 2019
@gwwar
Copy link
Contributor

gwwar commented Jun 18, 2019

For context the @wordpress/editor package was deprecated in favor of @wordpress/block-editor with no target date

Let's double check what get's included/or not in the dist files. Ideally we avoid sending down duplicate packages (or multiple versions) but depending on what happens we can adjust what we do for the deprecation strategy here.

@gwwar
Copy link
Contributor

gwwar commented Jun 18, 2019

Okay so we're externalizing this using the wordpress-external-dependencies-plugin props @sirreal. We'll need to be careful then about keeping track of what versions we support (WP/Gutenberg), and when packages are fully dropped

plugin_dir_path( __FILE__ ) . 'dist/full-site-editing.deps.json'

https://333006-45936895-gh.circle-artifacts.com/0/tmp/artifacts/full-site-editing/full-site-editing-plugin/full-site-editing/dist/full-site-editing.deps.json

https://github.com/Automattic/wp-calypso/tree/master/packages/wordpress-external-dependencies-plugin

const depsFile = compilation.getPath( outputFilename.replace( /\.js$/i, '.deps.json' ), {

@gwwar
Copy link
Contributor

gwwar commented Jun 18, 2019

Added a related writeup paAmJe-tx-p2

Copy link
Contributor

@gwwar gwwar left a comment

Choose a reason for hiding this comment

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

Thanks @kwight ! I think this is good to ship if we can verify that no-one else has added back block-editor in the meantime.

@mmtr
Copy link
Member

mmtr commented Jun 19, 2019

I think this is good to ship if we can verify that no-one else has added back block-editor in the meantime.

Actually, the dependency is currently duplicated:

"@wordpress/block-editor": "^2.2.0",
"@wordpress/blocks": "^6.2.3",
"@wordpress/block-editor": "^2.0.3",

Seems that @rodrigoi also included it on #33885 for the InnerBlocks component, we can still import it from @wordpress/editor in order to support older versions of the plugin.

I'd suggest to update this PR too with a switch to the @wordpress/editor package on the a8c/post-content block, given that the change should be pretty straight forward.

@mmtr
Copy link
Member

mmtr commented Jun 19, 2019

Note that I also included a small change fixing a typo in the site description block title (which I accidentally introduced in #33720).

Totally unrelated to what this PR is fixing, but didn't want to create a separate PR for such a small change.

@sirreal
Copy link
Member

sirreal commented Jun 19, 2019

I left some thoughts on paAmJe-tx-p2#comment-1205 that may be interesting for folks to read.

@kwight
Copy link
Contributor Author

kwight commented Jun 19, 2019

Totally unrelated to what this PR is fixing, but didn't want to create a separate PR for such a small change.

There is no such thing as a PR that's too small 🙂(but yes, let's keep it in)

@kwight kwight force-pushed the update/fse-description-block-editor branch from 272a2f1 to 1af2a0b Compare June 19, 2019 14:48
@kwight
Copy link
Contributor Author

kwight commented Jun 19, 2019

@gwwar @mmtr I've updated the post content block to use the deprecated package (and tested that the block still works). I think I've covered everything needed here to merge?

I'm a little confused by the app's package-lock.json, which continues to have references to @wordpress/block-editor, even after I did npm install and npm update for funsies in the directory – is there a proper way to update it that I can't find?

@sirreal I like your suggestion in that we don't have to worry about anything while writing code (just use the newest thing). But like you mentioned in that comment, it relies on the two packages having identical exports, correct? Maybe getting this in for now is smart until we can figure out if we need something more robust.

@sirreal
Copy link
Member

sirreal commented Jun 19, 2019

But like you mentioned in that comment, it relies on the two packages having identical exports, correct?

Right, that was an assumption on my part that may or may not be accurate. I was under the impression that editor was essentially renamed to block-editor, but I'm not informed that is likely a poor assumption.

Please proceed with the immediate fix. My comment was intended to provide helpful information, I don't know whether it is actionable or how relevant it is for you right now.

@gwwar
Copy link
Contributor

gwwar commented Jun 19, 2019

Ah can we gitignore the package-lock.json? We're using externals for @wordpress/* here so even the versions in package.json don't have much meaning.

@gwwar
Copy link
Contributor

gwwar commented Jun 19, 2019

I was under the impression that editor was essentially renamed to block-editor

💯

Copy link
Contributor

@gwwar gwwar left a comment

Choose a reason for hiding this comment

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

Thanks @kwight! Let's stick with this approach until we make the required webpack plugin changes.

I verified that the block name was updated:
Screen Shot 2019-06-19 at 3 42 39 PM

And that we only have the following in full-site-editing.deps.json

Screen Shot 2019-06-19 at 3 38 06 PM

Screen Shot 2019-06-19 at 3 38 14 PM

@kwight kwight force-pushed the update/fse-description-block-editor branch from 991807d to ef2e614 Compare June 20, 2019 18:21
@kwight
Copy link
Contributor Author

kwight commented Jun 20, 2019

Ah can we gitignore the package-lock.json?

Oh, no need, it's already ignored higher up somewhere; I was just trying to make sense of what I thought I should be seeing.

We're good to go then; had to rebase, will merge after tests clear again.

@kwight kwight merged commit 2411f01 into master Jun 20, 2019
@kwight kwight deleted the update/fse-description-block-editor branch June 20, 2019 19:10
@matticbot matticbot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jun 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Goal] Full Site Editing [Pri] Normal Schedule for the next available opportuinity. [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants