denoland / deno_ast

Source text parsing, lexing, and AST related functionality for Deno
https://crates.io/crates/deno_ast
MIT License
144 stars 43 forks source link

feat: skip serialize option for jsx precompile #241

Closed marvinhagemeister closed 3 months ago

marvinhagemeister commented 3 months ago

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.