This doesn't directly load Polymer.
<link rel="import" href="bower_components/Polymer/polymer.html">

It loads an HTML file with this script tag.
<script src="polymer.js"></script>

HTML imports don't load JavaScript. They load HTML that may contain an 
inline script tag or a script tag with a `src` attribute. This isn't module 
loading in any way shape or form. It's not wrong. It's a completely valid 
way of doing it. It's just not module loading.

With the `script` tag and the `link` tag we have 2 types of "loaders". ES6 
modules can replace the script tag. You still need 2 types of loaders 
either way.

The de-dupe feature in HTML imports isn't the part that's lacking. The 
problem you mentioned about jQuery is that it's defining itself on the 
window global as `window.$` and `window.jQuery`. Modules on the other hand 
don't ever define globals. You load a reference to the object using it's 
file path. If you have two different versions of jQuery as modules, say 
`bower_components/jquery/1.7.0/jquery.js` and 
`bower_components/jquery/2.1.0/jquery.js`, and you load 2.1.0 using `import 
{ $ } from 'bower_components/jquery/2.1.0/jquery'`, it wouldn't conflict 
with 1.7.0.

HTML imports doesn't have a problem with de-duping. The problem is globals. 
The thing I don't want to see Polymer suggest doing is this "module 
registry" which has nothing to do with modules. It's a namespace mechanism. 
HTML imports are a great alternative to loading HTML with iframes but they 
are a mediocre way of loading JavaScript at best.

Follow Polymer on Google+: plus.google.com/107187849809354688692
--- 
You received this message because you are subscribed to the Google Groups 
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/polymer-dev/c1f77369-d0cb-4fee-b18a-7bf36fb67442%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to