Repository navigation
fix(css): encode values in debug class names, update dependencies - #672
Merged
Merged
Conversation
Debug class names encoded the selector but appended the style value verbatim. Values such as .8, $text, 50% or calc() made the emitted selector invalid, so browsers dropped the rule. #FFF turned into an ID selector, and values with spaces split one class into several class tokens, so those rules never matched. Run the value through the same encoder as the selector. Production builds are unaffected; they use base-37 names. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…lasses Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…lasses Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Regenerated with bun test --update-snapshots; every changed line decodes back to the previous snapshot, so only value encoding differs. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
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.80 → 1.0.81 - bindings/devup-ui-wasm/package.jsonPatch
@devup-ui/bun-plugin@1.0.19 → 1.0.20 - packages/bun-plugin/package.jsonPatch
@devup-ui/components@0.1.57 → 0.1.58 - packages/components/package.jsonPatch
@devup-ui/eslint-plugin@1.0.20 - packages/eslint-plugin/package.jsonMaybe you forgot to write the following files to the latest version @devup-ui/next-plugin@1.0.87 → 1.0.88 - packages/next-plugin/package.jsonPatch
@devup-ui/react@1.0.43 - packages/react/package.jsonMaybe you forgot to write the following files to the latest version @devup-ui/rsbuild-plugin@1.0.64 → 1.0.65 - packages/rsbuild-plugin/package.jsonPatch
@devup-ui/vite-plugin@1.0.70 → 1.0.71 - packages/vite-plugin/package.jsonPatch
@devup-ui/webpack-plugin@1.0.68 → 1.0.69 - packages/webpack-plugin/package.jsonPatch
|
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
happy-dom 20.11 rejected var() in style setters, so toHaveStyle compared an empty expected value against an empty computed style and always passed. The generated CSS is never loaded into the test DOM, so there is no computed style to check. happy-dom 20.14 parses var(), which exposed these assertions. Assert the debug class that carries each declaration instead, as the other component tests already do. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Bump oxc 0.147 -> 0.151, rstest 0.26 -> 0.27 and the wasm-bindgen family. oxc 0.151 renames ParserReturn::panicked to fatal_error with the same meaning. Cargo.lock is regenerated from scratch, so transitive crates move to their latest compatible versions. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Regenerated from scratch, so transitive packages move to their latest compatible versions as well. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
v2 denies warnings through CARGO_BUILD_WARNINGS instead of setting RUSTFLAGS=-D warnings, so the rustflags in bindings/devup-ui-wasm/.cargo/config.toml now apply in CI the same way they do locally. No action inputs are used here. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
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.
문제
debug 모드(플러그인
debug: true, bun-plugin은 항상)에서 만드는 클래스명에 스타일 값이 그대로 들어간다. selector는encode_selector로 인코딩하지만 값은 인코딩하지 않았다.생성된 CSS를 Chromium에 넣어
cssRules로 확인했다 (규칙 9개).24px.8,.5,$text,50%,calc(100% - 10px),all .2s ease-in-out#FFF.color-0-클래스 +#FFF--255id1px solid #DDD9개 중 실제로 적용되는 규칙은
width하나뿐이다.공백이 들어간 값은 HTML
class속성에서도 여러 토큰으로 쪼개진다(transition-0-all/.2s/ease-in-out--255). 그래서 CSS를 쓸 때 이스케이프(CSS.escape)하는 것만으로는 해결되지 않는다. 이스케이프한 규칙도 파싱은 되지만 매칭되는 클래스가 없다. 클래스명을 만들 때 값을 인코딩해야 한다.프로덕션(비 debug) 빌드는 base-37 이름(
a,b, …)을 쓰므로 영향이 없다.수정
sheet_to_classname의 debug 분기에서 값도 selector와 같은encode_selector를 거치게 했다..8→_d_8,$text→_dl_text,#FFF→_h_FFF,50%→50_pc_,all .2s ease-in-out→all_s__d_2s_s_ease-in-out-,_만 있는 값(24px,red)은 그대로다테스트
libs/css:test_debug_sheet_to_classname_encodes_value추가 (0.8,$text,#fff,50%,all .2s ease-in-out)packages/components: 원시 값이 들어간 debug 클래스명을 기대하던toHaveClass단언 7곳(Input, Textarea, Select, Stepper)을 인코딩된 이름으로 바꿨다검증 (Windows, Bun 1.4.2)
bun run test(pre-commit): Rust 커버리지 98.19% (9015/9181, +0.00%),bun test5204 pass / 0 fail, 89 snapshots, 함수·라인 커버리지 100%bun run lint: 통과 (변경과 무관한 기존 경고 1건):active는 빼고 검사),background,transition,color,height,opacity적용 확인 (수정 전: 3/9 파싱, 1개 적용)릴리스
@devup-ui/wasmPatch changepack을 추가했다. 플러그인들은workspace:^로 의존하므로 semver 범위 안에서 수정본을 받는다.의존성 업데이트
bunx @dependency-check-updates/cli -d -u --rm으로 모든 manifest를 최신으로 올리고,bun.lock과Cargo.lock을 처음부터 다시 만들었다. 그래서 전이 의존성도 호환되는 최신 버전으로 올라갔다.주요 변경:
actions-rust-lang/setup-rust-toolchainv1 → v2업그레이드 때문에 고친 것
ParserReturn::panicked가 같은 의미의fatal_error로 이름이 바뀌어 3곳을 고쳤다.toHaveStyle단언 5개가 실패했다. 그런데 이 단언들은 원래부터 아무것도 검사하지 않고 있었다. happy-dom 20.11은 style setter에서var()를 거부해서 기대값이''가 되고, 테스트 DOM에는 생성된 CSS가 로드되지 않아 계산된 스타일도''이라 항상 통과했다. 20.14가var()를 파싱하면서 드러났다. 다른 컴포넌트 테스트처럼 해당 선언을 가진 debug 클래스를toHaveClass로 확인하도록 바꿨다.RUSTFLAGS=-D warnings대신CARGO_BUILD_WARNINGS=deny로 바뀌었다. 그래서bindings/devup-ui-wasm/.cargo/config.toml의 rustflags가 로컬과 똑같이 CI에서도 적용된다. action input은 쓰지 않으므로 워크플로우 수정은 없다.올리지 못한 것
minicov0.3.8 (0.3.9 있음):wasm-bindgen-test 0.3.78이=0.3.8로 고정한다. wasm32 커버리지 전용 전이 의존성이라 upstream이 올려야 한다.typescript-eslint8.70의 peer가typescript <6.1.0이라 설치 시 TS 7.0.2 경고가 난다. 기존과 같은 상황이고, ESLint는 이미eslint-typescript6.cjs로 TS 6에서 돌고 있다. upstream이 TS 7을 지원해야 한다.참고
@devup-ui/react와@devup-ui/components의dependencies.react가^19.3으로 올라갔다.검증 (업데이트 후, Windows)
bun run lint: 통과bun run test: Rust 커버리지 98.20% (9017/9182, +0.00%),bun test5204 pass / 0 fail, 커버리지 100%bun-plugin test:regression5/0,verify:dist통과build(vinext),build:next