4 ms·
Does anybody just write plain JS ?
by gens 10y ago
Does anybody just write plain JS ?
- deleted 10y ago[deleted]
- warent 10y agoI did recently for a very simple Cordova app used by sales reps for marketing purposes. A framework or external libraries was overkill to the extreme, so by sticking with just vanilla I kept the app size to a minimum.
- Buetol 10y agoI write plain js for simple pages and load webpack-compiled js for complex pages, you can do both.
- DCoder 10y agoYes. I just wrote a Chrome extension this week, using plain ES6. There was not enough code in it to require TypeScript or Webpack.
- madhadron 10y agoYes, actually. As soon as you recognize that the DOM API is rich and fast and you understand how MVC works, you actually get much cleaner code by not mixing HTML and JavaScript. My original explorations of doing this are at https://github.com/madhadron/mvc_for_the_web https://github.com/madhadron/mvc_for_the_web. When you understand this, React's shadow DOM and JSX are completely unnecessary. Combine it with the fact that grid layout is expected to be in the stable releases of Chrome and Firefox in the next month, and, if you have no legacy browser requirements as I happen not to, web application development becomes somewhat reasonable for the first time since I began doing it in the '90's. Admittedly, when I started trying to build a library out of this (https://github.com/madhadron/allorryll https://github.com/madhadron/allorryll), I put it in TypeScript, but I'm also the guy who did serial port and Firewire camera control in Haskell. Obviously this doesn't apply to writing documents on the web, where JavaScript should only be added as part of a structure that will gracefully degrade.
- ojr 10y agoI am able to bring the React patterns on the web and use the same patterns and code to make native iOS and android apps. Until there is a solution that can work cross-platform like this, I don't feel React and JSX is unnecessary
- olavgg 10y agoNice to hear! I also use a MVC framework (Grails) with plain old Javascript for DOM manipulations. I have no need for complex bloated frameworks like Angular and React. I do more complex UI with canvas too(where zooming and panning is required). I agree that web development has never been more fun that it is today, except for Safari with buggy flex implementation and iOS that set position: fixed to absolute and refuse to properly scale the "document" when you want to type some text. Every time I get a bug report these days it is Safari or iOS that doesnt follow the standard. Chrome, Firefox, Edge works great most of the time.
- bastawhiz 10y ago> plain JS ES2016 is "plain JS". If by "plain JS" you mean "jQuery plus ES5", I encourage you to learn what's happened in the last half a decade.
- gens 10y agoI see. I meant it as "things implemented in the browser", without any of the million and a half libraries.
- sp4ke 10y agoI did frontend for around 5 years. Started with Angular before it was cool and went through all the node/npm hype. I'm getting out of frontend now because of the ridiculous state of frameworks and libraries. In the mean time for my side projects I now do almost everything in pure JS and use only specific functions from libraries if there is no way around. The irony with all these frameworks, in many cases especially for small projetcs, it will be more efficient to code it from scratch than dealing with the whole stack thing. So much for not reinventing the wheel ...