Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix (some) header metadata generation in un-hydrated content [#1011] #1016

Merged
merged 1 commit into from
Sep 9, 2024

Conversation

genehack
Copy link
Contributor

@genehack genehack commented Sep 5, 2024

Description of proposed changes

  • Switch from using react-helmet to next/head for populating <head> element in pages
  • Swap various <Helmet> usage to <Head>
  • Migrate social media-related metadata headers to _document.tsx

This is a preliminary step that fixes feed auto-discovery; subsequent work will get full metadata headers (i.e., OpenGraph, etc) into un-hydrated renders.

Related issue(s)

Closes #1011

Checklist

@nextstrain-bot nextstrain-bot temporarily deployed to nextstrain-s-fix-feed-d-e5kniw September 5, 2024 22:59 Inactive
* Switch from using `react-helmet` to `next/head` for populating
  `<head>` element in pages
* Swap various `<Helmet>` usage to `<Head>`
* Migrate social media-related metadata headers to `_document.tsx`

This is a preliminary step that fixes feed auto-discovery; subsequent
work will get full metadata headers (i.e., OpenGraph, etc) into
un-hydrated renders.
@genehack genehack force-pushed the fix-feed-disco-1011 branch from 77b9565 to 45f6245 Compare September 5, 2024 23:02
@genehack genehack temporarily deployed to nextstrain-s-fix-feed-d-e5kniw September 5, 2024 23:02 Inactive
Copy link
Member

@victorlin victorlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked the diff of un-hydrated content, looks good

diff details
diff \
  <(curl https://next.nextstrain.org/ | tidy) \
  <(curl https://nextstrain-s-fix-feed-d-e5kniw.herokuapp.com/ | tidy)
8a9,17
> <link rel="me" href="https://mstdn.science/@nextstrain">
> <link href="https://nextstrain.org/blog/atom.xml" rel="alternate"
> title="Atom feed for nextstrain.org/blog" type=
> "application/atom+xml">
> <link href="https://nextstrain.org/blog/feed.json" rel="alternate"
> title="JSON feed for nextstrain.org/blog" type="application/json">
> <link href="https://nextstrain.org/blog/rss2.xml" rel="alternate"
> title="RSS2 feed for nextstrain.org/blog" type=
> "application/rss+xml">
40c49
< "/_next/static/chunks/webpack-f18a76835c777373.js" defer
---
> "/_next/static/chunks/webpack-022efe4e2824bafb.js" defer
52c61
< "/_next/static/chunks/pages/index-1592d50a80c28441.js" defer
---
> "/_next/static/chunks/pages/index-3b7ab159a7f6b20f.js" defer
55c64
< "/_next/static/gORQO5sWexyjqbbXhAT3X/_buildManifest.js" defer
---
> "/_next/static/bucZKFJf16fMJZcQAu4-O/_buildManifest.js" defer
58c67
< "/_next/static/gORQO5sWexyjqbbXhAT3X/_ssgManifest.js" defer
---
> "/_next/static/bucZKFJf16fMJZcQAu4-O/_ssgManifest.js" defer
65c74
< {"props":{"pageProps":{}},"page":"/","query":{},"buildId":"gORQO5sWexyjqbbXhAT3X","nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}
---
> {"props":{"pageProps":{}},"page":"/","query":{},"buildId":"bucZKFJf16fMJZcQAu4-O","nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}

@genehack genehack merged commit 6dae3ca into master Sep 9, 2024
7 checks passed
@genehack genehack deleted the fix-feed-disco-1011 branch September 9, 2024 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

syndication feed autodiscovery doesn't work because of client-side rendering
3 participants