-
Notifications
You must be signed in to change notification settings - Fork 45
Execute hook #47
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
System builder's behavior to not execute modules can be implemented by setting this hook to a NOP. What you're proposing is a generalized version instead of an on/off switch. Seems useful. The instantiate hook is very similar, though. Are both needed? |
Preventing executing for a trace is another use-case, yes. Instantiate might be able to serve this use case. If you could return an execute function and this applies to dynamic and declarative modules, that would work. The spec is not filled out on instantiate though: http://whatwg.github.io/loader/#browser-instantiate |
@matthewp I haven't look at this problem yet (I will), but at the first glance, there is a problem with your example, modifying the result of lookup is not allowed. Maybe you should simplify it to modify some runtime values instead of dealing with the module's dependencies. |
Ah, yes you're right. I'll try to come up with a better example. |
@matthewp is this still valid? do you have a better example? Otherwise let's close this. |
I do not for the time being, let's close this and I'll reopen in the future if a good scenario comes up. |
A hook just prior to execution would be extremely helpful in scenarios where you need to alter the universe for a particular module. Consider something like this:
In this example a
logger
module is redefined so that it prints out the key of the module using it.This won't work if used async but it's still quite useful.
The text was updated successfully, but these errors were encountered: