Repository navigation
Conversation
…bals Two apps in one process shared the single process-wide engine state. Gather the persistent state into values that can be exchanged with the live globals: - css::engine_state::CssState holds the prefix, debug flag, atom hoist threshold and plan, slot reservation, class map, file map, canonical map, file routes, custom shorthands, theme tokens and Tailwind definitions. css::test_state::TestStateGuard is now built on it. - extractor::ExtractorCaches holds the vanilla-extract imported runs and stripped TypeScript of the calling thread. - devup_ui_binding_core::session keeps session 0 live from the start and parks every other session's EngineState (CSS state + stylesheet). select_session swaps a parked state with the live globals, with_session runs a closure under the session lock and swaps back, also on unwind. Extractor caches are parked per thread and aligned on every switch, since they hold Rc values and session file numbers. - PerSession<T> keys host values by the live session; the WASM and native module resolvers use it. Existing call sites read the globals unchanged; until a host creates a session the engine behaves as before. Refs #686 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add the engine session calls to the WASM and native engines: - createSession() returns the id of a new session with a clean state - selectSession(id) makes it live; every later call works on its state - dropSession(id) drops it with its module resolver, returning whether it existed; dropping the live session makes session 0 live The shared argument boundary checks the id as an unsigned 32-bit integer before engine entry. The ABI grows from 29 to 32 names: the WASM glue check, the native adapter and typings, the e2e ABI list, the validation positions (47 in 20 functions, 283 invalid-input cases) and a parity corpus scenario follow it. Refs #686 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hape Refs #686 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs #686 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 15, 2026
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
Keep main's check_resolved_path/resolved_module re-exports beside the session re-exports in libs/binding. removeFile (#951) only touches the file map, canonical map, class map and global sheet, which CssState and EngineState already swap per session; a new session test pins that forgetting a file in one session leaves another session's styles alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in main through #963, including removeFile (#951). The ABI now holds 33 names: main's 30 plus createSession, selectSession and dropSession. Updated script.js, the native typings and README, the e2e ABI list and consumer, and compiler-types (32 without Output). Validation covers 48 positions in 21 functions (288 cases), and the summary reports 21 functions. The corpus keeps both new scenarios and adds remove-file-stays-in-its-session, which checks that removeFile only forgets the file in the live session (28 scenarios). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 of 2 tasks
extractor/lib.rs keeps both this branch's ExtractorCaches export and main's vanilla_extract_theme_import_tests module. Main added no binding exports since the last merge, so the counts stay: 33 ABI names, 21 validated functions with 48 positions and 288 cases, and 28 parity scenarios. #967's serialization cache needs no session state: a session switch swaps the sheet through a tracked mutable borrow, which forgets the cached serializations. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
owjs3901
added a commit
that referenced
this pull request
Nov 17, 2026
extractor/lib.rs keeps both this branch's ExtractorCaches export and main's vanilla_extract_theme_import_tests module, as #964 resolved it. Main's new state needs no session handling: the stylesheet-export COMPILING stack is empty between calls, and the CSS serialization cache is dropped when a session swap borrows the sheet mutably. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Picks up #983's snapshot fix so CI runs against the current main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
NXT-07 step 2: exposes the engine sessions built in #963 as public API of the WASM and native (NAPI) engines.
createSession(): creates a new session with a clean state and returns its id (u32).selectSession(id): makes that session live. All later calls work on that session's state (numbering, sheets, theme, config, module resolver).dropSession(id): drops the session and its module resolver, and returns whether it existed (boolean). Dropping the live session makes session 0 live. Session 0 cannot be dropped.bindings/argument-validation.cjs) checks the id as an unsigned 32-bit integer before it reaches the engine. A violation throwsTypeError; a nonexistent session or an attempt to drop session 0 throwsError.script.js)index.d.cts,index.mjs)sessions-keep-apart-until-dropped## Sessionssection added to WASM)Expected conflicts
removeFile) also touches the ABI count (29→30),argument-validation.cjs, the adapter, typings, and the e2e list. Whichever merges later must combine the counts (e.g. 33).Test plan
cargo test -p devup-ui-binding-core -p devup-ui-wasm -p devup-ui-binding --tests -j 2-D warnings) andcargo check --target wasm32-unknown-unknownscript.jspasses) and native build (x86_64-pc-windows-msvc)bun test: 52 pass inwasm-abi.test.ts,wasm-reset.test.ts,compiler-types.test.tsrecords.jsonlare byte-identical, and the session scenario is included.e2e/binding/validation.mjs: 283 cases / 47 positions / 20 functions / 566 runs, failed 0, missing 0, crash 0요약
NXT-07 2단계: #963에서 만든 엔진 세션을 WASM과 네이티브(NAPI) 엔진의 공개 API로 노출합니다.
createSession(): 깨끗한 상태의 새 세션을 만들고 id(u32)를 돌려줍니다.selectSession(id): 해당 세션을 live로 만듭니다. 이후 모든 호출은 그 세션의 상태(번호 매김, 시트, 테마, 설정, 모듈 resolver)에서 동작합니다.dropSession(id): 세션과 그 모듈 resolver를 버리고, 존재했는지 여부(boolean)를 돌려줍니다. live 세션을 버리면 세션 0이 live가 됩니다. 세션 0은 버릴 수 없습니다.bindings/argument-validation.cjs)가 엔진에 들어가기 전에 id를 unsigned 32-bit 정수로 검사합니다. 위반하면TypeError, 없는 세션이거나 세션 0을 버리려 하면Error를 던집니다.script.js)index.d.cts,index.mjs)sessions-keep-apart-until-dropped## Sessions섹션 추가)충돌 예상
removeFile)도 ABI 개수(29→30),argument-validation.cjs, adapter, typings, e2e 목록을 건드립니다. 나중에 머지되는 쪽에서 개수를 합쳐야 합니다(예: 33).테스트 계획
cargo test -p devup-ui-binding-core -p devup-ui-wasm -p devup-ui-binding --tests -j 2-D warnings)와cargo check --target wasm32-unknown-unknownscript.js의 32개 export 검사 통과)와 네이티브 빌드(x86_64-pc-windows-msvc)bun test:wasm-abi.test.ts,wasm-reset.test.ts,compiler-types.test.ts52개 통과records.jsonl451줄이 바이트 단위로 동일하고, 세션 시나리오도 포함됩니다.e2e/binding/validation.mjs: 283 cases / 47 positions / 20 functions / 566 runs, failed 0, missing 0, crash 0Refs #686
🤖 Generated with Claude Code