From c4e90245465fc08ec332475a4f8fa5cf0eab2a38 Mon Sep 17 00:00:00 2001 From: Peter Wilson <519727+peterwilsoncc@users.noreply.github.com> Date: Tue, 18 Jun 2024 12:42:57 +1000 Subject: [PATCH] Update Private API opt-in string for WP 6.6. (#62635) Co-authored-by: peterwilsoncc Co-authored-by: talldan --- docs/contributors/code/coding-guidelines.md | 2 +- packages/block-directory/src/lock-unlock.js | 2 +- packages/block-editor/src/lock-unlock.js | 2 +- packages/block-library/src/lock-unlock.js | 2 +- packages/blocks/src/lock-unlock.js | 2 +- packages/commands/src/lock-unlock.js | 2 +- packages/components/src/lock-unlock.js | 2 +- packages/core-commands/src/lock-unlock.js | 2 +- packages/core-data/src/private-apis.js | 2 +- packages/customize-widgets/src/lock-unlock.js | 2 +- packages/data/src/lock-unlock.js | 2 +- packages/dataviews/src/lock-unlock.ts | 2 +- packages/edit-post/src/lock-unlock.js | 2 +- packages/edit-site/src/lock-unlock.js | 2 +- packages/edit-widgets/src/lock-unlock.js | 2 +- packages/editor/src/lock-unlock.js | 2 +- packages/format-library/src/lock-unlock.js | 2 +- packages/interface/lock-unlock.js | 2 +- packages/patterns/src/lock-unlock.js | 2 +- packages/preferences/src/lock-unlock.js | 2 +- packages/private-apis/README.md | 5 +++-- packages/private-apis/src/implementation.js | 2 +- packages/private-apis/src/test/index.js | 2 +- packages/reusable-blocks/src/lock-unlock.js | 2 +- packages/router/src/lock-unlock.js | 2 +- 25 files changed, 27 insertions(+), 26 deletions(-) diff --git a/docs/contributors/code/coding-guidelines.md b/docs/contributors/code/coding-guidelines.md index d89df5876e3804..b76d77b3040e68 100644 --- a/docs/contributors/code/coding-guidelines.md +++ b/docs/contributors/code/coding-guidelines.md @@ -162,7 +162,7 @@ do so by opting-in to `@wordpress/private-apis`: import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis'; export const { lock, unlock } = __dangerousOptInToUnstableAPIsOnlyForCoreModules( - 'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', + 'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/block-editor' // Name of the package calling __dangerousOptInToUnstableAPIsOnlyForCoreModules, // (not the name of the package whose APIs you want to access) ); diff --git a/packages/block-directory/src/lock-unlock.js b/packages/block-directory/src/lock-unlock.js index a6cc2fe3440f61..79b82edbc0fc78 100644 --- a/packages/block-directory/src/lock-unlock.js +++ b/packages/block-directory/src/lock-unlock.js @@ -5,6 +5,6 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri export const { lock, unlock } = __dangerousOptInToUnstableAPIsOnlyForCoreModules( - 'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', + 'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/block-directory' ); diff --git a/packages/block-editor/src/lock-unlock.js b/packages/block-editor/src/lock-unlock.js index 433a61a12aec01..51929a5920b11b 100644 --- a/packages/block-editor/src/lock-unlock.js +++ b/packages/block-editor/src/lock-unlock.js @@ -5,6 +5,6 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri export const { lock, unlock } = __dangerousOptInToUnstableAPIsOnlyForCoreModules( - 'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', + 'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/block-editor' ); diff --git a/packages/block-library/src/lock-unlock.js b/packages/block-library/src/lock-unlock.js index 3c18e76b798cda..cc8ef7a811fff8 100644 --- a/packages/block-library/src/lock-unlock.js +++ b/packages/block-library/src/lock-unlock.js @@ -5,6 +5,6 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri export const { lock, unlock } = __dangerousOptInToUnstableAPIsOnlyForCoreModules( - 'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', + 'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/block-library' ); diff --git a/packages/blocks/src/lock-unlock.js b/packages/blocks/src/lock-unlock.js index 0a98fcfb19d296..2ed55b6ba6adb5 100644 --- a/packages/blocks/src/lock-unlock.js +++ b/packages/blocks/src/lock-unlock.js @@ -5,6 +5,6 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri export const { lock, unlock } = __dangerousOptInToUnstableAPIsOnlyForCoreModules( - 'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', + 'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/blocks' ); diff --git a/packages/commands/src/lock-unlock.js b/packages/commands/src/lock-unlock.js index e11bd687d87421..ffff128cdb91b7 100644 --- a/packages/commands/src/lock-unlock.js +++ b/packages/commands/src/lock-unlock.js @@ -5,6 +5,6 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri export const { lock, unlock } = __dangerousOptInToUnstableAPIsOnlyForCoreModules( - 'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', + 'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/commands' ); diff --git a/packages/components/src/lock-unlock.js b/packages/components/src/lock-unlock.js index 1525ece158072e..7749a249cd02ac 100644 --- a/packages/components/src/lock-unlock.js +++ b/packages/components/src/lock-unlock.js @@ -5,6 +5,6 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri export const { lock, unlock } = __dangerousOptInToUnstableAPIsOnlyForCoreModules( - 'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', + 'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/components' ); diff --git a/packages/core-commands/src/lock-unlock.js b/packages/core-commands/src/lock-unlock.js index 6f0712a8069fdd..de47c0eeb81552 100644 --- a/packages/core-commands/src/lock-unlock.js +++ b/packages/core-commands/src/lock-unlock.js @@ -5,6 +5,6 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri export const { lock, unlock } = __dangerousOptInToUnstableAPIsOnlyForCoreModules( - 'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', + 'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/core-commands' ); diff --git a/packages/core-data/src/private-apis.js b/packages/core-data/src/private-apis.js index 53f0dc2dfa133d..91bf30792c970a 100644 --- a/packages/core-data/src/private-apis.js +++ b/packages/core-data/src/private-apis.js @@ -5,6 +5,6 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri export const { lock, unlock } = __dangerousOptInToUnstableAPIsOnlyForCoreModules( - 'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', + 'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/core-data' ); diff --git a/packages/customize-widgets/src/lock-unlock.js b/packages/customize-widgets/src/lock-unlock.js index 01d57a2835d5d7..92ef5147b1713e 100644 --- a/packages/customize-widgets/src/lock-unlock.js +++ b/packages/customize-widgets/src/lock-unlock.js @@ -5,6 +5,6 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri export const { lock, unlock } = __dangerousOptInToUnstableAPIsOnlyForCoreModules( - 'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', + 'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/customize-widgets' ); diff --git a/packages/data/src/lock-unlock.js b/packages/data/src/lock-unlock.js index b5b1f9cbed5a56..99596d756f66e7 100644 --- a/packages/data/src/lock-unlock.js +++ b/packages/data/src/lock-unlock.js @@ -5,6 +5,6 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri export const { lock, unlock } = __dangerousOptInToUnstableAPIsOnlyForCoreModules( - 'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', + 'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/data' ); diff --git a/packages/dataviews/src/lock-unlock.ts b/packages/dataviews/src/lock-unlock.ts index 18318773cefefe..d1533da413cfc3 100644 --- a/packages/dataviews/src/lock-unlock.ts +++ b/packages/dataviews/src/lock-unlock.ts @@ -5,6 +5,6 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri export const { lock, unlock } = __dangerousOptInToUnstableAPIsOnlyForCoreModules( - 'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', + 'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/dataviews' ); diff --git a/packages/edit-post/src/lock-unlock.js b/packages/edit-post/src/lock-unlock.js index bf65b262d9f484..6ef97785cd0a67 100644 --- a/packages/edit-post/src/lock-unlock.js +++ b/packages/edit-post/src/lock-unlock.js @@ -5,6 +5,6 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri export const { lock, unlock } = __dangerousOptInToUnstableAPIsOnlyForCoreModules( - 'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', + 'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/edit-post' ); diff --git a/packages/edit-site/src/lock-unlock.js b/packages/edit-site/src/lock-unlock.js index 5c335db46b9d48..5d1a87670c52fb 100644 --- a/packages/edit-site/src/lock-unlock.js +++ b/packages/edit-site/src/lock-unlock.js @@ -5,6 +5,6 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri export const { lock, unlock } = __dangerousOptInToUnstableAPIsOnlyForCoreModules( - 'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', + 'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/edit-site' ); diff --git a/packages/edit-widgets/src/lock-unlock.js b/packages/edit-widgets/src/lock-unlock.js index 003e53788068c0..1c401a0ccd4dab 100644 --- a/packages/edit-widgets/src/lock-unlock.js +++ b/packages/edit-widgets/src/lock-unlock.js @@ -5,6 +5,6 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri export const { lock, unlock } = __dangerousOptInToUnstableAPIsOnlyForCoreModules( - 'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', + 'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/edit-widgets' ); diff --git a/packages/editor/src/lock-unlock.js b/packages/editor/src/lock-unlock.js index 12df6f4711b23e..a507ffe95e11d4 100644 --- a/packages/editor/src/lock-unlock.js +++ b/packages/editor/src/lock-unlock.js @@ -4,6 +4,6 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis'; export const { lock, unlock } = __dangerousOptInToUnstableAPIsOnlyForCoreModules( - 'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', + 'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/editor' ); diff --git a/packages/format-library/src/lock-unlock.js b/packages/format-library/src/lock-unlock.js index f7512caa4b746f..e0effa2b829ee0 100644 --- a/packages/format-library/src/lock-unlock.js +++ b/packages/format-library/src/lock-unlock.js @@ -5,6 +5,6 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri export const { lock, unlock } = __dangerousOptInToUnstableAPIsOnlyForCoreModules( - 'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', + 'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/format-library' ); diff --git a/packages/interface/lock-unlock.js b/packages/interface/lock-unlock.js index b6e29bb71c7c02..1e5bb39ed18c6d 100644 --- a/packages/interface/lock-unlock.js +++ b/packages/interface/lock-unlock.js @@ -5,6 +5,6 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri export const { lock, unlock } = __dangerousOptInToUnstableAPIsOnlyForCoreModules( - 'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', + 'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/interface' ); diff --git a/packages/patterns/src/lock-unlock.js b/packages/patterns/src/lock-unlock.js index d727871d71439a..2e9ca804023edc 100644 --- a/packages/patterns/src/lock-unlock.js +++ b/packages/patterns/src/lock-unlock.js @@ -4,6 +4,6 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis'; export const { lock, unlock } = __dangerousOptInToUnstableAPIsOnlyForCoreModules( - 'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', + 'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/patterns' ); diff --git a/packages/preferences/src/lock-unlock.js b/packages/preferences/src/lock-unlock.js index 981f244881ed03..9556c83135e581 100644 --- a/packages/preferences/src/lock-unlock.js +++ b/packages/preferences/src/lock-unlock.js @@ -4,6 +4,6 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis'; export const { lock, unlock } = __dangerousOptInToUnstableAPIsOnlyForCoreModules( - 'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', + 'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/preferences' ); diff --git a/packages/private-apis/README.md b/packages/private-apis/README.md index 163ef630d0febc..b95fb0d7bd3eba 100644 --- a/packages/private-apis/README.md +++ b/packages/private-apis/README.md @@ -12,7 +12,7 @@ Every `@wordpress` package wanting to privately access or expose experimental AP import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis'; export const { lock, unlock } = __dangerousOptInToUnstableAPIsOnlyForCoreModules( - 'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', + 'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/block-editor' // Name of the package calling __dangerousOptInToUnstableAPIsOnlyForCoreModules, // (not the name of the package whose APIs you want to access) ); @@ -22,7 +22,7 @@ Each package may only opt in once. The function name communicates that plugins a The function will throw an error if the following conditions are not met: -1. The first argument must exactly match the required consent string: `'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.'`. +1. The first argument must exactly match the required consent string: `'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.'`. 2. The second argument must be a known `@wordpress` package that hasn't yet opted into `@wordpress/private-apis` Once the opt-in is complete, the obtained `lock()` and `unlock()` utilities enable hiding `__experimental` APIs from the naked eye: @@ -120,3 +120,4 @@ The final string in this list is the current version. 1. I know using unstable features means my plugin or theme will inevitably break on the next WordPress release. 2. I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress. +3. I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress. diff --git a/packages/private-apis/src/implementation.js b/packages/private-apis/src/implementation.js index bea820226fe332..c268e46f669cbf 100644 --- a/packages/private-apis/src/implementation.js +++ b/packages/private-apis/src/implementation.js @@ -56,7 +56,7 @@ const registeredPrivateApis = []; * CHANGE MAY OCCUR IN EITHER A MAJOR OR MINOR RELEASE. */ const requiredConsent = - 'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.'; + 'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.'; /** @type {boolean} */ let allowReRegistration; diff --git a/packages/private-apis/src/test/index.js b/packages/private-apis/src/test/index.js index d91f7d3bcdafe1..51d1b6a3afba00 100644 --- a/packages/private-apis/src/test/index.js +++ b/packages/private-apis/src/test/index.js @@ -16,7 +16,7 @@ beforeEach( () => { } ); const requiredConsent = - 'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.'; + 'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.'; describe( '__dangerousOptInToUnstableAPIsOnlyForCoreModules', () => { it( 'Should require a consent string', () => { diff --git a/packages/reusable-blocks/src/lock-unlock.js b/packages/reusable-blocks/src/lock-unlock.js index c0bc2d1529f7d9..4f637985155805 100644 --- a/packages/reusable-blocks/src/lock-unlock.js +++ b/packages/reusable-blocks/src/lock-unlock.js @@ -4,6 +4,6 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis'; export const { unlock } = __dangerousOptInToUnstableAPIsOnlyForCoreModules( - 'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', + 'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/reusable-blocks' ); diff --git a/packages/router/src/lock-unlock.js b/packages/router/src/lock-unlock.js index d7f4e92b4a542d..e7323bd0270ea2 100644 --- a/packages/router/src/lock-unlock.js +++ b/packages/router/src/lock-unlock.js @@ -5,6 +5,6 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri export const { lock, unlock } = __dangerousOptInToUnstableAPIsOnlyForCoreModules( - 'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', + 'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/router' );