Skip to content

Font Library: Add post types and low level APIs#6027

Closed
youknowriad wants to merge 13 commits into
WordPress:trunkfrom
youknowriad:add/font-library-apis
Closed

Font Library: Add post types and low level APIs#6027
youknowriad wants to merge 13 commits into
WordPress:trunkfrom
youknowriad:add/font-library-apis

Conversation

@youknowriad

Copy link
Copy Markdown
Contributor

This PR backports the font library post types and low level APIs to Core. This is the first step to include the font library entirely into Core. Once this merged, we'll open a PR with the necessary REST API controllers.

Trac ticket: https://core.trac.wordpress.org/ticket/59166

@github-actions

github-actions Bot commented Feb 5, 2024

Copy link
Copy Markdown

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.

Core SVN

If you're a Core Committer, use this list when committing to wordpress-develop in SVN:

Props: youknowriad, get_dave, grantmkin, swissspidy, hellofromtonya, mukesh27, mcsf.

GitHub Merge commits

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: youknowriad <youknowriad@git.wordpress.org>
Co-authored-by: getdave <get_dave@git.wordpress.org>
Co-authored-by: creativecoder <grantmkin@git.wordpress.org>
Co-authored-by: swissspidy <swissspidy@git.wordpress.org>
Co-authored-by: hellofromtonya <hellofromtonya@git.wordpress.org>
Co-authored-by: mukeshpanchal27 <mukesh27@git.wordpress.org>
Co-authored-by: mcsf <mcsf@git.wordpress.org>

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

Comment thread src/wp-includes/fonts/class-wp-font-library.php Outdated
@youknowriad youknowriad force-pushed the add/font-library-apis branch from b513974 to 2613c74 Compare February 5, 2024 09:47

@swissspidy swissspidy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This seems to reintroduce or ignore things that were previously already flagged in #5285.

Can we make sure that the feedback from there is respected?

Comment thread src/wp-includes/fonts/class-wp-font-library.php Outdated
Comment thread src/wp-includes/fonts/class-wp-font-library.php Outdated
Comment thread src/wp-includes/fonts/class-wp-font-library.php
Comment thread src/wp-includes/fonts/class-wp-font-library.php Outdated
@youknowriad youknowriad force-pushed the add/font-library-apis branch from 2d1d9b2 to 51bd927 Compare February 5, 2024 10:16
@getdave

getdave commented Feb 5, 2024

Copy link
Copy Markdown
Contributor

e2e tests are failing on await requestUtils.activatePlugin( 'gutenberg' );.

@github-actions

github-actions Bot commented Feb 5, 2024

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • The Plugin and Theme Directories cannot be accessed within Playground.
  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@youknowriad

Copy link
Copy Markdown
Contributor Author

@getdave Yes, that means this PR conflicts with the latest Gutenberg, it means we probably need to bring these changes to the latest Gutenberg version and do a patch release of Gutenberg before committing this PR to Core. But it doesn't prevent this PR from being reviewed properly.

@youknowriad

Copy link
Copy Markdown
Contributor Author

With the latest Gutenberg release, this PR passes all the tests now 🎉

Comment thread src/wp-includes/fonts/fonts.php Outdated
Comment thread src/wp-settings.php Outdated
Comment thread src/wp-includes/default-filters.php Outdated
Comment thread src/wp-includes/fonts/class-wp-font-collection.php Outdated

@mukeshpanchal27 mukeshpanchal27 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Lest some quick feedbacks.

Comment thread src/wp-includes/fonts.php Outdated
Comment thread src/wp-includes/fonts/class-wp-font-collection.php Outdated
Comment thread src/wp-includes/fonts/class-wp-font-library.php Outdated
Comment thread src/wp-includes/fonts/class-wp-font-library.php Outdated
*/
class Tests_Fonts_FontLibraryHooks extends WP_UnitTestCase {

public function test_deleting_font_family_deletes_child_font_faces() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Add @ticket annotation in all tests that are added for ticket.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi @mukeshpanchal27 👋

Per the handbook, the @ticket annotation is only for bugfixes:

@ticket – A custom WordPress annotation. Use @ticket 12345 to indicate that a test addresses the bug described in ticket #12345. Internally, @ticket annotations are translated to @group, so that you can limit test runs to those associated with a specific ticket: $ phpunit --group 12345.

The tests have already have @group annotations for allowing its test to be run separately.

Are you okay with not including the @ticket?

@getdave

getdave commented Feb 5, 2024

Copy link
Copy Markdown
Contributor

Note also some fixes will be coming in here as soon as WordPress/gutenberg#58675 is in Gutenberg.

Comment thread src/wp-includes/fonts/class-wp-font-library.php
Comment thread src/wp-includes/fonts/class-wp-font-library.php
Comment thread src/wp-includes/fonts/class-wp-font-collection.php

@mcsf mcsf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

My review consisted of minor things, and I don't want them to get in the way of what feels like a good PR. I don't love the WP_Font_Utils class, but we can refine that later.

@getdave

getdave commented Feb 5, 2024

Copy link
Copy Markdown
Contributor

I've applied the fixes from WordPress/gutenberg#58675.

Ideally should aim to do one final PR upstream in Gutenberg repo to resolve all outstanding review comments here.

Comment thread src/wp-includes/fonts.php Outdated
Comment thread src/wp-includes/fonts/class-wp-font-collection.php
@getdave

getdave commented Feb 5, 2024

Copy link
Copy Markdown
Contributor

More feedback being addressed in Gutenberg at WordPress/gutenberg#58691.

Comment thread src/wp-includes/fonts/class-wp-font-collection.php Outdated
Comment thread src/wp-includes/fonts/class-wp-font-library.php Outdated
@creativecoder

creativecoder commented Feb 5, 2024

Copy link
Copy Markdown

The updates from WordPress/gutenberg#58691, addressing changes requested in review comments here, have now been applied to this PR.

@hellofromtonya hellofromtonya left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

  • After @swissspidy flagged some feedback that was missed from the original Core PR, it was re-audited today. The missed feedback was addressed and needed changes resolved in 507f1d9

  • All feedback in this PR is addressed and, if required, code changes made. ✅

LGTM 👍

IMO it's ready for commit.

@youknowriad

Copy link
Copy Markdown
Contributor Author

Commit here https://core.trac.wordpress.org/changeset/57539
I'll be opening a follow-up PR with the REST controllers shortly.

@youknowriad youknowriad closed this Feb 6, 2024
@youknowriad youknowriad deleted the add/font-library-apis branch February 6, 2024 08:51
@youknowriad

Copy link
Copy Markdown
Contributor Author

Follow-up PR here #6034

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.

7 participants