From 92532b88820bc45f3f02bca0054e8433c3f7a743 Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Fri, 14 Jan 2022 12:11:56 -0500 Subject: [PATCH] Fixes for blog and docs examples (#2373) * Fixes for blog and docs examples * Adds a changeset * Upgrade the compiler version * Use a global style tag * Skip on windows temporarily --- .changeset/yellow-dolphins-buy.md | 5 +++++ examples/blog/src/components/BaseHead.astro | 5 +++++ examples/blog/src/layouts/BlogPost.astro | 2 +- examples/blog/src/pages/index.astro | 1 - examples/docs/src/components/Header/Search.tsx | 4 +++- packages/astro/package.json | 2 +- packages/astro/src/runtime/server/index.ts | 4 ++-- packages/astro/src/runtime/server/metadata.ts | 12 +++++++++--- .../src/components/Nested.astro | 7 +++++++ .../src/components/Nested.jsx | 18 ++++++++++++++++++ .../src/pages/nested.astro | 13 +++++++++++++ .../static-build/src/pages/index.astro | 6 ++++++ .../astro/test/static-build-frameworks.test.js | 13 ++++++++++++- packages/astro/test/static-build.test.js | 10 +++++++++- yarn.lock | 8 ++++---- 15 files changed, 95 insertions(+), 15 deletions(-) create mode 100644 .changeset/yellow-dolphins-buy.md create mode 100644 packages/astro/test/fixtures/static-build-frameworks/src/components/Nested.astro create mode 100644 packages/astro/test/fixtures/static-build-frameworks/src/components/Nested.jsx create mode 100644 packages/astro/test/fixtures/static-build-frameworks/src/pages/nested.astro diff --git a/.changeset/yellow-dolphins-buy.md b/.changeset/yellow-dolphins-buy.md new file mode 100644 index 000000000..63589b562 --- /dev/null +++ b/.changeset/yellow-dolphins-buy.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Hydrated component fix with the static build diff --git a/examples/blog/src/components/BaseHead.astro b/examples/blog/src/components/BaseHead.astro index e5745e196..f39f77338 100644 --- a/examples/blog/src/components/BaseHead.astro +++ b/examples/blog/src/components/BaseHead.astro @@ -1,4 +1,6 @@ --- + + export interface Props { title: string; description: string; @@ -34,3 +36,6 @@ const { title, description, permalink } = Astro.props; + diff --git a/examples/blog/src/layouts/BlogPost.astro b/examples/blog/src/layouts/BlogPost.astro index e6bb0a6c7..bf682b7ae 100644 --- a/examples/blog/src/layouts/BlogPost.astro +++ b/examples/blog/src/layouts/BlogPost.astro @@ -3,6 +3,7 @@ import BaseHead from '../components/BaseHead.astro'; import BlogHeader from '../components/BlogHeader.astro'; import BlogPost from '../components/BlogPost.astro'; + const { content } = Astro.props; const { title, description, publishDate, author, heroImage, permalink, alt } = content; --- @@ -10,7 +11,6 @@ const { title, description, publishDate, author, heroImage, permalink, alt } = c - diff --git a/examples/blog/src/pages/index.astro b/examples/blog/src/pages/index.astro index 9a2178ed0..c7bc3ea32 100644 --- a/examples/blog/src/pages/index.astro +++ b/examples/blog/src/pages/index.astro @@ -28,7 +28,6 @@ allPosts = allPosts.sort((a, b) => new Date(b.publishDate).valueOf() - new Date( -