I have a small JavaScript library that I\'ve written that depends on prototype.j
ID: 646094 • Letter: I
Question
I have a small JavaScript library that I've written that depends on prototype.js.
I'm considering creating a new version that would use jQuery instead.
The goal is to make it easier for users to install (choose which framework you use!) while not making it harder for me to maintain.
The main issue I see is that I would need to support two separate versions with overlapping functionality. If there is a bug, then I would need to fix it in two separate places.
How can I support multiple different frameworks in a JavaScript library without having a maintenance nightmare?
Explanation / Answer
You don't. You do not build libraries on top of frameworks. You just support standards, like the DOM and ES5.1
Those standards work in modern browsers, if the users of libraries want to support legacy browsers tell them to use any of the standard polyfills.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.