-
Notifications
You must be signed in to change notification settings - Fork 814
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] Upgrade the Google Fonts Provider to use the new Fonts API #28063
Comments
Thanks for the heads up! This is currently in progress in #28054. |
Awesome! Thanks @jeherve 🎉 Once the rename is merged, I'll pop back with what else needs to change. |
Thanks! Similar follow up need in Blockbase theme once this merges Automattic/themes#6794 (comment) |
API renaming coming up as well potentially in GB 14.9; WordPress/gutenberg#46749 Renaming will be great as it'll allow us test if the array format should follow new or old way just by checking for Class existance; if ( class_exists( 'WP_Fonts' ) ) {
// New
} else if ( class_exists( 'WP_Webfonts' ) ) {
/// Old
} |
Heads up: The API renaming PR merged today. Unsure if it will be released in Gutenberg 15.0 or 15.1. For example, The original function and class names moved to the BC Layer and are deprecated. This BC Layer keeps the deprecated code functioning with deprecation notices, but will not be backported into WP Core. The redesign of the API's consumable public functionality and data structures should now be complete. What else might change?
|
It is not. @cometgrrl Are API changes considered part of maintenance or bug reports only? |
@obenland While we'd like to focus primarily on bugs, since this is something timely that needs to be addressed, we can take it. |
Impacted plugin
Jetpack
What
Upgrade Google Fonts Provider for the new Fonts API
How
The original Webfonts API being developed in Gutenberg has changed and will impact the Google Fonts Provider module/package in Jetpack:
New Architecture:
The API's architecture has been redesigned to extend
WP_Dependencies
. The new design changed the registration data structures and available public functionality. (See commit 87c738e and PR 43492. Scheduled to release Gutenberg 14.9.What changed?
jetpack/projects/plugins/jetpack/modules/google-fonts.php
Lines 112 to 131 in a3b8bf9
changes to:
WP_Webfonts
class is deprecated. UseWP_Web_Fonts
instead.WP_Webfonts::get_font_slug()
is deprecated.$wp_webfonts-> get_registered_webfonts()
is deprecated.The code in
Automattic\Jetpack\Fonts\Utils::is_font_family_registered()
is impacted:jetpack/projects/packages/google-fonts-provider/src/class-utils.php
Lines 46 to 56 in b313bd2
changes to:
API renamed
The API is in the process of being renamed, meaning all public functionality (functions, classes, methods will be affected). Likely won't release until Gutenberg 14.10.
What changed?
This change is WIP. Stay tuned.
Temporary BC Layer and deprecations
The new API includes a temporary backwards-compatible (BC) layer (that will not be backported to WordPress Core) that does work with current version of the Google Fonts Provider. This means Jetpack's module will still work but will throw deprecation notices.
The text was updated successfully, but these errors were encountered: