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

ESBuild Integration (Inspired by Vite) #609

Open
mattstrayer opened this issue Nov 10, 2020 · 6 comments
Open

ESBuild Integration (Inspired by Vite) #609

mattstrayer opened this issue Nov 10, 2020 · 6 comments
Labels
enhancement New feature or request

Comments

@mattstrayer
Copy link

I'm relatively new to the ember world, so forgive me for any naivety...

Has anyone done investigation into the ESBuild project for bundling? Vite uses this under the hood for Vue 3 projects and it delivers an insanely fast bundling and HMR. Would be really great to leverage any existing & proven technologies that would drastically improve the build pipeline.

Copy/pasted from ESBuild's github page:
image

@ef4
Copy link
Contributor

ef4 commented Nov 10, 2020

There would be two different ways to use esbuild. One is their Transform API, which would make it a replacement for Babel. The other is their Build API, which would make it a replacement for Webpack. Either fits into the Embroider architecture just fine.

But the main challenge is that there are several critical babel transformations that we must apply. Those could be reimplemented within esbuild, if esbuild finishes implementing their own plugin system. But right now that is all unstable.

@mattstrayer
Copy link
Author

@ef4 Thanks for the quick response! That makes sense. Looks like they're making some strides on the plugin system. Just releasing an initial version of the plugin API and posting the documentation . Are you able to help shed some light on which mission-critical babel transformations embroider needs to apply?

@ef4
Copy link
Contributor

ef4 commented Nov 15, 2020

A good way to confirm what’s being used is to make a new ember app, add embroider, and run a build. It prints “Building into...” and names where the temp directory is. Look in there for your app, and it will contain _babel_config.js.

Some is embroider-specific like the adjust-imports plugin that makes sure all the addons can be found. Some is ember-specific like the modules-api-polyfill that makes sure the ember packages can be found.

@mattstrayer
Copy link
Author

fantastic, thanks @ef4 🙌

NullVoxPopuli added a commit to NullVoxPopuli/embroider that referenced this issue Mar 11, 2021
NullVoxPopuli added a commit to NullVoxPopuli/embroider that referenced this issue Mar 11, 2021
NullVoxPopuli added a commit to NullVoxPopuli/embroider that referenced this issue Mar 11, 2021
NullVoxPopuli added a commit to NullVoxPopuli/embroider that referenced this issue Mar 11, 2021
@patocallaghan
Copy link
Contributor

@mattstrayer FYI there is now a WIP PR which uses Vite (and therefore ESbuild under the hood) in #759

@mattstrayer
Copy link
Author

thats huge! Thanks for the update :) @patocallaghan

@void-mAlex void-mAlex added the enhancement New feature or request label Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants