Skip to content

Upgrade deprecated order-none to order-0 #18126

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

Merged
merged 7 commits into from
May 23, 2025

Conversation

RobinMalfait
Copy link
Member

This PR adds an initial version for deprecated utilities. Right now it's hardcoded to just the order-none utility.

This means that order-0 and order-[0] will not be migrated to order-none anymore. We did that automatically because we prefer named utilities over bare values and arbitrary values.

With this PR, order-none is ignored.

Similarly, order-none will be migrated to order-0 instead (defined in a separate migration for deprecated values). Made it a new migration instead of using the legacy migration because there all utilities still exist, but are defined differently (e.g.: shadow, shadow-sm, shadow-xs).

This PR is also an initial version, it doesn't add any form of deprecated flag or feature on a per-utility implementation basis. This therefor has the side effect that if you have a custom order-none defined, that it will also be ignored during migrations.

Test plan

  1. Added tests to ensure the order-0 is not migrated to order-none
  2. Added tests to ensure order-none is migrated to order-0 (if it's safe to do so, the signature is still computed to ensure the output is the same).
  3. Ran this on the Tailwind Plus codebase and ensured that order-0 is not migrated to order-none and that order-none is migrated to order-0.

- Added tests to make sure that `order-0` is not migrated to
  `order-none` because it is deprecated (aka, `order-none` is ignored).
- Added tests to ensure that `order-none` is migrated to `order-0`
  because `order-none` is deprecated.
- Added tests to ensure that `order-none` is _not_ migrated if you have
  a custom `@utility order-none {}` implementation.
@RobinMalfait RobinMalfait requested a review from a team as a code owner May 23, 2025 14:20
@RobinMalfait RobinMalfait changed the title Upgrade order-none to order-0 Upgrade deprecated order-none to order-0 May 23, 2025
@thecrypticace
Copy link
Contributor

Maybe move the definition of order-none from utilities.ts to the legacy utilities file too?

By moving the `order-none` to the legacy utilities, the `order-none` is
not suggested anymore from the core utility.

Since the pre computed utilities lookup is driven by the class list for
suggestions, this also solves our issue that `order-none` defined by the
user will still be used.
…st.ts

Co-authored-by: Jordan Pittman <jordan@cryptica.me>
@RobinMalfait RobinMalfait enabled auto-merge (squash) May 23, 2025 15:18
@RobinMalfait RobinMalfait merged commit 9cb3899 into main May 23, 2025
7 checks passed
@RobinMalfait RobinMalfait deleted the feat/upgrade-deprecated-order-none branch May 23, 2025 15:21
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.

2 participants