Skip to content
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

Add support for the new rc.5 angular2 lazy loading with hot-reload... #97

Closed
born2net opened this issue Aug 14, 2016 · 1 comment
Closed

Comments

@born2net
Copy link

born2net commented Aug 14, 2016

Angular2 released this week new support for lazy loading and modules.
https://angular.io/docs/ts/latest/guide/ngmodule.html

And while it does work well with systemjs, it does not support lazy loading with hot-reload!
So if you make a change in a lazy loaded module, hot-reload does not reload the module nor the component that the change was made in...

I think all it would take is just to recognize that a component is part of the build process even though it's not in the source code. What angular2 does is use the router to load a component via a string, such as

const appRoutes: Routes = [{
    path: '',
    component: EntryPanel
}, {   path: 'LazyLoad',
        loadChildren: 'src/comps/app1/lazyone/LazyOneModule'
    }, {

notice that LazyOneModule is referenced simply as a string, and so obviosuly if a change was made, the local server does not know it needs to reload the related component...
A solution would be to somehow parse the router or to somehow via a "hack" let the local server and thus hot-reload force a reload of related component tree.

Regards,

Sean - http://DigitalSignage.com

@alexisvincent
Copy link
Owner

@born2net If you still would like to champion this, please submit a failing test case to systemjs-hmr :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants