svelte
Advanced tools
Comparing version 5.0.0-next.97 to 5.0.0-next.98
@@ -5,3 +5,3 @@ { | ||
"license": "MIT", | ||
"version": "5.0.0-next.97", | ||
"version": "5.0.0-next.98", | ||
"type": "module", | ||
@@ -8,0 +8,0 @@ "types": "./types/index.d.ts", |
@@ -430,3 +430,8 @@ import { walk } from 'zimmerframe'; | ||
b.import_meta_hot(), | ||
b.call('$.hmr', b.member(b.import_meta_hot(), b.id('data')), b.id(analysis.name)), | ||
b.call( | ||
'$.hmr', | ||
b.member(b.import_meta_hot(), b.id('data')), | ||
b.id(analysis.name), | ||
b.member(b.member(b.literal('import'), b.literal('meta')), b.literal('url')) | ||
), | ||
b.id(analysis.name) | ||
@@ -433,0 +438,0 @@ ) |
@@ -8,11 +8,22 @@ import { block, branch, destroy_effect } from '../reactivity/effects.js'; | ||
* @template {(anchor: Comment, props: any) => any} Component | ||
* @param {{ source: import("#client").Source<Component>; wrapper: Component; }} data | ||
* @param {{ components: Map<string, { source: import("#client").Source<Component>; wrapper: null | Component; }> }} hot_data | ||
* @param {string} key | ||
* @param {Component} component | ||
*/ | ||
export function hmr(data, component) { | ||
if (data.source) { | ||
export function hmr(hot_data, component, key) { | ||
var components = (hot_data.components ??= new Map()); | ||
var data = components.get(key); | ||
if (data === undefined) { | ||
components.set( | ||
key, | ||
(data = { | ||
source: source(component), | ||
wrapper: null | ||
}) | ||
); | ||
} else { | ||
set(data.source, component); | ||
} else { | ||
data.source = source(component); | ||
} | ||
const component_source = data.source; | ||
@@ -27,3 +38,3 @@ return (data.wrapper ??= /** @type {Component} */ ( | ||
block(() => { | ||
const component = get(data.source); | ||
const component = get(component_source); | ||
@@ -30,0 +41,0 @@ if (effect) { |
@@ -134,3 +134,2 @@ import { DEV } from 'esm-env'; | ||
// eslint-disable-next-line eqeqeq | ||
if (get_value() == undefined) { | ||
@@ -137,0 +136,0 @@ update(false); |
@@ -12,6 +12,4 @@ /** @type {import('#client').Equals} */ | ||
export function safe_not_equal(a, b) { | ||
// eslint-disable-next-line eqeqeq | ||
return a != a | ||
? // eslint-disable-next-line eqeqeq | ||
b == b | ||
? b == b | ||
: a !== b || (a !== null && typeof a === 'object') || typeof a === 'function'; | ||
@@ -18,0 +16,0 @@ } |
@@ -1,2 +0,1 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-empty-function | ||
export const noop = () => {}; | ||
@@ -3,0 +2,0 @@ |
@@ -50,6 +50,3 @@ import { DEV } from 'esm-env'; | ||
/** @type {string} */ | ||
var method; | ||
for (method of read_methods) { | ||
for (const method of read_methods) { | ||
// @ts-ignore | ||
@@ -63,3 +60,3 @@ proto[method] = function (...v) { | ||
for (method of set_like_methods) { | ||
for (const method of set_like_methods) { | ||
// @ts-ignore | ||
@@ -66,0 +63,0 @@ proto[method] = function (...v) { |
@@ -30,7 +30,3 @@ import { noop, run_all } from '../internal/shared/utils.js'; | ||
export function safe_not_equal(a, b) { | ||
// eslint-disable-next-line eqeqeq | ||
return a != a | ||
? // eslint-disable-next-line eqeqeq | ||
b == b | ||
: a !== b || (a && typeof a === 'object') || typeof a === 'function'; | ||
return a != a ? b == b : a !== b || (a && typeof a === 'object') || typeof a === 'function'; | ||
} | ||
@@ -37,0 +33,0 @@ |
@@ -9,3 +9,3 @@ // generated during release, do not modify | ||
*/ | ||
export const VERSION = '5.0.0-next.97'; | ||
export const VERSION = '5.0.0-next.98'; | ||
export const PUBLIC_VERSION = '5'; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
1926226
41377