Skip to content
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

Follow up changes for signal-based inputs #54053

Closed
wants to merge 6 commits into from

Conversation

devversion
Copy link
Member

@devversion devversion commented Jan 24, 2024

See individual commits (language service, docs etc.)

Note that the API docs are still not ideal, but we are incrementally working to support them better. Alternatively we can consider extracting the required function into its own interface for API generation. Lets discuss in follow-ups

@angular-robot angular-robot bot added detected: feature PR contains a feature commit area: build & ci Related the build and CI infrastructure of the project labels Jan 24, 2024
@ngbot ngbot bot modified the milestone: Backlog Jan 24, 2024
@devversion devversion added area: core Issues related to the framework runtime core: inputs / outputs cross-cutting: signals aio: preview adev: preview and removed area: build & ci Related the build and CI infrastructure of the project detected: feature PR contains a feature commit labels Jan 24, 2024
Copy link

github-actions bot commented Jan 24, 2024

Deployed aio for 6134ba4 to: https://ng-dev-previews-fw--pr-angular-angular-54053-aio-wwwo0cyo.web.app

Note: As new commits are pushed to this pull request, this link is updated after the preview is rebuilt.

Copy link

github-actions bot commented Jan 24, 2024

Deployed adev-preview for 6134ba4 to: https://ng-dev-previews-fw--pr-angular-angular-54053-adev-prev-1047nbmw.web.app

Note: As new commits are pushed to this pull request, this link is updated after the preview is rebuilt.

@angular-robot angular-robot bot added detected: feature PR contains a feature commit area: build & ci Related the build and CI infrastructure of the project labels Jan 24, 2024
@devversion devversion marked this pull request as ready for review January 25, 2024 07:44
@devversion devversion added the action: review The PR is still awaiting reviews from at least one requested reviewer label Jan 25, 2024
@devversion devversion changed the title Follow up changes to signal-based inputs Follow up changes for signal-based inputs Jan 25, 2024
@pkozlowski-opensource
Copy link
Member

LGTM but it looks like this PR will need a rebase after recent merges.

This commit separates `InputSignal` for input signals with transforms.
The reason being that most of the time, signal inputs are not using
transforms and the generics are rather confusing.

Especially for users with inferred types displayed in their IDEs, the
input signal types are seemingly complex, even if no transform is used.

For this reason, we are introducing a new type called
`InputSignalWithTransform`. This type will be used for inputs with
transforms, while non-transform inputs just use `InputSignal`.

A notable fact is that `InputSignal` extends `InputSignalWithTransform`,
with the "identity transform". i.e. there is no transform. This allows
us to share the code for input signals. In practice, we don't expect
users to pass around `InputSignal`'s anyway.
This fixes the definitions for signal-based inputs in the language
service and type checking symbol builder.

Signal inputs emit a slightly different output. The output works well
for comppletion and was designed to affect language service minimally.
Turns out there is a small adjustment needed for the definition symbols.
This adds initial support for extracting and rendering call and construct
signatures of classes, like within the new `InputFunction` for signal
inputs.

For now, signatures are a rare occasion and represented as class member
entries. In the future we might consider exposing this via its own entry
type, and field on the class/interface entry.
clang-format seems to have problems with the call signature for
`input.required`. This commit works around the formatting issues that
obfuscate the signature. Users will actually see similar output when
they are looking for the `input` function definition of `@angular/core`.
This enables us to show overloads of methods in the API overview. This
is useful for e.g. showing the various signatures of the signal input
function, or for signal-based queris.

There seems to be some issues with the length of the `InputFunction`
overloads. There is some line wrapping that doesn't make it _super_
readable but this is an unrelated problem to this change, but rather
a question of UI / API representation in the angular.io site.
I've been working on framework parts and compiler since pre-Ivy, and
helped with Ivy, runtime and compiler. Adding myself as a reviewer to
ease future work and to help with review load.
Copy link
Member

@alxhub alxhub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed-for: public-api

@pullapprove pullapprove bot requested a review from alxhub January 26, 2024 18:12
@devversion devversion added PullApprove: disable and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jan 26, 2024
@devversion devversion added action: merge The PR is ready for merge by the caretaker target: minor This PR is targeted for the next minor release labels Jan 26, 2024
jessicajaniuk pushed a commit that referenced this pull request Jan 26, 2024
…uts (#54053)

This fixes the definitions for signal-based inputs in the language
service and type checking symbol builder.

Signal inputs emit a slightly different output. The output works well
for comppletion and was designed to affect language service minimally.
Turns out there is a small adjustment needed for the definition symbols.

PR Close #54053
jessicajaniuk pushed a commit that referenced this pull request Jan 26, 2024
…es (#54053)

This adds initial support for extracting and rendering call and construct
signatures of classes, like within the new `InputFunction` for signal
inputs.

For now, signatures are a rare occasion and represented as class member
entries. In the future we might consider exposing this via its own entry
type, and field on the class/interface entry.

PR Close #54053
jessicajaniuk pushed a commit that referenced this pull request Jan 26, 2024
…d` (#54053)

clang-format seems to have problems with the call signature for
`input.required`. This commit works around the formatting issues that
obfuscate the signature. Users will actually see similar output when
they are looking for the `input` function definition of `@angular/core`.

PR Close #54053
jessicajaniuk pushed a commit that referenced this pull request Jan 26, 2024
This enables us to show overloads of methods in the API overview. This
is useful for e.g. showing the various signatures of the signal input
function, or for signal-based queris.

There seems to be some issues with the length of the `InputFunction`
overloads. There is some line wrapping that doesn't make it _super_
readable but this is an unrelated problem to this change, but rather
a question of UI / API representation in the angular.io site.

PR Close #54053
@jessicajaniuk
Copy link
Contributor

This PR was merged into the repository by commit 23eeea5.

jessicajaniuk pushed a commit that referenced this pull request Jan 26, 2024
I've been working on framework parts and compiler since pre-Ivy, and
helped with Ivy, runtime and compiler. Adding myself as a reviewer to
ease future work and to help with review load.

PR Close #54053
nikvarma pushed a commit to nikvarma/angular that referenced this pull request Jan 31, 2024
…angular#54053)

This commit separates `InputSignal` for input signals with transforms.
The reason being that most of the time, signal inputs are not using
transforms and the generics are rather confusing.

Especially for users with inferred types displayed in their IDEs, the
input signal types are seemingly complex, even if no transform is used.

For this reason, we are introducing a new type called
`InputSignalWithTransform`. This type will be used for inputs with
transforms, while non-transform inputs just use `InputSignal`.

A notable fact is that `InputSignal` extends `InputSignalWithTransform`,
with the "identity transform". i.e. there is no transform. This allows
us to share the code for input signals. In practice, we don't expect
users to pass around `InputSignal`'s anyway.

PR Close angular#54053
nikvarma pushed a commit to nikvarma/angular that referenced this pull request Jan 31, 2024
…uts (angular#54053)

This fixes the definitions for signal-based inputs in the language
service and type checking symbol builder.

Signal inputs emit a slightly different output. The output works well
for comppletion and was designed to affect language service minimally.
Turns out there is a small adjustment needed for the definition symbols.

PR Close angular#54053
nikvarma pushed a commit to nikvarma/angular that referenced this pull request Jan 31, 2024
…es (angular#54053)

This adds initial support for extracting and rendering call and construct
signatures of classes, like within the new `InputFunction` for signal
inputs.

For now, signatures are a rare occasion and represented as class member
entries. In the future we might consider exposing this via its own entry
type, and field on the class/interface entry.

PR Close angular#54053
nikvarma pushed a commit to nikvarma/angular that referenced this pull request Jan 31, 2024
…d` (angular#54053)

clang-format seems to have problems with the call signature for
`input.required`. This commit works around the formatting issues that
obfuscate the signature. Users will actually see similar output when
they are looking for the `input` function definition of `@angular/core`.

PR Close angular#54053
nikvarma pushed a commit to nikvarma/angular that referenced this pull request Jan 31, 2024
…54053)

This enables us to show overloads of methods in the API overview. This
is useful for e.g. showing the various signatures of the signal input
function, or for signal-based queris.

There seems to be some issues with the length of the `InputFunction`
overloads. There is some line wrapping that doesn't make it _super_
readable but this is an unrelated problem to this change, but rather
a question of UI / API representation in the angular.io site.

PR Close angular#54053
nikvarma pushed a commit to nikvarma/angular that referenced this pull request Jan 31, 2024
I've been working on framework parts and compiler since pre-Ivy, and
helped with Ivy, runtime and compiler. Adding myself as a reviewer to
ease future work and to help with review load.

PR Close angular#54053
@devversion devversion mentioned this pull request Feb 3, 2024
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Feb 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker adev: preview aio: preview area: build & ci Related the build and CI infrastructure of the project area: core Issues related to the framework runtime core: inputs / outputs cross-cutting: signals detected: feature PR contains a feature commit PullApprove: disable target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants