Skip to content

Commit ccc47a0

Browse files
committed
remove unused second argument to source, and runtime immutable option to createRoot (not sure what that was doing there?)
1 parent 84a30b5 commit ccc47a0

File tree

3 files changed

+9
-24
lines changed

3 files changed

+9
-24
lines changed

packages/svelte/src/internal/client/render.js

+6-15
Original file line numberDiff line numberDiff line change
@@ -2606,7 +2606,6 @@ export function spread_props(props) {
26062606
* events?: Events;
26072607
* context?: Map<any, any>;
26082608
* intro?: boolean;
2609-
* immutable?: boolean;
26102609
* recover?: false;
26112610
* }} options
26122611
* @returns {Exports & { $destroy: () => void; $set: (props: Partial<Props>) => void; }}
@@ -2624,15 +2623,8 @@ export function createRoot(component, options) {
26242623
* @param {any} value
26252624
*/
26262625
function add_prop(name, value) {
2627-
const prop = source(
2628-
value,
2629-
options.immutable
2630-
? /**
2631-
* @param {any} a
2632-
* @param {any} b
2633-
*/ (a, b) => a === b
2634-
: safe_equal
2635-
);
2626+
const prop = source(value);
2627+
prop.e = safe_equal; // TODO should this be default_equal?
26362628
_sources[name] = prop;
26372629
define_property(_props, name, {
26382630
get() {
@@ -2666,11 +2658,10 @@ export function createRoot(component, options) {
26662658
return _props[property];
26672659
}
26682660
});
2669-
const props_source = source(
2670-
props_proxy,
2671-
// We're resetting the same proxy instance for updates, therefore bypass equality checks
2672-
() => false
2673-
);
2661+
const props_source = source(props_proxy);
2662+
2663+
// We're resetting the same proxy instance for updates, therefore bypass equality checks
2664+
props_source.e = safe_equal;
26742665

26752666
let [accessors, $destroy] = mount(component, {
26762667
...options,

packages/svelte/src/internal/client/runtime.js

+3-8
Original file line numberDiff line numberDiff line change
@@ -1142,25 +1142,20 @@ export function derived(init) {
11421142
/**
11431143
* @template V
11441144
* @param {V} initial_value
1145-
* @param {import('./types.js').EqualsFunctions<V>} [equals]
11461145
* @returns {import('./types.js').SourceSignal<V>}
11471146
*/
11481147
/*#__NO_SIDE_EFFECTS__*/
1149-
export function source(initial_value, equals) {
1148+
export function source(initial_value) {
11501149
const source = create_source_signal(SOURCE | CLEAN, initial_value);
11511150
source.x = current_component_context;
1152-
source.e = get_equals_method(equals);
1151+
source.e = get_equals_method();
11531152
return source;
11541153
}
11551154

11561155
/**
1157-
* @param {import('./types.js').EqualsFunctions} [equals]
11581156
* @returns {import('./types.js').EqualsFunctions}
11591157
*/
1160-
function get_equals_method(equals) {
1161-
if (equals !== undefined) {
1162-
return equals;
1163-
}
1158+
function get_equals_method() {
11641159
const context = current_component_context;
11651160
if (context && !context.i) {
11661161
return safe_equal;

packages/svelte/src/legacy/legacy-client.js

-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ class Svelte4Component {
6868
target: options.target,
6969
props: { ...options.props, $$events: this.#events },
7070
context: options.context,
71-
immutable: options.immutable,
7271
intro: options.intro,
7372
recover: options.recover
7473
});

0 commit comments

Comments
 (0)