@sveltejs/kit 2.60.0 → 2.60.1

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltejs/kit",
3
- "version": "2.60.0",
3
+ "version": "2.60.1",
4
4
  "description": "SvelteKit is the fastest way to build Svelte apps",
5
5
  "keywords": [
6
6
  "framework",
@@ -23,7 +23,7 @@
23
23
  "@types/cookie": "^0.6.0",
24
24
  "acorn": "^8.14.1",
25
25
  "cookie": "^0.6.0",
26
- "devalue": "^5.6.4",
26
+ "devalue": "^5.8.1",
27
27
  "esm-env": "^1.2.2",
28
28
  "kleur": "^4.1.5",
29
29
  "magic-string": "^0.30.5",
@@ -40,7 +40,7 @@
40
40
  "@types/set-cookie-parser": "^2.4.7",
41
41
  "dts-buddy": "^0.7.0",
42
42
  "rollup": "^4.59.0",
43
- "svelte": "^5.53.12",
43
+ "svelte": "^5.55.7",
44
44
  "typescript": "^5.3.3",
45
45
  "vite": "^6.4.2",
46
46
  "vitest": "^4.0.0"
@@ -250,9 +250,6 @@ function batch(validate_or_fn, maybe_fn) {
250
250
  /** @type {(arg?: any) => MaybePromise<Input>} */
251
251
  const validate = create_validator(validate_or_fn, maybe_fn);
252
252
 
253
- /** @type {Map<string, { get_validated: () => MaybePromise<any>, resolvers: Array<{resolve: (value: any) => void, reject: (error: any) => void}> }>} */
254
- let batching = new Map();
255
-
256
253
  /**
257
254
  * Enqueues a single call into the current batch (creating one if necessary)
258
255
  * and returns a promise that resolves with the result for this entry.
@@ -265,23 +262,29 @@ function batch(validate_or_fn, maybe_fn) {
265
262
  const { event, state } = get_request_store();
266
263
 
267
264
  return new Promise((resolve, reject) => {
268
- const entry = batching.get(payload);
265
+ const batches = (state.remote.batches ??=
266
+ /** @type {NonNullable<typeof state.remote.batches>} */ (new Map()));
267
+ let batched = batches.get(__.id);
268
+ if (!batched) {
269
+ batched = new Map();
270
+ batches.set(__.id, batched);
271
+ }
272
+ const entry = batched.get(payload);
269
273
 
270
274
  if (entry) {
271
275
  entry.resolvers.push({ resolve, reject });
272
276
  return;
273
277
  }
274
278
 
275
- batching.set(payload, {
279
+ batched.set(payload, {
276
280
  get_validated,
277
281
  resolvers: [{ resolve, reject }]
278
282
  });
279
283
 
280
- if (batching.size > 1) return;
284
+ if (batched.size > 1) return;
281
285
 
282
286
  setTimeout(async () => {
283
- const batched = batching;
284
- batching = new Map();
287
+ batches.delete(__.id);
285
288
  const entries = Array.from(batched.values());
286
289
 
287
290
  try {
@@ -150,11 +150,10 @@ export async function internal_respond(request, options, manifest, state) {
150
150
  remote: {
151
151
  data: null,
152
152
  forms: null,
153
- /** A map of remote function key to corresponding single-flight-mutation promise */
154
153
  refreshes: null,
154
+ requested: null,
155
155
  reconnects: null,
156
- /** A map of remote function ID to payloads requested for refreshing by the client */
157
- requested: null
156
+ batches: null
158
157
  },
159
158
  is_in_remote_function: false,
160
159
  is_in_render: false,
@@ -700,10 +700,24 @@ export interface RequestState {
700
700
  RemoteInternals,
701
701
  Record<string, { serialize: boolean; data: MaybePromise<any> }>
702
702
  >;
703
- forms: null | Map<any, any>;
703
+ /** Instances created via `myForm.for(...)` */
704
+ forms: null | Map<string, any>;
705
+ /** A map of remote function key to corresponding single-flight-mutation promise */
704
706
  refreshes: null | Map<string, Promise<any>>;
705
- reconnects: null | Map<string, Promise<any>>;
707
+ reconnects: null | Map<string, Promise<void>>;
708
+ /** A map of remote function ID to payloads requested for refreshing by the client */
706
709
  requested: null | Map<string, string[]>;
710
+ /** A map of query.batch ID to payloads requested for that batch within the same macrotask */
711
+ batches: null | Map<
712
+ string,
713
+ Map<
714
+ string,
715
+ {
716
+ get_validated: () => MaybePromise<any>;
717
+ resolvers: Array<{ resolve: (value: any) => void; reject: (error: any) => void }>;
718
+ }
719
+ >
720
+ >;
707
721
  };
708
722
  readonly is_in_remote_function: boolean;
709
723
  readonly is_in_render: boolean;
package/src/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  // generated during release, do not modify
2
2
 
3
3
  /** @type {string} */
4
- export const VERSION = '2.60.0';
4
+ export const VERSION = '2.60.1';
package/types/index.d.ts CHANGED
@@ -2927,7 +2927,7 @@ declare module '@sveltejs/kit' {
2927
2927
  class Redirect_1 {
2928
2928
 
2929
2929
  constructor(status: 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308, location: string);
2930
- status: 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308;
2930
+ status: 301 | 302 | 303 | 307 | 308 | 300 | 304 | 305 | 306;
2931
2931
  location: string;
2932
2932
  }
2933
2933