3 ms·
Dynamically replacing a div, based on a DOM event, with results of a fetch call can be done in way less than 200 lines of JS. But why you’d do that instead of
by TedDoesntTalk 4y ago
Dynamically replacing a div, based on a DOM event, with results of a fetch call can be done in way less than 200 lines of JS.
But why you’d do that instead of using 10 MB of React code, I don’t know.
- dymk 4y agoHow do you get 10MB of React code when React is 0.031MB, and Preact is 0.003MB?
- TedDoesntTalk 4y agoI’m exaggerating to make a point :)
- bzxcvbn 4y agoYour point is literally the size of the framework. Getting it wrong by more than two orders of magnitude is not exaggeration, it's a false argument.
- mmcnl 4y agoWhat is the point? Optimizing for lines of code is a wasteful target. I thought we all knew that by now? Great that you can demonstrate that you can do something without React where others are using React, but that's not the point at all. If you do more than a few asynchronous calls you will quickly find yourself developing your own DOM abstraction. That's a waste of time because React and Vue already exist, and have existed for years, and are battle tested. SPA frameworks also give you the ability to write your applications in a declarative way, which is _far_ easier and way less error prone, thus easier to test, than imperative DOM modifications.
- lobocinza 4y agoSomeone that is using React is probably also using X, Y and Z library and 10MB is realistic.
- dymk 4y agoAnd somebody not using React but rather re-implementing everything to achieve their equivalent complexity usecase brings in X, Y and Z a well...
- lobocinza 4y agoNot really. IMO, people are using large dependencies for things that can be implemented with a few lines of JS or even no JS at all. Doing things for the sake of complexity. The whole point is that X, Y and Z aren't needed.