News for hackers. Stuff that matters.
Re:Preact: Fast 3kb React Alternative with the Same API, Com... by kevsim on Saturday December 12, 2020 @03:47AM (#25396829)
The team behind Preact also recently released WMR [0] which attempts to simplify the process of actually building a web app. We're thinking of trying it out to replace the current mess we have with create-react-app, webpack, etc.

0: http://github.com/preactjs/wmr

Re:Preact: Fast 3kb React Alternative with the Same API, Com... by emilsedgh on Saturday December 12, 2020 @04:23AM (#25396984)
Webpack has some serious positive side effects:

1-2 times a year when I go to update our app's Webpack, in a matter of 3-4 days I:

1. Get up to date on all recent developments in the world of javascript, babel, esbuild, typescript, eslint, webpack, jest and all their plugins

2. Get the chance to browse through hundreds of fresh github issues while they are still open!

3. Open a few new pull requests

4. Find out about tens of of plugins that are not being developed anymore and their new replacements which are almost the same only with a new name and slightly different API!

5. Give my laptop and build server's CPU's a good go

6. Call my therapist

It's a wonderful opportunity to keep life on edge.

Re:Preact: Fast 3kb React Alternative with the Same API, Com... by IgorPartola on Saturday December 12, 2020 @06:58AM (#25397704)
This is too real. I don’t use webpack directly, only the way vue-cli bundles it, but still it’s a sort of blessing and curse. It is also dog slow for what it’s doing: even something like make can cache compilation objects and make sure that for example Bootstrap’s SCSS doesn’t need to be recompiled every time I update the background color of my app in my own stylesheet. And while speed measuring plugins exist, I am still at a loss at how to optimize a build of a simple SPA where my code all in is less than 10KB and yet it takes like 30 seconds to produce a build. And as you say, when a bug hits, good luck figuring that out.
Re:Preact: Fast 3kb React Alternative with the Same API, Com... by emilsedgh on Saturday December 12, 2020 @11:13PM (#25404254)
Try esbuild instead of babel. Really helps. There is an esbuild-loader that can replace babel neatly.
Re:Preact: Fast 3kb React Alternative with the Same API, Com... by tarsinge on Saturday December 12, 2020 @08:04AM (#25398004)
On the bright side it’s still possible to make a living shipping professional code with simple script dev tags, for now.
Re:Preact: Fast 3kb React Alternative with the Same API, Com... by JMTQp8lwXL on Saturday December 12, 2020 @01:15PM (#25400226)
I've been using webpack since v1 and I can't recall having to open pull requests when periodically upgrading it, or its plugins. Webpack 5 + html-webpack-plugin are kind of a mess right now, though. Webpack, in many use cases, needs html-webpack-plugin but there is only an alpha release supporting v5.

The release was rushed by community pressure, and now we have a half-baked upgrade strategy. I would've happily waited another 6-12 months before v5 was released to get major plugins ready first.

Re:Preact: Fast 3kb React Alternative with the Same API, Com... by brian_herman on Saturday December 12, 2020 @12:22PM (#25399816)
:( I just get notifications when my dependences have vulns on github and I update them with pip install -U <package_name>
Re:Preact: Fast 3kb React Alternative with the Same API, Com... by 4778468d on Saturday December 12, 2020 @05:09AM (#25397212)
Ooohhh snarky.... !
Re:Preact: Fast 3kb React Alternative with the Same API, Com... by jokull on Saturday December 12, 2020 @04:07AM (#25396917)
I found frontend tranquility in Snowpack and snowpack-rollup for production builds.
Re:Preact: Fast 3kb React Alternative with the Same API, Com... by kevsim on Saturday December 12, 2020 @04:23AM (#25396981)
Any gotchas? When I read about Snowpack, I always get a too-good-to-be-true feeling. Maybe I'm just jaded by years of grunt, webpack, parcel, etc.
Re:Preact: Fast 3kb React Alternative with the Same API, Com... by SCLeo on Saturday December 12, 2020 @01:51PM (#25400487)
May I ask what is the problem with parcel? I can't remember I have ever run into problems with parcel. Maybe it's because, unlike when using webpack, I never try to perform "dark arts" when using parcel.
Re:Preact: Fast 3kb React Alternative with the Same API, Com... by pull_my_finger on Saturday December 12, 2020 @02:24PM (#25400753)
I had previously run into the issue of Parcel watching `node_modules` for file changes and inevitably having issues related to that. There are a few issues on GH related to that, to which the devs basically said "that's a feature, not a bug". It's been a while since I used Parcel though, Idk if that's still and issue.
Re:Preact: Fast 3kb React Alternative with the Same API, Com... by hashkb on Saturday December 12, 2020 @11:01AM (#25399044)
Snowpack got really really slow after I added a few dependencies. Also, it can't reuse its cache between a docker container and my laptop... I was hoping the cache would be portable but it's not. It needed more restarts than webpack. And you give away your freedom to tinker.
Re:Preact: Fast 3kb React Alternative with the Same API, Com... by dmitriid on Saturday December 12, 2020 @04:32AM (#25397023)
For starting from scratch it mist likely does wonders.

Don't try converting a large legacy-ish codebase :)

Re:Preact: Fast 3kb React Alternative with the Same API, Com... by pea on Saturday December 12, 2020 @04:54AM (#25397125)
We love parceljs, too. Check it out.
Re:Preact: Fast 3kb React Alternative with the Same API, Com... by danmur on Saturday December 12, 2020 @06:36AM (#25397633)
I like parceljs too. I haven't used it on big projects (plus I'm not a web dev currently) but I found it to be more "config when you need to change the defaults" than "no config". But that's great. It works out of the box for a lot of stuff and you add some dotfiles when you want to customise.

I do want to try snowpack too though.

Re:Preact: Fast 3kb React Alternative with the Same API, Com... by matthewhartmans on Saturday December 12, 2020 @05:17AM (#25397252)
It's a joke isn't it?! We spend hours maintaining that stuff and it gives the customer 0 value. :explodinghead: But on the flip-side, we get paid! :D
Re:Preact: Fast 3kb React Alternative with the Same API, Com... by chiefalchemist on Saturday December 12, 2020 @07:44AM (#25397890)
Customer? How about the users? The tools keep getting "better and better" and yet time and again I'm on sites - big major sites - that trigger a "No way! WTF is _that_?!??"

Mind you that's not necessarily a direct result of the tools or those using the tools. On the other hand, resources are finite. Any time used for X (e.g., wresting with Webpack) "comes out of the budget" for Y (e.g., bug fixes) or Z (e.g., a UX designer).

Clients/customers care about their users/end-customers. And users/end-customers don't give a toss about Webpack or anything else. They care about themselves. Full stop.

Re:Preact: Fast 3kb React Alternative with the Same API, Com... by 411111111111111 on Saturday December 12, 2020 @09:54AM (#25398563)
The tools get better, enabling even more complex applications which occasionally have bugs and unintended features.

This is just in the nature of progress. If any product owner was fine with a simple static website which only displays some text, I'm sure there wouldn't be any noticeable bugs in it.

Re:Preact: Fast 3kb React Alternative with the Same API, Com... by coddle-hark on Saturday December 12, 2020 @12:51PM (#25400052)
I think it’s a general truth that all software projects tend to end up at the maximum possible complexity. Projects that aren’t inherently complex tend to achieve this by complicated tooling, deploys, and a slew of “special cases” that inevitably slow things down. It’s a special case of Parkinson’s law (work expands so as to fill the time available for its completion); all these developers need to spend their time on something after all, no-one’s going to code them self out of a job.
Re:Preact: Fast 3kb React Alternative with the Same API, Com... by MuffinFlavored on Saturday December 12, 2020 @01:57PM (#25400524)
Is a goal of `wmr` to ever support translating `exports.foo = bar` / `module.exports.foo = bar` + `require()` to `import/export` so that modules that work with `node.js` can work in the browser too?
Re:Preact: Fast 3kb React Alternative with the Same API, Com... by developit on Sunday December 13, 2020 @02:52PM (#25409549)
It already does this. Only for .cjs files and things in node_modules.