rask-ui 0.12.2 → 0.12.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -1784
- package/dist/component.d.ts +2 -2
- package/dist/component.d.ts.map +1 -1
- package/dist/component.js +4 -6
- package/dist/createComputed.d.ts.map +1 -1
- package/dist/createComputed.js +2 -10
- package/dist/createEffect.d.ts.map +1 -1
- package/dist/createEffect.js +8 -13
- package/dist/createRouter.d.ts.map +1 -1
- package/dist/createRouter.js +4 -1
- package/dist/createState.d.ts.map +1 -1
- package/dist/createState.js +4 -0
- package/dist/createTask.d.ts.map +1 -1
- package/dist/createTask.js +6 -0
- package/dist/createView.d.ts +4 -12
- package/dist/createView.d.ts.map +1 -1
- package/dist/createView.js +4 -0
- package/package.json +1 -1
package/dist/component.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare class RaskStatelessComponent extends Component {
|
|
|
7
7
|
shouldComponentUpdate(nextProps: Props<any>): boolean;
|
|
8
8
|
render(): VNode;
|
|
9
9
|
}
|
|
10
|
-
export declare function getCurrentComponent(): RaskStatefulComponent<any
|
|
10
|
+
export declare function getCurrentComponent(): RaskStatefulComponent<any> | undefined;
|
|
11
11
|
export declare function createMountEffect(cb: () => void): void;
|
|
12
12
|
export declare function createCleanup(cb: () => void): void;
|
|
13
13
|
export type RaskStatefulFunctionComponent<P extends Props<any>> = (() => () => VNode) | ((props: P) => () => VNode);
|
|
@@ -16,7 +16,7 @@ export declare class RaskStatefulComponent<P extends Props<any>> extends Compone
|
|
|
16
16
|
private renderFn?;
|
|
17
17
|
private reactiveProps?;
|
|
18
18
|
private observer;
|
|
19
|
-
|
|
19
|
+
isRendering: boolean;
|
|
20
20
|
private willRender;
|
|
21
21
|
private nextProps;
|
|
22
22
|
effects: Array<{
|
package/dist/component.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../src/component.ts"],"names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AC,GAAG,CAAC,IAC1D,CAAC,MAAM,MAAM,KAAK,CAAC,GACnB,CAAC,CAAC,KAAK,EAAE,CAAC,KAAK,MAAM,KAAK,CAAC,CAAC;AAEhC,qBAAa,qBAAqB,CAAC,CAAC,SAAS,KAAK,CAAC,GAAG,CAAC,CAAE,SAAQ,SAAS,CAAC,CAAC,CAAC;IACnE,KAAK,EAAE,6BAA6B,CAAC,CAAC,CAAC,CAAC;IAChD,OAAO,CAAC,QAAQ,CAAC,CAAc;IAC/B,OAAO,CAAC,aAAa,CAAC,CAAa;IACnC,OAAO,CAAC,QAAQ,CAKb;IAEH,WAAW,UAAS;IAEpB,OAAO,CAAC,UAAU,CAAQ;IAG1B,OAAO,CAAC,SAAS,CAAmB;IACpC,OAAO,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,GAAG,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC,CAAM;IAC3D,QAAQ,gBAAa;IACrB,eAAe;IAUf,QAAQ,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC,CAAM;IACjC,UAAU,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC,CAAM;IACnC,OAAO,CAAC,mBAAmB;IAyD3B,iBAAiB,IAAI,IAAI;IAGzB,oBAAoB,IAAI,IAAI;IAG5B;;OAEG;IACH,mBAAmB,CAAC,SAAS,EAAE,GAAG;IAkBlC,qBAAqB,CAAC,SAAS,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO;IAWrD,MAAM;CA2CP;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,MAAM,SAO9D"}
|
package/dist/component.js
CHANGED
|
@@ -24,9 +24,6 @@ export class RaskStatelessComponent extends Component {
|
|
|
24
24
|
}
|
|
25
25
|
let currentComponent;
|
|
26
26
|
export function getCurrentComponent() {
|
|
27
|
-
if (!currentComponent) {
|
|
28
|
-
throw new Error("No current component");
|
|
29
|
-
}
|
|
30
27
|
return currentComponent;
|
|
31
28
|
}
|
|
32
29
|
export function createMountEffect(cb) {
|
|
@@ -36,7 +33,7 @@ export function createMountEffect(cb) {
|
|
|
36
33
|
currentComponent.onMounts.push(cb);
|
|
37
34
|
}
|
|
38
35
|
export function createCleanup(cb) {
|
|
39
|
-
if (!currentComponent) {
|
|
36
|
+
if (!currentComponent || currentComponent.isRendering) {
|
|
40
37
|
throw new Error("Only use createCleanup in component setup");
|
|
41
38
|
}
|
|
42
39
|
currentComponent.onCleanups.push(cb);
|
|
@@ -151,9 +148,9 @@ export class RaskStatefulComponent extends Component {
|
|
|
151
148
|
return false;
|
|
152
149
|
}
|
|
153
150
|
render() {
|
|
151
|
+
currentComponent = this;
|
|
154
152
|
if (!this.renderFn) {
|
|
155
153
|
this.reactiveProps = this.createReactiveProps();
|
|
156
|
-
currentComponent = this;
|
|
157
154
|
try {
|
|
158
155
|
this.renderFn = this.setup(this.reactiveProps);
|
|
159
156
|
if (typeof this.renderFn !== "function") {
|
|
@@ -167,12 +164,12 @@ export class RaskStatefulComponent extends Component {
|
|
|
167
164
|
this.context.notifyError(error);
|
|
168
165
|
return null;
|
|
169
166
|
}
|
|
170
|
-
currentComponent = undefined;
|
|
171
167
|
}
|
|
172
168
|
const stopObserving = this.observer.observe();
|
|
173
169
|
let result = null;
|
|
174
170
|
try {
|
|
175
171
|
this.isRendering = true;
|
|
172
|
+
console.log("WTF", this.setup.name);
|
|
176
173
|
result = this.renderFn();
|
|
177
174
|
this.isRendering = false;
|
|
178
175
|
this.willRender = false;
|
|
@@ -185,6 +182,7 @@ export class RaskStatefulComponent extends Component {
|
|
|
185
182
|
}
|
|
186
183
|
finally {
|
|
187
184
|
stopObserving();
|
|
185
|
+
currentComponent = undefined;
|
|
188
186
|
}
|
|
189
187
|
return result;
|
|
190
188
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createComputed.d.ts","sourceRoot":"","sources":["../src/createComputed.ts"],"names":[],"mappings":"AAIA,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,EAChE,QAAQ,EAAE,CAAC,GACV;KACA,CAAC,IAAI,MAAM,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACjC,
|
|
1
|
+
{"version":3,"file":"createComputed.d.ts","sourceRoot":"","sources":["../src/createComputed.ts"],"names":[],"mappings":"AAIA,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,EAChE,QAAQ,EAAE,CAAC,GACV;KACA,CAAC,IAAI,MAAM,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACjC,CA0EA"}
|
package/dist/createComputed.js
CHANGED
|
@@ -2,13 +2,7 @@ import { getCurrentComponent, createCleanup } from "./component";
|
|
|
2
2
|
import { INSPECT_MARKER, INSPECTOR_ENABLED } from "./inspect";
|
|
3
3
|
import { getCurrentObserver, Observer, Signal } from "./observation";
|
|
4
4
|
export function createComputed(computed) {
|
|
5
|
-
|
|
6
|
-
try {
|
|
7
|
-
currentComponent = getCurrentComponent();
|
|
8
|
-
}
|
|
9
|
-
catch {
|
|
10
|
-
currentComponent = undefined;
|
|
11
|
-
}
|
|
5
|
+
const currentComponent = getCurrentComponent();
|
|
12
6
|
const proxy = {};
|
|
13
7
|
let notifyInspectorRef = {};
|
|
14
8
|
for (const prop in computed) {
|
|
@@ -27,9 +21,7 @@ export function createComputed(computed) {
|
|
|
27
21
|
});
|
|
28
22
|
}
|
|
29
23
|
});
|
|
30
|
-
|
|
31
|
-
createCleanup(() => computedObserver.dispose());
|
|
32
|
-
}
|
|
24
|
+
createCleanup(() => computedObserver.dispose());
|
|
33
25
|
Object.defineProperty(proxy, prop, {
|
|
34
26
|
enumerable: true,
|
|
35
27
|
configurable: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createEffect.d.ts","sourceRoot":"","sources":["../src/createEffect.ts"],"names":[],"mappings":"AAIA,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"createEffect.d.ts","sourceRoot":"","sources":["../src/createEffect.ts"],"names":[],"mappings":"AAIA,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,QA2BzD"}
|
package/dist/createEffect.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { syncBatch } from "./batch";
|
|
2
|
-
import {
|
|
2
|
+
import { createCleanup, getCurrentComponent } from "./component";
|
|
3
3
|
import { Observer } from "./observation";
|
|
4
4
|
export function createEffect(cb) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
catch {
|
|
10
|
-
currentComponent = undefined;
|
|
5
|
+
const component = getCurrentComponent();
|
|
6
|
+
if (!component || component.isRendering) {
|
|
7
|
+
throw new Error("Only use createEffect in component setup");
|
|
11
8
|
}
|
|
12
9
|
let disposer;
|
|
13
10
|
const observer = new Observer(() => {
|
|
@@ -24,11 +21,9 @@ export function createEffect(cb) {
|
|
|
24
21
|
disposer = cb();
|
|
25
22
|
stopObserving();
|
|
26
23
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
});
|
|
32
|
-
}
|
|
24
|
+
createCleanup(() => {
|
|
25
|
+
observer.dispose();
|
|
26
|
+
disposer?.();
|
|
27
|
+
});
|
|
33
28
|
runEffect();
|
|
34
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createRouter.d.ts","sourceRoot":"","sources":["../src/createRouter.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EACZ,OAAO,EACP,OAAO,EACR,MAAM,qBAAqB,CAAC;AAI7B,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,YAAY,IAAI,IAAI,CAC/C,OAAO,CAAC,CAAC,CAAC,EACV,SAAS,GAAG,QAAQ,GAAG,UAAU,CAClC,GAAG;IACF,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;CACpB,CAAC;AAEF,wBAAgB,YAAY,CAAC,KAAK,CAAC,CAAC,SAAS,YAAY,EACvD,MAAM,EAAE,CAAC,EACT,OAAO,CAAC,EAAE;IACR,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GACA,MAAM,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"createRouter.d.ts","sourceRoot":"","sources":["../src/createRouter.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EACZ,OAAO,EACP,OAAO,EACR,MAAM,qBAAqB,CAAC;AAI7B,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,YAAY,IAAI,IAAI,CAC/C,OAAO,CAAC,CAAC,CAAC,EACV,SAAS,GAAG,QAAQ,GAAG,UAAU,CAClC,GAAG;IACF,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;CACpB,CAAC;AAEF,wBAAgB,YAAY,CAAC,KAAK,CAAC,CAAC,SAAS,YAAY,EACvD,MAAM,EAAE,CAAC,EACT,OAAO,CAAC,EAAE;IACR,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GACA,MAAM,CAAC,CAAC,CAAC,CA4BX"}
|
package/dist/createRouter.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { createRouter as internalCreateRouter, } from "typed-client-router";
|
|
2
2
|
import { getCurrentObserver, Signal } from "./observation";
|
|
3
|
-
import { createCleanup } from "./component";
|
|
3
|
+
import { createCleanup, getCurrentComponent } from "./component";
|
|
4
4
|
export function createRouter(config, options) {
|
|
5
|
+
if (!getCurrentComponent()) {
|
|
6
|
+
throw new Error("Only use createRouter in component setup");
|
|
7
|
+
}
|
|
5
8
|
const router = internalCreateRouter(config, options);
|
|
6
9
|
const signal = new Signal();
|
|
7
10
|
createCleanup(router.listen(() => signal.notify()));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createState.d.ts","sourceRoot":"","sources":["../src/createState.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createState.d.ts","sourceRoot":"","sources":["../src/createState.ts"],"names":[],"mappings":"AAIA,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,KAElE;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAOzD;AAGD,eAAO,MAAM,YAAY,eAAoB,CAAC"}
|
package/dist/createState.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getCurrentComponent } from "./component";
|
|
1
2
|
import { INSPECT_MARKER, INSPECTOR_ENABLED } from "./inspect";
|
|
2
3
|
import { getCurrentObserver, Signal } from "./observation";
|
|
3
4
|
export function assignState(state, newState) {
|
|
@@ -28,6 +29,9 @@ export function assignState(state, newState) {
|
|
|
28
29
|
* @returns A reactive proxy of the state object
|
|
29
30
|
*/
|
|
30
31
|
export function createState(state) {
|
|
32
|
+
if (getCurrentComponent()?.isRendering) {
|
|
33
|
+
throw new Error("createState cannot be called during render. Call it in component setup or globally.");
|
|
34
|
+
}
|
|
31
35
|
return getProxy(state, {});
|
|
32
36
|
}
|
|
33
37
|
const proxyCache = new WeakMap();
|
package/dist/createTask.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createTask.d.ts","sourceRoot":"","sources":["../src/createTask.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createTask.d.ts","sourceRoot":"","sources":["../src/createTask.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,SAAS,CAAC,CAAC,EAAE,CAAC,IACtB;IACE,SA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AAE,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,CAAC,CAAC,GACnD,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC"}
|
package/dist/createTask.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
import { createCleanup, getCurrentComponent } from "./component";
|
|
1
2
|
import { assignState, createState } from "./createState";
|
|
2
3
|
export function createTask(task) {
|
|
4
|
+
const currentComponent = getCurrentComponent();
|
|
5
|
+
if (!currentComponent || currentComponent.isRendering) {
|
|
6
|
+
throw new Error("Only use createTask in component setup");
|
|
7
|
+
}
|
|
3
8
|
const state = createState({
|
|
4
9
|
isRunning: false,
|
|
5
10
|
result: null,
|
|
@@ -36,6 +41,7 @@ export function createTask(task) {
|
|
|
36
41
|
});
|
|
37
42
|
return promise;
|
|
38
43
|
};
|
|
44
|
+
createCleanup(() => currentAbortController?.abort());
|
|
39
45
|
return {
|
|
40
46
|
get isRunning() {
|
|
41
47
|
return state.isRunning;
|
package/dist/createView.d.ts
CHANGED
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Utility type that preserves unions while "flattening" object types.
|
|
3
|
-
*/
|
|
4
1
|
type Simplify<T> = T extends any ? {
|
|
5
2
|
[K in keyof T]: T[K];
|
|
6
3
|
} : never;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
type MergeTwo<A extends object, B extends object> = A extends any ? Simplify<Omit<A, keyof B> & B> : never;
|
|
12
|
-
/**
|
|
13
|
-
* Merge a readonly tuple of objects left-to-right, with later entries
|
|
14
|
-
* overriding earlier ones. Distributes over unions in the head element.
|
|
15
|
-
*/
|
|
4
|
+
type UndefinedKeys<T> = {
|
|
5
|
+
[K in keyof T]-?: [T[K]] extends [undefined] ? K : never;
|
|
6
|
+
}[keyof T];
|
|
7
|
+
type MergeTwo<A extends object, B extends object> = A extends any ? Simplify<Omit<A, keyof B> & Omit<B, UndefinedKeys<B>>> : never;
|
|
16
8
|
type MergeMany<T extends readonly object[]> = T extends [
|
|
17
9
|
infer H extends object,
|
|
18
10
|
...infer R extends object[]
|
package/dist/createView.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createView.d.ts","sourceRoot":"","sources":["../src/createView.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createView.d.ts","sourceRoot":"","sources":["../src/createView.ts"],"names":[],"mappings":"AAGA,KAAK,QAAQ,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,GAAG,KAAK,CAAC;AAEpE,KAAK,aAAa,CAAC,CAAC,IAAI;KACrB,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,KAAK;CACzD,CAAC,MAAM,CAAC,CAAC,CAAC;AAEX,KAAK,QAAQ,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,GAAG,GAC7D,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,GACtD,KAAK,CAAC;AAEV,KAAK,SAAS,CAAC,CAAC,SAAS,SAAS,MAAM,EAAE,IAAI,CAAC,SAAS;IACtD,MAAM,CAAC,SAAS,MAAM;IACtB,GAAG,MAAM,CAAC,SAAS,MAAM,EAAE;CAC5B,GACG,QAAQ,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,GACzB,EAAE,CAAC;AAEP;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;AACtD,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,EAC3D,CAAC,EAAE,CAAC,EACJ,CAAC,EAAE,CAAC,GACH,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAClB,wBAAgB,UAAU,CAAC,CAAC,SAAS,SAAS,MAAM,EAAE,EACpD,GAAG,IAAI,EAAE,CAAC,GACT,SAAS,CAAC,CAAC,CAAC,CAAC"}
|
package/dist/createView.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import { getCurrentComponent } from "./component";
|
|
1
2
|
import { INSPECT_MARKER, INSPECTOR_ENABLED } from "./inspect";
|
|
2
3
|
export function createView(...args) {
|
|
4
|
+
if (!getCurrentComponent()) {
|
|
5
|
+
throw new Error("Only use createView in component setup");
|
|
6
|
+
}
|
|
3
7
|
const result = {};
|
|
4
8
|
const seen = new Set();
|
|
5
9
|
let notifyInspectorRef = {};
|