Open raflymln opened 3 months ago
Thing I wonder about this always is how does async data fit into this. Like if the title is based on say a user you need to load. I'm unclear what the desired timing is etc..
The Next solution to async data is to allow exporting either a metadata
constant or a generateMetadata
function that can be async that blocks HTML streaming
Well async is there if you implement the generateMetadata
function, and because of that, I hope at least the static metadata
will be implemented for now
As for generateMetadata
, it's basically only supported on server, basically it'd be executed first before streaming the HTML to the client, so if you got a long duration function in the generateMetadata
function, the page will be loaded longer, kind like PHP.
Duplicates
Latest version
Summary π‘
I think it'd be great if solid implement the metadata handling that nextjs use, instead of we using solid-meta, it'd be much easier if we can just export
metadata
variable from a file and let that assigned as a metadata for that page.Seeing that SolidJS is compiling it's DOM using compiler, i think this is possible to create on client too, while on nextjs it's only available on server.
While i think that the dynamic metadata will only be supported on server, i think having static metadata on client will be a great improvement to solidjs developer experience.
Examples π
https://nextjs.org/docs/app/building-your-application/optimizing/metadata
Motivation π¦
{page name} | Site Name
.I believe that this isn't going to be priority for solidjs team, but i hope this will be considered by the team as a way to improve dx. Thanks!