Maciej Jaros (2014-01-28T02:07:19.000Z)
domenic at domenicdenicola.com (2014-01-31T14:47:56.228Z)
Sam Tobin-Hochstadt (2014-01-27 23:50): > This is absolutely necessary for polyfilling. > > Imagine that some browser has an ok-but-not-complete implementation of > the X library, but you want to use jQuery 17, which requires a better > version. You need to be able to replace X with a polyfilled update to > X, and then load jQuery on top of that. > > Note that this involves indirect access in the same library (jQuery) > to two versions of X (the polyfill and the browser version), which is > why I don't think Marius's worry is fixable without throwing out the > baby with the bathwater. Keeping your syntax you could declare: ```html <script type="module" name="jquery_1_17" src="jquery1.js"></script> <script type="module" name="jquery_2_1" src="jquery2.js"></script> ``` Then the script that need 1.17 uses import: ```js import $ from "jquery_1_17"; ``` And script that need 2.1: ```js import $ from "jquery_2_1"; ``` But to my understanding a loader could be created that could automatically resolve something like (i.e. per some convention it would now where to find best CDN for each jQuery version): ```js import $ from "cdn.jquery/2.1"; ``` Or just a full URL: ```js import $ from "http://code.jquery.com/jquery-2.1.0.min.js" ``` I actually like that syntax much more then declaring stuff in HTML. Not sure if that will be possible though.