Skip to content

Use SolidJS with ESBuild #2557

@Mqxx

Description

@Mqxx

Hey,

as stated by the documentation, SolidJS uses Babel in combination with a preset to transpile the JSX/TSX. I am currently trying to transpile my SolidJS app using ESBuild in combination with a Deno setup and ran into a few problems after realizing that SolidJS needs the Babel preset. I am now using the the esbuild-plugin-solid and that works well.

But this seems like a "workaround", because the plugin does not utilize the speed of ESBuild because it just calls Babel transpiler under the hood. I was wondering what features SolidJS requires, that ESBuild currently does not offer. ryansolid mentioned that SolidJS needs "AST level plugin manipulation". Is this just for performance so that SolidJS can be optimized or is this needed for something else? And would it be possible to transpile SolidJS without the need of Babel and the preset?

Currently ESBuild offers a "minimalistic" plugin API. ESBuild does not create an AST, so "AST level plugin manipulation" would not be possible without an other parser on top (That's what the plugin currently does). But the question is if we even need "AST level plugin manipulation" in the first place.

Maybe someone can give me a hint on why is is so "complicated and complex" to transpile SolidJS JSX/TSX.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions