Skip to content

Commit

Permalink
Update consent string for using private APIs.
Browse files Browse the repository at this point in the history
  • Loading branch information
peterwilsoncc committed Oct 10, 2023
1 parent 6db6ffc commit 99725b2
Show file tree
Hide file tree
Showing 20 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion docs/contributors/code/coding-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 plugin or theme will inevitably break on the next WordPress release.',
'I know using unstable features means my theme or plugin will inevitably 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)
);
Expand Down
2 changes: 1 addition & 1 deletion packages/block-editor/src/lock-unlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri

export const { lock, unlock } =
__dangerousOptInToUnstableAPIsOnlyForCoreModules(
'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.',
'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.',
'@wordpress/block-editor'
);
2 changes: 1 addition & 1 deletion packages/block-library/src/lock-unlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri

export const { lock, unlock } =
__dangerousOptInToUnstableAPIsOnlyForCoreModules(
'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.',
'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.',
'@wordpress/block-library'
);
2 changes: 1 addition & 1 deletion packages/blocks/src/lock-unlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri

export const { lock, unlock } =
__dangerousOptInToUnstableAPIsOnlyForCoreModules(
'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.',
'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.',
'@wordpress/blocks'
);
2 changes: 1 addition & 1 deletion packages/commands/src/lock-unlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri

export const { lock, unlock } =
__dangerousOptInToUnstableAPIsOnlyForCoreModules(
'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.',
'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.',
'@wordpress/commands'
);
2 changes: 1 addition & 1 deletion packages/components/src/private-apis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import Theme from './theme';

export const { lock, unlock } =
__dangerousOptInToUnstableAPIsOnlyForCoreModules(
'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.',
'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.',
'@wordpress/components'
);

Expand Down
2 changes: 1 addition & 1 deletion packages/core-commands/src/lock-unlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri

export const { lock, unlock } =
__dangerousOptInToUnstableAPIsOnlyForCoreModules(
'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.',
'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.',
'@wordpress/core-commands'
);
2 changes: 1 addition & 1 deletion packages/core-data/src/private-apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri

export const { lock, unlock } =
__dangerousOptInToUnstableAPIsOnlyForCoreModules(
'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.',
'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.',
'@wordpress/core-data'
);
2 changes: 1 addition & 1 deletion packages/customize-widgets/src/lock-unlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri

export const { lock, unlock } =
__dangerousOptInToUnstableAPIsOnlyForCoreModules(
'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.',
'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.',
'@wordpress/customize-widgets'
);
2 changes: 1 addition & 1 deletion packages/data/src/lock-unlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri

export const { lock, unlock } =
__dangerousOptInToUnstableAPIsOnlyForCoreModules(
'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.',
'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.',
'@wordpress/data'
);
2 changes: 1 addition & 1 deletion packages/edit-post/src/lock-unlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri

export const { lock, unlock } =
__dangerousOptInToUnstableAPIsOnlyForCoreModules(
'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.',
'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.',
'@wordpress/edit-post'
);
2 changes: 1 addition & 1 deletion packages/edit-site/src/lock-unlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri

export const { lock, unlock } =
__dangerousOptInToUnstableAPIsOnlyForCoreModules(
'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.',
'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.',
'@wordpress/edit-site'
);
2 changes: 1 addition & 1 deletion packages/edit-widgets/src/lock-unlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri

export const { lock, unlock } =
__dangerousOptInToUnstableAPIsOnlyForCoreModules(
'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.',
'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.',
'@wordpress/edit-widgets'
);
2 changes: 1 addition & 1 deletion packages/editor/src/lock-unlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';
export const { lock, unlock } =
__dangerousOptInToUnstableAPIsOnlyForCoreModules(
'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.',
'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.',
'@wordpress/editor'
);
2 changes: 1 addition & 1 deletion packages/patterns/src/lock-unlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';
export const { lock, unlock } =
__dangerousOptInToUnstableAPIsOnlyForCoreModules(
'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.',
'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.',
'@wordpress/patterns'
);
4 changes: 2 additions & 2 deletions packages/private-apis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 plugin or theme will inevitably break on the next WordPress release.',
'I know using unstable features means my theme or plugin will inevitably 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)
);
Expand All @@ -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 plugin or theme will inevitably break on the next WordPress release.'`.
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.'`.
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:
Expand Down
2 changes: 1 addition & 1 deletion packages/private-apis/src/implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const registeredPrivateApis = [];
* CHANGE MAY OCCUR IN EITHER A MAJOR OR MINOR RELEASE.
*/
const requiredConsent =
'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.';
'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.';

/** @type {boolean} */
let allowReRegistration;
Expand Down
2 changes: 1 addition & 1 deletion packages/private-apis/src/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ beforeEach( () => {
} );

const requiredConsent =
'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.';
'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.';

describe( '__dangerousOptInToUnstableAPIsOnlyForCoreModules', () => {
it( 'Should require a consent string', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/reusable-blocks/src/lock-unlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';

export const { unlock } = __dangerousOptInToUnstableAPIsOnlyForCoreModules(
'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.',
'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.',
'@wordpress/reusable-blocks'
);
2 changes: 1 addition & 1 deletion packages/router/src/lock-unlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri

export const { lock, unlock } =
__dangerousOptInToUnstableAPIsOnlyForCoreModules(
'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.',
'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.',
'@wordpress/router'
);

0 comments on commit 99725b2

Please sign in to comment.