-
-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Labels
questionFurther information is requestedFurther information is requested
Description
React reordered the tags that are already inside the head.
I tried to replicate the React behavior for this PR(#300), but it was affecting the hydrate as we weren't keeping the same order on html and model.
I don't know how React manages to avoid the hydrate issue, but take a look at the result from React:
const App = () => {
return (
<html lang="en">
<head>
<style />
<link precedence="low" rel="stylesheet" href="/foo.css" />
<meta charSet="utf-8" /><meta name="viewport" />
</head>
<body>
</body>
</html>
)
};
/** HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" />
<link rel="stylesheet" href="/foo.css" data-precedence="low" />
<style></style>
</head>
<body></body>
</html>
*/
/** Model
0:["$","html",null,{"lang":"en","children":[["$","head",null,{"children":[["$","style",null,{},"$1",
[["App","/Users/pedrolisboa/work/server-reason-react/arch/server/render-rsc-to-stream.js",48,5]],1],["$","link",null,
{"precedence":"low","rel":"stylesheet","href":"/foo.css"},"$1",[["App","/Users/pedrolisboa/work/server-reason-
react/arch/server/render-rsc-to-stream.js",49,5]],1],["$","meta",null,{"charSet":"utf-8"},"$1",
[["App","/Users/pedrolisboa/work/server-reason-react/arch/server/render-rsc-to-stream.js",50,5]],1],["$","meta",null,
{"name":"viewport"},"$1",[["App","/Users/pedrolisboa/work/server-reason-react/arch/server/render-rsc-to-
stream.js",50,29]],1]]},"$1",[["App","/Users/pedrolisboa/work/server-reason-react/arch/server/render-rsc-to-
stream.js",47,4]],1],["$","body",null,{},"$1",[["App","/Users/pedrolisboa/work/server-reason-react/arch/server/render-rsc-
to-stream.js",52,4]],1]]},"$1",[],1]
*/Should we mimic react? How? Is it possible without a hydration issue?
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested