Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 44d719d

Browse files
authored
fix!: sync renderSSRHead() (#629)
* fix!: sync `renderDOMHead` * doc: missing * fix!: sync `renderSSRHead()` * chore: conflict
1 parent 627eb05 commit 44d719d

73 files changed

Lines changed: 259 additions & 224 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

bench/bundle/src/schema-org/minimal.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ async function doHead() {
1919
}),
2020
])
2121

22-
return await renderSSRHead(head)
22+
return renderSSRHead(head)
2323
}
2424

2525
doHead()

bench/bundle/src/server/minimal.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ async function doHead() {
1919
],
2020
})
2121

22-
return await renderSSRHead(head)
22+
return renderSSRHead(head)
2323
}
2424

2525
doHead()

bench/bundle/src/vue-server/minimal.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ async function doHead() {
1919
],
2020
}, { head })
2121

22-
return await renderSSRHead(head)
22+
return renderSSRHead(head)
2323
}
2424

2525
doHead()

bench/ssr-harlanzw-com-e2e.bench.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ describe('ssr e2e bench', () => {
273273
head,
274274
})
275275

276-
const { headTags, bodyTags, bodyTagsOpen, htmlAttrs, bodyAttrs } = await renderSSRHead(head, {
276+
const { headTags, bodyTags, bodyTagsOpen, htmlAttrs, bodyAttrs } = renderSSRHead(head, {
277277
omitLineBreaks: true,
278278
})
279279
function normalizeChunks(chunks: (string | undefined)[]) {
@@ -321,6 +321,6 @@ ${htmlContext.bodyAppend.join('\n')}
321321
},
322322
],
323323
})
324-
await renderSSRHead(head)
324+
renderSSRHead(head)
325325
})
326326
})

bench/ssr-harlanzw-com-e2e.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ describe('ssr e2e bench', () => {
278278
head,
279279
})
280280

281-
const { headTags, bodyTags, bodyTagsOpen, htmlAttrs, bodyAttrs } = await renderSSRHead(head, {
281+
const { headTags, bodyTags, bodyTagsOpen, htmlAttrs, bodyAttrs } = renderSSRHead(head, {
282282
omitLineBreaks: true,
283283
})
284284
function normalizeChunks(chunks: (string | undefined)[]) {

bench/ssr-harlanzw-no-schema-e2e.bench.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ describe('ssr e2e bench', () => {
237237
head,
238238
})
239239

240-
const { headTags, bodyTags, bodyTagsOpen, htmlAttrs, bodyAttrs } = await renderSSRHead(head, {
240+
const { headTags, bodyTags, bodyTagsOpen, htmlAttrs, bodyAttrs } = renderSSRHead(head, {
241241
omitLineBreaks: true,
242242
})
243243
function normalizeChunks(chunks: (string | undefined)[]) {
@@ -285,6 +285,6 @@ ${htmlContext.bodyAppend.join('\n')}
285285
},
286286
],
287287
})
288-
await renderSSRHead(head)
288+
renderSSRHead(head)
289289
})
290290
})

bench/use-seo-meta-perf.bench.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe('use seo meta', () => {
2323
head,
2424
})
2525
}
26-
await renderSSRHead(head)
26+
renderSSRHead(head)
2727
}, {
2828
iterations: 1000,
2929
time: 1000,

docs/0.angular/head/guides/0.get-started/2.migration.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,10 @@ The `dom:beforeRender` hook is now synchronous and `renderDOMHead` no longer ret
107107
- await renderDOMHead(head, { document })
108108
+ renderDOMHead(head, { document })
109109
```
110+
111+
The SSR hooks (`ssr:beforeRender`, `ssr:render`, `ssr:rendered`) are now synchronous and `renderSSRHead` no longer returns a Promise:
112+
113+
```diff
114+
- const head = await renderSSRHead(head)
115+
+ const head = renderSSRHead(head)
116+
```

docs/0.react/head/guides/0.get-started/2.migration.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,10 @@ The `dom:beforeRender` hook is now synchronous and `renderDOMHead` no longer ret
105105
- await renderDOMHead(head, { document })
106106
+ renderDOMHead(head, { document })
107107
```
108+
109+
The SSR hooks (`ssr:beforeRender`, `ssr:render`, `ssr:rendered`) are now synchronous and `renderSSRHead` no longer returns a Promise:
110+
111+
```diff
112+
- const head = await renderSSRHead(head)
113+
+ const head = renderSSRHead(head)
114+
```

docs/0.solid-js/head/guides/0.get-started/2.migration.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,10 @@ The `dom:beforeRender` hook is now synchronous and `renderDOMHead` no longer ret
107107
- await renderDOMHead(head, { document })
108108
+ renderDOMHead(head, { document })
109109
```
110+
111+
The SSR hooks (`ssr:beforeRender`, `ssr:render`, `ssr:rendered`) are now synchronous and `renderSSRHead` no longer returns a Promise:
112+
113+
```diff
114+
- const head = await renderSSRHead(head)
115+
+ const head = renderSSRHead(head)
116+
```

0 commit comments

Comments
 (0)