Skip to content

Deprecate data-wp-ignore directive with warning message #70945

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 4 commits into from
Jul 29, 2025

Conversation

Sahil1617
Copy link
Contributor

@Sahil1617 Sahil1617 commented Jul 28, 2025

What?

Closes #70881

This PR adds a deprecation warning to the data-wp-ignore directive. The directive is being deprecated due to issues with context inheritance and navigation handling, and is likely to be removed in a future release.

Why?

The data-wp-ignore directive breaks context inheritance and complicates client-side navigation. While it's designed to prevent hydration of a specific region, it introduces bugs in the current implementation. The deprecation warning informs developers early.

How?

Added a warn() call inside the directive to log a deprecation message:

warn(
  'The "data-wp-ignore" directive is deprecated and will be removed in a future WordPress release.'
);

Testing Instructions

  1. Start the Gutenberg development environment.
  2. Use or simulate a block/component using data-wp-ignore.
  3. Open browser console.
  4. You should see the warning message:
    The "data-wp-ignore" directive is deprecated and will be removed in a future WordPress release.

Screenshots

Before
Screenshot 2025-07-28 222211

After
code

Copy link

github-actions bot commented Jul 28, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Sahil1617 <sahiljadhav1617@git.wordpress.org>
Co-authored-by: DAreRodz <darerodz@git.wordpress.org>
Co-authored-by: USERSATOSHI <tusharbharti@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Jul 28, 2025
Copy link

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @Sahil1617! In case you missed it, we'd love to have you join us in our Slack community.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@Sahil1617
Copy link
Contributor Author

Hi! 👋

Could someone from the team please help add the appropriate [Type] label?
This PR adds a deprecation warning to data-wp-ignore, so I believe [Type] Code Quality or [Type] Developer Documentation would be suitable.

Thanks!

@USERSATOSHI
Copy link
Contributor

Hi @Sahil1617, I think the PR has marked wrong issue.
As I believe, the issue this PR is handling is #70881 and not #70880.

@Sahil1617
Copy link
Contributor Author

Hi @USERSATOSHI
Thank you for pointing that out! You're absolutely right — this PR is addressing issue #70881, not #70880.
I'll update the PR description accordingly to reflect the correct issue.

Thanks again for the catch!

@DAreRodz DAreRodz added [Type] Enhancement A suggestion for improvement. [Feature] Interactivity API API to add frontend interactivity to blocks. [Packages] Interactivity /packages/interactivity labels Jul 29, 2025
Co-authored-by: David Arenas <darensr@gmail.com>
@DAreRodz
Copy link
Contributor

@Sahil1617, could you also add an entry in the CHANGELOG.md file of the Interactivity API package? 🙏

You can take a look at the docs if you don't know how to do so.

@Sahil1617
Copy link
Contributor Author

Hi @DAreRodz,
I've added the CHANGELOG.md entry under the ## Unreleased section as requested ✅
Let me know if any other changes are needed. Thanks again!

Copy link
Contributor

@DAreRodz DAreRodz left a comment

Choose a reason for hiding this comment

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

Tested and works fine. Thanks @Sahil1617! 🙂

@DAreRodz DAreRodz merged commit fbd2bd4 into WordPress:trunk Jul 29, 2025
59 checks passed
@github-actions github-actions bot added this to the Gutenberg 21.4 milestone Jul 29, 2025
adamsilverstein pushed a commit to adamsilverstein/gutenberg that referenced this pull request Jul 31, 2025
)

* Deprecate data-wp-ignore directive with warning message

* Update packages/interactivity/src/directives.tsx

Co-authored-by: David Arenas <darensr@gmail.com>

* Add deprecation note for data-wp-ignore directive in CHANGELOG

---------

Co-authored-by: Sahil1617 <sahiljadhav1617@git.wordpress.org>
Co-authored-by: DAreRodz <darerodz@git.wordpress.org>
Co-authored-by: USERSATOSHI <tusharbharti@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Interactivity API API to add frontend interactivity to blocks. First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Packages] Interactivity /packages/interactivity [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

iAPI: Deprecate data-wp-ignore
3 participants