Rich Harris

Results 788 comments of Rich Harris

I'd love to use an existing library for this rather than rolling our own multipart form data parser, even if we abstract it somehow. Unfortunately the ones that I know...

This is definitely something we want to do post-1.0. The challenge is designing it in a sufficiently future-proof and framework-agnostic way (e.g. it would make sense to use the same...

The issue here is that `src/routes/episodes-[number]` is marked as prerenderable by virtue of the `export const prerender = true` in `src/routes/episodes-[number]/+layout.server.ts`, which means the code to generate the `__data.js` files...

Cache headers won't work with `__data.js`, because SvelteKit needs to add a `?__id={x}` query parameter otherwise it will always use stale data. Since it's using `import` rather than `fetch`, it...

> Where would SvelteKit read the headers from exactly? If you call `setHeaders({ 'cache-control': 'max-age: 300' })` in one of your `load` functions, SvelteKit would turn that into `window.__sveltekit_ttl =...

It would apply per-URL, and data would be reused until it was stale. Manual invalidation would override `ttl`

This is intended behaviour: * it's not uncommon for `load` to return objects that can't be serialized (such as component constructors) * data returned from a `load` function is often...

What do I have to do to get this to work? It's not showing up as a Quick Fix option for me:

> What happens if one of the promises rejects? These are equivalent: ```js export function load() { return { foo: Promise.reject(new Error('nope')) }; } ``` ```js export async function load()...

I'm inclined to think it's an unnecessary micro-optimisation, so I've approved this PR, but shout if you feel differently