Parcel: Fast, zero configuration web application bundler
github.com
github.com
https://news.ycombinator.com/item?id=15853149 (435 points/163 comments)
I think really the value proposition here is “very little if any setup needed” and making so there was no setup possible may have gone too far.
Despite what people says in the comments, Parcel has its (great) value. The ability to import a rust file directly and have it compiled to a web assembly module for example, is a great piece of engineering and exceeded my expectations for web build tools. Parcel also hits the sweet spot where it's both zero-config, and easy to customize if you find the need.
Honestly? Parcel has a better experience than your C++ build tools. Be it CMake, Ninja, or whatever build tools people use in 2018.
I don't think there are many people who'd say that there's any good experience with using CMake for any slightly complicated project.
Just as we're getting to the point where many of these tools should be optional because we have great modern JS and modules support in browsers, and many projects are already written in supposedly standard modules, many are blocked from actually shipping code that runs un-built on the browser because of bundler features like importing images, CSS, etc.
This is one of a few tiring patterns in the JS ecosystem. The other is "you should be using grunt", "should be using gulp", "nooo just use NPM scripts". Ok so now our package manager is a task runner too despite the insistence on "tiny modules that do one thing well coz Unix!"
Now we have webpack. That isn't tiny but is. Its not a build tool. It's a build platform. How do you extend it? Yep. Tiny modules. In the configuration. Zero conf? Maybe for a 0 dependency tiny module. Then when they introduce a major version that breaks pretty much every plugin, the response? "That is what we call a fixed mindset. We want a growth mindset".
I wouldn't mind if the package management solution was built with tiny, one-big-lib in mind. I wouldn't mind if the ecosystem didn't contradict itself so much. Its just tiring.
For some the first reflex is to add a dependency instead of spending 5 minutes thinking of simple solutions for their use case. But the latter isn't restricted to the node ecosystem.
The avalanche of useless modules profits mainly to NPM, a for profit organisation operating a closed source package repository which imposed itself on the node project in dubious ways. Even nodejs creator regrets it.
So I tried using this. It was nice while what I was doing fit inside of everything that was default settings and/or what maintainers used. As soon as I stepped outside of that I ran into things like having to hope someone implemented a Parcel plugin for some random transform (an issue that applies to Webpack, too, but Webpack has so many more users that you're guaranteed someone actually did make one that actually works correctly), or: https://github.com/parcel-bundler/parcel/issues/645. Having an issue on something as popular as Bootstrap 4 be open for 6+ months is pretty frustrating. I spent several hours flailing at this issue to no avail.
I switched to Webpack 4 and had all of my existing build system and some additional niceties working in <45 minutes.
It was never great, not even good.
Perhaps your problem will be solved as parcel takes more time for third parties to fill those small niches.
A new user. Most of the time I spent was reading docs.
> Perhaps your problem will be solved as parcel takes more time for third parties to fill those small niches.
Oh yes, probably. That's basically what the advantage of Webpack was. There was more 3rd party stuff and it actually worked. Though really I'd want more first party support, otherwise I'm losing the 'zero configuration' sale that got me to try to use it in the first place.
That being said, Webpack 4 (released months ago) shipped with a similar zero config option, so I'll likely go back to it for future projects.
My line of thought here is helper methods in an empty package namespace, so that they only exist at build time and are stripped out in the result.
° Sourcemaps not working (wrong files / no source translation)
° Randomly losing exports (a module with multiple exports where one of them ends up as an empty object - fix by clearing cache and restarting)
° Errors like "module 71b not found"
° Hot module reload enabled by default, meaning that all top level code runs again when you reload the code (e.g. here's an extra canvas in your dom)
My preferred zero config setup for hobby projects has become <script type="module">[1] and a live reload server[2].
If I'm working on a React project then I will always use Create React App when I can[3].
When I take something beyond the hobby stage and into maintaining it as an ongoing project, I use TypeScript Quickstart[4]—to abstract the underlying Webpack config and start writing code immediately.
I'll only reach for Webpack when I know that I need more flexibility than any of these other tools offer—which isn't very often.
[1]: https://jakearchibald.com/2017/es-modules-in-browsers/
[2]: https://github.com/tapio/live-server
Bundlers probably have a certain minimum complexity that can’t be reduced if they want to be universally applicable, but a lot of that can be hidden for most use cases, particularly if using the same framework.
The only real problem I am having is lazy loading and dynamic component's. I am being forced really to add routes to lazy load some heavy components but I would really like not to have to deal with that. I believe there is a way to use SystemJS to load dynamic components at runtime but there is scant information and have no interest to pursue it. A small price to pay.
People who haven't tried can't even tell if you just screwed it up or there's actually a problem.
I imagine this relates to a whole range of broken assumptions it makes about where files actually are in my project, how things are configured on my system, etc. Normally you'd fix that by configuring these things. Since it doesn't provide a whole lot of documentation or guidance other than this thing needing no configuration because it is so smart, I decided against pursuing this thing any further and uninstalled parcel.
There is indeed something uncomfortable about a big node_modules directory or a magic build tool. It's almost like bathophobia, where instead of depths there is 3rd-party javascript code.
[1]: https://github.com/gvalkov/tailon-next/blob/master/frontend/...
And with regards to Parcel vs Webpack, it's not (at least not yet) even a competition since webpack 4 is basically zero-configuration and is so much more advanced tool at all levels.
Do remember looking into it for small side project but ended up just using npm scripts, maybe that's part of it.
Webpack is too complicated though, so if this can stay simple, why not.
I thought those were fixed in v4?
PS: we haven’t implemented Multicore, or Persistent Caching yet (slated for version 5). This means that there is still lots of room for improvement!!!!
It _is_ coming, which I'm excited about.
https://medium.com/webpack/webpack-4-released-today-6cdb9947...
1. The existing tool is way too complicated to configure and slow. Let me introduce a new, zero-configuration, blazing fast tool
2. OK so because it's strongly opinionated there are some things it can't do. So we'll allow you to extend it via plugins. You'll have to configure this.
3. Due to the increasing popularity, we are making a meta-version that lets you re-plug any element in the entire system with one of your own choosing. You'll have to configure this.
4. GOTO 1.
sounds like progress / innovation to me?
It gives the impression of progress without actually making progress.
This is also why I got tired being a programmer after doing it for many years. First version is always super nice. Then you add features, and refactor. Doing this is slower and slower the bigger your software gets. At the end, your software is filled with complexity and you want to rewrite it from scratch. So you do, and you are back with a nice version. Until again, more features need to be added.
Now, does this example above mean the developer is innovating? Are we getting somewhere? No. At the end, his product is going to be replaced by other products that does the job better - until they also meet the same fate.
Yes, this is the very definition of innovation. Just because what you're working on is going to be replaced, doesn't mean it's not innovative. Of course it's going to be replaced, that's the whole purpose. Hopefully we get better and smarter along the way. Sometimes something that seems trivial to you as an engineer is mind blowing to a layman with domain expertise that goes on to leverage your software to help make the company more money in ways no one was expecting (or maybe save money). In other words, innovating.
With Webpack 4 and Parcel especially, these tool are both zero config and configurable. Your point 1 and 3 are actually not mutually exclusive, and repeating the meme just sounds like you're perhaps out of the loop for a bit.
While the Javascript developer experience truly was horrible a few years back, it has dramatically become better. Try it, and you might be pleasantly surprised :)
Configuring Webpack is still pretty bad. If the zero config works for you, great. But if you need to configure it yourself, it's really verbose, it's really complicated, and the documentation is a bit thin.
SplitChunks in Webpack are like black magic, they work but you don't have any idea how, and when they don't work, you still have no idea how. And you don't know if it's because you didn't configure them properly, because you don't know what is configuring them properly, because the documentation on them is so bad.
Maybe I'm just bad at configuring Webpack, but I still don't understand how many things in Webpack work, and it's given me a lot of headaches, even with the "zero config" Webpack 4.
But frankly, if a JavaScript developer ever really wants to solve the problem... Learn enough C++ to write the equivalent code that compiles 6.5M in 0.1 seconds (assuming a nice HD).
Traversing that tree to remove unambiguous dead branches seems pretty clear. Perhaps if you get into a tricky manipulation between strings and syntax you could add a little runtime...
Come on man, that's beyond the point. Just because JavaScript needs to be compiled, doesn't mean it has a worse experience than compiling C++.
Instruction ordering is largely bound to instruction pipelining and the estimation of CPU instruction transitioning to reduce latency. Given that V8 uses some degree of virtual indirection... I don't think that's possible in JavaScript.
Believe it or not, some people have problems in domains with contexts that have nothing to do with yours and the things they come up with are equally valid solutions.
Compiling code from C++ to WASM is counter-productive if the native JavaScript is fine. It's just that native languages seem to perform quite a bit better in the domains of graph construction, graph optimization, and even basic string manipulation.
When did WASM come into the picture? I use Parcel because my time is valuable and I don't want to master the arcane arts of modern JS build toolchains but I still NEED to benefit from them if I'm to run a successful business and make sure my investors get their money back and a language I can deliver plain text over HTTP/S that runs performantly across billions of devices that I can modify on the fly is beyond valuable.
> native languages
C++ isn't going to help me deliver my product to my customers in any measurable way that influences the outcome of our relationship. JavaScript, frankly, does - the less time my organization spends writing code, the less we have to charge for things to make up for that margin impact.
Fastpack is a binary JS bundler written in OCaml:
It’s new and missing some features (http://fastpack.io/docs/get-started.html ), but already faster than Webpack / Parcel. It also supports Webpack loaders.
Also. What’s up with the obsessive use of emojis everywhere? Take a look at this issue for example: https://github.com/parcel-bundler/parcel/issues/144
Just like your comment.
Clearly a lot of people have put good work into this project, and have decided it adds value to their workflow and your first reaction is to sling mud. Maybe try reddit.