Skip to content

Commit 464d7b6

Browse files
committed
remove unused
1 parent c8cc931 commit 464d7b6

File tree

5 files changed

+6
-21
lines changed

5 files changed

+6
-21
lines changed

packages/svelte/src/compiler/phases/3-transform/client/types.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ export interface ParallelizedChunk {
9797
/** index in instance body */
9898
position: number;
9999
bindings: Binding[];
100-
type: 'promise_all' | 'all';
101100
}
102101

103102
export type Context = import('zimmerframe').Context<AST.SvelteNode, ClientTransformState>;

packages/svelte/src/compiler/phases/3-transform/client/visitors/Program.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,17 +152,12 @@ export function Program(node, context) {
152152
chunk.position + offset,
153153
0,
154154
b.declaration(chunk.kind, [
155-
b.declarator(
156-
declarator.id,
157-
chunk.type === 'promise_all'
158-
? b.await(declarator.init)
159-
: b.call(b.await(b.call('$.save', declarator.init)))
160-
)
155+
b.declarator(declarator.id, b.call(b.await(b.call('$.save', declarator.init))))
161156
])
162157
);
163158
} else {
164159
const pattern = b.array_pattern(chunk.declarators.map(({ id }) => id));
165-
const init = b.call(`$.${chunk.type}`, ...chunk.declarators.map(({ init }) => init));
160+
const init = b.call(`$.all`, ...chunk.declarators.map(({ init }) => init));
166161
body.splice(
167162
chunk.position + offset,
168163
0,

packages/svelte/src/compiler/phases/3-transform/client/visitors/VariableDeclaration.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ export function VariableDeclaration(node, context) {
7171
];
7272
if (
7373
context.state.current_parallelized_chunk &&
74-
context.state.current_parallelized_chunk.kind === node.kind &&
75-
context.state.current_parallelized_chunk.type === 'all'
74+
context.state.current_parallelized_chunk.kind === node.kind
7675
) {
7776
context.state.current_parallelized_chunk.declarators.push(...declarators);
7877
context.state.current_parallelized_chunk.bindings.push(...bindings);
@@ -85,8 +84,7 @@ export function VariableDeclaration(node, context) {
8584
kind: node.kind,
8685
declarators,
8786
position: /** @type {Program} */ (context.path.at(-1)).body.indexOf(node),
88-
bindings,
89-
type: 'all'
87+
bindings
9088
};
9189
context.state.current_parallelized_chunk = chunk;
9290
context.state.parallelized_chunks.push(chunk);
@@ -268,8 +266,6 @@ export function VariableDeclaration(node, context) {
268266
...context.state.scope.get_bindings(declarator)
269267
]);
270268
}
271-
// const type = parallelize ? (dev ? 'promise_all' : 'all') : null;
272-
const type = 'all';
273269

274270
/** @type {VariableDeclarator[]} */
275271
const derived_declarators = [];
@@ -383,8 +379,7 @@ export function VariableDeclaration(node, context) {
383379
}));
384380
if (
385381
context.state.current_parallelized_chunk &&
386-
context.state.current_parallelized_chunk.kind === node.kind &&
387-
context.state.current_parallelized_chunk.type === type
382+
context.state.current_parallelized_chunk.kind === node.kind
388383
) {
389384
context.state.current_parallelized_chunk.declarators.push(...declarators);
390385
context.state.current_parallelized_chunk.bindings.push(...bindings);
@@ -397,8 +392,7 @@ export function VariableDeclaration(node, context) {
397392
kind: node.kind,
398393
declarators,
399394
position: /** @type {Program} */ (context.path.at(-1)).body.indexOf(node),
400-
bindings,
401-
type: /** @type {ParallelizedChunk['type']} */ (type)
395+
bindings
402396
};
403397
context.state.current_parallelized_chunk = chunk;
404398
context.state.parallelized_chunks.push(chunk);

packages/svelte/src/internal/client/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ export {
102102
all,
103103
async_body,
104104
for_await_track_reactivity_loss,
105-
promise_all,
106105
save,
107106
track_reactivity_loss
108107
} from './reactivity/async.js';

packages/svelte/src/internal/client/reactivity/async.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,5 +202,3 @@ export function all(...promises) {
202202
)
203203
);
204204
}
205-
206-
export const promise_all = Promise.all;

0 commit comments

Comments
 (0)