Skip to content

Commit

Permalink
Update @astrojs/compiler (#1730)
Browse files Browse the repository at this point in the history
* chore: update @astrojs/compiler

* fix: add Fragment handling

* chore: add changeset
  • Loading branch information
natemoo-re authored Nov 2, 2021
1 parent bd3bed7 commit 11ee158
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
9 changes: 9 additions & 0 deletions .changeset/curvy-years-kiss.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion packages/astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 6 additions & 0 deletions packages/astro/src/runtime/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit 11ee158

Please sign in to comment.