Skip to content

Editor: Fix console warnings #1748

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 30, 2025
Merged

Editor: Fix console warnings #1748

merged 2 commits into from
May 30, 2025

Conversation

obenland
Copy link
Member

Fixes warnings like:

Bottom margin styles for wp.components.RangeControl is deprecated since version 6.7 and will be removed in version 7.0. Note: Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version.
36px default size for wp.components.RangeControl is deprecated since version 6.8 and will be removed in version 7.1. Note: Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version.

Proposed changes:

  • Sets __next* props on editor controls for forwards compatibility.
  • Adds block-editor-block-inspector class on PluginDocumentSettingPanel to define margins between controls.

Other information:

  • Have you written new tests for your changes, if applicable?

Testing instructions:

  • Open a new or existing post in the Editor.
  • Open the Developer Console and make sure there are no Control-related warnings.

Changelog entry

  • Automatically create a changelog entry from the details below.
Changelog Entry Details

Significance

  • Patch
  • Minor
  • Major

Type

  • Added - for new features
  • Changed - for changes in existing functionality
  • Deprecated - for soon-to-be removed features
  • Removed - for now removed features
  • Fixed - for any bug fixes
  • Security - in case of vulnerabilities

Message

Added forward compatibility for Editor Controls, fixing deprecated warnings in the Editor.

@obenland obenland self-assigned this May 29, 2025
@obenland obenland requested a review from Copilot May 29, 2025 15:30
@obenland obenland requested a review from pfefferle May 29, 2025 15:30
@github-actions github-actions bot added [Block] Post settings [Focus] Editor Changes to the ActivityPub experience in the block editor labels May 29, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes console warnings caused by deprecated styling and size properties in the editor’s components by enabling forward compatibility.

  • Adds the block-editor-block-inspector class on PluginDocumentSettingPanel to standardize margins.
  • Applies __next40pxDefaultSize and __nextHasNoMarginBottom props to controls to opt into new styling defaults.
  • Updates build artifacts and asset version to reflect these changes.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/editor-plugin/plugin.js Updated PluginDocumentSettingPanel and applied __next* props to controls.
build/editor-plugin/plugin.js Bundled changes reflecting the new __next* props in the production bundle.
build/editor-plugin/plugin.asset.php Updated asset version for dependency management.
Comments suppressed due to low confidence (1)

src/editor-plugin/plugin.js:80

  • The __next40pxDefaultSize and __nextHasNoMarginBottom props are applied to TextControl, yet the commit message and deprecation warnings reference RangeControl. Please verify if these props are intentionally applied to TextControl or if they should be limited to RangeControl only.
__next40pxDefaultSize

@obenland obenland merged commit e771890 into trunk May 30, 2025
11 checks passed
@obenland obenland deleted the update/editor-controls branch May 30, 2025 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Post settings [Focus] Editor Changes to the ActivityPub experience in the block editor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants