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>
Refs #688 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…e runtime Refs #688 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.82 → 1.0.83 - bindings/devup-ui-wasm/package.jsonPatch
@devup-ui/bun-plugin@1.0.21 → 1.0.22 - packages/bun-plugin/package.jsonPatch
@devup-ui/components@0.1.59 → 0.1.60 - packages/components/package.jsonPatch
@devup-ui/eslint-plugin@1.0.21 → 1.0.22 - packages/eslint-plugin/package.jsonPatch
@devup-ui/next-plugin@1.0.89 → 1.0.90 - packages/next-plugin/package.jsonPatch
@devup-ui/plugin-utils@1.0.16 → 1.0.17 - 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.66 → 1.0.67 - packages/rsbuild-plugin/package.jsonPatch
@devup-ui/vite-plugin@1.0.72 → 1.0.73 - packages/vite-plugin/package.jsonPatch
@devup-ui/webpack-plugin@1.0.70 → 1.0.71 - packages/webpack-plugin/package.jsonPatch
|
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
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 #688 (A: 다른 파일과
include라이브러리의 styled 정의를 모듈 해석으로 읽어 합성). #730 위에 쌓은 브랜치입니다. #706 #707 #710 #711 #722 #727 #728 #729 #730이 먼저 병합되어야 합니다.요약
같은 파일에서 정의한 styled 컴포넌트는 이미 정적으로 합성되지만, 다른 모듈이나
include라이브러리에서 import한 styled 컴포넌트는 불투명한 런타임 컴포넌트로 남아 계속 감싸졌습니다. 이제 빌드가 그 모듈의 정의를 읽어 같은 파일에서 정의한 것과 똑같이 합성합니다.이전에는
as: DevupAs = Base로Base를 런타임에 한 번 더 렌더링했고, 지금은Base의 태그와 스타일을 읽어div에color: blue(뒤 선언이 이김)와padding: 4px를 직접 붙입니다.동작
paths, 패키지exports,include라이브러리)로 모듈을 읽습니다. 모듈은 자신의 추출과 똑같이(별칭 변환 → 상수 인라인 → 방문) 컴파일하고, 그 안의 import도 같은 방식으로 따라갑니다.export { X } from,export * from,import { X }; export { X },export default, 이름 바꾼 export, 순환 import를 처리합니다. 한 번의 추출 안에서 모듈은 한 번만 읽습니다.styled(Imported)(...),styled(Imported).attrs(...),styled(Imported)\...`,Imported.withComponent(...),(Emotioncssprop),styled(UI.Imported)(namespace import)가 같은 파일 정의와 같은 규칙으로 합성됩니다. 속성+선택자+브레이크포인트+레이어마다 뒤 선언이 이기고, attrs는 순서대로 합쳐지며, 읽는 props(reads)와shouldForwardProp`으로 props를 거릅니다. 합성된 스타일은 가져오는 파일이 자기 이름으로 만들므로 가져오는 파일의 CSS에 들어갑니다.dependencies로 보고되어, 그 모듈이 바뀌면 가져오는 파일이 다시 빌드됩니다. 플러그인 쪽 변경은 필요 없었습니다(viteaddWatchFile, webpack/rsbuildaddDependency, next 로더가 이미 이 목록을 씁니다).${ImportedChild} { ... },[ImportedChild]규칙 키): 정의하는 파일이 내보내는 styled 컴포넌트마다 마커 클래스를 붙이고, 선택하는 파일은 같은 마커를 읽습니다. 마커는 정의 모듈의 파일 번호와 export 이름의 정렬 순서로만 정해지는 순수 함수라, 두 파일(과 두 프로세스)이 같은 문자열을 계산합니다. 플러그인은 모듈 해석기가 돌려주는 경로와 추출에 넘기는 파일 이름을 이미 같게 맞춥니다(toId). 확장한 컴포넌트는 기반 컴포넌트의 마커도 받습니다.프로브 (
--debug,survey/probe.ts --modules)새로 생기는 오류
새 종류의 오류는 없습니다. 달라지는 점은 하나입니다.
cssprop이 그 컴포넌트의 스타일과 겹치면, 같은 파일 정의와 똑같이파일:줄:열:cssonoverrides stylesBasesets, which the build orders only for a styled component rendering a tag with no attrs or props read, ...: move these styles intostyled(Base)(...)``로 보고됩니다. 이전에는 순서가 스타일시트에 맡겨져 조용히 넘어갔습니다. 겹치지 않거나 태그로 인라인할 수 있으면(attrs, 읽는 props, spread, `as` 없음) 오류 없이 `css` prop이 이깁니다.남는 한계
정확히 읽을 수 없는 정의는 건드리지 않고 지금 동작(런타임 컴포넌트로 감싸기)을 유지합니다.
styled(Link),styled(forwardRef(...)),styled(getThing().div). 정의 모듈의 식별자를 가져오는 쪽에서 가리킬 수 없기 때문입니다.attrs/클래스/동적 스타일 식(const handler = ...; styled.div.attrs({ onClick: handler }), 모듈 안 함수를 부르는${(p) => scaled(p.x)}, 모듈 안css()mixin 클래스). 식은 가져오는 파일에서 다시 평가되므로, 자신의 매개변수, props,rest, 언어 전역(Math,Number,String...)만 읽는 식(타입 주석 포함)만 읽습니다..css.ts,export const Base = 5처럼 styled 호출이 아닌 export,import type.styled(UI.Base)와UI.Base.withComponent(...)만 읽습니다.${UI.Child} { ... }와<UI.Base css={...}>는 읽지 않습니다.<Imported foo />처럼 합성 없이 쓰는 호출부에서는 props를 거르지 않습니다(정의 모듈이 자기 컴포넌트 안에서 거릅니다).검증
cargo fmt,cargo +1.99 clippy --workspace --all-targets -- -D warnings,cargo test --workspace통과imported_styled.rs)와 insta 스냅샷으로 확인. 같은 파일 정의와 스타일이 같은지(styled/attrs/withComponent/cssprop 10여 가지)도 비교합니다.packages/next-plugin/src/__tests__/imported-styled.test.ts): 상대 경로, tsconfigpaths, 패키지exports의include라이브러리, 의존성 보고, 모듈 변경 반영, 파일 간 마커 일치bun run build,bun test5491 통과, 커버리지 100%bun lint: 기존 경고 2개 외 없음