Repository navigation
feat(extractor): compose styled components other modules define - #736
Merged
Merged
Conversation
…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.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
|
This was referenced Oct 3, 2026
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
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>
…sition Refs #690 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Refs #695 #688 #689 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Refs #682 #695 #688 #689 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Refs #682 #695 #688 #689 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Refs #682 #689 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Refs #682 #695 #688 #689 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This was referenced Oct 16, 2026
Merged
Refs #682 #695 #688 #689 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Refs #682 #695 #688 #689 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Refs #682 #695 #688 #689 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Refs #682 #695 #688 #689 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Refs #695 #688 #689 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This was referenced Oct 20, 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 #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개 외 없음2026-10-08 main 11790bef를 병합하여 업데이트했습니다. 충돌 없이 갱신된 부모 PR의 변경과 main의 변경을 모두 보존했습니다.
2026-10-15 갱신: 갱신된 부모 #730 b28816c285a041f1ac8a59c22a42745a75698ce0을 병합했습니다. 충돌 파일 libs/extractor/src/extractor/extract_style_from_styled.rs, libs/extractor/src/lib.rs, libs/extractor/src/visit.rs, libs/extractor/src/snapshots/extractor__tests__styled_components_of_any_base.snap은 부모의 조건부 스프레드 우선순위·캡처 바인더·실제 타깃·forwardRef·식별 클래스와 이 PR의 모듈 읽기·의존성·export 식별자를 함께 보존해 해결했습니다. 고정 스타일 요약은 원래 정의 모듈의 렌더러와 정확한 클래스/forwarded-rest 객체 슬롯을 유지하므로 캡처를 가져오는 모듈에서 재실행하지 않으며, 캡처가 없는 알려진 native 기반 custom 자손과 attrs 없는 read-bearing 고정 자손도 같은 실제 capability로 합성합니다. 새로 생기는 오류 없음.
수락한 생성 스냅샷은 다음 여섯 개뿐이며 각 .snap.new를 재생성·독립 비교·해시 확인한 뒤 assertion_line 메타데이터만 제외했습니다: extractor__imported_styled__tests__imported_components_compose_like_local_ones, extractor__imported_styled__tests__imported_components_the_build_cannot_read_stay_runtime_components, extractor__imported_styled__tests__re_exports_and_namespaces_reach_the_defining_module, extractor__tests__conditional_composition, extractor__tests__styled_components_of_any_base, extractor__tests__template_interpolations. 첫 번째는 W/V의 export 식별 클래스와 승인된 custom V의 실제 슬롯 쌍, 두 번째는 forwardRef 바깥의 원래 eager 바인딩, 세 번째는 namespace W의 식별 클래스, 나머지는 스타일 합성식 바깥 식별 클래스 및 any-base A/B/C/E의 export 식별자만 반영했습니다. 스타일 원자·타깃·attrs·ref·의존성의 무관한 변경은 없습니다.
검증: 기본 Rust 스택/CARGO_BUILD_JOBS=2, Rust 1.99 all-target Clippy 및 fmt 통과, 일반 모드 cargo test --workspace 3,678개 통과(기존 CSS-prop 가드 343개 및 교차 모듈 실행 76개 유지), 최신 WASM·루트 빌드 통과, Bun 5,922개/실패 0개/커버리지 100%, 실제 공개 WASM+React/SSR의 필터 없는 16개 시나리오 통과, 전체 커밋 훅 통과. LSP는 사용 불가였으며 정상이라고 주장하지 않습니다. Linux 100% 커버리지와 새 head CI 결과는 별도 확인 중입니다.
남는 경계: attrs-bearing 교차 모듈 준비 프로토콜은 추가 구현하지 않았고 기존 동작을 유지합니다. 런타임 스타일러·스타일 헬퍼·레지스트리·callable 전송·새 오류·불투명 fallback을 추가하지 않았습니다. 이 head 752b6141687091f915f5111e4698562adc9d3edc는 코디네이터가 승인한 현재 부모/이전 main 76b1a15 기준의 완료 단위이며 최신 main a6ecc12 포함 완료를 뜻하지 않습니다. 이어서 승인된 a6ecc12 전파 라운드 한 번을 부모 갱신 순서대로 수행합니다.
실제 WASM/React 공개 API 검증 출력(생성 코드·CSS·SSR 결과):
2026-10-17 부모 갱신: 확정 main
a6ecc125를 포함한 최신 #730c3bfe034를 자동 병합했습니다(merge47e1f223, 부모752b6141/c3bfe034, 충돌 파일 없음).imported_components_the_build_cannot_read_stay_runtime_components의 생성 snapshot 한 개만 main의 Emotion 원시 배열 fallback 의미에 맞춰 갱신했습니다:styled.div({color:['red','blue']})를 확장한 I의 뒤쪽 blue 선언이 같은 breakpoint의 fallback을 대체하므로 불필요한 classf와 blue level1 atom만 제거되며 다른 출력은 동일합니다. snapshot은 테스트가 생성한 후보에서assertion_line만 제거해 수용했고 소스 fixture·기존 행동 assertion·production 정책은 변경하지 않았습니다.W60f 검증: DEFAULT Rust stack / CARGO_BUILD_JOBS=2 / 전체 프로세스 트리 6GiB(빌드·테스트), 12GiB(commit hook)로 순차 실행했습니다. Rust 정상 workspace 4,603개/실패 0개, cross-module 76개 및 기존 guard 343개+상위 추가 2개, fmt, Rust1.99 Clippy, fresh WASM/root, lint, Bun 5,926개/실패 0개/커버리지 100%, 실제 React/WASM 16개와 fallback 양방향 추출 순서 2개가 통과했습니다. snapshot-only 새 commit
f4aaa814는 전체 hook을 통과했습니다(472.912초, peak 3.193GiB); Windows Rust 98.03%는 Linux 100% 증명이 아니므로 별도 CI로 확인합니다. 기존 React migration lint 경고 9개 외 오류 없음, LSP는 설치/응답 불가로 clean이라 주장하지 않습니다.새로 생기는 오류: 이번 부모 갱신으로 추가한 오류 없음. 원래 renderer와 정확한 class/forwarded-object 쌍, 빈 값 교체, raw/read/filter, identity 분리와 capture-free custom descendant의 empty-parent-bindings 제한을 그대로 유지했습니다. attrs-bearing B 확장은 계속 보류이며 runtime styling/helper/registry/callable transport·새 fallback은 추가하지 않았습니다.
f4aaa814를 정상 push했고 최신 head CI run38925940835는 진행 중입니다(이전 head의 CI를 현재 검증으로 사용하지 않음).실제 WASM/공개 API 검증 출력:
2026-10-17 CI 확인: head f4aaa8144e8f7d243fea03b570ae2b10c13f50c2의 run 38925940835은 모든 job 및 Codecov가 통과했습니다. publish job 117057365246 실제 로그에서 Linux Rust 100.00% coverage, 14543/14543 lines covered, Bun 5926개/실패 0개/전체 커버리지 100%를 확인했습니다. 확정 main a6ecc12 포함 및 현재 merge 상태는 최신 PR audit로 재확인했습니다.
2026-10-20 부모 갱신: GREEN #730
18e496f1을 이 PR의 headf4aaa814에 진짜 병합했습니다(merge4255abd1, 부모f4aaa814/18e496f1). 충돌 파일은 libs/extractor/src/lib.rs, visit.rs, style_values.rs, extractor/extract_style_from_styled.rs, 스냅샷 14개와 styled_source_tests/compatibility.rs였고 두 쪽의 변경을 모두 보존했습니다: 이 PR의 StyledCapability·imported_styled 읽기·컴포넌트 marker에 #730/#729/#728/main의 ReadContext·ClassNames 공유 scoping·$전달 prop 필터(styled_transient)·header pragma·parsing::parse를 합쳤습니다.합친 결과로 바뀐 동작은 두 가지입니다. (1) 가져온 컴포넌트를 template 계산 키로 쓰는
[&:focus ${Dyn}]는 이제&:focus .a--b로 컴파일되어, 이 PR의 기존 빌드 오류(styled() cannot use ...)가 사라집니다(#730의 template key 지원이 가져온 컴포넌트에도 적용됨). (2) 내보냈지만 컴포넌트가 아닌 상수(예:export const cls = css(...))도 marker를 먼저 만들면서 파일 번호를 등록하던 것을, marker 이름을 실제 컴포넌트가 될 때만 계산하도록 바꿨습니다. 등록된 파일 번호가 예약 슬롯 수(getUnreservedClassSlotCount)와 어긋나던 문제(rsbuild audit 시험 2개)를 고치고, css만 내보내는 파일의 불필요한 작업도 줄입니다. next-plugin webpack 전달 시험(webpack-delivery-http.cjs)은 선언이 없는 marker 클래스(--포함)만 건너뛰도록 시험 도우미를 갱신했고, 모든 스타일 클래스가 선언에 연결되어야 한다는 단언은 그대로입니다.검증: 기본 스택, CARGO_BUILD_JOBS=2, 6 GiB 감시로
cargo fmt, clippy(-D warnings) 통과, workspace 테스트 5,796개 통과·실패 0, 스냅샷 20개 검토 후 반영(14개 충돌 스냅샷 + 가져온 컴포넌트 6개; 변경은$필터 감싸기,__devupRecord0, header pragma 순서, 위 1번 하나뿐), WASM/root 재빌드, lint 0 오류(기존 경고 20개), Bun 6,597개 통과/실패 0/함수·라인 100%, 전체 hook 807초 통과.새로 생기는 오류: 없음(위 1번으로 하나 줄었습니다). 남는 한계와 새 런타임 코드: 없음(
$전달 prop 필터는 main에서 이미 승인된 코드입니다).