Integrating multiple SPAs in one single SPA using

2019-07-29 16:49发布

问题:

We’re in the process of re-imagining our suite of software applications and need some advice.

Currently, we have 3 fairly large SPAs (coded in react&redux) that we need to rewrite into a single SPA.

What we’d like is to replace each of the individual SPAs with a new SPA written using React&Redux.

How can this be achieved?

Thanks for the help!!

回答1:

Why do you need to rewrite them into a single SPA? What are the issues you are trying to solve?

If you are trying to have the three SPA work together without refreshing the page you could look into using single-spa. It is a micro front-ends that allows multiple SPA to be knit together to create a single SPA. With this approach, you could optimize load time by hoisting shared dependencies into a single bundle that is loaded once and shared between the three apps.

Example single-spa project