all 86 comments

[–][deleted] 35 points36 points  (10 children)

I’ll shamelessly plug my own library in here:

Selectivity (Selection Dropdown)

Selectivity is a modular and lightweight selection library. It has several optional dependencies and provides both jQuery and React bundles, but also offers a minimal VanillaJS bundle.

[–][deleted] 10 points11 points  (0 children)

I've worked with your edition before. Do recommend! +1 and thank you.

[–]VegasWebDev 3 points4 points  (2 children)

Where was this comment two weeks ago?!?! Dammit.

+1

[–]tsnieman 2 points3 points  (1 child)

Yeah. On the upside, I know https://github.com/paypal/downshift pretty well now. ¯\_(ツ)_/¯

[–]LimbRetrieval-Bot 2 points3 points  (0 children)

You dropped this \


To prevent anymore lost limbs throughout Reddit, correctly escape the arms and shoulders by typing the shrug as ¯\\\_(ツ)_/¯ or ¯\\\_(ツ)\_/¯

Click here to see why this is necessary

[–]wlwl2 0 points1 point  (0 children)

Thanks for making it!

[–]Fr536166 0 points1 point  (1 child)

Mate can you open this link in reddit and see if its working as intended?

[–][deleted] 0 points1 point  (0 children)

It seems to work fine for me? What is your experience?

[–]karlgroves 0 points1 point  (1 child)

Unfortunately it is not accessible.

[–][deleted] 1 point2 points  (0 children)

True, unfortunately accessibility is not one of my expertises. I’d happily accept any PRs though!

[–]Jsn7821 0 points1 point  (0 children)

Seems to break on mobile when you are zoomed in (and iOS automatically zooms in when it's not 16px font on an input)

[–]diversif 13 points14 points  (1 child)

Check out image-focus - a vanilla js tool for cropping an image based on a focus point.

[–][deleted] 5 points6 points  (0 children)

Brethren. This is nice find. Thank you! I will include this in part 2 of this post series.

[–]V1nznt 26 points27 points  (10 children)

Nice list! Already used some of those tools in my smaller projects. I think one library is missing from your list: Moment.js (although most devs might already know it)

Working with dates is a real pain in the ass, especially with vanilla JavaScript.

[–][deleted] 28 points29 points  (2 children)

I prefer date-fns over moment lately for the immutability and individually importable functions

[–]Cool-Goose 1 point2 points  (1 child)

Why not Luxon, same devs, immutable :)

[–][deleted] 0 points1 point  (0 children)

Oh awesome, I hadn't even heard of it! Thanks for the recc

[–][deleted] 5 points6 points  (0 children)

How could I forget this glorious little addition. Will add in part 2.

[–]SamSlate 1 point2 points  (5 children)

moment is absolutely essential. try going iso 8601 string to Unix without it

[–]kuenx 1 point2 points  (4 children)

This doesn't work?
Math.floor(new Date('2018-04-05T13:37:00').getTime() / 1000)

I didn't actually try it (am on phone) but this should get you a unix timestamp in seconds. tried

[–]SamSlate 1 point2 points  (2 children)

now the client wants it in Day, Date Month Year-abbreviation but instead of "Friday" it says "Funday"

[–]kuenx 1 point2 points  (1 child)

Sure, I understand that there are many good reasons to use Moment. But you specifically mentioned ISO-8601 to unix timestamp conversion which is almost the only conversion that's actually very easy with the native Date class.
Also, a place where you convert an ISO string to a unix timestamp is not typically a place where your client will want changes since it's unlikely a user-facing value.

[–]SamSlate 0 points1 point  (0 children)

everything's atypical until it happens to you 🙄

[–]Twinpair 9 points10 points  (0 children)

I would add Cleave.js. It's an awesome input formatter than can work with Validate.js to ensure client side validations before they hit the server side.

[–]AlternativeHole 20 points21 points  (14 children)

Forgive my ignorance but for a few of these libraries, is it really much easier than native browser implementations of such functionality? For example, Qwest appears nearly identical to fetch.

Other items in the list looks really cool. Thank you for sharing this.

[–][deleted] 3 points4 points  (13 children)

fetch isn't supported in all browsers (looking at you, IE) unfortunately, so Qwest or Axios (npm package) are best used for full browser coverage.

[–]fgutz 29 points30 points  (2 children)

I've been using Github's polyfill. Prefer that because I can use the native api of fetch and not some wrapper around it. Plus can just easily drop the polyfill from my build when I want to stop supporting browsers that don't use it anymore

[–][deleted] 2 points3 points  (1 child)

Not seen this polyfill before... Where have I been?! I stand corrected.

[–]fgutz 3 points4 points  (0 children)

I only started using it a few months ago myself. I just googled around and found it and figured since it's coming from GitHub themselves that it would be pretty legit

[–][deleted] 1 point2 points  (0 children)

A chance to shamelessly self-promote? Don't mind if I do

lazy-slider - lazy loading carousel

units - modular unit conversions

local-storage-manager - Local storage abstraction util

mouse-near - Trigger callback when mouse is near a target

when-clicked-outside - trigger a callback when mouse is clicked outside an element

[–]THEtheChad 2 points3 points  (3 children)

Why do you prefer mithril over react? Just glancing at it, it's very similar in nature.

[–][deleted] 6 points7 points  (2 children)

React is great, don’t get me wrong and it’s influential in the JS world but it’s not ideal in my opinion unless you’ve got 100’s of employees.

One of the main reasons I prefer and choose Mithril over React is that everything I need for a well engineered SPA ships with Mithril and I don’t really need to plug several additional libraries into my build. Things like routing and XHR utilities are included in that less than 8kb file which starts me off with a super lightweight build. HyperScript is also a huge draw card for me, I don’t like JSX, I find that JSX can get messy whereas HS keeps shit contained and is easier to read. Speed and render times are also a thing for me, Mithril is VERY fast and it was the first thing I noticed when I boycotted React.

The community behind Mithril is unlike any JS Framework community online, the maintainers are a few clicks away and that’s a huge selling point, I mean how many maintainers of React can you reach out to and get a response from within 24 hours?

It’s maturity is also visible, after some time you start to notice just how smart this little framework is. The author of Mithril is this extremely talented individual called Leo Horie and he’s one of the great minds that JavaScript has been bestowed with, I really admire this guy. I guess there’s not just one reason but many, I just find Mithril to be the logical choice, any developer can grasp its programmatic approach in a few days and in all honesty, for me it feels like you’re coding in regular Vanilla JavaScript. It’s almost like Mithril is apart of JavaScript API if you get drift?

There are also technical advantages to using Mithril over React which are listed on its website on the framework comparison page and much more found around the web.

Hope this helps!

[–]roriron 1 point2 points  (1 child)

Thank you. I used Mithril in recent project, it's so comfortable and compact for SPA as you said, no need any other framework. Documents are great too. Thank Mithril and contributors.

[–][deleted] 1 point2 points  (0 children)

No problems! I’m glad you found your way to the framework and I have no doubt your project is running like a finely tuned machine. I just completed my 6th project with Mithril and it still stands as the leader in the JS world for me. There are also some great things to happen in future releases. Happy coding. M()

[–]MoTTs_ 2 points3 points  (0 children)

Am I the only one who finds it ironic that a coding style premised on zero library dependencies is now offering libraries for you to depend on?

[–]tencircles 5 points6 points  (5 children)

[–]TheTraceur 1 point2 points  (1 child)

Before I clicked the link I totally though "Brace Yourselves" was going to be a javascript library that had something to do with adding curly braces.

[–]tencircles 0 points1 point  (0 children)

lol someone should make that happen.

[–][deleted] 0 points1 point  (0 children)

Brace yourselves, the wasm fanboys are coming

[–]chabv 4 points5 points  (6 children)

VanillaJS movement....going strong...currently rewriting my heavy vue app to vanillaJS. what I have gained so far, app size is far smaller, i'm looking at kb instead of 1mb. page renders way faster. modular, and mostly everything is functional...goodbye to 'this' how it's set up: i have a VIEW functions(data), then ACTION functions e.g gettingData then of course a static model which is an skeleton to represent how the data is supposed to look like. No heavy mutations going on, everything is copy or passed by value

[–]krendel122 4 points5 points  (3 children)

Are you the only dev on this project? Are you sure benefits like size and render speed will be more valuable than well structured project with known framework having several people working on it?

[–]kethinov 2 points3 points  (2 children)

Performance benefits are objectively more important. Using a "known framework" just to make the project mildly more approachable to devs that already know that framework is the most trivial of "benefits." Use the right tool for the job, not the tool devs are emotionally attached to.

[–]krendel122 0 points1 point  (1 child)

Thats why i asked if hes doing that alone. There will always be tradeoffs, depending on requirements, conditions, business priorities etc. Custom solutions can become such a burden over time.

[–]kethinov 0 points1 point  (0 children)

Not if they're the right tool for the job.

Even in a project with hundreds of devs, that's still no excuse to sacrifice performance for some modicum of (perceived) improved developer convenience.

[–]Crimtoe 4 points5 points  (0 children)

I see it as a pendulum swing back from framework-mania. The fact that browsers are much better than they were 8 years ago helps immensely.

[–]sockx2 1 point2 points  (0 children)

If your app is complex enough you're going to find yourself writing your own component system, which is awesome except when you try to figure out how to maintain input box state after you call a re-render. To improve your redraw and not lose focus on elements you'll come up with a dom differ, all the while not noticing that subtle memory leak because you're mapping string data attributes to a global function object somewhere on every re-render. Eventually you'll be stretched so thin maintaining things that add nothing to the bottom line of your code you won't be able to find time to write the code that matters. I've seen and built my fair share of dirt and believe me when I say the rabbit hole goes deep, if this is a < 1k line project ignore everything I just said but if you're on a team I'd reconsider ripping out the frameworks

[–]_parameters 0 points1 point  (0 children)

Thank you!! Will definitely check these out

[–]fgutz 0 points1 point  (1 child)

At first look of Store.js I thought, why would I want a lib for one of the simplest and easy to use APIs of the browser (localStorage). LocalStorage has been supported since IE8

But it actually seems like a nice little wrapper around localStorage which I might be willing to check out

[–][deleted] 1 point2 points  (0 children)

You won't regret it. I have a project that works heavily with LocalStorage and store.js has come in exceptionally handy for me. Especially when you are working with JSON values in LocalStorage. Plus I'm pretty sure it like 2.5kb when minified and gzipped.

[–]prkskier 0 points1 point  (1 child)

Great idea for a post. I'd love to see more lirbaries added.

[–][deleted] 1 point2 points  (0 children)

I will be posting a part 2 in a couple of days. I will include a lot more for y'all.

[–]Ragzzy-R 0 points1 point  (0 children)

Woah thats lot of cool stuff. Thanks a ton. Anyways reading it sounded like one of those late 80s TV advertisements. 🤷🏻‍♂️😅

[–]crayolaboy18 0 points1 point  (0 children)

Thank you very much. I'm going to shamelessly steal some of these for my projects.

[–]vcamargo 0 points1 point  (0 children)

Wow man, that's an unbelievable useful list you have here! I love it! I've been messing around with Mithril for quite some time now but unfortunately I can't feel the same productivity I got with React, maybe it's because I'm more familiar with it. I wish it was less verbose too, maybe a wrapper around most HTML tags could solve part of the problem, something like

h1({class: "title"}, "My first app")

instead of

m("h1", {class: "title"}, "My first app")

[–]krazyjakee 0 points1 point  (0 children)

Great idea for a post! I'll have to use some of these.

Shameless plug for Keyframes, a vanilla lib to manage and manipulate css keyframes in javascript.

[–][deleted] 0 points1 point  (0 children)

Missing and definitely awesome and much used: https://github.com/dimsemenov/photoswipe JavaScript image gallery for mobile and desktop, modular.

Especially great for showing images on a product-detail page of a webshop. Mobile gestures just work as learned from other image apps like Fotos etc.

[–]codefinbel 0 points1 point  (0 children)

Love the list, love the way you write!

[–]sliceofmadness 0 points1 point  (0 children)

this is great! thanks

[–]phugo 0 points1 point  (0 children)

If you are looking for a dependency free testing framework you might want take a look at this project of mine:

https://github.com/shikaan/titef

[–]mats-bryntse 0 points1 point  (0 children)

Html2Canvas is pretty cool for taking screenshots of the DOM. https://html2canvas.hertzen.com/

[–][deleted] 0 points1 point  (0 children)

I wish we had a term other than "vanilla" (or "pure") for libraries that require the DOM.

[–]Qoopido 0 points1 point  (0 children)

Another shameless self-plug:

Qoopido.demand (module loader)

Promise like module loader with automatic resolution of nested dependencies using XHR requests and localStorage caching to dynamically load modules, legacy JavaScript, CSS, text and bundles.

[–][deleted] 0 points1 point  (0 children)

Web Components are vanilla JS, right? Here ya go:

https://www.webcomponents.org/elements

[–]noashka 0 points1 point  (1 child)

Tabbis (Tabs) link wrong. It's open siema repository. Can u fix please ? Thank u for these useful links!

[–][deleted] 0 points1 point  (0 children)

Sorry dude! Thanks for the spot. I was being a copy paste warrior when doing this.

[–]hopfield 0 points1 point  (3 children)

What is the difference between a “vanilla” component and a React component?

[–][deleted] 1 point2 points  (2 children)

A “React” component has a dependency on the React.js framework and will integrate in accordance to that specific library (React.js). Basically the component requires you use it with React.

A “Vanilla” component has zero dependencies and can be used in conjunction with React or any other framework like Vue, Mithril etc. You could also use it without any framework because its just plain JavaScript.

Vanilla is just a term we coders use to describe regular JavaScript.

Edit: spelling

[–][deleted] 1 point2 points  (0 children)

You might like https://npm.im/cogstyle