-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
feat: compatibility with latest versions of React and Next #55
Conversation
…n project config environments use ts file for jest config, add types file for common types, improve types
…deStream data-reactroot attribute is not added on the root element since react 16 so it's no more needed to add add a root div to remove the attribute afterward improve types
…config, add prettier to eslint
return a React element instead of a string and remove div from esi:include tag improve environment checking in server.tsx
…ror.log files to gitignore
…ate deps update readme example links
Everything should be ok now @dunglas |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So cool! I left some minor comments, and we'll be able to merge.
I've applied the remaining suggestions. |
Found this related issue: facebook/react#1444 |
The attributes from the generated html is indeed correctly escaped <div>
<h1>React ESI demo app</h1>
<esi:include
alt=""'<&Alt>'""
src="/_fragment?fragment=MyFragment&props=%7B%22greeting%22%3A%22Hello%21%22%2C%22esi%22%3A%7B%22attrs%22%3A%7B%22alt%22%3A%22%5C%22%27%3C%26Alt%3E%27%5C%22%22%7D%7D%7D&sign=c7102a792fa20beeb85c02081698c855c42f3cf575503202bbed224bce793845"
>
</esi:include>
</div> I think this is because we are not using renderToString or/and dangerouslySetInnerHTML anymore. |
As ESI is an XML vocabulary, using the long form instead of a self-closing element is most likely spec-compliant. |
The spec says
It doesn't say that it MUST NOT have a closing tag so, yes, we're probably good. |
Hi @dunglas |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I made some small changes directly to your branch and granted you the commit bit @J3m5. Feel free to merge!
This is whats output to the page in the express example so matches the spec as per your conversation previously. All tests are passing this looks great. Wish I'd have seen this PR before checking out main - doh! Excellent work! |
close #54, close #56