11 ms·
If anyone is tired of Webpack configuration issues / slow performance, give Parcel a try: https://parceljs.org/ https://parceljs.org/ The project is less than
by shawn 9y ago
If anyone is tired of Webpack configuration issues / slow performance, give Parcel a try:
https://parceljs.org/ https://parceljs.org/
The project is less than two months old, so Parcel might not be a good fit for you. But if it is, it's usually a drop-in replacement. Zero configuration. Just run it and go.
We're working hard to add the most requested features: source map support is coming very soon, for example. But if you can put up with a few rough edges, Parcel promises to give you a ~5x performance increase over webpack.
(We kick off multiple processes to do the actual bundling work, and we have an asset cache, which accounts for most of the speedups.)
If you'd like to participate or have any questions, hop on our Slack! https://slack.parceljs.org/ https://slack.parceljs.org/ We have about 500 devs ready to help you out and chat with you (about anything, really).
Feel free to snag an issue and start working on it: https://github.com/parcel-bundler/parcel/issues?utf8=%E2%9C%93&q=is%3Aissue+sort%3Aupdated-desc+ https://github.com/parcel-bundler/parcel/issues?utf8=%E2%9C%... There's plenty of work to go around.
It's been really cool to see so many people pitching in. We recently had a Japanese contributor help get Parcel up and running for multi-language projects: https://qiita.com/zacky1972/items/0ce05454b67506edc634 https://qiita.com/zacky1972/items/0ce05454b67506edc634
- chickenfries 9y agoIs parcel the first node module bundler to run multiple cores? I’ve been waiting for this forever! Definitely going to take a look at the code and try this out soon.
- chmln 9y agoI believe webpack can run using multiple threads at least [0] [0] https://github.com/webpack-contrib/thread-loader https://github.com/webpack-contrib/thread-loader
- chrismorgan 9y agoThere’s a reason why it’s not generally done: there are no good tools for doing this in Node, nor is JavaScript particularly conducive to it. The state of the art in such matters is Rust with its type system-assisted fearless concurrency; my favourite demonstration of how it can work is Rayon, where introducing data parallelism is typically as simple as replacing a .iter() with a .par_iter(). I’d love it if something like Rayon could be ported to Node, somehow. (By virtue of being excellent at the low-level and having zero-cost abstractions, Rust actually ends up being a really good high-level language.) In Node, if you want to process a zillion files in the same way, there are no good solutions. I recently needed to improve the performance of a manually-crafted, Node-centred build process; in Rust, it would have been a matter of: add Rayon, replace a .iter() with .par_iter() and we’re done—and what’s more, it’ll only flex its parallelism muscles where it’s worthwhile. But in Node it took a several hours of trouble (after research, I settled on using worker-farm to help) to produce a strictly inferior result. Rayon: https://github.com/rayon-rs/rayon https://github.com/rayon-rs/rayon worker-farm: https://www.npmjs.com/package/worker-farm https://www.npmjs.com/package/worker-farm
- chickenfries 9y agoI've also tried to naively improve a node build process and given up after realizing that, for the particular project I was working on, splitting up the build into multiple processes actually slowed things down compared to the single threaded build process Node's single threaded event loop works well for some use cases but makes it hard to parallelize build process. I would absolutely use a module bundler developed in a better suited language and distributed on npm as a binary like flow.
- thangngoc89 9y agoThen you should consider fastpack. It’s written in OCaml and use Flow parser. Also, it should be distributed as a binary Fastpack: https://github.com/fastpack/fastpack https://github.com/fastpack/fastpack
- beckler 9y agoI would also consider bazel. https://bazel.build https://bazel.build
- lambdadmitry 9y agoHave you tried it to build web projects? Unfortunately there are very few experience reports out there.
- chrismorgan 9y agoI’ve thought in concrete terms about porting postcss to Rust before. It’s the sort of tool that is stuck with slow while it’s in JavaScript, but could be amazingly fast in Rust, for which it’s a really good match (especially algebraic data types). (Seriously, the sort of thing that typically takes a second or so in JavaScript with things like postcss I would expect to take under five milliseconds in well-written Rust, and under a hundred in badly-written Rust.) The real problem with all these sorts of things is network effects. People aren’t going to use the Rust port of postcss unless the plugin they want to use works in it, and it can be conveniently tied into their existing toolchain, and—— and—— This is why we can’t have fast, efficient things. I’m really looking forward to getting something of the pthread style in WebAssembly, because then, finally, blending the two should be easily feasible. You can already use things like Neon (https://www.neon-bindings.com https://www.neon-bindings.com) to write Node modules in Rust, but it’s not as easy as it should eventually be a few years down the track.
- deleted 9y ago[deleted]
- PudgePacket 9y agoMaybe a naive question but did you consider writing it in language that is typically faster (C++/Go/Rust)? I understand the many benefits of it being written in JS but there is an inherent maximum level of performance that JS can achieve in certain workloads.
- thangngoc89 9y agoThere is an attempt to write JS module bundler in OCaml https://github.com/fastpack/fastpack https://github.com/fastpack/fastpack
- fenomas 9y agoMy naive answer, but I'd think that the heavy lifting for bundlers like this lies mostly in the external packages that parse and modify the code (Babel, uglify, postcss, etc). The core work of the bundler to wrangle which dependencies to pass to those external libraries probably isn't a performance bottleneck, surely?
- ioquatix 9y agoIn my experience you are not wrong. Resolving a build graph can be done efficiently. The main cost is typically the tools invoked to satisfy build targets. However, if the build graph does unnecessary work, it can slow the build down by a large amount, e.g. compiling files which were already compiled. In. a large project, it might be the difference between a 10 second build and a 10 minute build for example.
- merb 9y agowell at least there is a tool in java. and once warmed up it's basically the fastest tool available. google closure compiler. so basically if there would be a closure service that could be installed on your system a lot of things would be way faster.
- JoshGlazebrook 9y agoI tried out Parcel this past weekend and I was really impressed with how easy it was compared to when I tried using Webpack for the first time. Just import what you need and it find it all and you're good to go.
- hazza1 9y agoParcel is a neat solution, lack of sourcemaps stops me from using it for anything serious but I believe this is being worked on.
- Fiahil 9y agoI would prefer to stick with webpack and make it easy and fast again, rather than changing tools -again. We've seen this with grunt, gulp, and now webpack. What if, we're changing strategy this time ?
- purerandomness 9y agoNah, I heard Yeoman solves all these problems.
- JimDabell 9y ago> If anyone is tired of Webpack configuration issues / slow performance, give Parcel a try Shawn, half the articles about Webpack I see recently have these kinds of comments about Parcel. This goes beyond excitement into spammy behaviour. I've seen plenty of other people complaining about this too. This was an article about Webpack performance, and you've come along to talk about unrelated Parcel features like source map support and i18n, to link to the Parcel Slack, and to ask for help working on Parcel bugs. It really puts me off Parcel and there's no chance I'll look at it so long as when an article about Webpack pops up, there's always a comment from a Parcel developer spamming your project. Please stop spamming Parcel in Webpack discussions.
- kreetx 9y agoBut why not actually try it then, and come back with what you got? I.e maybe he's here because they solve most of the pressing issues. (I myself have no skin in the game either way)
- ksec 9y agoI am sorry if this is silly question, and no offence intended. Is Webpack beyond fixable? Tech has always been about reinventing the wheels, but the JS community seems to dial this up to a whole new level. Isn't Webpack 4 heading towards Zero Configuration? Isn't Webpack 4 making many performance improvements? This isn't to say i dislike Parcel. I mean God I wish Rails could have picked up on it as default.
- dbbk 9y agoOut of interest, is there an overview of Webpack 4 somewhere? This sounds interesting and it's the first I've heard of it.
- xab9 9y agoThis sounds great, but in reality most projects became so dependent on webpack, that moving to another packager would be a time waster (at least from managemen't spoint of view - and heck, I might agree: for us it would take weeks if not months).
- Sacho 9y agoWhy is parcel x5 faster than webpack?
- znt 9y agoMaybe it's because you don't spend 5 hours reading through webpack documentation and examples?