Private APIs: remove re-registration check#73613
Private APIs: remove re-registration check#73613ellatrix merged 2 commits intoremove/allow-re-registrationfrom
Conversation
Co-authored-by: ellatrix <4710635+ellatrix@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @Copilot. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
What?
Remove the re-registration check from the private APIs package. This allows packages to opt-in to private APIs multiple times.
Why?
Some packages like data views and global styles UI are bundled in other packages multiple times, causing the private APIs registration to fail with duplicate opt-in errors—except in Gutenberg itself. This behavior difference between Gutenberg and Core is preventing package syncs because editors crash.
The explicit opt-in process (install package, consent string, unlock) already communicates that these APIs are private with no backwards compatibility guarantees. The check was being worked around via npm patches anyway.
How?
registeredModulesSet and duplicate registration check fromimplementation.tsTesting Instructions
Tests should pass.
Testing Instructions for Keyboard
N/A
Screenshots or screencast
N/A
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.