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 API Architecture: Remove external access to internal-only functionality #41484

Closed
hellofromtonya opened this issue Jun 1, 2022 · 1 comment
Assignees
Projects

Comments

@hellofromtonya
Copy link
Contributor

Part of #41479.

Problem Statement

The current and some ongoing open work expose internal-only functionality through global private functions. Unlike private or protected methods, PHP does not support limiting functions for internal-only usage. Though documented in the function DocBlock as private, these global functions are not truly private, meaning each is publicly exposed.

Why is this problematic?
Anything in the global space is fully accessible internally (within Gutenberg and WordPress Core) and externally (for extenders). Changes can be a backwards-compatibility issue, especially given the API will be a WordPress Core backend API to support block and classic web font needs.

Scope

Explore removing external access to internal-only functionality by removing private global functions and replacing with abstractions.

Benefits / Goals

  • eliminate any future backwards-compatibility concerns when changes are needed (including function signatures, renaming, removing, return data or types, and internal workings)
  • future flexibility
  • reduction of future burden costs

Ways to Accomplish

Some potential ways to accomplish are:

@hellofromtonya
Copy link
Contributor Author

#50250 resolved architectural issues with 2 global functions. I don't see other opportunities for hiding public access to internal-only functionality. Therefore, I think this issue can be closed.

Fonts API automation moved this from In progress to Done May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

1 participant