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

feat(core): add Angular Signals to the public API #49150

Closed
wants to merge 1 commit into from

Conversation

alxhub
Copy link
Member

@alxhub alxhub commented Feb 21, 2023

For context, see this Github Discussion on our experiments with fine-grained reactivity in Angular

This commit exposes signal, computed, effect and various helpers from the @angular/core entrypoint.

These APIs are marked as @developerPreview and are still prototypes in active development. Their final shapes will be subject to our internal design reviews as well as one or more community RFCs. We're exporting them now to allow for experimentation using 16.0.0 next and RC releases.

@angular-robot angular-robot bot added the detected: feature PR contains a feature commit label Feb 21, 2023
@alxhub alxhub added target: major This PR is targeted for the next major release core: reactivity Work related to fine-grained reactivity in the core framework labels Feb 21, 2023
@dylhunn dylhunn self-requested a review February 21, 2023 22:55
Copy link
Contributor

@dylhunn dylhunn 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: fw-core, public-api

@alxhub alxhub added the merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note label Feb 21, 2023
Copy link
Contributor

@AndrewKushnir AndrewKushnir 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

@JeanMeche
Copy link
Member

I'm excited to see Angular's signal land as public API, thanks for the work on the developer Preview ❤️

@alxhub
Copy link
Member Author

alxhub commented Feb 21, 2023

Caretaker: this will need a new g3 patch.

Copy link
Contributor

@jessicajaniuk jessicajaniuk 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

@pkozlowski-opensource pkozlowski-opensource added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews and removed merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note labels Feb 22, 2023
@alxhub alxhub force-pushed the fw/reactivity/signals-public-api branch 2 times, most recently from 54d1608 to af397e3 Compare February 22, 2023 18:25
@alxhub alxhub added action: merge The PR is ready for merge by the caretaker merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Feb 22, 2023
@alxhub alxhub force-pushed the fw/reactivity/signals-public-api branch from af397e3 to dc75079 Compare February 22, 2023 18:34
This commit exposes `signal`, `computed`, `effect` and various helpers from
the `@angular/core` entrypoint.

These APIs are marked as `@developerPreview` and are still prototypes in
active development. Their final shapes will be subject to our internal
design reviews as well as one or more community RFCs. We're exporting them
now to allow for experimentation using 16.0.0 next and RC releases.
@alxhub alxhub force-pushed the fw/reactivity/signals-public-api branch from dc75079 to 874a540 Compare February 22, 2023 19:22
@alxhub
Copy link
Member Author

alxhub commented Feb 22, 2023

This PR was merged into the repository by commit bc5ddab.

@alxhub alxhub closed this in bc5ddab Feb 22, 2023
@goffxnca
Copy link

goffxnca commented Mar 18, 2023

I miss the old days of the aesthetically pleasing and readable syntax of ref() in Vue and useState() in React for reactive synchronous values. It's inspiring to see how these three frameworks and libraries have influenced and inspired each other. I cannot wait to see these features publicly released! Kudos to you guys who are behind all of these amazing features.

@ivanivanyuk1993
Copy link

Added comment https://github.com/angular/angular/pull/49091/files#r1153925100

If we don't preprocess function in computed at compile-time or use some form of reflection to atomically notify only affected signals, won't it require O(n) change checks, where n is a quantity of signals in application, effectively making it have same algorithmic complexity as ChangeDetectionStrategy.Default and making it useless?

@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 May 1, 2023
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 core: reactivity Work related to fine-grained reactivity in the core framework detected: feature PR contains a feature commit merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants