Skip to content

Consider renaming lib/compat PHP files and directories for evergreen overrides of core WordPress #38900

@andrewserong

Description

@andrewserong

What problem does this address?

Following on from a couple of comments on #38883 and related PRs.

One of the things that we've bumped into while making overrides to theme.json support in the lib/compat directory, is the potential confusion between which changes belong in the wordpress-5.9 and wordpress-6.0 directories (for backwards and forwards compatibility), and which overrides we'll need to maintain in perpetuity due to Gutenberg being the main place for development of global styles related features.

One way of looking at it is that the files in the lib/compat directory serve the following purposes:

  • Maintain backwards compatibility with the current + previous WordPress versions
  • Maintain compatibility with the current trunk of wordpress-develop
  • Maintain evergreen overrides for core WordPress, that should always point to Gutenberg functions / implementations, to preserve the development environment (and experimentation of features that might not make it to core) in Gutenberg

What is your proposed solution?

  1. Can we split out those evergreen overrides that we need to have to a separate directory, and add more documentation at the top of each file instructing how to use it?
  2. If there are any files that we should not modify when making changes, is it worth adding additional linting to prevent accidental changes?
  3. If we settle on a consistent layout that we'd like to go with (or if we have one already), is it worth us updating the backward-compatibility.md documentation to provide guidance on how we use this area?

The overall goal for this issue is to see what changes we can make to improve the developer experience on making updates to theme.json / global settings and styles, to hopefully make it easier for new contributors to contribute to or slot into development work in these areas.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Developer ExperienceIdeas about improving block and theme developer experienceGlobal StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.json[Type] Code QualityIssues or PRs that relate to code quality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions