-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Opt-out from re-registration of private APIs. #4121
Opt-out from re-registration of private APIs. #4121
Conversation
Gutenberg introduced a system of sharing private APIs in WordPress/gutenberg#46131. One of the safeguards is a check preventing the same module from opting-in twice so that contributors cannot easily gain access by pretending to be a core module. That safeguard is only meant for WordPress core and not for the released `@wordpress` packages. However, right now it is opt-out and must be explicitly disabled by developers wanting to install the `@wordpress` packages. Let's make it opt-out instead. This commit opts-out from that check in WordPress core by setting the ALLOW_EXPERIMENT_REREGISTRATION to false. Once it's merged, the Gutenberg plugin should be adjusted to use `true` as the default value.
This reverts commit 8761517.
…opt-out Gutenberg introduced a system of sharing private APIs in #46131. One of the safeguards is a check preventing the same module from opting-in twice so that contributors cannot easily gain access by pretending to be a core module. That safeguard is only meant for WordPress core and not for the released @WordPress packages. However, right now it is opt-out and must be explicitly disabled by developers wanting to install the @WordPress packages. Let's make it opt-out instead. This commit makes the check opt-in rather than opt-out. Its counterpart in the wordpress-develop repo makes WordPress explicitly set the ALLOW_EXPERIMENT_REREGISTRATION to false: WordPress/wordpress-develop#4121
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it looks like we can safely land it at any time. It won't take effect until WordPress packages are synced with the related changes. The change impacts only the build process.
…opt-out via IS_WORDPRESS_CORE (#48352) Gutenberg introduced a system of sharing private APIs in #46131. One of the safeguards is a check preventing the same module from opting-in twice so that contributors cannot easily gain access by pretending to be a core module. That safeguard is only meant for WordPress core and not for the released @WordPress packages. However, right now it is opt-out and must be explicitly disabled by developers wanting to install the @WordPress packages. Let's make it opt-out instead. In other words: * If we’re in WP core – prevent opting-in to private API with the same package name twice * If we’re not in WP core – don’t prevent it Or: * Before this commit, double opt-in safeguard is enabled by default * After this commit, double opt-in safeguard is disabled by default AND WordPress core [explicitly enables it](WordPress/wordpress-develop#4121) The corresponding PR in `wordpress-develop` repo makes WordPress explicitly set the `IS_WORDPRESS_CORE` to true: WordPress/wordpress-develop#4121
@hellofromtonya @peterwilsoncc let me know if you think this is suitable for merging, and if yes then I could make it my first commit. |
@adamziel I marked the ticket for commit and assigned the commit to you. Go ahead with your first commit 🎉 |
Committed in https://core.trac.wordpress.org/changeset/55512/trunk – thank you everyone! 🎉 |
Description
Gutenberg introduced a system of sharing private APIs in
WordPress/gutenberg#46131. One of the
safeguards is a check preventing the same module from opting-in
twice so that contributors cannot easily gain access by pretending
to be a core module.
That safeguard is only meant for WordPress core and not for
the released
@wordpress
packages. However, right now it isopt-out and must be explicitly disabled by developers wanting to
install the
@wordpress
packages. Let's make it opt-out instead.This commit opts-out from that check in WordPress core by setting
the
IS_WORDPRESS_CORE
totrue
. Once it's merged,the Gutenberg plugin should be adjusted to use
false
as thedefault value.
In other words:
Test plan:
Merging this PR will have no immediate effect:
wordpress-develop
repo.I recommend:
This way, the check will be enabled by default in 6.2 and enabled explicitly in 6.3.
Trac ticket: https://core.trac.wordpress.org/ticket/57795