Hacker News new | past | comments | ask | show | jobs | submit login

If you don’t want any external dependencies and want to replace jQuery. Then one solution is the site titled “You might not need jQuery” [1]. It points out plenty jQuery methods that can be replaced with plain JS. I actually recently advised a coworker to try learning plain JS and recommended that site. I honestly love using React though and won’t go without so don’t think I’m just a roll your own and dogfooding kind of person.

Anyways also as a self plug: I recently wrote a quick little dom library [2] (that is not published and only exists on a single code sandbox [doesn’t even have a license yet]) it’s in the file dom-lib.js. I made it in the last two days that people could look at just to see how you might go about writing a small framework that rerenders an app from top to bottom each time. Super unperformant and without optimizations. Well you can take a look, but don’t assume it’s anything more than two days work and some old code that I had laying around to help me traverse an object. I definitely don’t recommend adopting it or anything especially for production, but it works well enough as a lower-level dom library for the moment and I might make something more of it at some point (Be careful of XSS and understand that when something is assigned to .innerHTML, like the second parameter of the El function, then it should not contain user input. User input is what the third parameter of El is for.)

[1]: http://youmightnotneedjquery.com/ [2]: https://codesandbox.io/embed/example-plain-js-app-u6ce7?code...




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: