feat(core): expose new input API for signal-based inputs#53872
feat(core): expose new input API for signal-based inputs#53872devversion wants to merge 3 commits intoangular:mainfrom
Conversation
…tion This allows us to ensure signal inputs and a potential JIT transform remain single file compilation compatible. The consequences are that options need to be statically analyzable more strictly, compared to loosened restrictions with static interpretation where e.g. `alias` can be defined through a shared variable.
Enables signal inputs for existing Zone based components. This is a next step we are taking to bring signal inputs earlier to the Angular community. The goal is to enable early access for the ecosystem to signal inputs, while we are continuing development of full signal components as outlined in the RFC. This will allow the ecosystem to start integrating signals more deeply, prepare for future migrations, and improves code quality and DX for existing components (especially for OnPush). Based on our work on full signal components, we've gathered more information and learned new things. We've improved the API by introducing a way to intuitively declare required inputs, as well as improved the API around initial values. We even support non-primitive initial values as the first argument to the `input` function now. ```ts @directive({..}) export class MyDir { firstName = input<string>(); // string|undefined lastName = input.required<string>(); // string age = input(0); // number ```
|
FYI: Removing CLI shared review-request as this is a non-CLI facing change in |
Remove unnecessary exports for API guarding Note: Need to update dev-infra to avoid a API extractor issue.
4dc2d43 to
f3dca7f
Compare
jelbourn
left a comment
There was a problem hiding this comment.
LGTM
Reviewed-for: public-api
packages/compiler-cli/src/ngtsc/annotations/directive/src/input_function.ts
Show resolved
Hide resolved
|
This PR was merged into the repository by commit 863be4b. |
Enables signal inputs for existing Zone based components. This is a next step we are taking to bring signal inputs earlier to the Angular community. The goal is to enable early access for the ecosystem to signal inputs, while we are continuing development of full signal components as outlined in the RFC. This will allow the ecosystem to start integrating signals more deeply, prepare for future migrations, and improves code quality and DX for existing components (especially for OnPush). Based on our work on full signal components, we've gathered more information and learned new things. We've improved the API by introducing a way to intuitively declare required inputs, as well as improved the API around initial values. We even support non-primitive initial values as the first argument to the `input` function now. ```ts @directive({..}) export class MyDir { firstName = input<string>(); // string|undefined lastName = input.required<string>(); // string age = input(0); // number ``` PR Close #53872
|
So we can't use |
No. There will be a new kind of input called model input that will serve for two way data binding (and that you can call set on it) |
…tion (angular#53872) This allows us to ensure signal inputs and a potential JIT transform remain single file compilation compatible. The consequences are that options need to be statically analyzable more strictly, compared to loosened restrictions with static interpretation where e.g. `alias` can be defined through a shared variable. PR Close angular#53872
…3872) Enables signal inputs for existing Zone based components. This is a next step we are taking to bring signal inputs earlier to the Angular community. The goal is to enable early access for the ecosystem to signal inputs, while we are continuing development of full signal components as outlined in the RFC. This will allow the ecosystem to start integrating signals more deeply, prepare for future migrations, and improves code quality and DX for existing components (especially for OnPush). Based on our work on full signal components, we've gathered more information and learned new things. We've improved the API by introducing a way to intuitively declare required inputs, as well as improved the API around initial values. We even support non-primitive initial values as the first argument to the `input` function now. ```ts @directive({..}) export class MyDir { firstName = input<string>(); // string|undefined lastName = input.required<string>(); // string age = input(0); // number ``` PR Close angular#53872
…tion (angular#53872) This allows us to ensure signal inputs and a potential JIT transform remain single file compilation compatible. The consequences are that options need to be statically analyzable more strictly, compared to loosened restrictions with static interpretation where e.g. `alias` can be defined through a shared variable. PR Close angular#53872
…3872) Enables signal inputs for existing Zone based components. This is a next step we are taking to bring signal inputs earlier to the Angular community. The goal is to enable early access for the ecosystem to signal inputs, while we are continuing development of full signal components as outlined in the RFC. This will allow the ecosystem to start integrating signals more deeply, prepare for future migrations, and improves code quality and DX for existing components (especially for OnPush). Based on our work on full signal components, we've gathered more information and learned new things. We've improved the API by introducing a way to intuitively declare required inputs, as well as improved the API around initial values. We even support non-primitive initial values as the first argument to the `input` function now. ```ts @directive({..}) export class MyDir { firstName = input<string>(); // string|undefined lastName = input.required<string>(); // string age = input(0); // number ``` PR Close angular#53872
…tion (angular#53872) This allows us to ensure signal inputs and a potential JIT transform remain single file compilation compatible. The consequences are that options need to be statically analyzable more strictly, compared to loosened restrictions with static interpretation where e.g. `alias` can be defined through a shared variable. PR Close angular#53872
…3872) Enables signal inputs for existing Zone based components. This is a next step we are taking to bring signal inputs earlier to the Angular community. The goal is to enable early access for the ecosystem to signal inputs, while we are continuing development of full signal components as outlined in the RFC. This will allow the ecosystem to start integrating signals more deeply, prepare for future migrations, and improves code quality and DX for existing components (especially for OnPush). Based on our work on full signal components, we've gathered more information and learned new things. We've improved the API by introducing a way to intuitively declare required inputs, as well as improved the API around initial values. We even support non-primitive initial values as the first argument to the `input` function now. ```ts @directive({..}) export class MyDir { firstName = input<string>(); // string|undefined lastName = input.required<string>(); // string age = input(0); // number ``` PR Close angular#53872
|
What trips me a bit is that Besides it feels a bit inconsistent, the If not for |
|
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. |
Enables signal inputs for existing Zone based components.
This is a next step we are taking to bring signal inputs earlier to the Angular community.
The goal is to enable early access for the ecosystem to signal inputs, while we are continuing
development of full signal components as outlined in the RFC. This will allow the ecosystem
to start integrating signals more deeply, prepare for future migrations, and improves code quality
and DX for existing components (especially for OnPush).
Based on our work on full signal components, we've gathered more information and learned
new things. We've improved the API by introducing a way to intuitively declare required inputs,
as well as improved the API around initial values. We even support non-primitive initial values
as the first argument to the
inputfunction now.