question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NgUpgrade for Performance's `downgradeModule` can only be called once

See original GitHub issue

I’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:closed
  • Created 5 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jrabbecommented, Oct 11, 2018

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?

1reaction
jrabbecommented, Sep 24, 2018

I don’t have a problem manually mapping components to modules for downgrading purposes.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found