-
Notifications
You must be signed in to change notification settings - Fork 45
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
mutable System.loader #72
Comments
+1 for this feature. Is my understanding correct when I say that without this feature, the |
@joeldenning that is correct. Without the ability to set
|
@dherman Could you help me understand your second bullet point? I'm pretty new to reading through these types of specs and don't understand what you meant by "HTML semantics triggering a property get." |
@joeldenning this is a question of whether |
note: I don't think there is precedent for the property get triggered by HTML semantics, but I might be wrong. |
Yeah, this is an area fraught with danger, as custom elements shows. But it should be possible to make this as palatable as custom elements, e.g. by deferring all such property gets until a later queued task, instead of having them happen during parsing. |
Would
I just verified in Chrome that |
ha, that is a good example. thanks @joeldenning. |
In regards to the first bullet point in @dherman's original post, is there any feature there that could not be implemented in userland (especially now that, as of #65, a loader's registry is iterable)? In other words, is there any advantage to having the host environment do "loader chaining" instead of userland code? |
@joeldenning the question here is how |
To support not only subclassability (see #35) but the ability to use a custom subclass as the built-in loader, should we allow
System.loader
(according to the discussion in #34 this seems to be the best name for the default system loader to live in) to be mutated?The reason to allow this is that it's more expressive: if you have custom loader logic defined in a subclass, you can't use that simply by modifying the hooks of
System.loader
; you need to replace it with an instance of that subclass.There are a couple of subtleties, however:
System.loader
would require you also to populate the new loader's registry with any entries you want to share from the old one. (At a minimum this can be done by iterating over the old registry (see Iterating over the registry #17) and copying the entries in. Alternatively it should be possible to define subclasses with "chaining" logic that allows some lookups to delegate to another loader.)System.loader
being a getter/setter pair.The text was updated successfully, but these errors were encountered: