vasille-web 7.0.0-rc.2 → 7.0.0-rc.3

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 CHANGED
@@ -130,9 +130,12 @@ We respect semantic versioning:
130
130
  - A minor version is increased when we add functionality.
131
131
  - Patch version is increased when we fix bugs.
132
132
 
133
- ### 7.0
133
+ ### 7.0 RC (WIP)
134
134
 
135
- - WIP
135
+ - Add `debounceRef`, `edgeRef` and `fieldRef` functions, which extend the reativity system.
136
+ - Add `Zombie` component, it keeps HTML elements alive some time after destruction.
137
+ - Add `abortSignal` to cancel fetch requests and timers when component is destroyed.
138
+ - Add `safeRef`, `safeExpr`, `safeInit` functions, they make the JSX much safer.
136
139
 
137
140
  ### 6.0 RC (never released)
138
141
 
@@ -161,12 +164,12 @@ We respect semantic versioning:
161
164
 
162
165
  - Switch to a babel plugin to compile components code. **[API change]**
163
166
  - 100% of the code has been covered with unit tests.
164
- - New developement direction: `keep it simple`.
167
+ - New development direction: `keep it simple`.
165
168
 
166
169
  ### 2.0 - 2.3
167
170
 
168
171
  - Introduces components compilation via a typescript plugin. **[API change]**
169
- - New developement direction: `write less, do more`.
172
+ - New development direction: `write less, do more`.
170
173
 
171
174
  ### 1.0 - 1.2
172
175
 
package/lib/dev.js CHANGED
@@ -3,8 +3,8 @@ import { devRouteApp as coreRouteApp } from "vasille-router/dev";
3
3
  import { DevFragment, DevPortal, DevRunner, errorToString, inspector, toDevValue, } from "vasille/dev";
4
4
  import { modal, prompt } from "./index.js";
5
5
  function createPortal(node, declaration, usage, name) {
6
- const portal = new DevPortal({ node: document.body }, node.runner, declaration, usage, name);
7
- node.create(portal);
6
+ const portal = new DevPortal(document.body, node.runner, declaration, usage, name);
7
+ node.child(portal);
8
8
  return portal;
9
9
  }
10
10
  export function devModal(modalFn, declaration, name) {
@@ -39,7 +39,7 @@ export function devModal(modalFn, declaration, name) {
39
39
  if (!input.slot && slot) {
40
40
  input.slot = slot;
41
41
  }
42
- node.create(frag);
42
+ node.child(frag);
43
43
  fragments.set(frag, { props: input, node: frag, usage });
44
44
  run(frag, input, usage);
45
45
  };
@@ -93,7 +93,7 @@ export function devPrompt(modal, declaration, name) {
93
93
  };
94
94
  const renderer = (node, input, timeout, usage) => {
95
95
  const frag = new DevFragment(node.runner, null, null, name, {});
96
- node.create(frag);
96
+ node.child(frag);
97
97
  fragments.set(frag, { props: input, node: frag, usage });
98
98
  return run(frag, input, timeout, usage);
99
99
  };
package/lib/index.js CHANGED
@@ -4,14 +4,14 @@ import { mount as coreMount } from "vasille-jsx";
4
4
  import { routeApp as coreRouteApp } from "vasille-router/web-router";
5
5
  export { styleSheet } from "vasille-css";
6
6
  export { safe } from "vasille";
7
- export { view, view as component, view as compose, ensure, ref, expr, expr as bind, expr as calculate, expr as watch, set, Delay, For, Slot, Watch, awaited, store, model, setModel, mapModel, arrayModel, Switch, setErrorHandler, match, ArrayView, ArrayModelView, MapModelView, SetModelView, QueuedRender, } from "vasille-jsx";
7
+ export { view, view as component, view as compose, ensure, ref, expr, expr as bind, expr as calculate, expr as watch, set, Delay, For, Slot, Watch, awaited, store, model, setModel, mapModel, arrayModel, Switch, setErrorHandler, match, ArrayView, ArrayModelView, MapModelView, SetModelView, QueuedRender, debounceRef, edgeRef, safeExpr, safeInit, safeRef, toDeepFieldRef, toFieldRef, Zombie, abortSignal, } from "vasille-jsx";
8
8
  export { screen, screen as page, } from "vasille-router";
9
9
  export { Router } from "vasille-router/web-router";
10
10
  export { setMobileMaxWidth, setTabletMaxWidth, setLaptopMaxWidth } from "vasille-css";
11
11
  export { context, impute, receive, share, receiveOptional } from "vasille-context";
12
12
  function createPortal(node) {
13
- const portal = new Portal({ node: document.body }, node.runner, node.sDeep + 1);
14
- node.create(portal);
13
+ const portal = new Portal(document.body, node.runner, node.sDeep + 1);
14
+ node.child(portal);
15
15
  return portal;
16
16
  }
17
17
  export function modal(modal, create = createPortal) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vasille-web",
3
- "version": "7.0.0-rc.2",
3
+ "version": "7.0.0-rc.3",
4
4
  "description": "The same devkit which is designed to build fault tolerant frontends.",
5
5
  "main": "index.js",
6
6
  "types": "./index.d.ts",
@@ -50,11 +50,11 @@
50
50
  "homepage": "https://github.com/vasille-js/vasille-js#readme",
51
51
  "dependencies": {
52
52
  "csstype": "^3.1.3",
53
- "vasille": "^7.0.0-rc.3",
54
- "vasille-context": "^6.0.0-rc",
55
- "vasille-css": "^5.0.0",
56
- "vasille-jsx": "^7.0.0-rc.2",
57
- "vasille-router": "^7.0.0-rc"
53
+ "vasille": "^7.0.0-rc.9",
54
+ "vasille-context": "^7.0.0-rc.1",
55
+ "vasille-css": "^7.0.0-rc.3",
56
+ "vasille-jsx": "^7.0.0-rc.7",
57
+ "vasille-router": "^7.0.0-rc.3"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@types/node": "^24.3.0",
package/types/index.d.ts CHANGED
@@ -6,7 +6,7 @@ export { styleSheet } from "vasille-css";
6
6
  export type { RawStyleProps as StyleProps, StyleSheetProps } from "./spec/css.js";
7
7
  export type { ClassItem } from "./jsx-runtime.js";
8
8
  export { safe } from "vasille";
9
- export { view, view as component, view as compose, ensure, ref, expr, expr as bind, expr as calculate, expr as watch, set, Delay, For, Slot, Watch, awaited, store, model, setModel, mapModel, arrayModel, Switch, setErrorHandler, match, ArrayView, ArrayModelView, MapModelView, SetModelView, QueuedRender, } from "vasille-jsx";
9
+ export { view, view as component, view as compose, ensure, ref, expr, expr as bind, expr as calculate, expr as watch, set, Delay, For, Slot, Watch, awaited, store, model, setModel, mapModel, arrayModel, Switch, setErrorHandler, match, ArrayView, ArrayModelView, MapModelView, SetModelView, QueuedRender, debounceRef, edgeRef, safeExpr, safeInit, safeRef, toDeepFieldRef, toFieldRef, Zombie, abortSignal, } from "vasille-jsx";
10
10
  export { type QueryParams, type ScreenProps, type RouteParameters, screen, screen as page, type FallbackScreenProps, type ErrorScreenProps, } from "vasille-router";
11
11
  export { Router, type WebRouterInitialization, type NavigationMode } from "vasille-router/web-router";
12
12
  export { setMobileMaxWidth, setTabletMaxWidth, setLaptopMaxWidth } from "vasille-css";
@@ -1,5 +1,6 @@
1
1
  import type { RawStyleProps } from "./spec/css.ts";
2
2
  import type { HtmlTagMap } from "./spec/html.ts";
3
+ import type { CssStyleInjector } from "vasille-css";
3
4
  export type { TagEvents, TagAttrs, TagProps } from "./spec/html.ts";
4
5
  export type prefixedObject<T, P extends string> = {
5
6
  [K in keyof T as K extends string ? `${P}${K}` : never]?: T[K];
@@ -7,7 +8,7 @@ export type prefixedObject<T, P extends string> = {
7
8
  export type EventHandlers<T> = {
8
9
  [K in keyof T]: T[K] | [T[K], boolean | AddEventListenerOptions];
9
10
  };
10
- export type ClassItem = string | Record<string, boolean> | false;
11
+ export type ClassItem = string | CssStyleInjector | Record<string, boolean> | false;
11
12
  declare const internal: unique symbol;
12
13
  export interface VasilleElement {
13
14
  [internal]: typeof internal;
@@ -15,11 +16,11 @@ export interface VasilleElement {
15
16
  export type VasilleChild = VasilleElement | string | number | boolean | null | undefined;
16
17
  export type VasilleSlot = VasilleChild | VasilleChild[];
17
18
  type HtmlInput<K extends keyof HTMLElementTagNameMap & keyof HtmlTagMap> = {
18
- callback?: (node: HTMLElementTagNameMap[K]) => unknown;
19
+ callback?: (node: HTMLElementTagNameMap[K]) => void | HTMLElementTagNameMap[K] | (() => void);
19
20
  class?: ClassItem[] | string;
20
21
  style?: RawStyleProps | string;
21
22
  "vasille:slot"?: VasilleSlot;
22
- } & Partial<HtmlTagMap[K]["attrs"]> & prefixedObject<EventHandlers<HtmlTagMap[K]["events"]>, "on"> & Partial<prefixedObject<HtmlTagMap[K]["props"], "bind:">>;
23
+ } & Partial<HtmlTagMap[K]["attrs"]> & prefixedObject<EventHandlers<HtmlTagMap[K]["events"]>, "on"> & Partial<prefixedObject<HtmlTagMap[K]["props"], "property:">>;
23
24
  export declare namespace JSX {
24
25
  type ElementType = keyof IntrinsicElements | ((props: any) => void);
25
26
  type Element = VasilleElement;
@@ -28,6 +28,7 @@ export interface TagAttrs {
28
28
  lang: string;
29
29
  nonce: string;
30
30
  part: string;
31
+ role: string;
31
32
  slot: string;
32
33
  spellcheck: "true" | "false" | "" | boolean;
33
34
  tabindex: number;
@@ -132,6 +133,7 @@ interface ImgAttrs extends TagAttrs {
132
133
  referrerpolicy: string;
133
134
  decoding: string;
134
135
  loading: string;
136
+ fetchpriority: string;
135
137
  }
136
138
  interface IframeAttrs extends TagAttrs {
137
139
  src: string;