Repository navigation
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
class 이름과 파일 번호를 처음 본 순서로 매기기 때문에, 같은 소스라도 처리 순서가 바뀌면 이름이 바뀝니다. 확인 예: 같은 두 파일을 순서만 바꿔 처리하면 a.tsx의 class가 a b에서 c d로 바뀝니다.
전체 계획과 결정 사항은 추적 이슈(#682)에 있습니다. 조사 기준 커밋: 77daad74 (현재 main d0b84255).
결정에 따른 작업
- (권장) 빌드 시작 시 모든 파일을 경로 순으로 먼저 훑어 번호를 확정하고 결과를 재사용(모든 플러그인). 측정: devup 파일 1,000개당 약 0.2~1초
- (권장) dev에서 새로 생긴 class는 번호를 뒤에 이어 붙임(dev와 prod 이름은 다를 수 있음)
- (권장) 모듈 간 keyframes/class 이름(KNOWN-9)은 이 작업 후 다시 검토
발견 항목
심각도: P0 = 흔한 사용에서 조용히 틀리거나 크래시, P1 = 흔한 패턴이 명시적 에러로 막히거나 드물게 조용히 틀림, P2 = 드문 경우·도구/문서 불일치, P3 = 있으면 좋음.
권장 (14)
- INF-12 (P0, NONDET) File-derived names depend on first-seen worker order
- 근거:
get_file_num_by_filenameassignsmap.len()(file_map.rs:74-93); vanilla-extract IDs include that number (vanilla_extract.rs:109-111,438). - 수정 방향: derive IDs from stable canonical paths/content or preassign sorted files centrally.
- 근거:
- INF-15 (P1, NONDET) Full vanilla-extract Boa evaluation lacks the restricted determinism prelude
- 근거: build-time-values disables Date/random/locale/environment (
build_time_values.rs:943-963), but vanilla context creation atvanilla_extract.rs:250-282does not apply it. - 수정 방향: share the deterministic prelude or explicitly reject nondeterministic globals in stylesheet evaluation.
- 근거: build-time-values disables Date/random/locale/environment (
- NXT-01 (P1, NONDET) Development class names depend on Turbopack request order
- 근거:
extraction-order.tsruns the existing WASM in fresh processes.abtransforms red to classaand blue tob;batransforms blue toaand red tob. Development skips sorted prewarm (plugin.ts:371) and coordinator extraction executes in HTTP arrival order (coordinator.ts:432-483). - 수정 방향: Deterministically seed class/file maps in development before accepting loader requests, or derive identifiers from canonical content rather than mutation order.
- 근거:
- NXT-02 (P1, NONDET) Root-level App/Pages Router projects bypass deterministic prewarm
- 근거:
plugin.ts:293-325hard-codes<cwd>/src.root-router-graph.tscreatedapp/page.tsxat project root and observedgraphFiles=[],compiled=[]. The coordinator then uses idle completion (coordinator.ts:247-259), which can serve before a later extraction wave. - 수정 방향: Discover both root and
srcrouters (or set graph root to the project and exclude generated/dependency directories) and prewarm the real route closure.
- 근거:
- NXT-03 (P1, NONDET) Pages Router never produces a deterministic completion set
- 근거:
plugin-utils/import-graph.ts:74-76,322-336only treats a basenamepage.*as a leaf route. Normal Pages routes such assrc/pages/about.tsx,_app.tsx, and index files therefore leaveexpectedBaseFiles=[];/css?waitForIdle=truefalls back to traffic timing atcoordinator.ts:247-259. - 수정 방향: Add Pages Router entry discovery and
_app/_documentshell reachability; pass that compiled set to prewarm/coordinator completion.
- 근거:
- NXT-08 (P1, NONDET) Concurrent processes sharing
dfcan cross-wire coordinators and corrupt state- 근거: Turbo defaults all modes to
distDir='df'(plugin.ts:136) and sharescoordinator.port, sheet, class map, and file map paths (plugin.ts:150-155,267). Each startup deletes then rewrites the shared port (plugin.ts:462-469); each process writes the same state files. - 수정 방향: Namespace state by project identity plus Next phase/build ID (or derive from Next's actual output directory); use atomic ownership metadata in the port file.
- 근거: Turbo defaults all modes to
- PLG-14 (P1, NONDET) Per-file class/file numbering remains nondeterministic for included libraries and Rsbuild
- 근거: Vite seeds sorted files only under local
src/app; webpack prewarms only localsrc; Rsbuild does neither. Include-listed package modules are transformed on bundler arrival, so the shared engine assigns numbers according to parallel module order. This changesdevup-ui-N.css, class prefixes, and output hashes between identical builds. - 수정 방향: Seed from the deterministic resolved module graph (including included packages) or derive IDs from stable normalized paths without arrival-order allocation.
- 근거: Vite seeds sorted files only under local
- PLG-15 (P1, NONDET) Shared WASM configuration leaks between builds/plugin instances
- 근거:
setPrefixis called only when prefix is truthy; atom hoist/routes/canonical maps are only imported when enabled/planned; no plugin resets those globals when options are absent or a plan fails. The WASM sheet itself is process-global. A later compiler in the same process can inherit prefix, routes, atom threshold, maps, classes, or styles from an earlier compiler. - 수정 방향: Introduce explicit engine build-session/reset APIs or instance-scoped WASM state; set every option, including disabled/default values, on every setup.
- 근거:
- PLG-16 (P1, NONDET) Async persistence writes can commit older global state last
- 근거: Webpack loader synchronously mutates the engine, snapshots
exportSheet/classMap/fileMap, then launches independent async writes per concurrent module (loader.ts:100-127). An older transform's writes may finish after a newer snapshot. Vite also sets its content cache before asynchronous writes and concurrent writes to the same base filename are not serialized. - 수정 방향: Serialize/coalesce writes per destination with a monotonic revision and atomic temp-file rename; never permit revision N to overwrite N+1.
- 근거: Webpack loader synchronously mutates the engine, snapshots
- PLG-17 (P1, NONDET) Vite multi-environment CSS forwarding is order-dependent
- 근거:
serverBundleToForwardis populated only when the servergenerateBundleruns; client overlap removal occurs only if that variable is already set (vite plugin.ts:597-615). A concurrent/client-first build skips dedup and can retain theFILE_NAME_CONFLICTthe code intends to prevent. - 수정 방향: Coordinate both completed bundle records before mutating forwarding metadata, or perform dedup in an environment-independent finalization point.
- 근거:
- INF-11 (P2, NONDET) Class numbers depend on unordered style traversal — 재검증 후 P0→P2: 같은 입력이면 같은 출력(시드 없는 해시). 불안정 문제
- 근거:
StyleSheet::update_stylesconsumesFxHashSet(sheet/src/lib.rs:487-589) beforeclass_num_for_keyallocates from global map length (css/src/lib.rs:368-380); sorting occurs only after names exist. - 수정 방향: sort a stable style key before first class registration; test equivalent sets inserted in opposite orders.
- 근거:
- INF-13 (P2, NONDET) Vanilla global styles/constants preserve evaluator insertion order
- 근거: unlike styles/keyframes,
global_stylesandconstant_exportsvectors emit unsorted atvanilla_extract.rs:1421-1437. - 수정 방향: attach a stable source/index key and sort before emission.
- 근거: unlike styles/keyframes,
- INF-14 (P2, NONDET) Exported map JSON is not canonical
- 근거: hash-backed class/file/canonical maps are serialized directly at binding lines
240-300. - 수정 방향: serialize sorted
BTreeMapviews or document these strings as non-canonical.
- 근거: hash-backed class/file/canonical maps are serialized directly at binding lines
- NXT-16 (P2, NONDET) Coordinator port publication is unvalidated and non-atomic
- 근거: startup writes the bare port directly (
coordinator.ts:665-670); readers callparseIntand cache the result without finite/range/health validation (loader.ts:43-49,css-loader.ts:27-30). A torn/empty/stale file can cacheNaNor the wrong listener. - 수정 방향: Write JSON
{pid,port,token,project}to a temporary file then rename; validate fields and/healthtoken before caching.
- 근거: startup writes the bare port directly (
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Activity
fix(plugins): number buckets and extracted files only, leave vite css…
chore: merge main into deterministic numbering
test(vite-plugin): follow array and restore plugin contract
test(css): cover route unions and restored mixed atom placement
test(next-plugin): release injected loader namespaces between suites
chore: merge plugin-core into next coordinator
chore: merge plugin-core CI fixes into next coordinator
chore: merge plugin-core numbering and library CSS fixes
fix(extractor): prove module effects before exact stylesheet evaluation
fix(extractor): reject recoverable source and semantic parse errors
fix(extractor): reject synthetic reflection during static evaluation
test(extractor): cover evaluation setup and naming seams
chore(wasm): record located diagnostics patch changepack
chore: merge prepared graph APIs into next coordinator
167 remaining items
fix(plugin-utils): reserve literal CommonJS dependency closures
fix(rsbuild): reserve current final compiler entries
fix(plugin-utils): refresh slots after resolution-only changes
chore: merge main into order-independent class slots
chore: merge Next webpack JSX and source map prerequisite
chore: merge latest class reservations into Vite slots
chore: merge settled main into Vite slots
fix(vite): reserve shared class slots before extraction
owjs3901 commentedon Nov 15, 2026
main(
1160bf646)에 병합된 수정을 확인해 체크리스트를 갱신했습니다.새로 체크한 항목 (8건)
아직 열린 PR로만 다루는 항목 (5건): NXT-01 (#939), NXT-03 (#943), NXT-08 (#941), NXT-16 (#917), PLG-17 (#953)
판단을 보류한 항목: INF-13. #743은 코드 변경 없이 평가 순서(= 소스 순서)를 유지한다고 정리했습니다. 수정 방향(정렬)과 달라서 체크하지 않았습니다.
체크하지 않은 결정 항목: 3건 모두. 경로 순 번호 확정은 next dev(NXT-01)가 남아 있고, dev append와 KNOWN-9는 별도로 확인하지 못했습니다.
fix(plugin-utils): count every Next route file in the compiled set (#943
fix(next-plugin): keep each coordinator's port and recover from resta…
fix(next-plugin): reserve shared class slots before next dev extracts (…
fix(next-plugin): keep coordinator state per process on a shared dist…
owjs3901 commentedon Nov 17, 2026
Re-verified against main
e9e5801cc. Every item is resolved in main, so I am closing this issue. No new PR was needed, and none of the open PRs (#915, #922, #965, #966, #969, #972, #978, #981, #984, #985, #986, #987, #989) is required for this area.How it was checked
I generated a fixture of 30 components. Each component has a background, padding, margin,
_hover, a responsive width, a localkeyframesand acss()class. Each one is imported by two parents, so per-file mode emits separate buckets. I built it three times per configuration, withsingleCssoff and on:I then compared the class names of every component and every emitted stylesheet.
transformRequestorder forward/reversed with jitterDevupUIWebpackPlugin)next dev --webpack, reversed)next dev --turbopack, reversed)Bun.build)With
singleCss: false, Rsbuild and Next concatenate the per-file sheets into one chunk following the source import order. When the imports are reversed, that chunk lists the same rules in a different order and gets a different hash. This is expected: the source changed, every rule is scoped to its own file prefix, and the forward and repeat builds are byte-identical.Items
next dev --turbopackgives the same names in either request order.global_stylesandconstant_exportsare filled while Boa evaluates the stylesheet sequentially, andconstant_exportsfollows the AST binding order. The result is source order, which is the same on every run. Global rules must also keep that order, because it is their cascade order, so sorting them would be wrong.collectNumberedFiles, and all of them also reserve shared class slots in path order (createSharedSlotReservation); Rsbuild uses only the slot reservation, which also seeds file numbers in path order. Confirmed by the matrix above.a1-…per-file,d0 d1single). Existing files kept their names after the addition.docs/limitations), not a determinism defect. An importedkeyframes/cssvalue in a style prop compiles to a CSS variable carrying the real name, so it works at runtime and stays deterministic. Using it as a selector key remains an explicit build error. Static cross-module resolution would be a new extraction feature, not part of this area.main
e9e5801cc기준으로 다시 검증했습니다. 모든 항목이 main에서 해결되어 이 이슈를 닫습니다. 새 PR은 필요하지 않았고, 열린 PR(#915, #922, #965, #966, #969, #972, #978, #981, #984, #985, #986, #987, #989) 중 이 영역에 필요한 것도 없습니다.검증 방법
컴포넌트 30개짜리 fixture를 만들었습니다. 각 컴포넌트는 배경, padding, margin,
_hover, 반응형 width, 파일 안keyframes,css()class를 씁니다. 부모 두 곳에서 import하므로 per-file 모드에서 bucket이 따로 생깁니다. 설정마다singleCss끄고·켜고 세 번씩 빌드했습니다.그다음 모든 컴포넌트의 class 이름과 출력 stylesheet를 비교했습니다.
transformRequest정/역순 + 지연)DevupUIWebpackPlugin포함)next dev --webpack, 역순)next dev --turbopack, 역순)Bun.build)singleCss: false일 때 Rsbuild와 Next는 파일별 sheet를 소스 import 순서대로 한 chunk에 이어 붙입니다. import를 뒤집으면 그 chunk의 규칙 순서와 hash가 바뀝니다. 소스가 바뀌었으므로 예상된 동작이고, 규칙은 모두 파일 prefix로 분리되어 있으며, 정방향 반복 빌드는 byte 단위로 같습니다.항목
next dev --turbopack이 요청 순서와 상관없이 같은 이름을 냄global_styles와constant_exports는 Boa가 stylesheet를 순차 평가하면서 채우고,constant_exports는 AST 바인딩 순서를 따릅니다. 결과는 소스 순서이고 실행마다 같습니다. 전역 규칙은 이 순서가 곧 cascade 순서이므로 정렬하면 오히려 틀립니다.collectNumberedFiles로 seed하고, 모두 공유 class slot도 경로 순으로 예약합니다(createSharedSlotReservation). Rsbuild는 slot 예약만 쓰며, 이 예약이 파일 번호도 경로 순으로 seed합니다. 위 표로 확인했습니다.a1-…, singled0 d1). 기존 파일 이름은 추가 후에도 그대로였습니다.docs/limitations)으로 유지하며, 결정성 결함이 아닙니다. 다른 모듈에서 import한keyframes/css값을 style prop에 쓰면 실제 이름을 담은 CSS 변수로 컴파일되어 런타임에 동작하고 결정적입니다. selector 키로 쓰는 경우는 명시적 빌드 에러로 남습니다. 모듈 간 정적 해석은 새 추출 기능이고 이 영역의 범위가 아닙니다.