Repository navigation
fix(extractor): compile factory dynamic utility references - #804
Merged
Merged
Conversation
Refs #683 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Refs #683 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Refs #683 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Refs #791 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 84 files with indirect coverage changes 🚀 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 #791 (#803 위에 쌓은 PR입니다. #803이 먼저 병합되어야 합니다.)
요약
JSX factory의 동적 스타일 값을 문자열로 직렬화하기 전에 원래 AST의 유틸리티 호출을 빌드 타임에 컴파일합니다. 기존 main에서 발생하던 네 가지 non-class 동적 스타일 ReferenceError를 해결하며, import 제거 정책이나 lexical binding guard를 완화하지 않습니다.
변경한 production은 기존 Rust 세 파일의 추가+삭제 158줄 / 승인 한도 200줄입니다. build-time generic 준비 훅을 기존 재귀 경로에 전달할 뿐, emitted runtime callable/helper/import, dependency, evaluator, style schema/variant, 전체 프로그램 pass는 추가하지 않았습니다.
동작
행 12: named / per-file 실제 WASM 출력 전/후
파일: /src/W70h-seam-spread-with-call-alias.js, singleCss=false, 마지막 설정 인자={}. 실행식은 render(false, {}, () => ({}), undefined)입니다.
입력
수정 전 생성 코드
수정 전 실제 CSS
실제 오류: ReferenceError: i is not defined
수정 후 생성 코드
수정 후 실제 CSS
수정 후 실제 실행 결과
{ "target": "div", "props": { "className": "external a-b", "style": { "--a": "a-a" } } }행 32: namespace / per-file 실제 WASM 출력 전/후
파일: /src/W70h-seam-spread-with-call-namespace.js, singleCss=false, 마지막 설정 인자={}. 실행식은 render(false, {}, () => ({}), undefined)입니다.
입력
수정 전 생성 코드
수정 전 실제 CSS
실제 오류: ReferenceError: ui$css is not defined
수정 후 생성 코드
수정 후 실제 CSS
수정 후 실제 실행 결과
{ "target": "div", "props": { "className": "external a-b", "style": { "--a": "a-a" } } }행 89: named / single CSS 실제 WASM 출력 전/후
파일: /src/W70h-seam-spread-with-call-alias.js, singleCss=true, 마지막 설정 인자={}. 실행식은 render(false, {}, () => ({}), undefined)입니다.
입력
수정 전 생성 코드
수정 전 실제 CSS
실제 오류: ReferenceError: i is not defined
수정 후 생성 코드
수정 후 실제 CSS
수정 후 실제 실행 결과
{ "target": "div", "props": { "className": "external b", "style": { "--c": "a" } } }행 109: namespace / single CSS 실제 WASM 출력 전/후
파일: /src/W70h-seam-spread-with-call-namespace.js, singleCss=true, 마지막 설정 인자={}. 실행식은 render(false, {}, () => ({}), undefined)입니다.
입력
수정 전 생성 코드
수정 전 실제 CSS
실제 오류: ReferenceError: ui$css is not defined
수정 후 생성 코드
수정 후 실제 CSS
수정 후 실제 실행 결과
{ "target": "div", "props": { "className": "external b", "style": { "--c": "a" } } }새로 생기는 오류
새 오류 종류나 evaluator 정책은 추가하지 않았습니다. 다만 이전에 factory 내부에서 방문되지 않아 사라진 utility를 런타임에 호출하던 읽을 수 없는 css/keyframes 값도 기존 located build error로 거절됩니다. 예를 들어 factory의 other: css({color:tone}), other: keyframes({from:{opacity:tone}})는 다음 기존 요구사항을 냅니다. direct utility control의 동일 요구사항도 보존했습니다.
남는 한계
빌드가 알 수 없는 유틸리티 스타일 값은 정적인 값/theme token/상수로 작성해야 합니다. 일반 element의 기존 동적 값과 inline scale/absence 예외는 변경하지 않았습니다. 일반 helper의 기존 spread/eager 순서 문제는 이 수정에 섞지 않았으며 별도 보류 항목입니다.
2026-10-23 unknown spread는 순수 pass-through라는 새 결정은 이 PR에서 구현하지 않습니다. 기존 className/style 병합을 포함한 별도 #756 재작업과 후속 queue가 소유합니다. 이 PR의 literal-spread 네 행과 pre-serialization 결함은 해당 정책과 독립적입니다.
검증
head: 36da206; 테스트한 staged tree: 4519f8300bd7025ca4340e64bc36342ab7ad8c35.
native RED 24 PASS / 110 FAIL 이후 최종 focused 142 PASS / 0 FAIL, 기존 factory suite 222 PASS / 0 FAIL. 원래 main observer를 수정하거나 다른 지원 코드를 복사하지 않았습니다.
default-stack cargo test --workspace 6659 PASS / 0 FAIL / 0 ignored, cargo fmt, stable strict workspace/all-targets/all-features clippy 통과했습니다.
fresh bun install, binding WASM build, root build 및 bun lint 통과했습니다. lint는 0 errors와 기존 React 경고 20건입니다.
official latest private Bun 1.4.4: 6857 PASS / 0 FAIL / 89 snapshots, 실제 All files 함수/라인 100.00 / 100.00. 공유 Bun 1.4.3도 동일 6857 / 0 / 100.00 / 100.00입니다. 공유 설치를 변경하지 않았습니다.
public WASM 8 + 60 + 32 = 100 positive/control 행과 16 located refusal/control 행 통과했습니다. named/namespace, per-file/single CSS, responsive/selector/template/sequence/binary/helper/member, keyframes, mx, parameter/block-local shadow, absence/lazy/once-only 및 reset/prefix를 검증했습니다.
최종 WASM SHA256: bdb305ae4d122152f7055a00e7366f0e41a4d1e32bee8fbb2cdfc41a3f0eecfa. 새 runtime callable/helper/import는 없으며 기존 namespace import 제거 정책도 그대로입니다.
정확한 test: restore latest Bun coverage and preserve sparse values #803 base를 새 private Cargo target에서 빌드하고 원래 base WASM hash와 일치함을 확인한 뒤, 같은 프로세스에서 8개 입력을 각각 5000회 x 10 AB/BA 교대 측정했습니다. 모든 출력 hash는 동일하고 median delta 범위는 **-2.90% ~ +1.31%**입니다. 속도 향상이나 완전한 성능 동등성 주장은 하지 않습니다.
동일 도구 local WASM size 비교는 raw +0.706%, gzip +0.168%, JS glue raw/gzip **0%**로 네 metric 모두 1% 정책 이내입니다. Linux CI의 exact-source 비교가 최종 gate입니다.
jobs=2, stable/default Rust stack, CI unset, build/test 6 GiB 및 hook 12 GiB watchdog, 7 GiB free-memory preflight를 사용합니다. LSP daemon은 timeout, JS/JSON 서버는 설치 거절 상태이므로 clean-LSP라고 주장하지 않습니다.
managed changepack은 bindings/devup-ui-wasm/package.json Patch 한 개이며 Cargo/root package key는 없습니다.
exact-tree full hook: PASS, 650s, peak 4.72 GiB.
최종 CI
39945316026 SUCCESS, head 36da206, 재실행 0회입니다. 필수 validation 8개 job과 Codecov patch가 모두 SUCCESS이며 main-only release/deploy skip만 정상적으로 남습니다.
실제 publish log의 Linux Rust 100.00% (16638/16638), Bun All files 100.00 / 100.00를 확인했습니다. WASM size의 네 metric도 모두 PASS입니다.
vinext prerender 및 per-file/singleCss E2E와 release-compat의 실제 실행 step도 성공했습니다. workflow의 Node20/ubuntu-latest migration annotation은 기존 안내이며 실패가 아닙니다.