Skip to content
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

[Webfonts] Use Core's _deprecated_argument() for deprecating data structures #47125

Merged
merged 3 commits into from
Jan 23, 2023

Conversation

hellofromtonya
Copy link
Contributor

@hellofromtonya hellofromtonya commented Jan 12, 2023

Fixes #47123.

What?

Use Core's _deprecated_argument() instead of trigger_error() for deprecating data structures. This is similar to how deprecated functions in the API's BC layer uses Core's _deprecated_function().

Why?

To avoid filling server logs on production sites. _deprecated_argument() is Core's standard and will only display the deprecation when WP_Debug is on.

How?

See above.

Testing Instructions

With WP_Debug off:

  1. Active TT3.
  2. Active the Gutenberg plugin.
  3. Install this testing plugin which uses Jetpack's Google Font Provider and deprecated functionality and data structures.
  4. Run the site.
  5. Open the server logs. > Notice there no deprecations.

Now turn on WP_Debug:
Repeat steps 1-5. Notice there are deprecations.

Testing Instructions for Keyboard

Screenshots or screencast

@hellofromtonya hellofromtonya changed the title [Webfonts] Use Core's _deprecated_function() for deprecating data structures [Webfonts] Use Core's _deprecated_argument() for deprecating data structures Jan 12, 2023
Copy link
Member

@aristath aristath left a comment

Choose a reason for hiding this comment

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

Code looks good, but the PR should be rebased since the file has been moved

Copy link
Member

@fullofcaffeine fullofcaffeine left a comment

Choose a reason for hiding this comment

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

This tests well! 🐑

@hellofromtonya hellofromtonya force-pushed the try/fonts-api/use-core-deprecated-functions branch from 141b1f4 to 19d0f57 Compare January 23, 2023 14:09
@hellofromtonya
Copy link
Contributor Author

Rebased to trunk (for the API renaming) ✅

@hellofromtonya hellofromtonya added the [Type] Bug An existing feature does not function as intended label Jan 23, 2023
@hellofromtonya hellofromtonya removed the request for review from spacedmonkey January 23, 2023 14:33
@github-actions
Copy link

Flaky tests detected in 19d0f57.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/3987197064
📝 Reported issues:

@hellofromtonya
Copy link
Contributor Author

The failure on the "React Native E2E Tests (Android)" are unrelated to this PR. Restarting that CI Job for the third time. But it fails again, will ignore and merge this PR.

@hellofromtonya hellofromtonya merged commit 70ba921 into trunk Jan 23, 2023
@hellofromtonya hellofromtonya deleted the try/fonts-api/use-core-deprecated-functions branch January 23, 2023 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Webfonts] Deprecations for data structural changes filling server logs
3 participants