-
Notifications
You must be signed in to change notification settings - Fork 37
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
A simple implementation of Angular 2 templateUrl style component hot-… #73
Conversation
I wouldn't advise assuming default behaviour per extension. |
@guybedford I would not want to hardcode behaviour based on an extension as well. Well have to find a different way to solve this. |
@capaj just let me know if you want to discuss the plugin reloading further at all. I assume all these issues are to do with the |
@guybedford I think supporting only plugins via meta config as we've been doing so far is sufficient. We should make it clearer in the readme and include some working examples where we can just link everyone to that. Angular 2 example with hot reloaded templates will be my goal. |
@capaj yeah a lot of users use plugin syntax, so this should either be highlighted at the top of the docs as something not supported or it should definitely be supported. Handling plugins uses the same |
oh, I did not realize plugin syntax would be so easy to handle. I will try to add support for it then. |
I guess the main thing is to do the one to many reverse look up, where a change to file at |
@guybedford thanks for pointing me to it. Sounds like a good idea, even though this could lead to situation where we reload more than is needed. |
@capaj if you have |
@guybedford I tried it on jspm-ng2 repo and found out that when I call:
But my template file is stored under a key
Meaning when I want to delete it, I need to call:
Why is System.normalize working as it works for plugins? Why doesn't it normalize fully? The way it works now, it seems to me that the only way how to find plugin loaded modules is to iterate trough |
@capaj yes plugin syntax normalizes uniquely based on the unique module name of the plugin. Yes you would need to iterate all loads to match all possible plugins for a given invalidation. It would be worth checking the performance but I don't expect it would be that bad? |
@guybedford ok, you're right. It will be plenty fast. I will give it a shot. |
@guybedford
to match the record needed. That works and finds the right module to delete. When it is deleted, it will be reimported and reloaded properly. the bad thing is that is lacks importers. I am importing the template from the app.js file, so it should have an Any idea why that might be ? |
@capaj I don't think we set |
@guybedford Oh I just realized that I clicked the wrong property on |
Those importers shouldn't be set anywhere in SystemJS or the module loader! |
I think if you are using jspm/systemjs you should not be using templateUrl and instead be importing the html. |
conflicted and should be reopened in https://github.com/alexisvincent/systemjs-hmr if still needed. |
A simple solution for templateUrl style Angular 2 hot-reloading issue: #62