[wp-trac] [WordPress Trac] #57795: [@wordpress packages] Make the safeguard for using private APIs opt-in rather than opt-out

WordPress Trac noreply at wordpress.org
Fri Mar 10 12:20:05 UTC 2023


#57795: [@wordpress packages] Make the safeguard for using private APIs opt-in
rather than opt-out
----------------------------------------------+------------------------
 Reporter:  zieladam                          |       Owner:  zieladam
     Type:  defect (bug)                      |      Status:  reviewing
 Priority:  normal                            |   Milestone:  6.3
Component:  Build/Test Tools                  |     Version:
 Severity:  normal                            |  Resolution:
 Keywords:  has-patch gutenberg-merge commit  |     Focuses:
----------------------------------------------+------------------------
Description changed by zieladam:

Old description:

> Summary: The current system of sharing private APIs in Gutenberg
> (WordPress/gutenberg#46131) includes a safeguard to prevent the same
> module from opting-in twice. However, this safeguard is only intended for
> WordPress core and not for the released @wordpress packages. As a result,
> developers must currently explicitly disable this check in order to
> install the @wordpress packages. Some developers have reported troubles
> with updating these packages to the latest version.
>
> This Trac ticket proposes to make the check for sharing private APIs opt-
> out for the @wordpress packages. This change would be implemented by
> setting the ALLOW_EXPERIMENT_REREGISTRATION to false in the WordPress
> core, allowing the Gutenberg plugin to use true as the default value.
>
> Impact: This change would streamline the process for installing the
> @wordpress packages, making it easier for developers to use these
> packages in their projects.

New description:

 Summary: The current system of sharing private APIs in Gutenberg
 (WordPress/gutenberg#46131) includes a series of safeguards: Only core
 JavaScript modules can participate in the private APIs system and each of
 them can only be registered once.

 The latter safeguard is enabled by default in WordPress 6.2. However, in
 the most recent editor version it is disabled by default
 (WordPress/gutenberg#48352) and needs to be explicitly enabled by setting
 the IS_WORDPRESS_CORE to true.

--

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57795#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list