Add Solid plugin support#12
Open
MuNeNICK wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add Solid JSX/TSX support through Volt's plugin system.
Volt.Plugin.Solid, usingbabel-preset-solidthroughVolt.JS.Runtime..jsxand.tsxextensions as React while requiring a different compiler transform.solid-jsandsolid-js/web.require(...), worker URLs, and downlevel source maps.examples/solidthat configuresVolt.Plugin.Solid.Why
Solid JSX needs the Solid compiler rather than a generic JSX transform. Keeping this in
Volt.Plugin.Solidadds Solid support without changing Volt's default Vue/Svelte/React plugin set.The implementation follows the same plugin boundary as the existing Vue and Svelte support: Volt owns module resolution, bundling, workers, and dev/prod integration, while the framework plugin owns the framework-specific source transform.
Usage
Enable the plugin explicitly in Volt config:
Use
solid-jsandsolid-js/webfrom TSX as usual:The
examples/solidapp shows the full Phoenix configuration.Design notes
This PR does not add Solid to the default plugin set because
.jsxand.tsxfiles are already handled by the generic JSX/React path. Enabling Solid automatically would require a broader Volt configuration decision, such as a Solid-specificimport_sourceor framework JSX mode. This PR keeps that decision out of scope and exposes Solid through explicitVolt.Plugin.Solidconfiguration.The Solid compiler runtime uses a 32MB QuickJS stack. In local validation with a recent Solid app using Solid 1.9 and Tailwind v4, a 16MB stack overflowed during Babel-based JSX/TSX compilation, while 32MB succeeded for the same input.
This is not meant to claim that 32MB is enough for every Solid project. Larger apps may still need more stack, and I would appreciate maintainer guidance on how Volt should handle compiler runtime resource limits for framework plugins.
For comparison, I also tested a few larger Svelte OSS components locally and saw similar 16MB stack overflows that compiled successfully with 32MB. I did not include any Svelte changes in this PR because that seems like a separate Volt runtime policy question rather than part of adding Solid support.
Notes
I'm currently building an app with SolidJS and Elixir, and I would like to use Volt for that stack in the future. This PR proposes Solid support as an opt-in framework plugin while keeping Volt's default plugin set unchanged.
If Solid support is outside Volt's scope, I completely understand. Otherwise, I’d be happy to adjust the implementation if there is a better fit for Volt’s plugin model.
Validation
mix test --include integrationmix test test/plugin_test.exs test/builder_test.exs --include integration