Hacker News new | past | comments | ask | show | jobs | submit login
Microjs: Fantastic Micro-Frameworks and Micro-Libraries for Fun and Profit (microjs.com)
73 points by jer0me on Oct 9, 2022 | hide | past | favorite | 22 comments



Most of the libraries are sampled are 5-10 years old, for the most part.

Not sure if you just consider them "feature complete" or if thats a bad thing (mix of both?) but it does mean most are not written in ES Module syntax, which can bloat bundles potentially


I'm getting real sick of the state of npmjs.org and the lack of ES modules. Or, the lack of documentation on ES modules. So many examples, even for brand new 2022 libraries, show using require() and other gross syntax. It's simply unacceptable in <current year> that require, commonjs, etc are being used.

Take, for example, the yargs module. Somehow, a very popular library. Nowhere in the docs does it show a <working> example of how to import it as an ES module.

Worse still, the typescript typings are all wrong. For example: await yargs.parseAsync() shows as valid TS as the typings indicate that is a function. In reality, you get a runtime error because that function simply does not exist on that object. It's a mess and I cannot wait for Deno to become more popular.


I'm in the market for a "microts" website, basically the same but for typescript-first content.


I think this is just a super old website, I wouldn't consider them all "feature complete"


Considering they are “micro” libraries, I would guess feature complete.


The first one that showed was a wrapper on localstorage, not sure why we'd need one of those but anyhow I looked at the code, no update since 2018. I spend a lot of time at work trying to minimise the amount of unnecessary crap we pull from npm explaining people that gaining 2 minutes by npm install something might deserve us in the long run but that's a massive uphill battle. The leftpad is a great example especially since there's a standard function for it (padStart) but most frontend people I am in contact with ignore those standard and first start by npm install whatever is available


Here is 90% of all the wrapping you'll ever need over localStorage:

    function ls_get(k) {
        JSON.parse(localStorage.getItem(k))
    }

    function ls_set(k, v) {
        localStorage.setItem(k, JSON.stringify(v))
    }


My current customer has a designer, who claimed that we used Lottie Script[0] for animations all over the site, and we needed an animation to nudge the user to change from portrait to landscape. The animation was rotating an svg, and changing opacity on some svg children. It could all be done in pure html/svg and css, but we almost ended up bloating our, already huge bundle with all this Lottie stuff. My colleague did not consider that the designer did not know what he was talking about. Luckily this was caught in a PR.

[0] https://airbnb.io/lottie/#/


Fun fact: this site is so old that Moment.js was on it as a brand-new micro library.

Back then we didn’t have bower nor npm. We barely had GitHub. Finding these libraries meant scouring the blogosphere


Ironically, where I work, multiple copies of momentjs, each embedding the full folder of it's own language files, is the biggest space waster in our final webpack build.


There’s a webpack plugin for that. You can use it to drop all the locales.


Do I have to learn a dozen separate microframework apis or can I just use jQuery?

If I only new a few right now, then jQuery (or jQuery-like lib) will have me covered when the time comes.

jQuery, the VBscript of 2006 (tm).


What features do you need from jQuery that isn't covered by the modern browser API?


Not OP, but binding data to elements is pretty nice (how $("#thingy").select2() always works on the same instance of the plugin without me having to store a reference somewhere).

Also things like fade and animate for when CSS transitions aren't enough and the ability to perform operations on multiple elements without a look are very convenient.


If you still have jQuery but are looking for a "lighter" library maybe Zepto would work for you.

It cannot carry jQuery-UI.


What is the advantage of Zepto? Is it faster? I can't seem to find any benchmarks.


Reminds me of http://www.dynamicdrive.com/ from back in the olden times


An oldie but a goodie. The site has been around since 2011. What’s great about this site is the general idea that you don’t necessarily need a framework (ie React) for everything.


Reminds me an old version of https://www.javascripting.com/


Until the sum of your micro libraries is..


Equivalent to a milli library


I hate the phrase for fun and profit




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

Search: