Repository navigation
fix(css): preserve quoted selector and interpolation boundaries - #795
Merged
Merged
Conversation
Refs #686 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Refs #686 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Refs #686 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Refs #686 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.
🚀 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 #686 (PR4; #793
fix/quoted-css-strings위에 쌓은 후속 수정이며 #793이 먼저 병합되어야 합니다. 현재 base는 main이고 retarget은 사용자가 결정합니다.)요약
#793이 남긴 선택자·at-rule prelude·템플릿 보간 위치의 문자열 경계를 수정합니다. 문자열 안의
&, 괄호, 쉼표, 세미콜론, 중괄호, 공백은 문법으로 오인하지 않으며 원래 바이트를 유지합니다. 스타일링 런타임, 의존성, 해시 이름은 추가하지 않습니다.원인
선택자 중첩과 최종 CSS 출력은
&를 단순 치환했고, media 조건 조합은 문자열 안의 괄호·쉼표를 깊이와 목록 구분자로 세었습니다.interpolation_place도 문자열을 구분하지 않고 앞뒤의;,{,},:를 검색했으므로content:'a;${p => p.label}'같은 값 보간을 선택자로 잘못 거부했습니다. 별도의 mixin 깊이 계산과 선택자 params 탐색도 같은 종류의 문제를 가졌습니다.동작
QuoteState와 원본 slice 기반 탐색·치환으로 선택자 중첩, 최종 class 치환, Tailwind 조합, params, media 목록을 처리합니다. 실제 nesting&만 바꾸고 문자열·escape 안의&는 유지합니다.[title="&"]는 자손 선택자이고, selectors 객체의 같은 키는 element 자체의 attribute 선택자입니다. 기존 두 의미를 유지하며 실제 anchor만 보완합니다.런타임 코드
새 imported helper나 runtime callable은 없습니다. generator는 수정하지 않았으며, 정적인 선택자·prelude 수정은 CSS와 class 문자열만 바꿉니다. main에서 잘못 거부되던 문자열 안의 값 보간은 기존 styled/CSS-variable 출력 경로를 사용합니다. 실제 single-CSS 공개 출력에서 확인한 값 식은 다음과 같습니다(각 행은 해당 fixture의 독립 출력입니다).
상수 보간으로 여는 quote를 제공한 경우도 두 번째 식과 같습니다. callback은 사용자가 작성한 원래 식이며, 마지막 사례는 실제 render마다
trace === ['value']로 정확히 한 번 실행됩니다. 비교용 기존 unquoted 값은...{ "--b": (p=>p.label)(rest) }입니다. 그 밖의forwardRefwrapper, props의Object.fromEntries(Object.entries(...).filter(...)), theme/read-prop 제외,as/forwardedAs/ref 전달,className의filter(Boolean).join(" "),...style병합은 이 기존 경로와 동일합니다. 함수·클래스·CSS-variable helper를 새로 삽입하지 않습니다.새로 생기는 오류
새 build-error 종류는 추가하지 않습니다. build-time에 알 수 없는 선택자·prelude 보간은 기존 located 오류로 남고, 문자열 안의 선언 값 보간을 잘못 거부하던 경우는 정상적인 기존 CSS-variable 경로로 컴파일됩니다. 실제 공개 probe의 정확한 오류는 다음과 같습니다(두 CSS 모드 모두 동일).
각각
&[title="x:${p=>p.label}"]{color:red}와@supports (content:"x:${p=>p.label}"){color:red}의 원본 arrow span입니다. 주어진 예의 import와 fixture wrapper를 포함한 위치이며, 사용자의 파일에서는 해당 원본 위치로 표시됩니다.남는 한계
검증
7188d5ff에서 구현 전 RED를 먼저 고정했습니다(CSS 5 fail / extractor 6 fail). fix(css): keep quoted strings out of value rewriting #793 headea8356ae에서도 남은 CSS 7 fail / extractor 3 fail을 확인한 뒤 수정했습니다. 추가 selector/escape/recovery/EOF/hexadecimal 경계도 별도 RED 후 GREEN입니다..a[title="a&b"]{color:red},@media print and (name:"a),b"){...},.a{content:var(--b)}. 줄바꿈 이후0.5px는.5px로 최적화되지만 EOF 문자열'0.5의 두 공백은 유지됩니다.5f366fdc는 treee161b9a0에서 전체 hook 1회 PASS(837초, native 12 GiB cap, raw peak 4.45 GiB)입니다. 그 뒤 local 추가 줄 커버리지에서 실제 closing-brace 분기가 빠진 것을 찾아 제품 코드 변경 없이 global pseudo/닫힌 nested block 회귀 두 건을 보강한 별도 커밋e2e6e227을 만들었고, treed9fd32f7에서 전체 hook 1회 PASS(661초, raw peak 4.44 GiB)했습니다. amend·hook skip·coverage exclusion은 없습니다.b'&'행 하나이며, 이 플랫폼의 line-table 결과를 감추거나 제외하지 않았습니다. 실제 CI/Linux Rust 100% 결과는 아래에서 별도로 확인합니다.e2e6e22756f769e7cc6bb3576af33a2d04645c79와 일치합니다. publish job118594540394에서 Linux Rust 100.00% (15,799/15,799 lines), Bun 6,631 pass / 0 fail / 함수·라인 100%, 별도 preload regression 9/9를 직접 로그로 확인했습니다. publish·benchmark·wasm-size·landing-next-e2e·react-18·vinext-rsc-css-e2e·webpack-extends-theme·release-compat 모두 PASS이며 release/deploy는 PR에서 의도대로 SKIPPED입니다. CI rerun은 없었습니다.7188d5ff입니다. hook 이후 실제 공개 WASM·SSR도 다시 48/48 결정론적 PASS했습니다. #791과 fix(css): keep quoted strings out of value rewriting #793 역시 CLEAN이며 병합·닫기·승인·draft 전환·retarget은 하지 않았습니다.