@sveltejs/kit 1.8.1 → 1.8.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltejs/kit",
3
- "version": "1.8.1",
3
+ "version": "1.8.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/sveltejs/kit",
@@ -141,9 +141,9 @@ export async function render_data(
141
141
  }),
142
142
  {
143
143
  headers: {
144
- // text/plain isn't strictly correct, but it makes it easier to inspect
145
- // the data, and doesn't affect how it is consumed by the client
146
- 'content-type': 'text/plain',
144
+ // we use a proprietary content type to prevent buffering.
145
+ // the `text` prefix makes it inspectable
146
+ 'content-type': 'text/sveltekit-data',
147
147
  'cache-control': 'private, no-store'
148
148
  }
149
149
  }
@@ -460,7 +460,7 @@ export async function render_response({
460
460
  : new Response(
461
461
  new ReadableStream({
462
462
  async start(controller) {
463
- controller.enqueue(encoder.encode(transformed));
463
+ controller.enqueue(encoder.encode(transformed + '\n'));
464
464
  for await (const chunk of chunks) {
465
465
  controller.enqueue(encoder.encode(chunk));
466
466
  }
@@ -525,7 +525,7 @@ function get_data(event, options, nodes, global) {
525
525
  str = devalue.uneval({ id, data, error }, replacer);
526
526
  }
527
527
 
528
- push(`\n<script>${global}.resolve(${str})</script>`);
528
+ push(`<script>${global}.resolve(${str})</script>\n`);
529
529
  if (count === 0) done();
530
530
  }
531
531
  );