-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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: support precompiled JSX transform #4177
Conversation
Size Change: +1.8 kB (3%) Total Size: 59.2 kB
ℹ️ View Unchanged
|
d1713fe
to
f88bf02
Compare
jsx-runtime/src/encode.js
Outdated
const ENCODED_ENTITIES = /["&<]/; | ||
|
||
/** @param {string} str */ | ||
export function encodeEntities(str) { |
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.
This function is just copied over from preact-render-to-string
https://github.com/preactjs/preact-render-to-string/blob/17f839c47309d7de35cc407c25b016a0dcc325c8/src/util.js#L11
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.
I am so excited for this!
f88bf02
to
29e3ada
Compare
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.
Should tree-shake out so I am okay with the increase in total size for the ssr perf gains
ca1ac38
to
975779a
Compare
This PR adds support for the new precompile JSX transform that will ship with the next deno version. The new deno version will come out this week.
The idea behind the precompile JSX transform is that instead of allocating a full vnode object + props for every element, we precompile HTML nodes during the JSX transpilation step to strings. During rendering we then need to mostly only concatenate strings together.
Demo: https://github.com/marvinhagemeister/deno-jsx-precompile-preact-demo
See preactjs/preact-render-to-string#322 .