[英]Alternative to Single-spa
We have huge enterprise application written in angularjs.我们有用 angularjs 编写的庞大的企业应用程序。
Now we have to migrate to angular, so we have ruled out an option of hybrid approach angular suggests using "ngUpgrade".现在我们必须迁移到 angular,因此我们排除了 angular 使用“ngUpgrade”建议的混合方法选项。
So now we are creating a new application in angular, which means we have 2 applications "angularjs(old)" and angular(new).所以现在我们正在用 angular 创建一个新的应用程序,这意味着我们有 2 个应用程序“angularjs(old)”和 angular(new)。
So to switch between these two applications can be done without refresh using angular-spa.因此,可以使用 angular-spa 在不刷新的情况下在这两个应用程序之间切换。
I was trying to find if there is another framework, where navigating between two apps happens without refreshing(without refreshing entire page by navigating to new html).我试图找到是否有另一个框架,在两个应用程序之间导航时无需刷新(无需通过导航到新 html 来刷新整个页面)。
Possible solution: Use a new Angular application as a wrapper, then just use iframe
to show the application you want depends on the context - old or new.可能的解决方案:使用新的 Angular 应用程序作为包装器,然后根据上下文使用
iframe
显示您想要的应用程序 - 旧的或新的。 The issue you might face is changing the iframe, but I guess you can use postMessage
to communicate between the apps.您可能面临的问题是更改 iframe,但我想您可以使用
postMessage
在应用程序之间进行通信。
A bit more sophisticated: Use Angular Elements
to create your hybrid app.更复杂一点:使用
Angular Elements
创建您的混合应用程序。 I really recommend you to watch Erin talks from the last Angular connect about how Google made the migration from js to Angular.我真的建议您观看Erin在上一次 Angular 连接中关于 Google 如何从 js 迁移到 Angular 的演讲。
I've recently tried the micro-frontend architecture described here: https://www.martinfowler.com/articles/micro-frontends.html我最近尝试了这里描述的微前端架构: https : //www.martinfowler.com/articles/micro-frontends.html
Each app on different code repository, runtime build and quite easy to implement.每个应用程序都位于不同的代码存储库、运行时构建并且非常容易实现。 Take a look :)
看一看 :)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.