DEV Community

Discussion on: What's the minimum amount of JavaScript can a web application get away with?

Collapse
ozzyogkush profile image
Derek Rosenzweig

CSS can handle most animations/transitions on its own, but the "minimum" JS is such an open question because it depends entirely on what your application is being built for. HTML5 form validation still isn't truly cross-browser compatible (or even consistent), especially when older browsers need to be supported. You can get away with replacing AJAX/fetch calls (or websocket connections) with regular form submissions, you just get a fresh page on every action. You can even embed Flash/Flex applications (though I highly recommend against this in 2018...) to handle highly complex UI, but that's basically cheating since you're just replacing JS with AS.

At its core, JS (in the browser) is just a way to handle events and interact with the DOM. Basic webpages don't need much, but nobody builds basic webpages anymore. A "webapp" denotes a certain expectation of a high amount of user interaction, including expectation of good UX across the entire application.

A specific example of a good candidate from the OP would be uploading a profile picture: letting the user choose a file, crop/resize it, preview, then submit.