loading...

Discussion on: A discussion regarding pure JS apps

Collapse
ben profile image
Ben Halpern

dev.to was vanilla JS on the frontend for most of its history until recently and still doesn't use a "framework" per se, but we do now use Preact for writing new UIs.

I'm not sure I'd skip the framework if you're really looking to be productive. I went vanilla as a forcing function to keep the frontend logic simple and basic while the project's direction, and for the major performance benefits of just not including more code.

If it is indeed simply an internal portal, it is possible that you don't need stateful complicated UIs in the first place and it definitely could make sense to simplify like that.

As things have grown, the original vanilla code is probably the worst part of the codebase, and that is probably tough to avoid.

Collapse
renannobile profile image
Renan Lourençoni Nobile Author

Thank you Ben, maybe I`ll go with Preact too, I believe we'll have a very basic state (maybe no state at all, things are being defined yet).

But since Dev.to is using it, I'll definetely give it a go.

Thanks again.

Collapse
ben profile image
Ben Halpern

Since it’s an internal tool I’d probably go with React over Preact. Preact is basically a lightweight implementation of the React API, which is great for high-traffic sites, but not all that important for an internal dashboard. It would be fine but probably just easier to go with the mainstream thing.

But I’d definitely be an advocate for using plain React without a state management system like Redux. IMO this is where simple problems get complicated.

For your needs, you’re probably good with whatever you pick. Just be cautious about over-designing and over-tooling and you’ll be good. Plain ole React really is quite simple, so makes for a good choice.

Collapse
alephnaught2tog profile image
M. Shemayev

The project I am on right now is currently all vanilla JS for the front end. Which is really nice in its own way for a lot of things -- and there is a chunk of it that has a decent amount of UI, which is growing, and holy shit I forgot what a big pain in the ass it is to do that kind of thing involving stateful UI stuff in pure JS without something like React. I think frameworks are often jumped to too soon or relied on too much -- ie, very few things can or should be done purely in React as all one big thing, IMHO -- but hoooo boy.

Collapse
ben profile image
Ben Halpern

Stimulus is a project in the Rails community which is an attempt to meet in the same middle. I buy it as a pretty decent option in a lot of conventional cases, but haven’t given it a spin yet.