-
Notifications
You must be signed in to change notification settings - Fork 12k
Solution for Smaller Unit Development (Lazy Compile Per Module or isolated app - but without the cost of micro front-end) #21123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Have you looked at https://storybook.js.org? I think this may provide a part of what you are looking for. |
@petebacondarwin Thank you for the reply. Yes Storybook seems really great for documenting and developing. Although it still compiles the full app. (In case of a large codebase with 500+ components) I've found others try to use webpack loaders to lazy compile storybook as well. liximomo/lazy-compile-webpack-plugin#13 To be more specific for my case, I work in an Nx workspace where I have I suppose, I'm hoping the feature would be an internal webpack config that can make lazy AngularModule compiling work seamlessly with Storybook or Nx.
I really hope you put this request into consideration. |
Hi @Jonathan002, Thanks for this request. There are a number of things to consider here. Prebuild your libraries before consuming them in your application
Lazy/partial compilations We will keep an eye on this feature. Microfrontends Other than that, it's likely be a footgun due to unnecessary increase of completely introduced to the project and build-pipeline. Consistency We are consistently working to improving the performance and reduce compilation times. In version 12.0.2 we did several changes to improve Sass compilation time by forcing usage of Sass sync API which at times can be 2x faster than the async version. In version 12.1.x of the Angular CLI which is currently in pre-release, you can opt-in into an experimental persistent build cache which should improve the compilations times quite a lot While, I thank you again for these requests. I don't see any of these to fall in the Angular CLI roadmap in the near future mainly because there are a number of UI testing frameworks and |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
🚀 Feature request
Command (mark with an
x
)Description
A very large Angular App can take several minutes to compile, when only a Unit Module or Feature is needed for development. (E.g. Imagine Compiling all of Angular Material Components when only 1 material component module needs development.)
There have been proposed solutions that allow faster compile/development such as Micro Front Ends (Where a large app is broken into smaller embedded apps in the view). Although it is very wrong performance wise to have multiple angular apps in 1 view. (e.g. why bootstrap angular 5 times if the web app view used 5 micro front ends?)
https://speakerdeck.com/naltatis/bye-bye-frontend-monolith-accelerating-feature-development-with-micro-frontends?slide=36
Describe the solution you'd like
Allow developers to
ng serve
a spec file (single / module scoped) for development (in compile isolation to the rest of the app - the server can be reached via browser to view development results). A spec file should contain mock data needed to bootstrap itself to a micro app for development.Below are 2 approches:
A: Unit Testing UI but for Development with Lazy Compile
I would like a feature where the angular cli has a navigatable UI environment (like how karama test runner opens the browser)
and allows us to choose Unit Testable modules for development work. Only the module selected is lazy compiled and it is fast to get up and running with development.
B: ng serve command per module
ng serve moduleName
The command can open a micro-app for unit development and faster compilation.
Angular is considered to be quite heavy that it is suggested to try other frameworks when using the micro front end pattern:
https://speakerdeck.com/naltatis/bye-bye-frontend-monolith-accelerating-feature-development-with-micro-frontends?slide=59
If a dev team decides to convert lazy route navigation into micro front ends as well, it really feels like we loose the benefit of a SPA if each new route has to get a new html document and bootstrap all over again, instead of updating the DOM quickly (if user goes back and forth multiple times)
We should seek to isolate in dev apps during development but still ship a single app that gives us the performance and speed of a SPA.
Describe alternatives you've considered
Have you considered any alternative solutions or workarounds?The text was updated successfully, but these errors were encountered: