Answer the question
In order to leave comments, you need to log in
How to organize a large single page application?
I need to write a client for a call center, an application with a lot of widgets, tables, and so on. I want to use react, redux, webpack for it. But I do not know how to organize modularity and dynamic loading of modules. I was thinking about making a common layout and loading various widgets and so on through the iframe, which are separate redux applications, and using localstorage to synchronize the state, maybe this can be done differently?
Answer the question
In order to leave comments, you need to log in
iframes are definitely a bad option - most likely you will get a lot of unexpected problems + technologically this is an obvious crutch.
Ajax has long been easy to use in any browser: load the necessary modules, paste them in the right places. Modularity within code is provided by CommonJS (requirejs) modules.
There are several options for dynamically loading modules.
For example, you can place each component in a separate file, but at the end, instead of exports, insert the component into the browser's global scope.
var SomeComp = React.createClass({
...
})
window.SomeComp = SomeComp
...
render(){
...
<SomeComp ... />
...
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question