-
Notifications
You must be signed in to change notification settings - Fork 4.1k
feat(module:alert): support standalone component #8182
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
feat(module:alert): support standalone component #8182
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #8182 +/- ##
=======================================
Coverage 91.70% 91.71%
=======================================
Files 519 520 +1
Lines 17885 17905 +20
Branches 2747 2839 +92
=======================================
+ Hits 16401 16421 +20
+ Misses 1182 1181 -1
- Partials 302 303 +1 ☔ View full report in Codecov by Sentry. |
HyperLife1119
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Should the use of standalone be revealed in ''When To Use''? @HyperLife1119 @evgeniyefimov |
|
Adding two import methods at the same time may cause confusion for users. In order to resolve this confusion, we may also need to use a more detailed explanation, which will be more lengthy. I think just prompting the user that the component supports standalone usage would be enough, WDYT? |
|
Looks good! Maybe we don't need the "Import Module" header anymore. |
|
I think two types of imports in the docs may really confuse users. It'll be difficult to explain that users need to import multiple components for complex components to let them work correctly instead of a single module. Single module just more user friendly. I think it's better to mention only modules in the docs. It's simillar to Angular Material. Material's components and directives are standalone, but only module import is mentioned in the docs. I would say that
|
For complex components, it is not recommended to support standalone and should be imported as module. @evgeniyefimov |
|
I believe that since the official direction is towards standalone components. So we can pursue the official position, which reduces everyone's communication costs and Zorro's future path. I believe that shifting towards a comprehensive standalone and abandoning the Module is the direction for Angular's future. Why not focus on future development now that there is community assistance available? |
|
It's worth noting that while Standalone is taking the lead, NgModule will not be deprecated, and we can do both, leaving it up to the user to decide whether they want to use NgModule or Standalone Component. Personally, when a feature has a lot of components/directives, I prefer to use NgModule because it's more cohesive and allows me to import all the components I need at once. Of course, this can be a bit subjective, so the choice should be left to the user, all we need to do is to remind them that our components support standalone mode :) |
|
The current documentation of the components indicates that they can also be standalone at the API section of each component. However, since standalone approach will be the default approach from Angular version 17, I think it would be better to change the order of the information. |
|
The current standalone transformation has already started, so is it okay if we support standalone for all components in 17.1.0 and change the documentation and demos to standalone mode in one of the subsequent releases? @HyperLife1119 @MunMunMiao @simplejason |
Yes. Convert all components to standalone, with standalone as the main focus while retaining modules, ensuring that the component library remains consistent with the official development roadmap. |
components/alert/alert.component.ts
Outdated
| exportAs: 'nzAlert', | ||
| animations: [slideAlertMotion], | ||
| standalone: true, | ||
| imports: [BidiModule, NgIf, NzIconModule, NzOutletModule], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: You can remove BidModule because the directive exported by this module is not used here
|
LGTM |
|
LGTM |

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?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Transfrom
Alertcomponent to standalone simillar to #8037