Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is there no javascript file? #1707

Closed
Silom opened this issue Jun 1, 2015 · 6 comments
Closed

Why is there no javascript file? #1707

Silom opened this issue Jun 1, 2015 · 6 comments

Comments

@Silom
Copy link

Silom commented Jun 1, 2015

It feels odd to do this:

link(rel="import" href="lib/polymer.html")

Is there a way to include a script instead, I would like to use Borwserify and require Polymer.

Or could someone enlighten me about how to use Polymer properly?

@birkir
Copy link

birkir commented Jun 1, 2015

Checkout how web components work.

@clintonjrobinson
Copy link

@Silom Polymer seems to be encouraging using the new HTML5 Imports to include Polymer. They are also using Bower as the package manager.

Importing the polymer.html includes the 3 scripts to get polymer running (polymer.js, polymer-mini.js, polymer-micro.js).

So at the moment, no easy way to use Browserify to require Polymer into your project.

@Silom
Copy link
Author

Silom commented Jun 2, 2015

@birkir not very helpful, since I was asking about implementation and not feature set.

@clintonjrobinson thanks for clearing things up for me. I think its odd to provide a javascript API interface with only giving you the global scope of Polymer, as a developer I rather like to choose how I implement a library. I need a alternative for that, the way it is right now I can not add it to my architecture without losing consistency.

@clintonjrobinson
Copy link

@Silom Not saying I agree or not, but as I understand Polymer is aiming to be more than just a UI library. It's a set of polyfills that fill in any gaps in HTML5 standard that the executing browser may not have implemented yet. So from Polymers perspective it should be global scope, because your browser should have all this stuff in the global scope anyways.

@kevinpschaaf
Copy link
Member

Web components built with Polymer require HTML imports, because a Polymer element definition has both a script and an HTML component, and unlike legacy JS loaders, HTML Imports allows marshaling both script and markup together using a browser primitive that allows multi-threaded parsing of HTML.

We would love to allow the Polymer API itself to be imported into your JS scope via a module system, however we are avoiding to "choose" a blessed module system that puts a module dependency or transpiler requirement on the user, and instead have chosen to use one global (Polymer) until such time that ES6 modules are a shipping feature in browsers without requiring transpilation.

@Silom
Copy link
Author

Silom commented Jun 3, 2015

@kevinpschaaf thanks for the reply, makes sense now. Maybe I can jump into Polymer better when I use this vulcanized tool. I will give it another shot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants