Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: move signals code into primitives package
This commit reorganizes the Angular code a bit, and moves signals into a newly defined `@angular/core/primitives` location. This will be used inside g3 to allow non-Angular targets to depend on the signals core without incurring a dependency on the whole framework.
- Loading branch information
Showing
34 changed files
with
173 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
## API Report File for "@angular/core_primitives_signals" | ||
|
||
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). | ||
```ts | ||
|
||
// @public | ||
export function consumerAfterComputation(node: ReactiveNode | null, prevConsumer: ReactiveNode | null): void; | ||
|
||
// @public | ||
export function consumerBeforeComputation(node: ReactiveNode | null): ReactiveNode | null; | ||
|
||
// @public | ||
export function consumerDestroy(node: ReactiveNode): void; | ||
|
||
// @public | ||
export function createComputed<T>(computation: () => T): ComputedGetter<T>; | ||
|
||
// @public | ||
export function createSignal<T>(initialValue: T): SignalGetter<T>; | ||
|
||
// @public (undocumented) | ||
export function createWatch(fn: (onCleanup: WatchCleanupRegisterFn) => void, schedule: (watch: Watch) => void, allowSignalWrites: boolean): Watch; | ||
|
||
// @public | ||
export function defaultEquals<T>(a: T, b: T): boolean; | ||
|
||
// @public (undocumented) | ||
export function isInNotificationPhase(): boolean; | ||
|
||
// @public (undocumented) | ||
export function isReactive(value: unknown): value is Reactive; | ||
|
||
// @public | ||
export function producerAccessed(node: ReactiveNode): void; | ||
|
||
// @public | ||
export function producerNotifyConsumers(node: ReactiveNode): void; | ||
|
||
// @public | ||
export function producerUpdatesAllowed(): boolean; | ||
|
||
// @public | ||
export function producerUpdateValueVersion(node: ReactiveNode): void; | ||
|
||
// @public (undocumented) | ||
export interface Reactive { | ||
// (undocumented) | ||
[SIGNAL]: ReactiveNode; | ||
} | ||
|
||
// @public (undocumented) | ||
export const REACTIVE_NODE: ReactiveNode; | ||
|
||
// @public | ||
export interface ReactiveNode { | ||
consumerAllowSignalWrites: boolean; | ||
// (undocumented) | ||
readonly consumerIsAlwaysLive: boolean; | ||
// (undocumented) | ||
consumerMarkedDirty(node: unknown): void; | ||
dirty: boolean; | ||
liveConsumerIndexOfThis: number[] | undefined; | ||
liveConsumerNode: ReactiveNode[] | undefined; | ||
nextProducerIndex: number; | ||
producerIndexOfThis: number[] | undefined; | ||
producerLastReadVersion: Version[] | undefined; | ||
producerMustRecompute(node: unknown): boolean; | ||
producerNode: ReactiveNode[] | undefined; | ||
// (undocumented) | ||
producerRecomputeValue(node: unknown): void; | ||
version: Version; | ||
} | ||
|
||
// @public (undocumented) | ||
export function setActiveConsumer(consumer: ReactiveNode | null): ReactiveNode | null; | ||
|
||
// @public (undocumented) | ||
export function setAlternateWeakRefImpl(impl: unknown): void; | ||
|
||
// @public (undocumented) | ||
export function setPostSignalSetFn(fn: (() => void) | null): (() => void) | null; | ||
|
||
// @public (undocumented) | ||
export function setThrowInvalidWriteToSignalError(fn: () => never): void; | ||
|
||
// @public | ||
export const SIGNAL: unique symbol; | ||
|
||
// @public (undocumented) | ||
export type SignalGetter<T> = (() => T) & { | ||
[SIGNAL]: SignalNode<T>; | ||
}; | ||
|
||
// @public (undocumented) | ||
export type SignalGetterOrNode<T> = SignalGetter<T> | SignalNode<T>; | ||
|
||
// @public (undocumented) | ||
export function signalMutateFn<T>(this: SignalGetterOrNode<T>, mutator: (value: T) => void): void; | ||
|
||
// @public (undocumented) | ||
export interface SignalNode<T> extends ReactiveNode { | ||
// (undocumented) | ||
[SIGNAL]: this; | ||
// (undocumented) | ||
equal: ValueEqualityFn<T>; | ||
// (undocumented) | ||
value: T; | ||
} | ||
|
||
// @public (undocumented) | ||
export function signalSetFn<T>(this: SignalGetterOrNode<T>, newValue: T): void; | ||
|
||
// @public (undocumented) | ||
export function signalUpdateFn<T>(this: SignalGetterOrNode<T>, updater: (value: T) => T): void; | ||
|
||
// @public | ||
export type ValueEqualityFn<T> = (a: T, b: T) => boolean; | ||
|
||
// @public (undocumented) | ||
export interface Watch { | ||
// (undocumented) | ||
[SIGNAL]: WatchNode; | ||
// (undocumented) | ||
cleanup(): void; | ||
destroy(): void; | ||
// (undocumented) | ||
notify(): void; | ||
run(): void; | ||
} | ||
|
||
// @public | ||
export type WatchCleanupFn = () => void; | ||
|
||
// @public | ||
export type WatchCleanupRegisterFn = (cleanupFn: WatchCleanupFn) => void; | ||
|
||
// (No @packageDocumentation comment for this package) | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,9 +14,6 @@ ts_library( | |
"**/*.ts", | ||
], | ||
), | ||
deps = [ | ||
"//packages/core/src/util", | ||
], | ||
) | ||
|
||
tsec_test( | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.