Conversation
Complement the sync package exclusion from Core builds (#78081) by disabling the remaining public RTC APIs at their entry points. These APIs are already shipped publicly, so they cannot be made private; gate them on IS_GUTENBERG_PLUGIN instead so they no-op in Core builds: - getSyncConnectionStatus / setSyncConnectionStatus (core store) - SelectionType / SelectionDirection enums (wp.coreData) - isCollaborationEnabledForCurrentPost (core/editor store) Also gate the CollaboratorsOverlay mount in EditorInterface on IS_GUTENBERG_PLUGIN to prevent the overlay hooks from crashing on the now-undefined SelectionType in Core builds. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Size Change: +13 B (0%) Total Size: 7.92 MB 📦 View Changed
ℹ️ View Unchanged
|
|
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 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. |
|
Can we make this private? What's the point of shipping public APIs if they don't work? P.S. I think some of these new actions/selects should've been private from the start. |
|
I personally wanted to avoid making this private again, as it has already been published in the Gutenberg plugin. |
That's fine. IIRC, APIs are really public when they ship in core. At least that's how I remember this approach. |
|
Worth noting that the sync packages is already being hidden in #78085 |
Related to:
See: https://wordpress.slack.com/archives/C07NVJ51X6K/p1778229071236919?thread_ts=1778216739.261239&cid=C07NVJ51X6K
What?
This PR is part of the effort to disable RTC in the 7.0 release and ensures that public APIs are not shipped to core.
How?
Check
IS_GUTENBERG_PLUGINand prevent the following APIs from being publicly exposed.wp.data.select( 'core' ).getSyncConnectionStatus()wp.data.dispatch( 'core' ).setSyncConnectionStatus( ... )wp.coreData.SelectionTypewp.coreData.SelectionDirectionwp.data.select( 'core/editor' ).isCollaborationEnabledForCurrentPost()This PR is a minimal approach to prevent unintended API exposure. We may need follow-ups to prevent unnecessary subscriptions or side effects.
Testing Instructions
IS_GUTENBERG_PLUGIN=false npm run buildUse of AI Tools
Developed with assistance from Claude (Anthropic) for code analysis and drafting.