Lazy loading for React
I found this : http://blog.stevensanderson.com/2016/05/02/angular2-react-knockout-apps-on-aspnet-core/ I'm seeing that angular2/react is not supported lazy loading. But some topic in this repo are discussing about setting up lazy loading for angular2. Is there an option for react? If 'yes', I'm very happy to see the document. Thank you!!!!
Lazy Loading is possible, but it doesn't exist in the React Redux template right now. It would require changes to the webpack config, as well as how routes/components get loaded in. I'd try the Webpack 2 docs for an example of how this might work, as they have a fairly complete example. I haven't managed to get this working in my own project which is based off the ReactRedux template, but it might be worth looking into extending the template to support lazy loading, as it's impracticle to load entire apps up front in one bundle.
Sent from my iPhone
On 20 Mar 2017, at 14:31, hungdluit [email protected] wrote:
I found this : http://blog.stevensanderson.com/2016/05/02/angular2-react-knockout-apps-on-aspnet-core/ I'm seeing that angular2/react is not supported lazy loading. But some topic in this repo are discussing about setting up lazy loading for angular2. Is there an option for react? If 'yes', I'm very happy to see the document. Thank you!!!!
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
looks like I have to bundle entry components. I know how webpack handle this, and we can load components by dependences. I'm looking an approach that allows me to load the view by asp.net controller. I think it will a big help to handle access permission. Is that possible? Please, correct me if any thoughts is wrong :)
I'm looking an approach that allows me to load the view by asp.net controller. I think it will a big help to handle access permission. Is that possible?
I would definitely not try to do that if I was you. Theoretically it's possible (as in, you can use ASP.NET controllers to handle any incoming HTTP request and impose access control, even when serving content like .js bundles that are not normally subject to access control). However I don't think it's really going to help with security since in generally, the markup in views isn't usually a secret - the thing you need to focus on protecting is access to read/write the underlying data.
I'd suggest not trying to impose access control on your React app bundles (assuming they don't contain sensitive info, which generally they wouldn't), but instead enforce it rigourously on your web APIs.