feat: support async route components (#1388)

This commit is contained in:
Marvin Hagemeister
2023-07-12 21:09:56 +02:00
committed by GitHub
parent e2a1bf8643
commit 62a5613a46
20 changed files with 564 additions and 96 deletions
+2 -2
View File
@@ -15,9 +15,9 @@ export default function(state) { hydrate(options, state); }`;
return {
name: "twind",
entrypoints: { "main": main },
render(ctx) {
async renderAsync(ctx) {
sheet.reset(undefined);
const res = ctx.render();
const res = await ctx.renderAsync();
const cssTexts = [...sheet.target];
const snapshot = sheet.reset();
const scripts = [];
+2 -2
View File
@@ -15,8 +15,8 @@ export default function(state) { hydrate(options, state); }`;
return {
name: "twind",
entrypoints: { "main": main },
render(ctx) {
const res = ctx.render();
async renderAsync(ctx) {
const res = await ctx.renderAsync();
const cssText = stringify(sheet.target);
const scripts = [];
if (res.requiresHydration) {