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.
Zwitterion: a web dev server that lets you import anything
81–90 of 127 posts
Re: Zwitterion: a web dev server that lets you import anything
#82Earlier quoted context omitted.
I’ve been doing React for years and haven’t experienced this. What kinds of apps are you building?
React Router used to be a mess. And should I use Redux? I thought it’s not cool anymore. If I do, do I store everything in a global state? Maybe I’ll use Context and Hooks. Or was it HoCs? And what about mobX? I heard it’s like Vue. I like Vue. And I absolutely need something to handle requests. Saga? Maybe some GraphQL? Now that I have my views, my state, and my data, how do I test this? Jest or something else? But…
These days I use two libraries: Preact and Immer. And I only introduce Immer to a project if state management becomes a pain point in the project, so I often don't even use Immer. I import these in my project with:
// in my JS
import { h, Component, render } from './path/to/preact.js';
import produce from immer;
This is sort of janky because Immer doesn't provide a real JS module, but basically all this does is pull in a total of four variables: h, Component, render, and produce.Re: Zwitterion: a web dev server that lets you import anything
#83"Zwitterion lets you get back to the good old days of web development." I'm OK with people pining for simpler times. There's a lot of projects that are overcomplicated these days. But the good old days of web development didn't require three files for "Hello, World."
It seems like that was just a way of showing how you can use import statements and other things in that setup without needing to set it up.
Re: Zwitterion: a web dev server that lets you import anything
#84Like, what made the good days go bad? What is this supposed to be better than?
Re: Zwitterion: a web dev server that lets you import anything
#85Earlier quoted context omitted.
This project is very clearly under active dev. The box Github puts on the repo front page saying the last release was a year ago is misleading.
Which "box" are we talking about?
Re: Zwitterion: a web dev server that lets you import anything
#86Earlier 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…
EDIT: Forgot to mention component template co-location, which is pretty great, too.
Re: Zwitterion: a web dev server that lets you import anything
#87Cool project. "Also...Zwitterion is NOT a bundler. It eschews bundling for a simpler experience." I get that, run locally, it's not bundling, but how is it not a bundler when running static builds for production?
It seems like for production it just compiles the stuff (the things that need it) and puts everything into a /dist folder but it does not indeed bundle it. The author advises relying on HTTP2 to serve the files.
Re: Zwitterion: a web dev server that lets you import anything
#88Earlier quoted context omitted.
React Router used to be a mess. And should I use Redux? I thought it’s not cool anymore. If I do, do I store everything in a global state? Maybe I’ll use Context and Hooks. Or was it HoCs? And what about mobX? I heard it’s like Vue. I like Vue. And I absolutely need something to handle requests. Saga? Maybe some GraphQL? Now that I have my views, my state, and my data, how do I test this? Jest or something else? But…
Everyone worries about these choices in react, but you don't need to, for most apps, they're all good choices: use redux or mobx, doesn't really matter. Use lodash or underscore, doesn't really matter. There are minor advantages to some of the tools, and the nice thing about the react ecosystem is that it lets you pick if you really need to, but for getting started, just pick one and move on. IMO this is highly prefe…
I'd argue that they're all bad choices.
Redux/Mobx are just causing you to use global state, which forces you into a single-page application anti-pattern. I've stopped using either and my code has become massively less complex.
Lodash/Underscore are massive libraries that you end up using only a few functions from. Many of these functions can be written in <10 lines of code yourself, and some are equivalent to ones that already exist in newer versions of vanilla JS. In the latter case I'll often use polyfills, and remove them as support for the new features gets good enough.
Re: Zwitterion: a web dev server that lets you import anything
#89But again what is the advantage over parcel?
Re: Zwitterion: a web dev server that lets you import anything
#90That's unfortunate, and really limits the packages that can be used with this. Parcel does appear to support `require()`. Is this something you might add in the near future?