There are a couple options for treating the JS lib as a regular dependency (that only loads once):
One approach is to create a new HTML file that's sole purpose is to load the library - and then you import that HTML file.
Alternatively, we also provide a helper for this in the form of https://github.com/Polymer/core-shared-lib
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 polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/c92cf77a-b5ca-4781-ab12-45ed9c5ceef6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Oh, and a third approach if you are authoring the JS lib: consider authoring it in an HTML file (e.g. wrap it in a <script> tag)
There are a couple options for treating the JS lib as a regular dependency (that only loads once):
One approach is to create a new HTML file that's sole purpose is to load the library - and then you import that HTML file.
Alternatively, we also provide a helper for this in the form of https://github.com/Polymer/core-shared-lib
On Thu, Dec 11, 2014, 09:57 null <jimin...@gmail.com> wrote:
I am just starting out to learn Polymer.Follow Polymer on Google+: plus.google.com/107187849809354688692I have built a small web application using it but I find myself puzzled about how to organize my javascript files.If my polymer components that go on the same HTML page and a number of them need to use the same javascript library,do I include that js file at the very top HTML page? Because that's is what I am doing right now basically.I have a long list of all the javascript files that all the polymer components on that page needs.Inside the polymer components code, they assume those javascript libraries are included already and start using them.
---
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 polymer-dev+unsubscribe@googlegroups.com.
Oh, and a third approach if you are authoring the JS lib: consider authoring it in an HTML file (e.g. wrap it in a <script> tag)
On Thu, Dec 11, 2014, 10:19 Ian MacLeod <im...@google.com> wrote:
There are a couple options for treating the JS lib as a regular dependency (that only loads once):
One approach is to create a new HTML file that's sole purpose is to load the library - and then you import that HTML file.
Alternatively, we also provide a helper for this in the form of https://github.com/Polymer/core-shared-lib
On Thu, Dec 11, 2014, 09:57 null <jimin...@gmail.com> wrote:
I am just starting out to learn Polymer.Follow Polymer on Google+: plus.google.com/107187849809354688692I have built a small web application using it but I find myself puzzled about how to organize my javascript files.If my polymer components that go on the same HTML page and a number of them need to use the same javascript library,do I include that js file at the very top HTML page? Because that's is what I am doing right now basically.I have a long list of all the javascript files that all the polymer components on that page needs.Inside the polymer components code, they assume those javascript libraries are included already and start using them.
---
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 polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/2eed3e16-4b79-46f9-8c2e-d88114228724%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/0c33eaf5-34db-45f1-836f-f8cf5cf4c4ff%40googlegroups.com.
Let's say 5 of my polymer components use your HTML import example to load the same JS file, would I be downloading and loading it 5 times? DO you also know if it's a synchronous load? Say one polymer component who appears first in the top HTML file tries to use the javascript without loading it because later components included it?
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/CAD4op9YWPVXHH4%2BmXYnLQa3w9eA66VvyaEjS1B4tMr8c4VOM6A%40mail.gmail.com.