Repository navigation
fix(extractor): read constants in Emotion rules as px and compose mixins and inline css() by styles - #740
Open
owjs3901 wants to merge 31 commits into
Open
fix(extractor): read constants in Emotion rules as px and compose mixins and inline css() by styles#740owjs3901 wants to merge 31 commits into
owjs3901 wants to merge 31 commits into
Conversation
…rations css(a, b) composing classes whose styles the build knows, bound to css() in the file or exported by another module, merges their atoms per property, selector, breakpoint and layer, conditions included, instead of joining classes whose winner the stylesheet order picked. vanilla-extract style([...]) passes each composed style as its own argument, keeping a style composed again later. Refs #688 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Refs #688 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Refs #688 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Refs #688 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…asurable Refs #688 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…JSX spreads win Refs #688 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…led order and JSX element className Refs #688 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Refs #689 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…uate shouldForwardProp at build time Refs #689 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…ring Refs #689 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Refs #691 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Refs #690 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
… and conditional styles Refs #690 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…h Emotion Refs #690 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Refs #690 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…ed parameters Refs #690 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Refs #690 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…ins and inline css() by styles Refs #688, #690 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Contributor
Changepacks@devup-ui/wasm@1.0.83 → 1.0.84 - bindings/devup-ui-wasm/package.jsonPatch
@devup-ui/bun-plugin@1.0.22 → 1.0.23 - packages/bun-plugin/package.jsonPatch
@devup-ui/components@0.1.60 → 0.1.61 - packages/components/package.jsonPatch
@devup-ui/eslint-plugin@1.0.22 → 1.0.23 - packages/eslint-plugin/package.jsonPatch
@devup-ui/next-plugin@1.0.90 → 1.0.91 - packages/next-plugin/package.jsonPatch
@devup-ui/plugin-utils@1.0.17 → 1.0.18 - packages/plugin-utils/package.jsonPatch
@devup-ui/react@1.0.44 → 1.0.45 - packages/react/package.jsonPatch
@devup-ui/reset-css@1.0.31 → 1.0.32 - packages/reset-css/package.jsonPatch
@devup-ui/rsbuild-plugin@1.0.67 → 1.0.68 - packages/rsbuild-plugin/package.jsonPatch
@devup-ui/vite-plugin@1.0.73 → 1.0.74 - packages/vite-plugin/package.jsonPatch
@devup-ui/webpack-plugin@1.0.71 → 1.0.72 - packages/webpack-plugin/package.jsonPatch
|
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
No conflicted files; preserve composition changes and main ESLint checks.
No conflicted files; combine updated parent and PR changes.
No conflicted files; combine updated parent and PR changes.
Conflicted file: libs/extractor/src/lib.rs. Retain both composition helper and regression tests from PR 706 and Tailwind per-class regression tests from main 11790be; take rewritten main Tailwind implementation with Rust 1.99 assertions. bun.lock regenerated by bun install; no snapshots were hand-merged. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Merge updated parent PR 706 (30247ba), containing main 11790be. Conflicted file: libs/extractor/src/prop_modify_utils.rs. Preserve PR 707's last-written className/style spread semantics and no spread_props parameter with capacity 2, together with main's per-class Tailwind compiler. No snapshots were hand-merged. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Merge updated parent PR 727 (12328b9), containing main 11790be. Conflicted file: packages/bun-plugin/src/plugin.ts. Preserve PR 728's readJsxImportSource alias discovery and main PR 703's compiledPackages scanner, Bun.build stylesheet deferral, runtime writes and debug policy; keep main PR 704 plugin CSS behavior. WASM/root builds and real Bun stylesheet regression passed; no snapshots were hand-merged. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
owjs3901
added a commit
that referenced
this pull request
Oct 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #690, #688 (Emotion 계열 규칙의 숫자와 조합). #730 위에 쌓인 브랜치입니다. #706 #707 #710 #711 #722 #727 #728 #729 #730이 먼저 병합되어야 합니다.
요약
Emotion, styled-components, vanilla-extract로 쓴 규칙에서
cssprop 밖에 남아 있던 세 가지 어긋남을 고칩니다.const gap = 8; css({ padding: gap })은px가 아니라 Devup의 간격 스케일(32px)이 되었습니다. 리터럴8만 사전 패스(LibraryNumbers)에서"8px"로 바뀌고, 상수는 나중에 인라인되면서(inline_constants)cssprop 안에서만px를 받았기 때문입니다.css`${mixin}; color: red;`가 mixin의 클래스와 템플릿의 클래스를 이어 붙이기만 해서, 뒤의 선언이 mixin의 선언을 대체하지 못하던 문제.css(css({ color: 'red' }), { color: 'blue' }),css(cond && css({ ... }), base)처럼css()인자 안의css()호출이 먼저 자기 클래스로 컴파일되어 정적 조합이 되지 않던 문제.동작
1. 상수의
px. 사전 패스가 규칙 안의 값과 규칙 자체가 놓인 위치(상수가 대신 설 수 있는 표현식)의 소스 범위를 기록해Aliased.px로 넘기고,inline_constants는 그 위치에서 상수를 인라인할 때 리터럴과 똑같이 처리합니다. 숫자는px문자열이 되고, 상수 객체(css(rules),...rules,'&:hover': rules)는 안쪽 숫자까지px가 됩니다. 단위 없는 속성(keeps_bare_number)은 맨 숫자를 유지하고,0은0이며,p·mx같은 Devup 단축 속성은 간격 스케일을 유지합니다.vars아래와@devup-ui/react의css는 건드리지 않습니다. 지역 상수, 가져온 상수,-gap·gap * 2·cond ? gap : 4·gap || 3·(gap)같은 식,css(),styled.div()/styled()(),Global styles,ClassNames의css, vanilla-extractstyle()에 적용됩니다.2. 템플릿 안의 mixin.
template_parts로 텍스트를 mixin 앞뒤로 나누고(cssprop과 같은 경로), 스타일을 아는 클래스(css()/css템플릿 상수)가 mixin이면known_parts/composed_class로 스타일 단위로 조합합니다. 뒤의 선언이 이깁니다.css템플릿 상수도 이제 스타일을 아는 클래스라서 이후css(a, b)나 다른 템플릿이 이를 스타일로 조합합니다. 스타일을 모르는 mixin(런타임 인자 등)은 이전처럼 클래스를 잇습니다(CSS 캐스케이드).3. 중첩된 인라인
css(). 방문 전에css()인자(와 템플릿 mixin) 안의 인라인css()호출을 자신이 조합하는 것들의 배열로 펼치고, 배열·조건·&&/||/??를 따라 내려갑니다. 그 뒤cssprop·ClassNames와 같은 정적 조합 경로로 합쳐 뒤가 이깁니다. 템플릿 안의 인라인css`...`는 클래스가 CSS 텍스트로 읽히지 않도록 배열로 감쌉니다.known_side가ClassNames밖에서도 배열을 읽어cond && [css(...), {...}]가 조합됩니다.새로 생기는 오류
없습니다. 이전에 컴파일되던 입력은 같은 스타일을 더 정확한 순서로 냅니다. 이전에 오류였던 입력(런타임 값, 펼침 인자 등)은 같은 오류를 그대로 냅니다.
남는 한계
css(css`color: red;`, { color: 'blue' })처럼 인자로 들어간 태그드 템플릿css는 여전히 먼저 클래스로 컴파일되어 클래스로 이어집니다(캐스케이드). 템플릿 mixin 안의 인라인css`...`도 같습니다. 호출 형태(css({...}))만 스타일 단위로 조합됩니다.css(...rest)처럼 펼침 인자를 가진 인라인 호출은 펼치지 않고 이전처럼 컴파일하며, 같은 오류를 냅니다.css(cond && [{ ... }, { ... }], { ... })처럼 인라인css()가 없고 규칙 객체 배열만 있는 호출은 이전처럼 일반 경로에서Cannot compose오류입니다(이 PR의 범위 밖).검증
vars·css/styled/Global/ClassNames/style/@devup-ui/react의css(변경 없음 확인), 템플릿 mixin(스타일을 아는/모르는/조건부/중첩), 중첩·조건부 인라인css()(배열,&&,||, 삼항, 3중 중첩, 펼침 인자,@devup-ui/react). 기존template_interpolations스냅샷의 한 항목(css`${mixin} ...`)이`a-e ${mixin}`에서 같은 클래스를 정적으로 합친"a-a a-e"로 바뀌었습니다.cargo fmt --all,cargo +1.99 clippy --workspace --all-targets -- -D warnings,cargo test --workspace통과. CI와 같은 넓은 rustfmt 설정으로cargo tarpaulin --engine llvm을 돌려 이 PR의 줄이 모두 덮이는 것을 확인했습니다(로컬 Windows에서 남는 줄은 모두 이전부터 있던 다른 코드입니다).bun run build,bun test(5487 pass, 0 fail, 커버리지 100%),bun lint(이전부터 있던 경고 2개만).2026-10-08 main 11790bef를 병합하여 업데이트했습니다. 충돌 없이 갱신된 부모 PR의 변경과 main의 변경을 모두 보존했습니다.