Skip to content

Commit 4c769dd

Browse files
committed
chore: move signal types to separate file
1 parent df664b7 commit 4c769dd

26 files changed

+173
-155
lines changed

packages/qwik/src/core/client/vnode-diff.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ import {
9191
import { mapApp_findIndx } from './util-mapArray';
9292
import { mapArray_set } from './util-mapArray';
9393
import { getNewElementNamespaceData } from './vnode-namespace';
94-
import { WrappedSignal, EffectProperty, isSignal, SubscriptionData } from '../signal/signal';
94+
import { WrappedSignal, isSignal } from '../signal/signal';
9595
import type { Signal } from '../signal/signal.public';
9696
import { executeComponent } from '../shared/component-execution';
9797
import { isSlotProp } from '../shared/utils/prop';
@@ -100,6 +100,8 @@ import { clearAllEffects } from '../signal/signal-cleanup';
100100
import { serializeAttribute } from '../shared/utils/styles';
101101
import { QError, qError } from '../shared/error/error';
102102
import { getFileLocationFromJsx } from '../shared/utils/jsx-filename';
103+
import { EffectProperty } from '../signal/types';
104+
import { SubscriptionData } from '../signal/subscription-data';
103105

104106
export const vnode_diff = (
105107
container: ClientContainer,

packages/qwik/src/core/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ export {
142142
createSerializerQrl,
143143
createSerializer$,
144144
} from './signal/signal.public';
145-
export { SubscriptionData as _EffectData } from './signal/signal';
146145

147146
//////////////////////////////////////////////////////////////////////////////////////////
148147
// Developer Low-Level API

packages/qwik/src/core/internal.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,4 @@ export { EMPTY_ARRAY as _EMPTY_ARRAY } from './shared/utils/flyweight';
3838
export { _serialize, _deserialize } from './shared/shared-serialization';
3939
export { _jsxQ, _jsxC, _jsxS } from './shared/jsx/jsx-runtime';
4040
export { _EFFECT_BACK_REF } from './signal/flags';
41+
export { SubscriptionData as _SubscriptionData } from './signal/subscription-data';

packages/qwik/src/core/shared/component-execution.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { isDev } from '@qwik.dev/core/build';
22
import { vnode_isVNode } from '../client/vnode';
33
import { Slot } from '../shared/jsx/slot.public';
4-
import { EffectProperty, isSignal } from '../signal/signal';
4+
import { isSignal } from '../signal/signal';
55
import { clearAllEffects } from '../signal/signal-cleanup';
66
import { invokeApply, newInvokeContext, untrack } from '../use/use-core';
77
import { type EventQRL, type UseOnMap } from '../use/use-on';
@@ -26,6 +26,7 @@ import {
2626
import { MAX_RETRY_ON_PROMISE_COUNT, isPromise, maybeThen, safeCall } from './utils/promises';
2727
import type { ValueOrPromise } from './utils/types';
2828
import { getSubscriber } from '../signal/subscriber';
29+
import { EffectProperty } from '../signal/types';
2930

3031
/**
3132
* Use `executeComponent` to execute a component.

packages/qwik/src/core/shared/jsx/jsx-runtime.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import { logOnceWarn, logWarn } from '../utils/log';
88
import { ELEMENT_ID, OnRenderProp, QScopedStyle, QSlot, QSlotS } from '../utils/markers';
99
import { qDev, seal } from '../utils/qdev';
1010
import { isArray, isObject, isString } from '../utils/types';
11-
import { WrappedSignal, WrappedSignalFlags } from '../../signal/signal';
11+
import { WrappedSignal } from '../../signal/signal';
12+
import { WrappedSignalFlags } from '../../signal/types';
1213
import type { DevJSX, FunctionComponent, JSXNode, JSXNodeInternal } from './types/jsx-node';
1314
import type { QwikJSX } from './types/jsx-qwik';
1415
import type { JSXChildren } from './types/jsx-qwik-attributes';

packages/qwik/src/core/shared/scheduler.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ import { isPromise, retryOnPromise, safeCall } from './utils/promises';
119119
import { addComponentStylePrefix } from './utils/scoped-styles';
120120
import { serializeAttribute } from './utils/styles';
121121
import type { ValueOrPromise } from './utils/types';
122+
import type { NodePropPayload } from '../signal/subscription-data';
122123

123124
// Turn this on to get debug output of what the scheduler is doing.
124125
const DEBUG: boolean = false;
@@ -135,15 +136,6 @@ export interface Chore {
135136
$executed$: boolean;
136137
}
137138

138-
export interface NodePropData {
139-
$scopedStyleIdPrefix$: string | null;
140-
$isConst$: boolean;
141-
}
142-
143-
export interface NodePropPayload extends NodePropData {
144-
$value$: Signal<unknown>;
145-
}
146-
147139
export type Scheduler = ReturnType<typeof createScheduler>;
148140

149141
type ChoreTarget = HostElement | QRLInternal<(...args: unknown[]) => unknown> | Signal | TargetType;

packages/qwik/src/core/shared/shared-container.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { ContextId } from '../use/use-context';
22
import { trackSignalAndAssignHost } from '../use/use-core';
33
import { version } from '../version';
4-
import type { SubscriptionData } from '../signal/signal';
4+
import type { SubscriptionData } from '../signal/subscription-data';
55
import type { Signal } from '../signal/signal.public';
66
import type { ISsrNode, StreamWriter, SymbolToChunkResolver } from '../ssr/ssr-types';
77
import type { Scheduler } from './scheduler';

packages/qwik/src/core/shared/shared-serialization.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,10 @@ import { vnode_getNode, vnode_isVNode, vnode_locate, vnode_toString } from '../c
1010
import { _EFFECT_BACK_REF, NEEDS_COMPUTATION } from '../signal/flags';
1111
import {
1212
ComputedSignalImpl,
13-
type EffectProperty,
14-
type EffectSubscription,
15-
EffectSubscriptionProp,
1613
SerializerSignalImpl,
1714
SignalImpl,
18-
SubscriptionData,
1915
WrappedSignal,
2016
isSerializerObj,
21-
SignalFlags,
22-
type AllSignalFlags,
2317
type SerializerArg,
2418
} from '../signal/signal';
2519
import {
@@ -48,7 +42,6 @@ import { getPlatform } from './platform/platform';
4842
import { createQRL, type QRLInternal, type SyncQRLInternal } from './qrl/qrl-class';
4943
import { isQrl, isSyncQrl } from './qrl/qrl-utils';
5044
import type { QRL } from './qrl/qrl.public';
51-
import { type NodePropData } from './scheduler';
5245
import { ChoreType } from './util-chore-type';
5346
import type { DeserializeContainer, HostElement, ObjToProxyMap } from './types';
5447
import { _CONST_PROPS, _VAR_PROPS } from './utils/constants';
@@ -58,6 +51,14 @@ import { ELEMENT_ID } from './utils/markers';
5851
import { isPromise } from './utils/promises';
5952
import { SerializerSymbol, fastSkipSerialize } from './utils/serialize-utils';
6053
import { type ValueOrPromise } from './utils/types';
54+
import {
55+
EffectSubscriptionProp,
56+
SignalFlags,
57+
type AllSignalFlags,
58+
type EffectProperty,
59+
type EffectSubscription,
60+
} from '../signal/types';
61+
import { SubscriptionData, type NodePropData } from '../signal/subscription-data';
6162

6263
const deserializedProxyMap = new WeakMap<object, unknown[]>();
6364

packages/qwik/src/core/shared/shared-serialization.unit.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { $, component$, noSerialize } from '@qwik.dev/core';
22
import { describe, expect, it, vi } from 'vitest';
33
import { _fnSignal, _wrapProp } from '../internal';
4-
import { SubscriptionData, type SignalImpl } from '../signal/signal';
4+
import { type SignalImpl } from '../signal/signal';
55
import {
66
createComputed$,
77
createSerializer$,
@@ -24,6 +24,7 @@ import {
2424
import { EMPTY_ARRAY, EMPTY_OBJ } from './utils/flyweight';
2525
import { isQrl } from './qrl/qrl-utils';
2626
import { NoSerializeSymbol, SerializerSymbol } from './utils/serialize-utils';
27+
import { SubscriptionData } from '../signal/subscription-data';
2728

2829
const DEBUG = false;
2930

packages/qwik/src/core/signal/signal-cleanup.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
import {
2-
EffectSubscriptionProp,
3-
WrappedSignal,
4-
type EffectSubscription,
5-
SignalImpl,
6-
type EffectProperty,
7-
type Consumer,
8-
} from './signal';
1+
import { WrappedSignal, SignalImpl } from './signal';
92
import { StoreHandler, getStoreHandler } from './store';
103
import type { Container } from '../shared/types';
114
import { ensureMaterialized, vnode_isElementVNode, vnode_isVNode } from '../client/vnode';
125
import { _EFFECT_BACK_REF } from './flags';
6+
import {
7+
EffectSubscriptionProp,
8+
type Consumer,
9+
type EffectProperty,
10+
type EffectSubscription,
11+
} from './types';
1312

1413
/** Class for back reference to the EffectSubscription */
1514
export abstract class BackRef {

0 commit comments

Comments
 (0)