Skip to content

Commit d601119

Browse files
refactor(signals,compiler): complete the patch removal — field diet, dead builders, budget reclaim
The cherry-picked gut left null-constant hook seams and the pc struct; this finishes the job: emission gates and row-ops builders deleted from store/reconcile/optimistic, the scheduler's _heldPatches merge dropped, and the six-field PatchChannel struct dieted to the one field the core actually uses — the written-keys bound, now t.wk directly (same named- field count, the array hidden-class rule holds). Rust loses the dead has_binding helper. Patch size scenarios deleted; all seven remaining tiers ratchet DOWN (up to -900 B brotli on the store-family app). Suites: signals 1461, web 667, solid 580, babel 232, compiler 5335+49. Co-authored-by: Cursor <[email protected]>
1 parent 2abab0f commit d601119

13 files changed

Lines changed: 83 additions & 844 deletions

File tree

‎.changeset/gut-patch-channel-region-branch.md‎

Lines changed: 0 additions & 7 deletions
This file was deleted.

‎.changeset/gut-patch-compiler-region-branch.md‎

Lines changed: 0 additions & 8 deletions
This file was deleted.

‎.changeset/remove-patch-channel.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
"@solidjs/signals": patch
3+
"@solidjs/web": patch
4+
"solid-js": patch
5+
"@solidjs/universal": patch
6+
"@solidjs/compiler": patch
7+
"@solidjs/babel-plugin-jsx": patch
8+
---
9+
10+
Remove the experimental patch channel and patch-mode list driver (always opt-in, never default). Graph-native regions own value delivery and the unified-For design owns list structure, so the channel's parallel delivery machinery is retired: `patch.ts`/`patch-driver.ts` deleted, the compiler-contract exports (`registerPatch`/`registerRowOps`/`registerSlotPatch`/`patchableRaw`, `patchDriver`/`rowProof`/`driveList`) removed, the `patchDriver` compiler option dropped from both compilers, the insert `$ll` seam stripped, and the write-side channel struct dieted to the single written-keys bound (`t.wk`) the core fold/notify paths actually use. Store-family app bundles reclaim up to ~900 B brotli; every measured tier shrinks.

‎packages/compiler/src/shared/bindings.rs‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -173,15 +173,9 @@ impl BindingTable {
173173
});
174174
}
175175

176-
/// Whether `name` resolves to ANY live declaration (Babel's
177-
/// `scope.getBinding` presence check for the patch-mode subject guard).
178-
pub(crate) fn has_binding(&self, name: &str) -> bool {
179-
self.resolve(name).is_some()
180-
}
181-
182176
/// Declares a function's parameters in the current frame. The statement
183-
/// walk only covers declarations; patch-mode subject resolution needs
184-
/// params (row functions' subjects ARE their params).
177+
/// walk only covers declarations; subject resolution needs params (row
178+
/// functions' subjects ARE their params).
185179
pub(crate) fn declare_function_params(&mut self, params: &oxc_ast::ast::FormalParameters<'_>) {
186180
let mut names = std::vec::Vec::new();
187181
for param in &params.items {

‎packages/signals/DESIGN-PATCH-CHANNEL.md‎

Lines changed: 0 additions & 250 deletions
This file was deleted.

‎packages/signals/src/core/scheduler.ts‎

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -223,27 +223,6 @@ function mergeTransitionState(target: Transition, outgoing: Transition): void {
223223
outgoing._affectsNodes.length = 0;
224224
}
225225
for (const store of outgoing._optimisticStores) target._optimisticStores.add(store);
226-
// Patch-channel stash (store/next/patch.ts): entries held for the outgoing
227-
// transition must ride the merge like every other per-transition
228-
// collection — releaseBatch only reads the COMMITTING transition's stash,
229-
// so a stranded sidecar would silently drop its patches. Move (don't
230-
// copy), same aliasing rule as the collections above. The field is an
231-
// expando so this module stays free of patch imports (pay-for-use).
232-
const heldPatches = (outgoing as any)._heldPatches as unknown[] | undefined;
233-
if (heldPatches !== undefined) {
234-
(outgoing as any)._heldPatches = undefined;
235-
let dest = (target as any)._heldPatches as unknown[] | undefined;
236-
if (dest !== undefined) dest.push(...heldPatches);
237-
else dest = (target as any)._heldPatches = heldPatches;
238-
// Retarget the entries' coalescing stamps to the surviving stash
239-
// (opaque backref contract with store/next/patch.ts): without this a
240-
// post-merge emission misses the stamp and pushes a SECOND entry —
241-
// the record's patch applies twice at commit (re-audit 5, P1-2).
242-
for (let i = 0; i < heldPatches.length; i++) {
243-
const pc = (heldPatches[i] as any).pc;
244-
if (pc !== undefined && pc.qe === heldPatches[i]) pc.qa = dest;
245-
}
246-
}
247226
// Legal transfer, not a new registration: entries move between transitions.
248227
if (__DEV__) beginAsyncReporterWrites();
249228
for (const [source, reporters] of outgoing._asyncReporters) {

0 commit comments

Comments
 (0)