diff --git a/packages/svelte/src/compiler/phases/3-transform/client/types.d.ts b/packages/svelte/src/compiler/phases/3-transform/client/types.d.ts index e67b14e624..9a569f3a9f 100644 --- a/packages/svelte/src/compiler/phases/3-transform/client/types.d.ts +++ b/packages/svelte/src/compiler/phases/3-transform/client/types.d.ts @@ -97,7 +97,6 @@ export interface ParallelizedChunk { /** index in instance body */ position: number; bindings: Binding[]; - type: 'promise_all' | 'all'; } export type Context = import('zimmerframe').Context; diff --git a/packages/svelte/src/compiler/phases/3-transform/client/visitors/Program.js b/packages/svelte/src/compiler/phases/3-transform/client/visitors/Program.js index 12a8f71c6c..b3f86c01d2 100644 --- a/packages/svelte/src/compiler/phases/3-transform/client/visitors/Program.js +++ b/packages/svelte/src/compiler/phases/3-transform/client/visitors/Program.js @@ -152,17 +152,12 @@ export function Program(node, context) { chunk.position + offset, 0, b.declaration(chunk.kind, [ - b.declarator( - declarator.id, - chunk.type === 'promise_all' - ? b.await(declarator.init) - : b.call(b.await(b.call('$.save', declarator.init))) - ) + b.declarator(declarator.id, b.call(b.await(b.call('$.save', declarator.init)))) ]) ); } else { const pattern = b.array_pattern(chunk.declarators.map(({ id }) => id)); - const init = b.call(`$.${chunk.type}`, ...chunk.declarators.map(({ init }) => init)); + const init = b.call(`$.all`, ...chunk.declarators.map(({ init }) => init)); body.splice( chunk.position + offset, 0, diff --git a/packages/svelte/src/compiler/phases/3-transform/client/visitors/VariableDeclaration.js b/packages/svelte/src/compiler/phases/3-transform/client/visitors/VariableDeclaration.js index e6ed9b0b42..3e28b86639 100644 --- a/packages/svelte/src/compiler/phases/3-transform/client/visitors/VariableDeclaration.js +++ b/packages/svelte/src/compiler/phases/3-transform/client/visitors/VariableDeclaration.js @@ -71,8 +71,7 @@ export function VariableDeclaration(node, context) { ]; if ( context.state.current_parallelized_chunk && - context.state.current_parallelized_chunk.kind === node.kind && - context.state.current_parallelized_chunk.type === 'all' + context.state.current_parallelized_chunk.kind === node.kind ) { context.state.current_parallelized_chunk.declarators.push(...declarators); context.state.current_parallelized_chunk.bindings.push(...bindings); @@ -85,8 +84,7 @@ export function VariableDeclaration(node, context) { kind: node.kind, declarators, position: /** @type {Program} */ (context.path.at(-1)).body.indexOf(node), - bindings, - type: 'all' + bindings }; context.state.current_parallelized_chunk = chunk; context.state.parallelized_chunks.push(chunk); @@ -268,8 +266,6 @@ export function VariableDeclaration(node, context) { ...context.state.scope.get_bindings(declarator) ]); } - // const type = parallelize ? (dev ? 'promise_all' : 'all') : null; - const type = 'all'; /** @type {VariableDeclarator[]} */ const derived_declarators = []; @@ -383,8 +379,7 @@ export function VariableDeclaration(node, context) { })); if ( context.state.current_parallelized_chunk && - context.state.current_parallelized_chunk.kind === node.kind && - context.state.current_parallelized_chunk.type === type + context.state.current_parallelized_chunk.kind === node.kind ) { context.state.current_parallelized_chunk.declarators.push(...declarators); context.state.current_parallelized_chunk.bindings.push(...bindings); @@ -397,8 +392,7 @@ export function VariableDeclaration(node, context) { kind: node.kind, declarators, position: /** @type {Program} */ (context.path.at(-1)).body.indexOf(node), - bindings, - type: /** @type {ParallelizedChunk['type']} */ (type) + bindings }; context.state.current_parallelized_chunk = chunk; context.state.parallelized_chunks.push(chunk); diff --git a/packages/svelte/src/internal/client/index.js b/packages/svelte/src/internal/client/index.js index 9b45e264eb..04dd4cfb13 100644 --- a/packages/svelte/src/internal/client/index.js +++ b/packages/svelte/src/internal/client/index.js @@ -102,7 +102,6 @@ export { all, async_body, for_await_track_reactivity_loss, - promise_all, save, track_reactivity_loss } from './reactivity/async.js'; diff --git a/packages/svelte/src/internal/client/reactivity/async.js b/packages/svelte/src/internal/client/reactivity/async.js index c0e081b017..181c33e9b9 100644 --- a/packages/svelte/src/internal/client/reactivity/async.js +++ b/packages/svelte/src/internal/client/reactivity/async.js @@ -202,5 +202,3 @@ export function all(...promises) { ) ); } - -export const promise_all = Promise.all;