-
Notifications
You must be signed in to change notification settings - Fork 140
Lazy load is not working in Tailor SPA if more than one angular apps present #289
Comments
Great that you created the issue, and great adding a git repo to reproduce it, however, it looks like the two submodule angular apps in the child-apps are not available to the public. You can click and see here in the github interface https://github.com/DhanasekaranSelvaraj/Tailor-Multiple-Angular-POC/tree/master/child-apps The first thought is that Tailor does not impose any limitations on how applications are loaded. The first test to debug what is wrong is to create a index.html and include the two script tags without using Tailor.js and get that working first before making it work with tailor, this way you can eliminate one dependency that can cause a problem 😄 |
Hi @kevinsimper , Somehow it was not pushed properly. Now it is available in the same repo. I agree that Tailor is not having any restrictions, But If i can resolve these kind of issues without Tailor as you mentioned then why we should select Tailor? We can host all our child applications in individual servers and can include So when a user chooses Tailor kind of frameworks, We would expect these kind of multiple angular application issues might not be there :) Here in this case we have 5 child applications, some of them are in Angular and some of them in React and all of them are developed by independent teams. So it would be great if i am not making more changes in the child application's configurations. If you have any other suggestion to resolve this issue it would be great. 💃 |
Ok. @kevinsimper. Here is the update after trying multiple scenarios. it might be helpful for others. Now I have added two more angular applications of version 6 along with existing two angular 7 apps.
But Still something is breaking in the below scenario Please find below stackstrace |
@DhanasekaranSelvaraj I don't think angular then can function on the same page, it seems like it is too invasive and leaks stuff to the global object. Have you tried this example app? https://github.com/zalando/tailor/tree/master/examples/basic-css-and-js Does that work for you? 😄 |
So here is the update after going through many blogs. Follow below steps to make lazyload works when you are working with multiple Angular apps.
Hope this will help others. |
Hi Dhanashekar, |
Hi Folks,
I am trying to create POC of multiple angular apps with lazy loaded bundle in Tailor SPA But i started facing many issues as below.
zone.js
should be included only once in the browser session. - I solved this by commenting outzone.js
in all other angular app'spolyfill.ts
file except main angular appI made following changes in webpack.config.js to use lazyload feature as mentioned in Tailor docs
In individual applications lazy load works fine and even it works fine in Tailor if only one angular app existing
Initially application is rendering properly
I can able to lazy load chunk file from anyone of the apps
Once if i lazy loaded any of the chunks, If i try to load another chunk file from another child application, then it breaks :(
Please use this repository to reproduce the issue.
https://github.com/DhanasekaranSelvaraj/Tailor-Multiple-Angular-POC
How to reproduce:
It contains one portal and two angular applications.
Run
npm install
in main folder and go to child-apps folder and runnpm install
inside both the angular appsRun
npm run build:webpack
to generate webpack bundleCome to main portal folder and run
npm run start
in one terminal andnpm run start-fragments
in another terminalOpen http://localhost:8080 in browser to see the application in action.
It would be really helpful, If i get a solution for this and if we are able to use default ng-cli build it would be added advantage.
The text was updated successfully, but these errors were encountered: