remove unused apparatus around immutable option

proxied-state-each-blocks
Rich Harris 2 years ago
parent 2347fd12f6
commit 95fa5ec66f

@ -261,14 +261,7 @@ export function client_component(source, analysis, options) {
}
const component_block = b.block([
b.stmt(
b.call(
'$.push',
b.id('$$props'),
b.literal(analysis.runes),
...(options.immutable ? [b.literal(true)] : [])
)
),
b.stmt(b.call('$.push', b.id('$$props'), b.literal(analysis.runes))),
...store_setup,
...legacy_reactive_declarations,
...group_binding_declarations,

@ -2104,7 +2104,7 @@ export function server_component(analysis, options) {
}
const component_block = b.block([
b.stmt(b.call('$.push', b.literal(analysis.runes), ...(options.immutable ? [b.true] : []))),
b.stmt(b.call('$.push', b.literal(analysis.runes))),
.../** @type {import('estree').Statement[]} */ (instance.body),
.../** @type {import('estree').Statement[]} */ (template.body),
b.stmt(b.call('$.pop'))

@ -110,8 +110,6 @@ export function create_component_context(props) {
c: null,
// effects
e: null,
// immutable
i: false,
// mounted
m: false,
// parent
@ -1163,17 +1161,6 @@ export function mutable_source(initial_value) {
return s;
}
/**
* @returns {import('./types.js').EqualsFunctions}
*/
function get_equals_method() {
const context = current_component_context;
if (context && !context.i) {
return safe_equal;
}
return default_equals;
}
/**
* Use `untrack` to prevent something from being treated as an `$effect`/`$derived` dependency.
*
@ -1785,13 +1772,11 @@ export function onDestroy(fn) {
/**
* @param {import('./types.js').MaybeSignal<Record<string, unknown>>} props
* @param {any} runes
* @param {any} immutable
* @returns {void}
*/
export function push(props, runes = false, immutable = false) {
export function push(props, runes = false) {
const context_stack_item = create_component_context(props);
context_stack_item.r = runes;
context_stack_item.i = immutable;
current_component_context = context_stack_item;
}

@ -47,8 +47,6 @@ export type ComponentContext = {
p: null | ComponentContext;
/** context */
c: null | Map<unknown, unknown>;
/** immutable */
i: boolean;
/** runes */
r: boolean;
/** update_callbacks */

@ -115,10 +115,9 @@ export function render(component, options) {
/**
* @param {boolean} runes
* @param {boolean} [immutable]
*/
export function push(runes, immutable) {
$.push({}, runes, immutable);
export function push(runes) {
$.push({}, runes);
}
export function pop() {

Loading…
Cancel
Save