Repository navigation
Open
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
164 remaining items
fix(plugins): reserve shared counter slots before extraction
fix(plugin-utils): isolate invalid manifest shapes during reservation
fix(plugin-utils): ignore quoted import snippets during discovery
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 (…