Update @astrojs/compiler
(#1730)
* chore: update @astrojs/compiler * fix: add Fragment handling * chore: add changeset
This commit is contained in:
parent
bd3bed7f27
commit
11ee158ad5
4 changed files with 20 additions and 5 deletions
9
.changeset/curvy-years-kiss.md
Normal file
9
.changeset/curvy-years-kiss.md
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
---
|
||||||
|
'astro': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix issue with `style` and `script` processing where siblings would be skipped
|
||||||
|
|
||||||
|
Fix `Fragment` and `<>` handling for backwards compatability
|
||||||
|
|
||||||
|
Fix CSS `--custom-proprty` parsing when using scoped CSS
|
|
@ -52,7 +52,7 @@
|
||||||
"test": "mocha --parallel --timeout 15000"
|
"test": "mocha --parallel --timeout 15000"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/compiler": "^0.2.23",
|
"@astrojs/compiler": "^0.2.24",
|
||||||
"@astrojs/language-server": "^0.7.16",
|
"@astrojs/language-server": "^0.7.16",
|
||||||
"@astrojs/markdown-remark": "^0.4.0-next.0",
|
"@astrojs/markdown-remark": "^0.4.0-next.0",
|
||||||
"@astrojs/markdown-support": "0.3.1",
|
"@astrojs/markdown-support": "0.3.1",
|
||||||
|
|
|
@ -90,11 +90,17 @@ export async function renderSlot(_result: any, slotted: string, fallback?: any)
|
||||||
return fallback;
|
return fallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const Fragment = Symbol("Astro.Fragment");
|
||||||
|
|
||||||
export async function renderComponent(result: SSRResult, displayName: string, Component: unknown, _props: Record<string | number, any>, slots: any = {}) {
|
export async function renderComponent(result: SSRResult, displayName: string, Component: unknown, _props: Record<string | number, any>, slots: any = {}) {
|
||||||
Component = await Component;
|
Component = await Component;
|
||||||
const children = await renderSlot(result, slots?.default);
|
const children = await renderSlot(result, slots?.default);
|
||||||
const { renderers } = result._metadata;
|
const { renderers } = result._metadata;
|
||||||
|
|
||||||
|
if (Component === Fragment) {
|
||||||
|
return children;
|
||||||
|
}
|
||||||
|
|
||||||
if (Component && (Component as any).isAstroComponentFactory) {
|
if (Component && (Component as any).isAstroComponentFactory) {
|
||||||
const output = await renderToString(result, Component as any, _props, slots);
|
const output = await renderToString(result, Component as any, _props, slots);
|
||||||
return output;
|
return output;
|
||||||
|
|
|
@ -106,10 +106,10 @@
|
||||||
"@algolia/logger-common" "4.10.5"
|
"@algolia/logger-common" "4.10.5"
|
||||||
"@algolia/requester-common" "4.10.5"
|
"@algolia/requester-common" "4.10.5"
|
||||||
|
|
||||||
"@astrojs/compiler@^0.2.23":
|
"@astrojs/compiler@^0.2.24":
|
||||||
version "0.2.23"
|
version "0.2.24"
|
||||||
resolved "https://registry.yarnpkg.com/@astrojs/compiler/-/compiler-0.2.23.tgz#ebc705521ed5ce89d37ebfc0c3392ec6c0d7ec47"
|
resolved "https://registry.yarnpkg.com/@astrojs/compiler/-/compiler-0.2.24.tgz#1e737989a0f3da00d785d48081935417cbaf8745"
|
||||||
integrity sha512-RjQXt4AFQqUYzjzbwFKBDqTnj2yfBnwPROHmFD40ONaIXaeHYcVvHKC3zrXqO8PIVRpQOlvFw9V3CWZD6rG7pw==
|
integrity sha512-BiS5nQIlRYB7kroay4zBtNgdzaW14RIh+Lpwbi9WcZ0oSRiq5LVa/lOgr6fKRClmmDQn56TX7LBWqy5gh68e7w==
|
||||||
dependencies:
|
dependencies:
|
||||||
typescript "^4.3.5"
|
typescript "^4.3.5"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue