Better synchronisation between Gutenberg and Core code#37141
Better synchronisation between Gutenberg and Core code#37141youknowriad merged 2 commits intotrunkfrom
Conversation
There was a problem hiding this comment.
That filter exists on 5.8 but is slightly different.
There was a problem hiding this comment.
Gutenberg plugin is using a special function here that is different from Core, I was not entirely sure which one was the right one, but I decided to use the Core approach. Let me know if this is wrong.
There was a problem hiding this comment.
There's a failing end2end test, if I had to guess, I think it's related to the change here, meaning Core is probably also broken and missing a backport :)
There was a problem hiding this comment.
Ok so this should be solved with dd377ed and that commit need to be backported in Core properly.
There was a problem hiding this comment.
The template loader is something that landed on 5.8 I believe but was tweaked on 5.9, so ideally the code here should be moved somehow to lib/compat/5.9 folder maybe. cc @ockham
To be honest, I didn't know this until recently. I wonder if other contributors might be the same. It might be good to put a README in the folder to explain how it works. I don't mind having a look at doing that (hopefully I have the right understanding now). |
Yeah, it's not very old, @gziolo proposed this a couple months ago, It makes sense and simplify backports and such. And yes, we definitely need to document this in the folder structure page or more. 👍 |
Related issue: #33810. We should formalize it once we have the structure in place. I know that @noisysocks started exploring those ideas a few months ago in the https://github.com/WordPress/gutenberg/tree/update/refactor-php branch, but I guess it was too much work for a single contributor. |
|
Yes, we can't change everything in one step, doing it file by file seems a good compromise while also checking the impact compared to Core. For instance this just helped uncover an unbackported change dd377ed |
dd377ed to
28797dc
Compare
|
I could use a ✅ here to continue iteration on these kind of changes. |
28797dc to
f5eba78
Compare
|
Agree with all of this 👍 thanks for tackling it @youknowriad. A
|
In the ideal scenario, Gutenberg's php code should be composed of three things:
lib/compatfolder with all the changes that are in Core or supposed to land in the next version in Core. (Most of the php code)Right now, we still have a lot of php code that is "unclear": lives outside of
lib/compatbut is already on core or its status need to be clarified. This kind of code makes it very hard to maintain the plugin and do the backports on each WordPress release. Ideally, we should seek to remove that code or move it to the right place. This PR starts that work by focusing on two FSE files.