Skip to content

fix: resolve WP 7.0 / Gutenberg editor deprecations#2876

Open
Soare-Robert-Daniel wants to merge 1 commit into
developmentfrom
fix/deprecations
Open

fix: resolve WP 7.0 / Gutenberg editor deprecations#2876
Soare-Robert-Daniel wants to merge 1 commit into
developmentfrom
fix/deprecations

Conversation

@Soare-Robert-Daniel

Copy link
Copy Markdown
Contributor

Summary

Resolves the editor-console deprecation warnings that surface under WP 7.0 / Gutenberg, across both the lite and pro bundles. Each fix targets the documented stable replacement; behavior is preserved.

Deprecation Since / removal Fix
Block API v2 (captcha) 6.9 bump to apiVersion: 3
wp.editPost.PluginSidebar / PluginSidebarMoreMenuItem 6.6 import from @wordpress/editor
wp.data.registerGenericStore (otter-store) 5.9 createReduxStore + register
core/preferences hiddenBlockTypes namespace 6.5 read/write under the core scope
__experimentalGetPreviewDeviceType (core/edit-post) 6.5 core/editor getDeviceType/setDeviceType
Custom components as toolbar controls 5.6 ToolbarButton; data-toolbar-item on the Design Library header button
core/edit-post interface scope 6.6 enableComplementaryArea( 'core', … )
wp.date.__experimentalGetSettings 6.1 getSettings
RichText onSplit (icon-list item) 6.4 block.json supports.splitting
FormFileUpload 36px default 6.8 / 7.1 __next40pxDefaultSize
moment malformed timezone offset (countdown) fix getTimezone() to emit a valid ISO ±HH:MM offset

Deferred (documented, intentional)

  • advanced-heading onSplit — core supports.splitting converts a heading's split tail to a plain core/paragraph, dropping all heading styling. Left as-is to avoid a real regression; needs a style-preserving transform.
  • TextControl 40px migration — broad, plugin-wide; tracked separately. Has a hard 7.1 removal.

Test plan

  • Unit (helper-functions-timezone.test.ts): getTimezone() returns a valid ISO 8601 offset for UTC, whole, negative, and fractional offsets — genuine red (+0:0) → green.
  • e2e (icon-list.spec.js): pressing Enter mid-text splits an item into two same-type icon-list items with the content divided at the caret — guards the onSplitsupports.splitting migration.
  • Full unit suite: 169 passed. Affected e2e specs (icon-list, countdown, section, sharing-icons, heading, editor-block-tools, global-memory, button-group, api-version-v3): all passing. phpstan: no errors. lint: 0 errors.
  • Verified via a browser console scan that inserts all Otter blocks: unique deprecations dropped from 7 → 2 (the two deferred items above).

🤖 Generated with Claude Code

Editor console deprecations surfaced under WP 7.0 / Gutenberg, fixed across
lite and pro:

- captcha: Block API v2 -> v3 (6.9)
- options sidebar: import PluginSidebar/PluginSidebarMoreMenuItem from
  @wordpress/editor (6.6)
- otter-store: registerGenericStore -> createReduxStore + register (5.9)
- preferences: read/write hiddenBlockTypes under the 'core' scope (6.5)
- device type: core/editor getDeviceType/setDeviceType instead of
  core/edit-post __experimentalGetPreviewDeviceType (6.5)
- toolbar controls: use ToolbarButton; mark the Design Library header button
  as a toolbar item (5.6)
- interface scope: enableComplementaryArea( 'core', ... ) not
  'core/edit-post' (6.6)
- date: getSettings instead of __experimentalGetSettings (6.1)
- icon-list item: RichText onSplit -> block.json supports.splitting (6.4)
- FormFileUpload: opt into __next40pxDefaultSize (6.8 / removal 7.1)
- countdown: fix malformed timezone offset (+0:0) fed into moment(), which
  forced a fallback to the JS Date constructor

Deferred, documented: advanced-heading onSplit (core splitting would convert
the styled heading tail to a plain paragraph) and the broad TextControl 40px
migration (tracked separately, removal in 7.1).

Tests:
- unit: getTimezone returns a valid ISO 8601 offset (red->green)
- e2e: icon-list splits into same-type items on Enter (guards the
  onSplit -> supports.splitting migration)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@pirate-bot

Copy link
Copy Markdown
Contributor

Bundle Size Diff

Package Old Size New Size Diff
Animations 178.27 KB 178.27 KB 0 B (0.00%)
Blocks 1.52 MB 1.52 MB -19 B (-0.00%)
CSS 7.87 KB 7.83 KB -34 B (-0.42%)
Dashboard 111.06 KB 111.05 KB -13 B (-0.01%)
Onboarding 68.14 KB 68.14 KB 0 B (0.00%)
Export Import 4.7 KB 4.73 KB 25 B (0.52%)
Pro 328.43 KB 328.27 KB -166 B (-0.05%)

@pirate-bot

Copy link
Copy Markdown
Contributor

Plugin build for 2b2ed70 is ready 🛎️!

@pirate-bot

Copy link
Copy Markdown
Contributor

E2E Tests

Playwright Test Status: See serial and parallel matrix jobs

Performance Results serverResponse: {"q25":458.3,"q50":490.8,"q75":498.3,"cnt":10}, firstPaint: {"q25":581.5,"q50":637.75,"q75":760.7,"cnt":10}, domContentLoaded: {"q25":3262.5,"q50":3305.1,"q75":3328.4,"cnt":10}, loaded: {"q25":3264.6,"q50":3306.95,"q75":3330.5,"cnt":10}, firstContentfulPaint: {"q25":3805.5,"q50":3843.1,"q75":3868.7,"cnt":10}, firstBlock: {"q25":13499.3,"q50":13578.15,"q75":13636,"cnt":10}, type: {"q25":20.98,"q50":22.15,"q75":24.02,"cnt":10}, typeWithoutInspector: {"q25":17.6,"q50":19.54,"q75":20.27,"cnt":10}, typeWithTopToolbar: {"q25":26.57,"q50":27.91,"q75":30.3,"cnt":10}, typeContainer: {"q25":13.12,"q50":13.53,"q75":16.46,"cnt":10}, focus: {"q25":104.23,"q50":105.86,"q75":111.92,"cnt":10}, inserterOpen: {"q25":37.58,"q50":38.4,"q75":39.57,"cnt":10}, inserterSearch: {"q25":12.41,"q50":12.44,"q75":12.64,"cnt":10}, inserterHover: {"q25":4.7,"q50":4.88,"q75":5.32,"cnt":20}, loadPatterns: {"q25":1487.46,"q50":1503.25,"q75":1622.37,"cnt":10}, listViewOpen: {"q25":207.21,"q50":212.53,"q75":226.28,"cnt":10}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants