Make WordPress Core

Opened 3 months ago

Closed 5 days ago

#62887 closed task (blessed) (fixed)

Editor: Update packages for 6.8

Reported by: mamaduka's profile Mamaduka Owned by: mamaduka's profile Mamaduka
Milestone: 6.8 Priority: normal
Severity: normal Version:
Component: Editor Keywords: has-patch has-unit-tests dev-reviewed commit fixed-major
Focuses: Cc:

Description

Update the packages worked on in the Gutenberg repo for WordPress 6.8.

Change History (47)

This ticket was mentioned in PR #8224 on WordPress/wordpress-develop by @Mamaduka.


3 months ago
#1

  • Keywords has-patch has-unit-tests added

@Mamaduka commented on PR #8224:


3 months ago
#2

I've not been involved in these syncs in the past, but was under the impression that we were attempting to move away from shipping these kinds of features under the experimental… prefix.

@joemcgill, that only applies to JS API. The block.json is a configuration file that can't have private APIs, hence the __experimental prefixes. They're and will be backward compatible.

@joemcgill commented on PR #8224:


3 months ago
#3

Thanks for clarifying! Do we have any documentation or best practice for why and when to use those prefixes for block.json features? If they are intended to be backward compatible, should we be looking to remove these prefixes?

@Mamaduka commented on PR #8224:


3 months ago
#4

These aren't new configuration values; they just got enabled for those blocks. When those features are stable, we usually create iteration issues like #64314 and stabilize the keys.

I don't recall any official docs, but it is probably worth documenting.

@Mamaduka commented on PR #8224:


2 months ago
#5

Updated packages to fix private API errors breaking the Site Editor (https://github.com/WordPress/gutenberg/pull/68964). It should be working correctly now.

Remaining issues:

  • I noticed the "Go to the Dashboard" buttons don't work in the Site Editor. It requires changes to block editor settings from #7903. I can cherry-pick them in this PR to unblock merging.
  • Some JavaScript CI tests fail due to this warning - Warning: The build/wp-includes/js/dist/data.js file must not contain a sourceMappingURL. Use --force to continue. Does anyone have experience fixing it?

## Screeenshot

https://github.com/user-attachments/assets/e08f76f7-04f1-45e2-a6ec-db7b16f3aa98

@Mamaduka commented on PR #8224:


2 months ago
#6

It looks like wp-polyfill has been reintroduced as a dependency, which causes the test_wp_add_inline_script_before_after_concat_with_core_dependency unit test to fail. It was initially removed via https://core.trac.wordpress.org/ticket/60962.

@swissspidy, any suggestions on how to approach this?

@swissspidy commented on PR #8224:


2 months ago
#7

Hmm good question, I wonder what caused this.

Last time this topic came up was in https://github.com/WordPress/gutenberg/issues/66552 and https://github.com/WordPress/gutenberg/pull/67230

A quick test here shows that wp-polyfill is now suddenly a dependency of wp-i18n, hence this unit test is failing with the new diff.

I thought with https://github.com/WordPress/gutenberg/pull/65292 / https://github.com/WordPress/gutenberg/pull/65582 the wp-polyfill dependency should only be added when needed.

Tinkering with the Gutenberg package build process I see that the i18n package now tries to load these two polyfills for iterator helpers (which are currently not supported by Safari) in create-i18n.js:

import "core-js/modules/esnext.iterator.constructor.js";
import "core-js/modules/esnext.iterator.for-each.js";

And that's why ultimately the wp-polyfill dependency is added.

create-i18n.js uses new Set() and Set.forEach(), so that's why. But those are supported in Safari, so adding the iterator polyfills is incorrect.

I wonder if we should do something like https://github.com/WordPress/gutenberg/pull/67230 but for Iterator. That would solve this issue. cc @sgomes

Related: it can't hurt to update Babel & core-js to the latest versions in the Gutenberg repo, as this will affect polyfills too.

@sergiomdgomes commented on PR #8224:


2 months ago
#8

The reason why polyfills are being added unnecessarily is due to fundamental limitations in core-js, the JS polyfill library that we use to make wp-polyfill, and which is used by Babel as well. In a nutshell, it's monolithic where it comes to objects like Set, and assumes that if a Set object is present anywhere, it's going to need all its methods, and therefore all the internal dependencies it uses to polyfill them.

This was likely caused by a core-js update that added new functionality, perhaps https://github.com/WordPress/gutenberg/pull/67708?

@sergiomdgomes commented on PR #8224:


2 months ago
#9

To follow up on the above, the aforementioned Gutenberg PR updated core-js to version 3.39, which according to the project changelog added the Iterator functionality, so we have our smoking gun.

@gziolo: Would it be worth it to replicate the unit test that's failing here (test_wp_add_inline_script_before_after_concat_with_core_dependency) at the Gutenberg level, so that we catch these situations in the Gutenberg repo, before they make their way to Core?

@Mamaduka commented on PR #8224:


2 months ago
#10

Thanks, @swissspidy, @sgomes.

So, for now, would the proposed resolution be something similar to https://github.com/WordPress/gutenberg/pull/67230?

@swissspidy commented on PR #8224:


2 months ago
#11

In that case I would say so, yes.

Adding a unit test or CI check for this stuff would be nice for sure.

@Mamaduka commented on PR #8224:


2 months ago
#12

Here's the PR to fix this problem - https://github.com/WordPress/gutenberg/pull/69070.

@gziolo commented on PR #8224:


2 months ago
#13

Would it be worth it to replicate the unit test that's failing here (test_wp_add_inline_script_before_after_concat_with_core_dependency) at the Gutenberg level, so that we catch these situations in the Gutenberg repo, before they make their way to Core?

Sure, that makes perfect sense. It looks like @Mamaduka added some test coverage in https://github.com/WordPress/gutenberg/pull/69070 that will help to catch similar regressions.

@Mamaduka commented on PR #8224:


2 months ago
#14

All outstanding issues for this PR are resolved now. We're good to commit if we decide to do so.

#15 @joemcgill
2 months ago

In 59775:

Editor: Update packages for 6.8 pre-Betas.

Syncs @wordpress/* packages to the 'latest' npm tag.

Props mamaduka, joemcgill, youknowriad, swissspidy, sergiomdgomes, gziolo.
See #62887.

#16 @joemcgill
2 months ago

In 59776:

Editor: Add query-total block files.

This is a follow-up to [59775] to add new files that were missed in the original commit.

See #62887.

#17 @joemcgill
2 months ago

In 59777:

Editor: Add remaining query block file.

This is a follow-up to [59776] and [59775] to add yet another file that was missed in the original commit.

See #62887.

This ticket was mentioned in Slack in #core by joemcgill. View the logs.


2 months ago

This ticket was mentioned in PR #8424 on WordPress/wordpress-develop by @Mamaduka.


7 weeks ago
#20

[!NOTE]
Just a "draft" PR to streamline the process. It includes changes for Gutenberg 20.3.
The last full change will happen tomorrow after Gutenberg 20.4 RC and packages are released.

Trac ticket: https://core.trac.wordpress.org/ticket/62887

This ticket was mentioned in PR #8424 on WordPress/wordpress-develop by @Mamaduka.


7 weeks ago
#21

[!NOTE]
Just a "draft" PR to streamline the process. It includes changes for Gutenberg 20.3.
The last full change will happen tomorrow after Gutenberg 20.4 RC and packages are released.

Trac ticket: https://core.trac.wordpress.org/ticket/62887

@Mamaduka commented on PR #8424:


7 weeks ago
#22

The last full sync. Latest package releases, including Gutenberg 20.4. It should be ready to commit.

#23 @joemcgill
7 weeks ago

In 59906:

Editor: Update packages for 6.8 Beta 1.

Syncs @wordpress/* packages to the 'latest' npm tag.

Props mamaduka, joemcgill, desrosj.
See #62887.

#26 @joemcgill
6 weeks ago

In 59961:

Editor: Update packages for 6.8 Beta 2.

Syncs @wordpress/* packages to the 'latest' npm tag.

Props mamaduka, desrosj, joemcgill.
See #62887.

#29 @joemcgill
5 weeks ago

In 60036:

Editor: Update packages for 6.8 Beta 3.

Syncs @wordpress/* packages to the 'wp-6.8' npm tag.

Props mamaduka.
See #62887.

#31 @joemcgill
4 weeks ago

In 60078:

Editor: Update packages for 6.8 RC 1.

Syncs @wordpress/* packages to the 'wp-6.8' npm tag.

Props mamaduka, audrasjb.
See #62887.

#32 @joemcgill
4 weeks ago

  • Summary changed from Editor: Update packages for 6.8 Betas to Editor: Update packages for 6.8

Let's keep this tracking ticket rolling for RCs

This ticket was mentioned in Slack in #core by audrasjb. View the logs.


4 weeks ago

This ticket was mentioned in Slack in #core by audrasjb. View the logs.


3 weeks ago

#37 @audrasjb
3 weeks ago

Committer sign-off: PR8628 is good to ship before RC2.

#38 @audrasjb
3 weeks ago

In 60114:

Editor: Update packages for 6.8 RC 2.

Syncs @wordpress/* packages to the 'wp-6.8' npm tag.

Props mamaduka.
See #62887.

#40 @joemcgill
3 weeks ago

  • Keywords dev-reviewed added

@audrasjb [60114] looks good for backporting.

#41 @audrasjb
3 weeks ago

In 60115:

Editor: Update packages for 6.8 RC 2.

Syncs @wordpress/* packages to the 'wp-6.8' npm tag.

Reviewed by joemcgill.
Merges [60114] to the 6.8 branch.
Props mamaduka.
See #62887.

This ticket was mentioned in PR #8674 on WordPress/wordpress-develop by @desrosj.


9 days ago
#42

This includes the corresponding package updates for 6.8 RC4, should it be deemed necessary.

Bugs addressed: https://github.com/WordPress/gutenberg/pull/69860

Trac ticket: Core-62887.

#43 @desrosj
9 days ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 60150:

Editor: Restore static properties for deprecated __experimentalLinkControl.

[59775] resulted in a backwards compatibility break in a now deprecated experimental component, which was stabilized to LinkControl. When experimental components are deprecated in favor of being stabilized, the same backwards compatibility policy applies and the shape of the component should not change.

This restores the static properties that were unintentionally removed from the __experimentalLinkControl component that was moved to DeprecatedExperimentalLinkControl.

Props karthikeya01, mamaduka, joemcgill, fabiankaegy, wildworks.
Fixes #62887.

#44 @desrosj
9 days ago

  • Keywords commit fixed-major dev-feedback added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening to consider backporting [60150].

This ticket was mentioned in Slack in #core by desrosj. View the logs.


9 days ago

#46 @joemcgill
9 days ago

  • Keywords dev-feedback removed

Thanks @desrosj. I've updated trunk locally with the new packages and tested to confirm that calling wp.blockEditor.__experimentalLinkControl.DEFAULT_LINK_SETTINGS does not result in an error.

Looks good to backport to 6.8.

#47 @wildworks
9 days ago

@desrosj Thanks for the update. I've tested trunk locally and works as expected.

#48 @desrosj
5 days ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 60156:

Editor: Restore static properties for deprecated __experimentalLinkControl.

[59775] resulted in a backwards compatibility break in a now deprecated experimental component, which was stabilized to LinkControl. When experimental components are deprecated in favor of being stabilized, the same backwards compatibility policy applies and the shape of the component should not change.

This restores the static properties that were unintentionally removed from the __experimentalLinkControl component that was moved to DeprecatedExperimentalLinkControl.

Reviewed by joemcgill, wildworks.
Merges [60150] to the 6.8 branch.

Props karthikeya01, mamaduka, joemcgill, fabiankaegy, wildworks.
Fixes #62887.

Note: See TracTickets for help on using tickets.