Skip to content
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: skip serialize option for jsx precompile #241

Merged
merged 3 commits into from
Apr 18, 2024

Conversation

marvinhagemeister
Copy link
Contributor

In Fresh we do add some properties automatically to certain elements under the hood, like marking a link as "active" when it matches the current route among other things. For that we need to materialize the full vnode to know what kind of element were dealing with and what kind of other props it has.

To address this, this PR adds a new option to the transform which allows the user to pass an array of element names like ["a", "img"] which should be excluded from being be precompiled by the transform. Plan is to add a new option in deno.json#compilerOptions for this.

Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat. LGTM

@marvinhagemeister marvinhagemeister merged commit b86fd73 into main Apr 18, 2024
2 checks passed
@marvinhagemeister marvinhagemeister deleted the precompile-skip-serialize branch April 18, 2024 15:16
marvinhagemeister added a commit to denoland/deno_config that referenced this pull request Apr 19, 2024
This PR exposes the recently added option for the JSX precompile
transform to skip precompiling passed elements.

See denoland/deno_ast#241
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants