-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed as not planned
Description
It can be beneficial to render HTML from Svelte without the need to handle hydration β for things such as email content, CMSs, RSS feeds and other such cases.
Rather than being an option we pass in to render from svelte/server, we should likely use another API here to enable future compatibility with possible async functionality, thus making this an API you should await (similar to what React does for this) as without hydration, showing async loading content would be useless. This change would meant that await blocks would no longer show their pending states and instead wait until the promise resolves.
import { renderStaticHTML } from 'svelte/server';
import App from './App.svelte';
const result = await renderStaticHTML(App, {
props: { some: 'property' }
});
result.body; // HTML for somewhere in this <body> tag
result.head; // HTML for somewhere in this <head> tagFor this I propose renderStaticHTML but maybe there's a better name out there.
max-got, ryanatkn, gterras, Azarattum, nil4 and 3 more
Metadata
Metadata
Assignees
Labels
No labels