Faster builds/rebuilds for development and production ⚡️ #11587
Replies: 16 comments 14 replies
|
What would be the difficulty of instead of patching the system, change the paradigm completely and move to a completely different one like Vite or Snowpack (which don't bundle, they use the native ES modules system and change only the affected file)? I think that we could spend a lot of time improving bundling performance, but the future seems to be bundle-less. It´s such a huge pain to wait for Meteor on every change, especially on Windows. It's the only big complain around Meteor. |
|
To be frank, we could start by defining some terms like "large project", "my Windows machine". Regardless of the time it takes to build a production bundle, I think we perceive slowness in our day to day development habits and if this is the case, I am not sure the tech needs a change though I am not against progress. Some of the things I do to prevent having to build a large project:
Some other things I do to keep existing projects small:
One of my top priority rules in a project is that I should not have a large project bundle. It is best to run multiple functional components of a larger project. With this in mind, I would rather focus on an official SSO and an official microfrontend-ing technology to attach Meteor and non-Meteor apps to one another in a "master app". |
|
@renanccastro Another separate step could be replacing |
|
SWC will not support nested imports, so, it doesn't suit for Meteor as Babel-replacement. |
|
Rome came up a bit in my browsing around the intrawebs. Seems to be quiet interesting project to look into. I think it fits well into Meteor philosophy. |
|
Maybe there is an easy way to add to isobuild multithreading Nodejs Worker Threads? First build each target in separate thread. And then compile N files at time. N - CPU cores count. @paulincai partially right about HMR and almost instant updates in browser during development. BUT when you change server side code, and even more, WHEN you debugging mobile cordova version on each CMD+S I wait 30-60 to see changes on first client code change and on each server side code change. My production build ~30min and 1Gb size When I debug cordova native features it's BIG PAIN |
|
We are staying far behind I think. Vite 3 is out and everything seems to be using it: I think we should ditch isobuild and start using it or a ESM based system or Meteor will never survive long term IMO. The bundler is by far the worst thing about Meteor, especially on Windows. That and not using npm to manage the packages. |
|
Support. Our builds are taking 35 minutes and we've already spent a lot of time trying to reduce that build time. Most of that time is just coming from Meteor build tooling. |
|
Dunno if this may be an issue for your builds, it has been for me... When I am running a build I make sure I do not have any watchers ( Also, on certain operating systems all new files are automatically scanned for viruses (e.g. windows). You can configure this scanning to ignore specified directory trees, like your build output. |
|
Just saw today: https://github.com/Akryum/meteor-vite/blob/main/packages/vite-bundler/README.md Maybe this might be something to bring into core and replace Babel? |
|
I have been working with Meteor since 2014 and in that time I have also tried many other frameworks, most recently I have worked on a project using Remix and on another project using AWS Amplify, and in my opinion to this day there is still no other framework which offers the same great developer experience as Meteor does. However I know that many people do complain about the build times and have stopped using Meteor because of this. For me personally, even with the slow build times it is better than other frameworks out there, but I do think if this one area were improved many people would move back to Meteor or at least want to give it another try. I am currently working on my first Meteor project in over a year, its an Electron app using meteor-desktop (also a really great project by the way). The initial startup time is around 5 minutes, in the grand scheme of things this is not a deal breaker for me, but my colleagues complain endlessly about this. I can paste my profiling output if it will help, but as others have mentioned above, its probably not worth it to continue debugging isobuild and that time is probably better spent figuring out how to move over to Vite or the like. Just my 20c. |
|
awesome work from @nachocodoner adopting SWC to build process |
|
If you're looking to help speed up our bundler, we've got some great blog posts that will guide you on using our profilers to identify bottlenecks in the building process! |
|
We’re continuing this conversation in the forums as well: Join the Effort to Speed Up Meteor bundler. There, we share updates on recent changes and performance profiles showing the improvements made so far. Our efforts to improve build and rebuild times are ongoing! ☄️🚀 |
|
We delivered already Meteor 3.3 with faster builds/rebuilds x3. See blog post. ☄️🚀 Our next efforts on improve the developer experience is the integration of Meteor-Rspack. Initial testing has showed incredible improvements on speed. |
|
Can you update your build-cache mechanism so it doesn't grow unbounded? Frequently I catch An auto-eviction mechanism as |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hello, everyone!
It's well known that for some time our meteor builds can take longer than the average players in the JS world, like webpack and rollup, for example, but, we also do more! We have nested imports, dynamic imports, and custom package resolution, everything without a single config, which is something you won't find out there :) We have made a lot of progress in this matter lately, which is great! First-time builds and bundling however are still slow for some apps.
Babel often takes up so much time (50%+) during initial (cold start) meteor builds (by @benjamn , as in this answer: meteor/meteor-feature-requests#398 (comment)) that it would be a good thing to replace it if we find a better alternative.
This is the profiling result for a bigger app, we can see that Babel is indeed 50% of the initial build. Rebuilds are faster.
So, let's discuss ideas for improving build/rebuild time on Meteor!
Here are some already pitched ideas, and some status:
Use SWC as a replacement for Babel
Initial feature request surfaced from ben's answer here: meteor/meteor-feature-requests#398 (comment)
Status: Tested, there are multiple blockers for using it.
The general idea is that SWC uses a rust backend and, on benchmarks, it's way faster than Babel.
What I've tested so far is getting a build plugin that uses SWC as a backend but there are some key points that block meteor from using it:
It's possible to progress more on this matter, and if anyone is interested, check out my POC here: https://github.com/renanccastro/swc-experiment
Use esbuild as an alternative for our Bundler
Source feature request: meteor/meteor-feature-requests#398
Status: Pending
Use Multiple cores on our own bundling/builder
Status: Pending
Worker threads would be a good fit for tree resolution.
Use Webpack
Status: Pending
There is already a working package that let you use webpack inside Meteor: https://github.com/ardatan/meteor-webpack
We need to analyze and benchmark the performance and its tradeoffs.
Also, feel free to suggest new ideas.
All reactions