-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[pkg:html_imports] Rename @polymerInitMethod #12389
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
Comments
Some notes: b) Currently the feature doesn't work outside of polymer-element tags. There are several questions here we need to figure out. For example what's the meaning of more than 1 script tag on the page. Currently Dartium says that each script tag run in its own isolate. Currently boot.js tries to preserve this for top-level tags: we take all the script tags from polymer-elements (A) and all the top-level script tags (B). For each tag S in (B), we create a new script tag that invokes S.main and each init method in A. That means that we continue to have an isolate for each top-level script tag that was originally in the code. |
yeah, we need some way to avoid one-script-per-isolate if we want to use Polymer/custom elements style of programming. Being able to execute <script> tags against the same DOM and heap is pretty important. (To be honest, I don't understand the use case for so-called "DOM isolates". They're sharing the DOM but pretending the scripts are isolated. Custom Elements and MDV both place Dart objects in the DOM, so it makes even less sense now. If we load all <script> tags into the same Dart isolate, Dart already gives pretty nice encapsulation of top level names and a good import system. If your app wants more isolation than that, an iframe will give actual DOM protection.) Changed the title to: "[pkg:html_imports] Rename @polymerInitMethod". |
@Sigmund -- we don't need to be blocked on the Dartium issues right? Boot.js can do whatever it needs to do (it already does :) ) |
Totally. I'd just like to have a design that will match the same semantics of the Dartium of the future =). |
Marked this as blocking #12405. |
Added this to the M8 milestone. |
this is now @initMethod Added Fixed label. |
Rename @polymerInitMethod. This is not a Polymer feature, it's a polyfill for Dartium so it can support multiple <script> tags. Perhaps @mainMethod? And allow you to omit the attribute if your method is called "main" or "_main"?
also, this feature should work regardless of whether the <script> is in a <polymer-element> or not. I'm not sure if that's the case already.
The text was updated successfully, but these errors were encountered: