Skip to content

Design system driven upgrade migrations #17831

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 39 commits into from
May 2, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
815a83c
add `Writable` types helper
RobinMalfait Apr 30, 2025
40fa9d7
add `memcpy` util
RobinMalfait Apr 30, 2025
551bbed
add signatures
RobinMalfait Apr 30, 2025
1d32882
add optimize modifier migration
RobinMalfait Apr 30, 2025
7838f27
add drop unnecessary data types migration
RobinMalfait Apr 30, 2025
48d449d
add arbitrary variants migration
RobinMalfait Apr 30, 2025
e064185
add arbitrary utilities migration
RobinMalfait Apr 30, 2025
b6a2a55
export candidate types
RobinMalfait Apr 30, 2025
56303f7
use new migrations
RobinMalfait Apr 30, 2025
24de47d
use memcpy
RobinMalfait Apr 30, 2025
7f23841
use migrate arbitrary value to bare value using signatures
RobinMalfait Apr 30, 2025
a2585e9
improve printing of candidates
RobinMalfait Apr 30, 2025
52de5ed
update apply migration test
RobinMalfait Apr 30, 2025
271f803
move test
RobinMalfait Apr 30, 2025
3705e1a
add walk variants util
RobinMalfait Apr 30, 2025
49da4f0
remove hardcoded list of variants
RobinMalfait Apr 30, 2025
1f69c0f
ensure incomputable signatures result in unique value
RobinMalfait Apr 30, 2025
5af9fa5
`--tw-sort` is the property, not the value
RobinMalfait Apr 30, 2025
fe5d717
prevent infinitely parsing the same value
RobinMalfait Apr 30, 2025
457e9b5
improve signature generation for variants
RobinMalfait Apr 30, 2025
100f524
update integration tests
RobinMalfait Apr 30, 2025
0f4c724
add tests to migrate to more specific utilities
RobinMalfait Apr 30, 2025
6aeecd6
try to migrate both arbitrary properties and arbitrary values
RobinMalfait Apr 30, 2025
fa15d91
handle negative in arbitrary scale
RobinMalfait Apr 30, 2025
f88fec3
update changelog
RobinMalfait Apr 30, 2025
892a417
prefer bare values over arbitrary values
RobinMalfait Apr 30, 2025
ba360ab
convert arbitrary rem value to bare value
RobinMalfait May 1, 2025
ccd8053
abstract parsing dimensions
RobinMalfait May 1, 2025
5d8b626
Update packages/@tailwindcss-upgrade/src/utils/dimension.ts
RobinMalfait May 1, 2025
34565f0
rename variables / comments
RobinMalfait May 1, 2025
42b621b
use existing `getClassList`
RobinMalfait May 1, 2025
1e9ce41
move printing candidate to core
RobinMalfait May 1, 2025
013f0b5
Update CHANGELOG.md
RobinMalfait May 2, 2025
5573c88
use try/finally for extra safety
RobinMalfait May 2, 2025
d5ac5cd
update changelog
RobinMalfait May 2, 2025
f2653ac
drop level of nesting
RobinMalfait May 2, 2025
cd92ff1
use `printModifier` helper
RobinMalfait May 2, 2025
987b9e7
add basic tests for _all_ migrations
RobinMalfait May 2, 2025
fbabe79
rename `memcpy` to `replaceObject`
RobinMalfait May 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
move test
Note: I removed the `leading-[1]` -> `leading-[none]` test. This is not
special cased anymore and is now done by another migration. So this test
is just moved to a different spot.
  • Loading branch information
RobinMalfait committed Apr 30, 2025
commit 271f803d198995a7ac1fada0809126fef5c70ad8
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ describe.each([['default'], ['with-variant'], ['important'], ['prefix']])('%s',
['[display:_flex]', 'flex'],
['[display:flex_]', 'flex'],

// Arbitrary property to static utility
// Map number to keyword-like value
['leading-[1]', 'leading-none'],

// Arbitrary property to named functional utility
['[color:var(--color-red-500)]', 'text-red-500'],
['[background-color:var(--color-red-500)]', 'bg-red-500'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ test.each([

// Leading is special, because `leading-[123]` is the direct value of 123, but
// `leading-123` maps to `calc(--spacing(123))`.
['leading-[1]', 'leading-none'],
['leading-[123]', 'leading-[123]'],

['data-[selected]:flex', 'data-selected:flex'],
Expand Down