This morning I stumbled across Griffith – a React-based web video player. That’s cool and all, but you know what’d be even cooler? A web video player that we all can use.

There’s a recurring theme in open source where TECHNOLOGY_X gets popular and then a bunch of libraries and tools get created specifically for (or ported to) TECHNOLOGY_X , but they can’t be used with TECHNOLOGY_Y or TECHNOLOGY_Z .

This is especially common in front-end-javascript-land where there are so many frameworks that come and go over the years. Examples!

You want a search box but you find an Angular search box You want a geocoding library but you find a jQuery geocoding library You want a datepicker but you find an Ember datepicker

It doesn’t have to be that way!

With a little forethought you can build a generically-useful library and then provide small wrapper libraries that adapt the generic library to specific framework use cases . This is called the adapter pattern and I swear it’s not as bad as we make it out to be in this tweet.

Nicolás Bevacqua has been applying this principle to much success for years. He’s a great example to follow if you need some help figuring out the details!

Case in point: he created Dragula – a generic drag-n-drop library you can use directly with vanilla JS. He then followed it up with adapters (which he calls bridges – same difference):

What’s even cooler about this approach is that Nicolás has paved the way for others to come along and build an Ember adapter for Dragula, an Aurelia adapter for Dragula, etc.

And when TECHNOLOGY_X++ comes along next year? You can guess what it’d take to build it an adapter for Dragula….