svelte 5.48.1 → 5.48.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "svelte",
3
3
  "description": "Cybernetically enhanced web apps",
4
4
  "license": "MIT",
5
- "version": "5.48.1",
5
+ "version": "5.48.3",
6
6
  "type": "module",
7
7
  "types": "./types/index.d.ts",
8
8
  "engines": {
@@ -67,7 +67,21 @@ export const a11y_interactive_handlers = [
67
67
  'mousemove',
68
68
  'mouseout',
69
69
  'mouseover',
70
- 'mouseup'
70
+ 'mouseup',
71
+ // Pointer events
72
+ 'pointerdown',
73
+ 'pointerup',
74
+ 'pointermove',
75
+ 'pointerenter',
76
+ 'pointerleave',
77
+ 'pointerover',
78
+ 'pointerout',
79
+ 'pointercancel',
80
+ // Touch events
81
+ 'touchstart',
82
+ 'touchend',
83
+ 'touchmove',
84
+ 'touchcancel'
71
85
  ];
72
86
 
73
87
  export const a11y_recommended_interactive_handlers = [
@@ -295,22 +295,18 @@ export function build_inline_component(node, expression, context) {
295
295
  b.array(props_and_spreads.map((p) => (Array.isArray(p) ? b.object(p) : p)))
296
296
  );
297
297
 
298
+ const dynamic =
299
+ node.type === 'SvelteComponent' || (node.type === 'Component' && node.metadata.dynamic);
300
+
298
301
  /** @type {Statement} */
299
302
  let statement = b.stmt(
300
- (node.type === 'SvelteComponent' ? b.maybe_call : b.call)(
301
- expression,
302
- b.id('$$renderer'),
303
- props_expression
304
- )
303
+ (dynamic ? b.maybe_call : b.call)(expression, b.id('$$renderer'), props_expression)
305
304
  );
306
305
 
307
306
  if (snippet_declarations.length > 0) {
308
307
  statement = b.block([...snippet_declarations, statement]);
309
308
  }
310
309
 
311
- const dynamic =
312
- node.type === 'SvelteComponent' || (node.type === 'Component' && node.metadata.dynamic);
313
-
314
310
  if (custom_css_props.length > 0) {
315
311
  statement = b.stmt(
316
312
  b.call(
@@ -19,6 +19,12 @@ import { get_boundary } from './boundary.js';
19
19
  * @param {(anchor: TemplateNode, ...deriveds: Value[]) => void} fn
20
20
  */
21
21
  export function async(node, blockers = [], expressions = [], fn) {
22
+ var was_hydrating = hydrating;
23
+
24
+ if (was_hydrating) {
25
+ hydrate_next();
26
+ }
27
+
22
28
  if (expressions.length === 0 && blockers.every((b) => b.settled)) {
23
29
  fn(node);
24
30
  return;
@@ -31,11 +37,7 @@ export function async(node, blockers = [], expressions = [], fn) {
31
37
  boundary.update_pending_count(1);
32
38
  batch.increment(blocking);
33
39
 
34
- var was_hydrating = hydrating;
35
-
36
40
  if (was_hydrating) {
37
- hydrate_next();
38
-
39
41
  var previous_hydrate_node = hydrate_node;
40
42
  var end = skip_nodes(false);
41
43
  set_hydrate_node(end);
@@ -103,7 +103,8 @@ export {
103
103
  run,
104
104
  save,
105
105
  track_reactivity_loss,
106
- run_after_blockers
106
+ run_after_blockers,
107
+ wait
107
108
  } from './reactivity/async.js';
108
109
  export { eager, flushSync as flush } from './reactivity/batch.js';
109
110
  export {
@@ -21,7 +21,7 @@ import {
21
21
  MANAGED_EFFECT
22
22
  } from '#client/constants';
23
23
  import { async_mode_flag } from '../../flags/index.js';
24
- import { deferred, define_property } from '../../shared/utils.js';
24
+ import { deferred, define_property, includes } from '../../shared/utils.js';
25
25
  import {
26
26
  active_effect,
27
27
  get,
@@ -243,7 +243,7 @@ export class Batch {
243
243
  } else if (async_mode_flag && (flags & (RENDER_EFFECT | MANAGED_EFFECT)) !== 0) {
244
244
  render_effects.push(effect);
245
245
  } else if (is_dirty(effect)) {
246
- if ((flags & BLOCK_EFFECT) !== 0) this.#dirty_effects.add(effect);
246
+ if ((flags & BLOCK_EFFECT) !== 0) this.#maybe_dirty_effects.add(effect);
247
247
  update_effect(effect);
248
248
  }
249
249
 
@@ -775,7 +775,7 @@ function depends_on(reaction, sources, checked) {
775
775
 
776
776
  if (reaction.deps !== null) {
777
777
  for (const dep of reaction.deps) {
778
- if (sources.includes(dep)) {
778
+ if (includes.call(sources, dep)) {
779
779
  return true;
780
780
  }
781
781
 
@@ -33,7 +33,7 @@ import { component_context } from '../context.js';
33
33
  import { UNINITIALIZED } from '../../../constants.js';
34
34
  import { batch_values, current_batch } from './batch.js';
35
35
  import { unset_context } from './async.js';
36
- import { deferred } from '../../shared/utils.js';
36
+ import { deferred, includes } from '../../shared/utils.js';
37
37
  import { set_signal_status, update_derived_status } from './status.js';
38
38
 
39
39
  /** @type {Effect | null} */
@@ -322,7 +322,7 @@ export function execute_derived(derived) {
322
322
  let prev_eager_effects = eager_effects;
323
323
  set_eager_effects(new Set());
324
324
  try {
325
- if (stack.includes(derived)) {
325
+ if (includes.call(stack, derived)) {
326
326
  e.derived_references_self();
327
327
  }
328
328
 
@@ -31,6 +31,7 @@ import {
31
31
  } from '#client/constants';
32
32
  import * as e from '../errors.js';
33
33
  import { legacy_mode_flag, tracing_mode_flag } from '../../flags/index.js';
34
+ import { includes } from '../../shared/utils.js';
34
35
  import { tag_proxy } from '../dev/tracing.js';
35
36
  import { get_error } from '../../shared/dev.js';
36
37
  import { component_context, is_runes } from '../context.js';
@@ -150,7 +151,7 @@ export function set(source, value, should_proxy = false) {
150
151
  (!untracking || (active_reaction.f & EAGER_EFFECT) !== 0) &&
151
152
  is_runes() &&
152
153
  (active_reaction.f & (DERIVED | BLOCK_EFFECT | ASYNC | EAGER_EFFECT)) !== 0 &&
153
- !current_sources?.includes(source)
154
+ (current_sources === null || !includes.call(current_sources, source))
154
155
  ) {
155
156
  e.state_unsafe_mutation();
156
157
  }
@@ -1,6 +1,6 @@
1
1
  /** @import { Derived, Effect, Reaction, Source, Value } from '#client' */
2
2
  import { DEV } from 'esm-env';
3
- import { get_descriptors, get_prototype_of, index_of } from '../shared/utils.js';
3
+ import { get_descriptors, get_prototype_of, includes, index_of } from '../shared/utils.js';
4
4
  import {
5
5
  destroy_block_effect_children,
6
6
  destroy_effect_children,
@@ -192,7 +192,7 @@ function schedule_possible_effect_self_invalidation(signal, effect, root = true)
192
192
  var reactions = signal.reactions;
193
193
  if (reactions === null) return;
194
194
 
195
- if (!async_mode_flag && current_sources?.includes(signal)) {
195
+ if (!async_mode_flag && current_sources !== null && includes.call(current_sources, signal)) {
196
196
  return;
197
197
  }
198
198
 
@@ -371,7 +371,7 @@ function remove_reaction(signal, dependency) {
371
371
  // Destroying a child effect while updating a parent effect can cause a dependency to appear
372
372
  // to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
373
373
  // allows us to skip the expensive work of disconnecting and immediately reconnecting it
374
- (new_deps === null || !new_deps.includes(dependency))
374
+ (new_deps === null || !includes.call(new_deps, dependency))
375
375
  ) {
376
376
  var derived = /** @type {Derived} */ (dependency);
377
377
 
@@ -514,7 +514,7 @@ export function get(signal) {
514
514
  // we don't add the dependency, because that would create a memory leak
515
515
  var destroyed = active_effect !== null && (active_effect.f & DESTROYED) !== 0;
516
516
 
517
- if (!destroyed && !current_sources?.includes(signal)) {
517
+ if (!destroyed && (current_sources === null || !includes.call(current_sources, signal))) {
518
518
  var deps = active_reaction.deps;
519
519
 
520
520
  if ((active_reaction.f & REACTION_IS_UPDATING) !== 0) {
@@ -542,7 +542,7 @@ export function get(signal) {
542
542
 
543
543
  if (reactions === null) {
544
544
  signal.reactions = [active_reaction];
545
- } else if (!reactions.includes(active_reaction)) {
545
+ } else if (!includes.call(reactions, active_reaction)) {
546
546
  reactions.push(active_reaction);
547
547
  }
548
548
  }
@@ -2,6 +2,7 @@
2
2
  // to de-opt (this occurs often when using popular extensions).
3
3
  export var is_array = Array.isArray;
4
4
  export var index_of = Array.prototype.indexOf;
5
+ export var includes = Array.prototype.includes;
5
6
  export var array_from = Array.from;
6
7
  export var object_keys = Object.keys;
7
8
  export var define_property = Object.defineProperty;
package/src/version.js CHANGED
@@ -4,5 +4,5 @@
4
4
  * The current version, as set in package.json.
5
5
  * @type {string}
6
6
  */
7
- export const VERSION = '5.48.1';
7
+ export const VERSION = '5.48.3';
8
8
  export const PUBLIC_VERSION = '5';