Uh oh!
There was an error while loading. Please reload this page.
Automate updating JS packages - #2621
Conversation
58aaa15 to
9974030Comparegziolo
commented
Apr 22, 2022
I'm looking forward to give it a spin on Monday/Tuesday 🎉 |
Uh oh!
There was an error while loading. Please reload this page.
9974030 to
7403279Compare9d9518e to
a3d7ef4Compareocean90
commented
Apr 26, 2022
It's right that "backporting" here means updating the packages to the same packages used by Gutenberg? I think this can be misleading as backporting in WordPress is more about cherry-picking a commit from trunk into a branch which the command is clearly not doing. |
gziolo
commented
Apr 26, 2022
Good perspective. It should be reworded so it's all clear it's about bringing changes from Gutenberg to WP core 👍🏻 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
adamziel
commented
Apr 27, 2022
Good notes! I renamed |
b10c503 to
a452b08Compare…kages to their required versions and runs the build process
04ebbe8 to
38eceedCompare| BUILD_DIR = 'build/', | ||
| WORKING_DIR = grunt.option( 'dev' ) ? SOURCE_DIR : BUILD_DIR, | ||
| BANNER_TEXT = '/*! This file is auto-generated */', | ||
| BANNER_TEXT = '/*! This file is auto-generated */', |
There was a problem hiding this comment.
My linting tool caught this. Seems fine to merge.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| } ); | ||
| } ); | ||
| grunt.registerTask( 'browserslist:update', 'Update WordPress packages', function() { |
There was a problem hiding this comment.
@desrosj, how do you feel about running this command every time we refresh WordPress packages from Gutenberg?
I know you open tickets to document the changes for supported browsers.
There was a problem hiding this comment.
@gziolo this just downloads the latest browserlist database, it doesn't affect the browsers supported by WordPress in any way.
There was a problem hiding this comment.
I know it’s expected to run this command regularly (browserslist/browserslist#492). It's perfectly fine for trunk, but it might not be expected for older major WordPress releases when you want only to update packages to fix security vulnerabilities.
See also https://core.trac.wordpress.org/ticket/52331 as a reference. I know from experience that overall the goal is to minimize JS and CSS changes in minor releases so it doesn’t prime all caches for WordPress. Those changes to the list of browsers might impact the generated content of files in both CSS and JS when Babel polyfills or vendor prefixes get removed.
@desrosj opened https://core.trac.wordpress.org/ticket/55559 to document supported browsers in the 6.0 cycle with a note that the list shouldn’t change after RC1.
There was a problem hiding this comment.
Hm that's a fair point. Let's make this opt-out then, and I'll add a CLI flag to enable it on demand.
gziolo
left a comment
There was a problem hiding this comment.
We need still to clarify the final strategy for browserslist, but it can be revised later. Everything looks good and we successfully tested it with WordPress 6.0 Beta 3 🎉
Let’s land this useful utility tool to make the backporting from Gutenberg easier. We also have plans how to improve keeping blocks in sync between Gutenberg and WordPress core.
d3f20ad to
d112751Compared112751 to
0801f0cCompareadamziel
commented
Apr 29, 2022
gziolo
commented
Apr 29, 2022
Excellent, I will commit while we work on backports today 👍🏻 |
gziolo
commented
Apr 29, 2022
Committed with https://core.trac.wordpress.org/changeset/53311. |
What problem does this PR solve?
Trac ticket: https://core.trac.wordpress.org/ticket/55642
Updating
@wordpresspackages is currently a manual process that takes some reading and trial&error to figure out:browserslistdatabase@wordpresspackages@wordpressrequired by the existing dependencies@wordpressdependencies to the versions required by the@wordpresspackagesnpm build:dev(see #2564)
This PR adds a single task called
sync-gutenberg-packagesthat automates this entire process.Ideally, the next step will be a GitHub action that runs it for you.
Test plan
Run the following commands:
Then merge this branch into your local copy:
Then run the command:
Then run
git statusand confirm it reports the following:cc @gziolo