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
## 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
### Minor Changes

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

@ -11,7 +11,7 @@ import {
untrack,
increment_write_version,
update_effect,
reaction_sources,
source_ownership,
check_dirtiness,
untracking,
is_destroying_effect,
@ -142,7 +142,7 @@ export function set(source, value, should_proxy = false) {
(!untracking || (active_reaction.f & INSPECT_EFFECT) !== 0) &&
is_runes() &&
(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();
}

@ -100,17 +100,17 @@ export function set_active_effect(effect) {
/**
* When sources are created within a reaction, reading and writing
* 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 */
export function push_reaction_value(value) {
if (active_reaction !== null && active_reaction.f & EFFECT_IS_UPDATING) {
if (reaction_sources === null) {
reaction_sources = [active_reaction, [value]];
if (source_ownership === null) {
source_ownership = { reaction: active_reaction, sources: [value] };
} 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 (
!async_mode_flag &&
reaction_sources?.[1].includes(signal) &&
reaction_sources[0] === active_reaction
)
source_ownership?.reaction === active_reaction &&
source_ownership.sources.includes(signal)
) {
continue;
}
if ((reaction.f & DERIVED) !== 0) {
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_reaction = active_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_untracking = untracking;
@ -293,7 +294,7 @@ export function update_reaction(reaction) {
(flags & UNOWNED) !== 0 && (untracking || !is_updating_effect || active_reaction === null);
active_reaction = (flags & (BRANCH_EFFECT | ROOT_EFFECT)) === 0 ? reaction : null;
reaction_sources = null;
source_ownership = null;
set_component_context(reaction.ctx);
untracking = false;
read_version++;
@ -389,7 +390,7 @@ export function update_reaction(reaction) {
untracked_writes = previous_untracked_writes;
active_reaction = previous_reaction;
skip_reaction = previous_skip_reaction;
reaction_sources = previous_reaction_sources;
source_ownership = previous_reaction_sources;
set_component_context(previous_component_context);
untracking = previous_untracking;
@ -804,8 +805,8 @@ export function get(signal) {
if (
!destroyed &&
((async_mode_flag && (active_reaction.f & DERIVED) === 0) ||
!reaction_sources?.[1].includes(signal) ||
reaction_sources[0] !== active_reaction)
source_ownership?.reaction !== active_reaction ||
!source_ownership?.sources.includes(signal))
) {
var deps = active_reaction.deps;

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

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

Loading…
Cancel
Save