-
Notifications
You must be signed in to change notification settings - Fork 3
Use of esbuild to decrease build and rebuild time #398
Comments
@filipenevola any ideas about who could help us to start work on it? |
@linegel yes, I think you could start by trying to integrate this as a minifier plugin, this doesn't require any changes to Meteor core. |
what about this one? https://deno.land/[email protected]/typescript/overview#how-does-it-work
and parcel 2b3 seems use swc |
@linegel As @crapthings mentioned above, the SWC project aims to be a drop-in replacement for Babel (or at least as much of a drop-in replacement as possible when using a different programming language), reimplementing many of its transforms, which means SWC could potentially replace/reimplement the Using SWC in this way seems especially appealing because Babel often takes up so much time (50%+) during initial (cold start) Note: I'm not actively working on Meteor these days, and I don't speak for the current team, but I wanted to express my relative confidence in the SWC-instead-of-Babel approach, compared to a blind replacement of the whole build system (using esbuild or any other toolchain). |
Meteor works with es5, ESBuild supports only ES6+. |
We wrote a minifier plugin using esbuild instead of terser. That reduced
our build time by about 50% and we even managed to remove Meteor.isServer()
blocks from client bundles.
There is definitely something to do with esbuild and/or swc.
…On Tue, Jun 8, 2021, 3:53 AM Alex Sosnovskiy ***@***.***> wrote:
Meteor works with es5, ESBuild supports only ES6+.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#398 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFPMMASASNDU3W3N75KWUDTRXD65ANCNFSM4MYBNP5A>
.
|
Maybe something to consider for Meteor 3 or 4. |
@jpambrun Can you please create a mini repo illustrating how you've managed to do it? Or even preferably a package? |
I am seeking approval.. might take a while.. |
@jpambrun Thanks a lot! |
I created a test to compare terser (faster than babel) and esbuild minifying 218 files (41MB) and esbuild (1.4s) is 46x faster than terser (65s). The final bundle had almost the same size. |
first clone these packagess in your project/packages
esbuild = esbuild || Npm.require('esbuild');
result.code = esbuild.transformSync(source, {
minify: true,
}).code;
result.minifier = 'esbuild';
return result; after replace i don't see performance boost with our project, weird. or should i meteor reset before build?
the total build time almost same like before MacBook Pro (Retina, 15-inch, Mid 2015) esbuild
Original
|
Hi @linegel and @crapthings we are looking for alternatives like this. @renanccastro could help in this work. The first step would be to define the scope for a PoC and the tools that we want to try first. |
I just played around for few hours with esbuild and WOAH that's really impressive thing Usage of it could really kill that years-long hassle with building and rebuilding of the project, we all struggling with it and that's one of the main disadvantages for the usage of Meteor in a big project.
The main problem looks like it could be a real mess to get into this. As the first step of integration, I see that we could use esbuild instead of current minifier (in my projects it takes around or sometimes more than 50% of the time during building stage). Then we can have a look at how we could move forward with all that we have in isobuild. It would be really nice to have a response from somebody who has worked with Meteor building process previously and who could give a tip where from I could start work on PoC
The text was updated successfully, but these errors were encountered: