Live data from Hacker News

Zwitterion: a web dev server that lets you import anything

github.com

71–80 of 127 posts

Re: Zwitterion: a web dev server that lets you import anything

#71
post #12

Can anyone point me to a workflow where the cognitive load is similar to how it was in the good old days? i.e. some thing that does everything for me apart from the bit where I write application and presentation code? That mostly just works and doesn't require me to understand the whole stack. Because when I switch to other languages/environments I can most remain blissfully unaware of the plumbing that keeps the thi…

If you don't need to support older browsers, just write raw JS and use module imports. This means that you're pulling down a lot of different files instead of one big blob, but a lot of those files will already be cached in the user's browser from CDNs anyway. Yes, you don't get JSX this way, but I've always seen people's obsession with syntactic sugar as bikeshedding. Typing out code isn't the bottleneck for develop…

Browser support is fairly new, I was actually surprised when you mentioned you could do this now :).

But yeah, probably not a terrible way to go. If you are working with an http2 server today then this will work really well.

Re: Zwitterion: a web dev server that lets you import anything

#72
post #29

Earlier quoted context omitted.

Ember.js is very much batteries-included although learning the framework definitely requires a time investment.

Ember.js is the highest-cognitive-load framework I've ever used. Not only do you have to understand all the bundling of JS, but you have to understand Ember's naming conventions and project structure, which has a lot of corners and edge cases. The basic problem is that they give you a bunch of configuration points and if you don't know what configuration point to insert your code at, you're either going to be writing…

They burned me with the "rails" problem. Ember and RoR are two projects that have really turned me against overarching frameworks. Both have gone through periods of crazy backwards breaking and paradigm shifts that have left me burnt out.

Re: Zwitterion: a web dev server that lets you import anything

#73

A couple of meta suggestions: The submission title is provocative and personally I'd say misleading. As can be seen in other comments, it can lead to badly framed discussions and general dislike about the project. The project readme doesn't even mention Webpack, so why is the leading phrase "Webpack killer" in the title? The repository readme is very long. As a dev, I'm looking to capture the core concepts of a proje…

Agree on the title. I'd have had a different reaction to this if the HN title hadn't claimed it was supposed to be a "webpack killer".

Re: Zwitterion: a web dev server that lets you import anything

#74

Earlier quoted context omitted.

If you don't need to support older browsers, just write raw JS and use module imports. This means that you're pulling down a lot of different files instead of one big blob, but a lot of those files will already be cached in the user's browser from CDNs anyway. Yes, you don't get JSX this way, but I've always seen people's obsession with syntactic sugar as bikeshedding. Typing out code isn't the bottleneck for develop…

Browser support is fairly new, I was actually surprised when you mentioned you could do this now :). But yeah, probably not a terrible way to go. If you are working with an http2 server today then this will work really well.

Chrome, Safari and Edge have supported it since late 2017; Firefox since May 2018. So it should be quite safe to use by now.

Re: Zwitterion: a web dev server that lets you import anything

#75
It doesn't appear to support CSS files (or other flavors like SCSS), so calling it a "webpack killer" seems extra. Also, a lot of people need polyfills for node modules written for NodeJS that are used in browser; for example, Buffer. Webpack takes care of all of those nuances for you. I wouldn't call this a killer for my workflows, where I need Webpack features such as aliasing, etc.

That being said, I support the effort to make a simpler, superior bundler. My disagreement is more so with the marketing in the title. Though, those sort of claims are what drive clicks today.

Re: Zwitterion: a web dev server that lets you import anything

#76
This looks like fun! I've been meaning to experiment with some WASM, but none of my ideas warrant investing time setting things up just yet, so I haven't. This will come in handy. @lastmjs: does it support defining the script MIME? I'm thinking something like:

    
      // ... script here
    
This really would be a great addition if not, and help drive the narrative that this brings simplicity back to that of "the old days" of web development (:

Re: Zwitterion: a web dev server that lets you import anything

#77
post #25

Earlier quoted context omitted.

Create-react-app is what you’re looking for.

But then you're forced to use React...and as soon as you need to do anything outside of what it provides it all falls apart which happens pretty quickly in my experience with it.

What have you been doing that React doesn't handle?

I'm one of those people who is very, very suspicious of imports, and barely ever uses anything outside Vanilla JS, but even with that mentality I have to admit that some libraries have their place. These days I usually use Preact (basically a stripped-down React) and I've not really come across much that it can't handle.

The key for me has been to just write isolated components, and avoid the "full page application" anti-pattern that is so common in web applications today. React doesn't force the anti-pattern on you like other frameworks, so I've had pretty good luck with this. It results in fairly clean, reusable code, and users see positive benefits because it allows me to create consistent, predictable interfaces.

Re: Zwitterion: a web dev server that lets you import anything

#78

Earlier quoted context omitted.

Vanilla JS? For most purposes I find that all these frameworks are simply unnecessary . As a bonus, all the debugging tools in Chrome work much better when there's no obfuscation or packing, and "recompiling" is just Ctrl-R. Code size and load speed is also massively better than it would otherwise be. Pages load instantly. It's nirvana, I tell you.

In my experience that results in the team building an inferior, untested, undocumented, and buggy version of React|Vue|jQuery|lodash. Now you need to train new peeps to handle that mess. And you haven’t even started solving actual problems. Provided you really need so much bulk at your disposal. But that’s a different story.

Perhaps that's the case. I'm assuming small-scale/personal sites, where there's no team and one person does all the work.

Re: Zwitterion: a web dev server that lets you import anything

#79

It doesn't appear to support CSS files (or other flavors like SCSS), so calling it a "webpack killer" seems extra. Also, a lot of people need polyfills for node modules written for NodeJS that are used in browser; for example, Buffer. Webpack takes care of all of those nuances for you. I wouldn't call this a killer for my workflows, where I need Webpack features such as aliasing, etc. That being said, I support the e…

Hmm...excellent feedback! Thank you. I hope I wasn't dishonest with the title. I do believe Zwitterion has the potential to rival and replace Webpack eventually.

Re: Zwitterion: a web dev server that lets you import anything

#80
post #76

This looks like fun! I've been meaning to experiment with some WASM, but none of my ideas warrant investing time setting things up just yet, so I haven't. This will come in handy. @lastmjs: does it support defining the script MIME? I'm thinking something like: // ... script here This really would be a great addition if not, and help drive the narrative that this brings simplicity back to that of "the old days" of web…

You should be able to set the MIME type: https://github.com/lastmjs/zwitterion#headers-file

In the case above, you would need to say type="module", because you are importing a module even if it is tsx. But, you should be able to set the MIME type for .tsx files with a custom header file

Post reply on HN