0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

Update @astrojs/compiler (#1730)

* chore: update @astrojs/compiler

* fix: add Fragment handling

* chore: add changeset
This commit is contained in:
Nate Moore 2021-11-02 16:20:35 -05:00 committed by GitHub
parent bd3bed7f27
commit 11ee158ad5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 5 deletions

View 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

View file

@ -52,7 +52,7 @@
"test": "mocha --parallel --timeout 15000"
},
"dependencies": {
"@astrojs/compiler": "^0.2.23",
"@astrojs/compiler": "^0.2.24",
"@astrojs/language-server": "^0.7.16",
"@astrojs/markdown-remark": "^0.4.0-next.0",
"@astrojs/markdown-support": "0.3.1",

View file

@ -90,11 +90,17 @@ export async function renderSlot(_result: any, slotted: string, fallback?: any)
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 = {}) {
Component = await Component;
const children = await renderSlot(result, slots?.default);
const { renderers } = result._metadata;
if (Component === Fragment) {
return children;
}
if (Component && (Component as any).isAstroComponentFactory) {
const output = await renderToString(result, Component as any, _props, slots);
return output;

View file

@ -106,10 +106,10 @@
"@algolia/logger-common" "4.10.5"
"@algolia/requester-common" "4.10.5"
"@astrojs/compiler@^0.2.23":
version "0.2.23"
resolved "https://registry.yarnpkg.com/@astrojs/compiler/-/compiler-0.2.23.tgz#ebc705521ed5ce89d37ebfc0c3392ec6c0d7ec47"
integrity sha512-RjQXt4AFQqUYzjzbwFKBDqTnj2yfBnwPROHmFD40ONaIXaeHYcVvHKC3zrXqO8PIVRpQOlvFw9V3CWZD6rG7pw==
"@astrojs/compiler@^0.2.24":
version "0.2.24"
resolved "https://registry.yarnpkg.com/@astrojs/compiler/-/compiler-0.2.24.tgz#1e737989a0f3da00d785d48081935417cbaf8745"
integrity sha512-BiS5nQIlRYB7kroay4zBtNgdzaW14RIh+Lpwbi9WcZ0oSRiq5LVa/lOgr6fKRClmmDQn56TX7LBWqy5gh68e7w==
dependencies:
typescript "^4.3.5"