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

fix: Solid bundling now works #3

Merged

Conversation

crutchcorn
Copy link

Previously, when bundling, the Solid output would include instructions for React.createElement:

image

As we explored on stream, this isn't easily worked around - even when using ** @jsx ** pragmas:

unjs/unbuild#325

Moreover, the plugin I found that would run during ESBuild:

https://github.com/amoutonbrady/esbuild-plugin-solid/

Has a few problems, namely that we cannot pass plugins to ESBuild inside of unbuild, since they're using the esbuild.transform API and not esbuild.build API (transforming doesn't support plugins but building does)

As such, I had to get clever and:

  • Disabled ESBuild entirely
  • Moved to fully bundle with Rollup's Babel plugin
  • Add in React, TypeScript, and Solid Babel plugins and namespaced them properly

Once this was done, we have the proper output for seemingly everything.

Solid:

image

React:

image

Vue (just as an additional dataset):

image

Copy link
Owner

@cmgriffing cmgriffing left a comment

Choose a reason for hiding this comment

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

Amazing work!

@cmgriffing cmgriffing merged commit 8e01faa into cmgriffing:feat/add-solid Oct 2, 2024
2 checks passed
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.

2 participants