Skip to content

Add more canonicalization rules for deprecated utilities#19849

Merged
RobinMalfait merged 10 commits intomainfrom
feat/more-canonicalization-rules
Mar 25, 2026
Merged

Add more canonicalization rules for deprecated utilities#19849
RobinMalfait merged 10 commits intomainfrom
feat/more-canonicalization-rules

Conversation

@RobinMalfait
Copy link
Copy Markdown
Member

@RobinMalfait RobinMalfait commented Mar 25, 2026

This PR adds more canonicalization rules for deprecated utilities.

Before After
overflow-ellipsis text-ellipsis
start-full inset-s-full
-start-full -inset-s-full
start-auto inset-s-auto
start-px inset-s-px
-start-px -inset-s-px
start-8 inset-s-8
-start-8 -inset-s-8
start-123 inset-s-123
-start-123 -inset-s-123
end-full inset-e-full
-end-full -inset-e-full
end-auto inset-e-auto
end-px inset-e-px
-end-px -inset-e-px
end-8 inset-e-8
-end-8 -inset-e-8
end-123 inset-e-123
-end-123 -inset-e-123

In a few cases we already had canonicalization rules, for example start-8 where 8 is one of the default suggested spacing scale values. But this now adds support for positive and negative values that exceed the default suggested spacing scale as well as some keywords.

Test plan

  1. Existing tests pass
  2. Added new tests to ensure these canonicalizations work

This also reduces some test duplication and uses a parameterized test
instead.
We can't hardcode all the `start-*` utilities, so using a regex instead
We already guard against this, no need to do it again.
Before this, the CSS file would be unique for each deprecated candidate
we are testing. That means that we have to create n design systems.

By sharing the CSS, we only have to create a single design system.
@RobinMalfait RobinMalfait requested a review from a team as a code owner March 25, 2026 10:30
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 25, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 4a307361-782a-43d9-9d58-ed96a322ccc6

📥 Commits

Reviewing files that changed from the base of the PR and between 754536f and 010346e.

📒 Files selected for processing (1)
  • CHANGELOG.md

Walkthrough

The canonicalization logic was expanded to handle additional deprecated utilities and dynamic name transformations. The single-step deprecation lookup was replaced with an iterator that yields candidate replacements (including new overflow-ellipsistext-ellipsis and logical start-*/end-*inset-s-*/inset-e-* mappings) and validates signature compatibility before accepting a replacement. collapseCandidates no longer returns early for 0–1 candidates. Tests were converted from isolated cases to a data-driven loop covering many deprecated candidate→expected pairs and cases with custom @utility implementations.

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding more canonicalization rules for deprecated utilities, which matches the file changes and PR objectives.
Description check ✅ Passed The pull request description clearly describes the changes made, providing a detailed table of deprecated utility mappings and explaining the intent to support additional values beyond the default spacing scale.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@RobinMalfait RobinMalfait merged commit 88a2d22 into main Mar 25, 2026
7 checks passed
@RobinMalfait RobinMalfait deleted the feat/more-canonicalization-rules branch March 25, 2026 10:38
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.

1 participant