-
Notifications
You must be signed in to change notification settings - Fork 4k
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
fix: add constructors when extending another classes to fix (f)esm2015 build #2339
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2339 +/- ##
=========================================
- Coverage 95.86% 95.8% -0.06%
=========================================
Files 485 487 +2
Lines 12224 12241 +17
Branches 1645 1655 +10
=========================================
+ Hits 11719 11728 +9
- Misses 148 153 +5
- Partials 357 360 +3
Continue to review full report at Codecov.
|
Any chance to merge? I'm facing more problems using |
@CarterLi you have to pass all ci before we start reviewing your code. |
@vthinkxie I'm surprised that adding some constructors can affects that much ( it's strange that adding constructor in nz-dropdown-button can affect tests in nz-autocomplete ). But I've reverted all changes that break CI. Only date-xxx-components left 😸 |
Ok I completely have no idea why CI is still broken. I give up. Although I think my change is safe to merge. If it's unacceptable, I'll close my pr. But I still hope that you can fix it in next small release. It's important to us. |
* fix(module:esm5): fix esm5 package close #2339 * refactor(module:all): refactor all constructor * fix(module:esm5): fix esm5 error
* fix(module:esm5): fix esm5 package close NG-ZORRO#2339 * refactor(module:all): refactor all constructor * fix(module:esm5): fix esm5 error
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Currently (f)esm2015 build is broken due to base components inheritance. When creating instances of subclasses, Angular fails to resolve their dependencies because auto-generated constructors have no type metadata which are required for DI working correctly.
For example:
NzPopoverComponent has no explicit constructor. TypeScript ( or babel? ) generates
Angular cannot deduce its dependencies so that angular passes no arguments into it
which results in error when opening popovers
Issue Number: N/A
What is the new behavior?
don't throw errors
Does this PR introduce a breaking change?
Other information
This change has been discussed with @vthinkxie on DingDing