pull/15844/head
Rich Harris 3 months ago
commit 1d0a945c5c

@ -1,5 +0,0 @@
---
'svelte': patch
---
feat: add parent hierarchy to `__svelte_meta` objects

@ -1,5 +1,17 @@
# svelte # svelte
## 5.35.2
### Patch Changes
- fix: bump esrap ([#16295](https://github.com/sveltejs/svelte/pull/16295))
## 5.35.1
### Patch Changes
- feat: add parent hierarchy to `__svelte_meta` objects ([#16255](https://github.com/sveltejs/svelte/pull/16255))
## 5.35.0 ## 5.35.0
### Minor Changes ### Minor Changes

@ -2,7 +2,7 @@
"name": "svelte", "name": "svelte",
"description": "Cybernetically enhanced web apps", "description": "Cybernetically enhanced web apps",
"license": "MIT", "license": "MIT",
"version": "5.35.0", "version": "5.35.2",
"type": "module", "type": "module",
"types": "./types/index.d.ts", "types": "./types/index.d.ts",
"engines": { "engines": {
@ -174,7 +174,7 @@
"axobject-query": "^4.1.0", "axobject-query": "^4.1.0",
"clsx": "^2.1.1", "clsx": "^2.1.1",
"esm-env": "^1.2.1", "esm-env": "^1.2.1",
"esrap": "^2.0.0", "esrap": "^2.1.0",
"is-reference": "^3.0.3", "is-reference": "^3.0.3",
"locate-character": "^3.0.0", "locate-character": "^3.0.0",
"magic-string": "^0.30.11", "magic-string": "^0.30.11",

@ -11,7 +11,7 @@ import {
untrack, untrack,
increment_write_version, increment_write_version,
update_effect, update_effect,
reaction_sources, source_ownership,
check_dirtiness, check_dirtiness,
untracking, untracking,
is_destroying_effect, is_destroying_effect,
@ -142,7 +142,7 @@ export function set(source, value, should_proxy = false) {
(!untracking || (active_reaction.f & INSPECT_EFFECT) !== 0) && (!untracking || (active_reaction.f & INSPECT_EFFECT) !== 0) &&
is_runes() && is_runes() &&
(active_reaction.f & (DERIVED | BLOCK_EFFECT | EFFECT_ASYNC | INSPECT_EFFECT)) !== 0 && (active_reaction.f & (DERIVED | BLOCK_EFFECT | EFFECT_ASYNC | INSPECT_EFFECT)) !== 0 &&
!(reaction_sources?.[1].includes(source) && reaction_sources[0] === active_reaction) !(source_ownership?.reaction === active_reaction && source_ownership.sources.includes(source))
) { ) {
e.state_unsafe_mutation(); e.state_unsafe_mutation();
} }

@ -100,17 +100,17 @@ export function set_active_effect(effect) {
/** /**
* When sources are created within a reaction, reading and writing * When sources are created within a reaction, reading and writing
* them within that reaction should not cause a re-run * them within that reaction should not cause a re-run
* @type {null | [active_reaction: Reaction, sources: Source[]]} * @type {null | { reaction: Reaction, sources: Source[] }}
*/ */
export let reaction_sources = null; export let source_ownership = null;
/** @param {Value} value */ /** @param {Value} value */
export function push_reaction_value(value) { export function push_reaction_value(value) {
if (active_reaction !== null && active_reaction.f & EFFECT_IS_UPDATING) { if (active_reaction !== null && active_reaction.f & EFFECT_IS_UPDATING) {
if (reaction_sources === null) { if (source_ownership === null) {
reaction_sources = [active_reaction, [value]]; source_ownership = { reaction: active_reaction, sources: [value] };
} else { } else {
reaction_sources[1].push(value); source_ownership.sources.push(value);
} }
} }
} }
@ -255,10 +255,11 @@ function schedule_possible_effect_self_invalidation(signal, effect, root = true)
if ( if (
!async_mode_flag && !async_mode_flag &&
reaction_sources?.[1].includes(signal) && source_ownership?.reaction === active_reaction &&
reaction_sources[0] === active_reaction source_ownership.sources.includes(signal)
) ) {
continue; continue;
}
if ((reaction.f & DERIVED) !== 0) { if ((reaction.f & DERIVED) !== 0) {
schedule_possible_effect_self_invalidation(/** @type {Derived} */ (reaction), effect, false); schedule_possible_effect_self_invalidation(/** @type {Derived} */ (reaction), effect, false);
@ -280,7 +281,7 @@ export function update_reaction(reaction) {
var previous_untracked_writes = untracked_writes; var previous_untracked_writes = untracked_writes;
var previous_reaction = active_reaction; var previous_reaction = active_reaction;
var previous_skip_reaction = skip_reaction; var previous_skip_reaction = skip_reaction;
var previous_reaction_sources = reaction_sources; var previous_reaction_sources = source_ownership;
var previous_component_context = component_context; var previous_component_context = component_context;
var previous_untracking = untracking; var previous_untracking = untracking;
@ -293,7 +294,7 @@ export function update_reaction(reaction) {
(flags & UNOWNED) !== 0 && (untracking || !is_updating_effect || active_reaction === null); (flags & UNOWNED) !== 0 && (untracking || !is_updating_effect || active_reaction === null);
active_reaction = (flags & (BRANCH_EFFECT | ROOT_EFFECT)) === 0 ? reaction : null; active_reaction = (flags & (BRANCH_EFFECT | ROOT_EFFECT)) === 0 ? reaction : null;
reaction_sources = null; source_ownership = null;
set_component_context(reaction.ctx); set_component_context(reaction.ctx);
untracking = false; untracking = false;
read_version++; read_version++;
@ -389,7 +390,7 @@ export function update_reaction(reaction) {
untracked_writes = previous_untracked_writes; untracked_writes = previous_untracked_writes;
active_reaction = previous_reaction; active_reaction = previous_reaction;
skip_reaction = previous_skip_reaction; skip_reaction = previous_skip_reaction;
reaction_sources = previous_reaction_sources; source_ownership = previous_reaction_sources;
set_component_context(previous_component_context); set_component_context(previous_component_context);
untracking = previous_untracking; untracking = previous_untracking;
@ -804,8 +805,8 @@ export function get(signal) {
if ( if (
!destroyed && !destroyed &&
((async_mode_flag && (active_reaction.f & DERIVED) === 0) || ((async_mode_flag && (active_reaction.f & DERIVED) === 0) ||
!reaction_sources?.[1].includes(signal) || source_ownership?.reaction !== active_reaction ||
reaction_sources[0] !== active_reaction) !source_ownership?.sources.includes(signal))
) { ) {
var deps = active_reaction.deps; var deps = active_reaction.deps;

@ -4,5 +4,5 @@
* The current version, as set in package.json. * The current version, as set in package.json.
* @type {string} * @type {string}
*/ */
export const VERSION = '5.35.0'; export const VERSION = '5.35.2';
export const PUBLIC_VERSION = '5'; export const PUBLIC_VERSION = '5';

@ -87,8 +87,8 @@ importers:
specifier: ^1.2.1 specifier: ^1.2.1
version: 1.2.1 version: 1.2.1
esrap: esrap:
specifier: ^2.0.0 specifier: ^2.1.0
version: 2.0.0 version: 2.1.0
is-reference: is-reference:
specifier: ^3.0.3 specifier: ^3.0.3
version: 3.0.3 version: 3.0.3
@ -1261,8 +1261,8 @@ packages:
resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==} resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==}
engines: {node: '>=0.10'} engines: {node: '>=0.10'}
esrap@2.0.0: esrap@2.1.0:
resolution: {integrity: sha512-zhw1TDqno99Ld5wOpe0t47rzVyxfGc1fvxNzPsqk4idUf5dcAePkAyfTceLJaSTytjiWDu26S5tI+grjvymXJA==} resolution: {integrity: sha512-yzmPNpl7TBbMRC5Lj2JlJZNPml0tzqoqP5B1JXycNUwtqma9AKCO0M2wHrdgsHcy1WRW7S9rJknAMtByg3usgA==}
esrecurse@4.3.0: esrecurse@4.3.0:
resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==}
@ -3622,7 +3622,7 @@ snapshots:
dependencies: dependencies:
estraverse: 5.3.0 estraverse: 5.3.0
esrap@2.0.0: esrap@2.1.0:
dependencies: dependencies:
'@jridgewell/sourcemap-codec': 1.5.0 '@jridgewell/sourcemap-codec': 1.5.0

Loading…
Cancel
Save