-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
HMR for SystemJS #10
Comments
No such reimplementation here. It should be pretty simple to add the required hooks via the SystemJS interface. I don't have capacity to do this, however any PRs are welcome. All that's most probably needed is a PR to aurelia/loader, adding similar capabilities as outlined here in the loader-webpack: |
I'm trying to implement aurelia-systemjs-loader based on (https://github.com/aurelia/loader-default) for HMR module, but as for me it's not so clear what the aurelia-webpack loader do (https://github.com/aurelia/loader-webpack). The stack I use:
https://github.com/capaj/chokidar-socket-emitter - to connect to the browser-sync The aurelia/hot-module-reload still a black box for me, would be glad for any information about API needs to be used in the aurelia loader. I'm not so familiar with webpack, so I start to compare line by line with default-loader, to find the places I have to reimplement:
And I stuck for now with system js alias for:
@niieani, could you please explain the scenario we have to implement in aurelia/loader to be able use aurelia-hmr modue with any custom loader, let's skip systemjs for a while. Any information even in general would be helpfull |
For now I have aurelia-systemjs-loader that didn't launch any methods after systemjs reload module, have no idea what to do next :( Updates: Found the way how to receive SystemJS new module object, and how to trigger the methods in the aurelia-loader. But two questions:
Using the aurelia/hot-module-reload? |
@wegorich see this main class: https://github.com/aurelia/hot-module-reload/blob/master/src/aurelia-hot-module-reload.ts#L41 It contains 3 methods: handleModuleChange, handleViewChange and reloadCss. Each can be used to hot reload a module of given type, once it is removed from the cache of the AureliaLoader instance, and a new instance is available for loading. You'll need to fork and edit aurelia-loader to add functionality that removes stale modules from its cache. You can see how this is done in |
@niieani thanks. Will dive in this methods.
I did pretty similar as at the aurelia-loader-webpack, but receive error. |
@niieani Still a bit confusing. So I reload js && html client side module then I trigger:
Nothing happened. |
@wegorich did you implement logic for cleaning the cache of modules in your fork of |
@niieani yep, aurelia-loader-systemjs, I made it works in the sandbox. Test only HTML and JS reloads. I'll make the beautiful fork of |
Please share a bit about the changes you needed to make, maybe they can be officially incorporated somehow or built into a plugin. |
Yeah, I spend the day and create simple modules we can use. No need to change the So I did
Not sure what to do with |
Ah my mistake, play with |
Does this mean that the description of this package that says HMR works across all loaders is incorrect ? or are these comments dated and there's no need for aurelia-systemjs-hot-plugin now ? I don't have HMR confgured with SystemJS now but I'm using aurelia + systemjs + ts... would like to setup HRM in the easiest/simplest way possible .. |
Hi Guys,
I'm trying to work out how to get Aurelia HMR support into systemjs-hmr, and by extension systemjs-hot-reloader.
But I'm unsure of what it would take other then standard hmr. This project seems to reimplement a module registry?
The text was updated successfully, but these errors were encountered: