NgUpgrade for Performance's `downgradeModule` can only be called once
See original GitHub issueI’m submitting a…
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Performance issue
[ ] Feature request
[x] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:
Current behavior
A call like:
module('demoApp', [downgradeModule(Ng2Mod1), downgradeModule(Ng2Mod2)])
succeeds but only the first module is usable.
Expected behavior
Either both modules are available or an error is throw describing the limitation. The workaround is not too bad IMHO, just import Ng2Mod1 and Ng2Mod2 into a single module, but without an error this is confusing to users.
Minimal reproduction of the problem with instructions
https://stackblitz.com/edit/ngupgradelite-multi-downgrademodule?file=ng1%2Fdemo-app.module.ts
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
downgradeModule - Angular
downgradeModule () returns the name of the created AngularJS wrapper module. You can use it to declare a dependency in your main AngularJS...
Read more >ngUpgrade performance considerations - Stack Overflow
I have finally had time to test this out.. Got the downgradeModule working (I think) but when I use downgradeComponent nothing is ever...
Read more >AngularJS to Angular 7 — Upgrade for performance without ...
We are using downgradeModule because it has better performance when ... In the Angular 7 project, we have a library called hybrid-app.
Read more >Angular NgUpgrade With DowngradeModule - SyntaxSuccess
Some of you may already be familiar with ngUpgrade and upgradeModule. UpgradeModule works great, but we now have an alternative called ...
Read more >9 Lessons Learned on an AngularJS to Angular 4 Upgrade
So we made the call to upgrade the services in one sprint. That made it quite easy to do our thing later on....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Seems like #26084 is the PR for better throwing, #26062 is the number of this issue.
#26217 looks like it would solve my use case, and would solve the use cases where you are migrating multiple different parts of an AngularJS application.
I am unsure what the value of #26084 is. If you can’t downgrade multiple modules you would need to have one root Angular module to downgrade, and depend on it at the earliest common root of the different places of the application you are migrating. Wouldn’t you just end up having to depend on the downgraded root Angular module almost from the outset, mitigating most of the benefit in using “Upgrade for performance” and the possibility of delaying the loading of Angular and its dependencies?
I don’t have a problem manually mapping components to modules for downgrading purposes.