From 6964b6e3d7a2fd9507a6d509d26845efe71478ce Mon Sep 17 00:00:00 2001 From: Sainath Poojary Date: Mon, 19 Oct 2026 19:00:25 +0530 Subject: [PATCH 1/4] Block Editor: Pass hint instead of note to deprecated in useSetting --- packages/block-editor/src/components/use-settings/index.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/block-editor/src/components/use-settings/index.ts b/packages/block-editor/src/components/use-settings/index.ts index 1f23f524e926cf..9307c0fb333bc3 100644 --- a/packages/block-editor/src/components/use-settings/index.ts +++ b/packages/block-editor/src/components/use-settings/index.ts @@ -48,8 +48,7 @@ export function useSetting( path: string ) { deprecated( 'wp.blockEditor.useSetting', { since: '6.5', alternative: 'wp.blockEditor.useSettings', - // @ts-expect-error `deprecated` has no `note` option, so this is ignored. - note: 'The new useSettings function can retrieve multiple settings at once, with better performance.', + hint: 'The new useSettings function can retrieve multiple settings at once, with better performance.', } ); const [ value ] = useSettings( path ); From 6db6693519db01b59ee9776594b1d3938d7e6080 Mon Sep 17 00:00:00 2001 From: Sainath Poojary Date: Mon, 19 Oct 2026 19:00:47 +0530 Subject: [PATCH 2/4] Block Editor: Add unit test for useSetting deprecation warning --- .../use-settings/test/index.jsdom.test.tsx | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 packages/block-editor/src/components/use-settings/test/index.jsdom.test.tsx diff --git a/packages/block-editor/src/components/use-settings/test/index.jsdom.test.tsx b/packages/block-editor/src/components/use-settings/test/index.jsdom.test.tsx new file mode 100644 index 00000000000000..c1cd29e47f592d --- /dev/null +++ b/packages/block-editor/src/components/use-settings/test/index.jsdom.test.tsx @@ -0,0 +1,33 @@ +import { describe, expect, it } from 'vitest'; +import { renderHook } from '@testing-library/react'; +import { createRegistry, RegistryProvider } from '@wordpress/data'; +import { useSetting } from '../'; +import { store as blockEditorStore } from '../../../store'; + +describe( 'useSetting', () => { + it( 'includes the migration hint in its deprecation warning', () => { + const registry = createRegistry(); + registry.register( blockEditorStore ); + registry.dispatch( blockEditorStore ).updateSettings( { + __experimentalFeatures: { + typography: { dropCap: false }, + }, + } ); + + const { result } = renderHook( + () => useSetting( 'typography.dropCap' ), + { + wrapper: ( { children } ) => ( + + { children } + + ), + } + ); + + expect( result.current ).toBe( false ); + expect( console ).toHaveWarnedWith( + 'wp.blockEditor.useSetting is deprecated since version 6.5. Please use wp.blockEditor.useSettings instead. Note: The new useSettings function can retrieve multiple settings at once, with better performance.' + ); + } ); +} ); From 1015c36cd51b0c02a1d2c0305366bf513054d763 Mon Sep 17 00:00:00 2001 From: Sainath Poojary Date: Mon, 19 Oct 2026 19:06:15 +0530 Subject: [PATCH 3/4] Block Editor: Add Changelog entry --- packages/block-editor/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/block-editor/CHANGELOG.md b/packages/block-editor/CHANGELOG.md index e34379af866718..68ccb641be5c74 100644 --- a/packages/block-editor/CHANGELOG.md +++ b/packages/block-editor/CHANGELOG.md @@ -27,6 +27,7 @@ ### Bug Fixes +- Block Editor: Include migration hint in useSetting deprecation warning ([#85100](https://github.com/WordPress/gutenberg/pull/85100)). - List View: Fix the drag-and-drop nesting gesture over an item without children ([#84856](https://github.com/WordPress/gutenberg/pull/84856)). - Writing Flow: Preserve rich text selection on Shift+click within the same block ([#84579](https://github.com/WordPress/gutenberg/pull/84579)). - List View: Show the appender when the container is contentOnly ([#84713](https://github.com/WordPress/gutenberg/pull/84713)). From 3a146e48fa7153eba32fad606b11f0652eef2eb5 Mon Sep 17 00:00:00 2001 From: Sainath Poojary Date: Mon, 19 Oct 2026 19:14:51 +0530 Subject: [PATCH 4/4] Block Editor: Remove redundant deprecation warning test --- .../use-settings/test/index.jsdom.test.tsx | 33 ------------------- 1 file changed, 33 deletions(-) delete mode 100644 packages/block-editor/src/components/use-settings/test/index.jsdom.test.tsx diff --git a/packages/block-editor/src/components/use-settings/test/index.jsdom.test.tsx b/packages/block-editor/src/components/use-settings/test/index.jsdom.test.tsx deleted file mode 100644 index c1cd29e47f592d..00000000000000 --- a/packages/block-editor/src/components/use-settings/test/index.jsdom.test.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import { describe, expect, it } from 'vitest'; -import { renderHook } from '@testing-library/react'; -import { createRegistry, RegistryProvider } from '@wordpress/data'; -import { useSetting } from '../'; -import { store as blockEditorStore } from '../../../store'; - -describe( 'useSetting', () => { - it( 'includes the migration hint in its deprecation warning', () => { - const registry = createRegistry(); - registry.register( blockEditorStore ); - registry.dispatch( blockEditorStore ).updateSettings( { - __experimentalFeatures: { - typography: { dropCap: false }, - }, - } ); - - const { result } = renderHook( - () => useSetting( 'typography.dropCap' ), - { - wrapper: ( { children } ) => ( - - { children } - - ), - } - ); - - expect( result.current ).toBe( false ); - expect( console ).toHaveWarnedWith( - 'wp.blockEditor.useSetting is deprecated since version 6.5. Please use wp.blockEditor.useSettings instead. Note: The new useSettings function can retrieve multiple settings at once, with better performance.' - ); - } ); -} );