UNPKG

@angular/core

Version:

Angular - the core framework

1 lines 18.9 kB
{"version":3,"file":"primitives-signals.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/core/primitives/signals/src/formatter.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/core/primitives/signals/src/watch.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/core/primitives/signals/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {SIGNAL} from './graph';\n\n// Only a subset of HTML tags are allowed in the custom formatter JsonML format.\n// See https://firefox-source-docs.mozilla.org/devtools-user/custom_formatters/index.html#html-template-format\ntype AllowedTags = 'span' | 'div' | 'ol' | 'ul' | 'li' | 'table' | 'tr' | 'td';\n\ntype JsonMLText = string;\ntype JsonMLAttrs = Record<string, string>;\ntype JsonMLElement =\n | [tagName: AllowedTags, ...children: (JsonMLNode | JsonMLChild)[]]\n | [tagName: AllowedTags, attrs: JsonMLAttrs, ...children: (JsonMLNode | JsonMLChild)[]];\ntype JsonMLNode = JsonMLText | JsonMLElement;\ntype JsonMLChild = ['object', {object: unknown; config?: unknown}];\ntype JsonML = JsonMLNode;\n\ntype FormatterConfig = unknown & {ngSkipFormatting?: boolean};\n\ndeclare global {\n // We need to use `var` here to be able to declare a global variable.\n // `let` and `const` will be locally scoped to the file.\n // tslint:disable-next-line:no-unused-variable\n var devtoolsFormatters: any[];\n}\n\n/**\n * A custom formatter which renders signals in an easy-to-read format.\n *\n * @see https://firefox-source-docs.mozilla.org/devtools-user/custom_formatters/index.html\n */\n\nconst formatter = {\n /**\n * If the function returns `null`, the formatter is not used for this reference\n */\n header: (sig: any, config: FormatterConfig): JsonML | null => {\n if (!isSignal(sig) || config?.ngSkipFormatting) return null;\n\n let value: unknown;\n try {\n value = sig();\n } catch (e: any) {\n // In case the signal throws, we don't want to break the formatting.\n return ['span', `Signal(⚠️ Error)${e.message ? `: ${e.message}` : ''}`];\n }\n\n const kind = 'computation' in (sig[SIGNAL] as any) ? 'Computed' : 'Signal';\n\n const isPrimitive = value === null || (!Array.isArray(value) && typeof value !== 'object');\n\n return [\n 'span',\n {},\n ['span', {}, `${kind}(`],\n (() => {\n if (isSignal(value)) {\n // Recursively call formatter. Could return an `object` to call the formatter through DevTools,\n // but then recursive signals will render multiple expando arrows which is an awkward UX.\n return formatter.header(value, config)!;\n } else if (isPrimitive && value !== undefined && typeof value !== 'function') {\n // Use built-in rendering for primitives which applies standard syntax highlighting / theming.\n // Can't do this for `undefined` however, as the browser thinks we forgot to provide an object.\n // Also don't want to do this for functions which render nested expando arrows.\n return ['object', {object: value}];\n } else {\n return prettifyPreview(value as Record<string | number | symbol, unknown>);\n }\n })(),\n ['span', {}, `)`],\n ];\n },\n\n hasBody: (sig: any, config: FormatterConfig) => {\n if (!isSignal(sig)) return false;\n\n try {\n sig();\n } catch {\n return false;\n }\n return !config?.ngSkipFormatting;\n },\n\n body: (sig: any, config: any): JsonML => {\n // We can use sys colors to fit the current DevTools theme.\n // Those are unfortunately only available on Chromium-based browsers.\n // On Firefow we fall back to the default color\n const color = 'var(--sys-color-primary)';\n\n return [\n 'div',\n {style: `background: #FFFFFF10; padding-left: 4px; padding-top: 2px; padding-bottom: 2px;`},\n ['div', {style: `color: ${color}`}, 'Signal value: '],\n ['div', {style: `padding-left: .5rem;`}, ['object', {object: sig(), config}]],\n ['div', {style: `color: ${color}`}, 'Signal function: '],\n [\n 'div',\n {style: `padding-left: .5rem;`},\n ['object', {object: sig, config: {...config, ngSkipFormatting: true}}],\n ],\n ];\n },\n};\n\nfunction prettifyPreview(\n value: Record<string | number | symbol, unknown> | Array<unknown> | undefined,\n): string | JsonMLChild {\n if (value === null) return 'null';\n if (Array.isArray(value)) return `Array(${value.length})`;\n if (value instanceof Element) return `<${value.tagName.toLowerCase()}>`;\n if (value instanceof URL) return `URL`;\n\n switch (typeof value) {\n case 'undefined': {\n return 'undefined';\n }\n case 'function': {\n if ('prototype' in value) {\n // This is what Chrome renders, can't use `object` though because it creates a nested expando arrow.\n return 'class';\n } else {\n return '() => {…}';\n }\n }\n case 'object': {\n if (value.constructor.name === 'Object') {\n return '{…}';\n } else {\n return `${value.constructor.name} {}`;\n }\n }\n default: {\n return ['object', {object: value, config: {ngSkipFormatting: true}}];\n }\n }\n}\n\nfunction isSignal(value: any): boolean {\n return value[SIGNAL] !== undefined;\n}\n\n/**\n * Installs the custom formatter into custom formatting on Signals in the devtools.\n *\n * Supported by both Chrome and Firefox.\n *\n * @see https://firefox-source-docs.mozilla.org/devtools-user/custom_formatters/index.html\n */\nexport function installDevToolsSignalFormatter() {\n globalThis.devtoolsFormatters ??= [];\n if (!globalThis.devtoolsFormatters.some((f: any) => f === formatter)) {\n globalThis.devtoolsFormatters.push(formatter);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n consumerAfterComputation,\n consumerBeforeComputation,\n consumerDestroy,\n consumerMarkDirty,\n consumerPollProducersForChange,\n isInNotificationPhase,\n REACTIVE_NODE,\n ReactiveNode,\n SIGNAL,\n} from './graph';\n\n// Required as the signals library is in a separate package, so we need to explicitly ensure the\n// global `ngDevMode` type is defined.\ndeclare const ngDevMode: boolean | undefined;\n\n/**\n * A cleanup function that can be optionally registered from the watch logic. If registered, the\n * cleanup logic runs before the next watch execution.\n */\nexport type WatchCleanupFn = () => void;\n\n/**\n * A callback passed to the watch function that makes it possible to register cleanup logic.\n */\nexport type WatchCleanupRegisterFn = (cleanupFn: WatchCleanupFn) => void;\n\nexport interface Watch {\n notify(): void;\n\n /**\n * Execute the reactive expression in the context of this `Watch` consumer.\n *\n * Should be called by the user scheduling algorithm when the provided\n * `schedule` hook is called by `Watch`.\n */\n run(): void;\n\n cleanup(): void;\n\n /**\n * Destroy the watcher:\n * - disconnect it from the reactive graph;\n * - mark it as destroyed so subsequent run and notify operations are noop.\n */\n destroy(): void;\n\n [SIGNAL]: WatchNode;\n}\nexport interface WatchNode extends ReactiveNode {\n fn: ((onCleanup: WatchCleanupRegisterFn) => void) | null;\n schedule: ((watch: Watch) => void) | null;\n cleanupFn: WatchCleanupFn;\n ref: Watch;\n}\n\nexport function createWatch(\n fn: (onCleanup: WatchCleanupRegisterFn) => void,\n schedule: (watch: Watch) => void,\n allowSignalWrites: boolean,\n): Watch {\n const node: WatchNode = Object.create(WATCH_NODE);\n if (allowSignalWrites) {\n node.consumerAllowSignalWrites = true;\n }\n\n node.fn = fn;\n node.schedule = schedule;\n\n const registerOnCleanup = (cleanupFn: WatchCleanupFn) => {\n node.cleanupFn = cleanupFn;\n };\n\n function isWatchNodeDestroyed(node: WatchNode) {\n return node.fn === null && node.schedule === null;\n }\n\n function destroyWatchNode(node: WatchNode) {\n if (!isWatchNodeDestroyed(node)) {\n consumerDestroy(node); // disconnect watcher from the reactive graph\n node.cleanupFn();\n\n // nullify references to the integration functions to mark node as destroyed\n node.fn = null;\n node.schedule = null;\n node.cleanupFn = NOOP_CLEANUP_FN;\n }\n }\n\n const run = () => {\n if (node.fn === null) {\n // trying to run a destroyed watch is noop\n return;\n }\n\n if (isInNotificationPhase()) {\n throw new Error(\n typeof ngDevMode !== 'undefined' && ngDevMode\n ? 'Schedulers cannot synchronously execute watches while scheduling.'\n : '',\n );\n }\n\n node.dirty = false;\n if (node.version > 0 && !consumerPollProducersForChange(node)) {\n return;\n }\n node.version++;\n\n const prevConsumer = consumerBeforeComputation(node);\n try {\n node.cleanupFn();\n node.cleanupFn = NOOP_CLEANUP_FN;\n node.fn(registerOnCleanup);\n } finally {\n consumerAfterComputation(node, prevConsumer);\n }\n };\n\n node.ref = {\n notify: () => consumerMarkDirty(node),\n run,\n cleanup: () => node.cleanupFn(),\n destroy: () => destroyWatchNode(node),\n [SIGNAL]: node,\n };\n\n return node.ref;\n}\n\nconst NOOP_CLEANUP_FN: WatchCleanupFn = () => {};\n\n// Note: Using an IIFE here to ensure that the spread assignment is not considered\n// a side-effect, ending up preserving `COMPUTED_NODE` and `REACTIVE_NODE`.\n// TODO: remove when https://github.com/evanw/esbuild/issues/3392 is resolved.\nconst WATCH_NODE: Partial<WatchNode> = /* @__PURE__ */ (() => {\n return {\n ...REACTIVE_NODE,\n consumerIsAlwaysLive: true,\n consumerAllowSignalWrites: false,\n consumerMarkedDirty: (node: WatchNode) => {\n if (node.schedule !== null) {\n node.schedule(node.ref);\n }\n },\n cleanupFn: NOOP_CLEANUP_FN,\n };\n})();\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {installDevToolsSignalFormatter} from './src/formatter';\n\nexport {ComputedNode, createComputed} from './src/computed';\nexport {\n ComputationFn,\n LinkedSignalNode,\n LinkedSignalGetter,\n PreviousValue,\n createLinkedSignal,\n linkedSignalSetFn,\n linkedSignalUpdateFn,\n} from './src/linked_signal';\nexport {ValueEqualityFn, defaultEquals} from './src/equality';\nexport {setThrowInvalidWriteToSignalError} from './src/errors';\nexport {\n REACTIVE_NODE,\n Reactive,\n ReactiveHookFn,\n ReactiveNode,\n ReactiveNodeKind,\n SIGNAL,\n consumerAfterComputation,\n consumerBeforeComputation,\n consumerDestroy,\n consumerMarkDirty,\n consumerPollProducersForChange,\n finalizeConsumerAfterComputation,\n getActiveConsumer,\n isInNotificationPhase,\n isReactive,\n producerAccessed,\n producerIncrementEpoch,\n producerMarkClean,\n producerNotifyConsumers,\n producerUpdateValueVersion,\n producerUpdatesAllowed,\n resetConsumerBeforeComputation,\n runPostProducerCreatedFn,\n setActiveConsumer,\n setPostProducerCreatedFn,\n Version,\n} from './src/graph';\nexport {\n SIGNAL_NODE,\n SignalGetter,\n SignalNode,\n createSignal,\n runPostSignalSetFn,\n setPostSignalSetFn,\n signalGetFn,\n signalSetFn,\n signalUpdateFn,\n} from './src/signal';\nexport {Watch, WatchCleanupFn, WatchCleanupRegisterFn, createWatch} from './src/watch';\nexport {setAlternateWeakRefImpl} from './src/weak_ref';\nexport {untracked} from './src/untracked';\nexport {runEffect, BASE_EFFECT_NODE, BaseEffectNode} from './src/effect';\nexport {installDevToolsSignalFormatter} from './src/formatter';\n\n// Required as the signals library is in a separate package, so we need to explicitly ensure the\n// global `ngDevMode` type is defined.\ndeclare const ngDevMode: boolean | undefined;\n\n// We're using a top-level access to enable signal formatting whenever the signals package is loaded.\n// ngDevMode might not have been init correctly yet, checking for `undefined` ensures that in case\n// it is not defined yet, we still install the formatter.\nif (typeof ngDevMode === 'undefined' || ngDevMode) {\n // tslint:disable-next-line: no-toplevel-property-access\n installDevToolsSignalFormatter();\n}\n"],"names":["formatter","header","sig","config","isSignal","ngSkipFormatting","value","e","message","kind","SIGNAL","isPrimitive","Array","isArray","undefined","object","prettifyPreview","hasBody","body","color","style","length","Element","tagName","toLowerCase","URL","constructor","name","installDevToolsSignalFormatter","globalThis","devtoolsFormatters","some","f","push","createWatch","fn","schedule","allowSignalWrites","node","Object","create","WATCH_NODE","consumerAllowSignalWrites","registerOnCleanup","cleanupFn","isWatchNodeDestroyed","destroyWatchNode","consumerDestroy","NOOP_CLEANUP_FN","run","isInNotificationPhase","Error","ngDevMode","dirty","version","consumerPollProducersForChange","prevConsumer","consumerBeforeComputation","consumerAfterComputation","ref","notify","consumerMarkDirty","cleanup","destroy","REACTIVE_NODE","consumerIsAlwaysLive","consumerMarkedDirty"],"mappings":";;;;;;;;;;;AAsCA,MAAMA,SAAS,GAAG;AAIhBC,EAAAA,MAAM,EAAEA,CAACC,GAAQ,EAAEC,MAAuB,KAAmB;IAC3D,IAAI,CAACC,QAAQ,CAACF,GAAG,CAAC,IAAIC,MAAM,EAAEE,gBAAgB,EAAE,OAAO,IAAI;AAE3D,IAAA,IAAIC,KAAc;IAClB,IAAI;MACFA,KAAK,GAAGJ,GAAG,EAAE;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