Support for Document Metadata in Preact
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 38.9k
- Forks
- 2.4k
- Avg merge
- 20h 18m
- Merged PRs (30d)
- 35
Description
With the release of React 19’s support for document metadata, managing <title>, <meta>, and other head elements has become convenient, it eliminated the need to use packages like react-helmet to manage these tags. However, when attempting to use preact/compact in my vite.config.ts to render my components, I encountered an issue:
While most functionality worked as expected, metadata tags defined within my pages were not handled correctly. Instead of being embedded in the document <head>, they were rendered inside the body section of my components. This behavior is undesirable and could impact proper SEO and metadata management.
I wanted to check if Preact plans to introduce support for document metadata, similar to React 19. This would be a valuable addition that would make it easier for developers to manage metadata seamlessly when leveraging Preact’s performance benefits.
Would love to hear your thoughts on this!
Thanks for all your great work.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the behavior with preact/compact configured in vite.config.ts, then compare it with React 19's document metadata behavior. The work would be complete when title, meta, and other supported head elements are placed in the document head rather than the component body, with coverage for the supported cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, vite
- Domain
- frontend, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100