vasille-web 4.2.0 → 4.3.1

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
@@ -104,6 +104,10 @@ All of these are supported:
104
104
 
105
105
  ## Change log
106
106
 
107
+ ### 4.3.0
108
+
109
+ Add new function `safe` which make functions safe, errors are reported automatically.
110
+
107
111
  ### 4.2.0
108
112
 
109
113
  Add support for inlined conditions in JSX, binary `&&` and ternary `?:` operator.
@@ -7,6 +7,7 @@ import type { Router } from "vasille-router/web-router";
7
7
  export type { RawStyleProps as StyleProps } from "../spec/css.d.ts";
8
8
  export type ClassItem = string | Record<string, boolean> | false;
9
9
  export type { FallbackScreenProps, ErrorScreenProps } from "vasille-router";
10
+ export { safe } from "vasille";
10
11
 
11
12
  /** Set a handler for component errors */
12
13
  export declare function setErrorHandler(handler: (e: unknown) => void): void;
@@ -117,7 +118,7 @@ export declare function store<Return extends object>(fn: () => Return): Return;
117
118
  /** Creates a model (state) constructor */
118
119
  export declare function model<Return extends object>(fn: () => Return): () => Return & Destroyable;
119
120
  export declare function model<Input extends object, Return extends object>(
120
- fn: (input: Input) => Return & Destroyable,
121
+ fn: (input: Input) => Return,
121
122
  ): (input: Input) => Return & Destroyable;
122
123
 
123
124
  export { QueryParams, ScreenProps, RouteParameters } from "vasille-router";
@@ -185,9 +186,11 @@ export declare function routerApp<Routes extends string>(
185
186
 
186
187
  /** Run a function before component mount */
187
188
  export declare function beforeMount(fn: () => void): void;
189
+ export declare function beforeMount(fn: () => Promise<void>): void;
188
190
 
189
191
  /** Run a function after component mount */
190
192
  export declare function afterMount(fn: () => void): void;
193
+ export declare function afterMount(fn: () => Promise<void>): void;
191
194
 
192
195
  /** Run a function before component destroy */
193
196
  export declare function beforeDestroy(fn: () => void): void;
package/lib/index.js CHANGED
@@ -3,6 +3,7 @@ import { Runner } from "vasille/web-runner";
3
3
  import { mount as coreMount } from "vasille-jsx";
4
4
  import { styleSheet as coreStyleSheet } from "vasille-css";
5
5
  import { routeApp as coreRouteApp } from "vasille-router/web-router";
6
+ export { safe } from "vasille";
6
7
  export { view, view as component, view as compose, forward, backward, ensure, ref, expr, expr as bind, expr as calculate, expr as watch, set, Debug, Delay, For, Slot, Watch, awaited, store, model, setModel, mapModel, arrayModel, Switch, setErrorHandler, match, } from "vasille-jsx";
7
8
  export { screen, screen as page, } from "vasille-router";
8
9
  export { Router, routeApp } from "vasille-router/web-router";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vasille-web",
3
- "version": "4.2.0",
3
+ "version": "4.3.1",
4
4
  "description": "The same framework which is designed to build bulletproof frontends.",
5
5
  "main": "index.js",
6
6
  "types": "./index.d.ts",
@@ -47,9 +47,9 @@
47
47
  "homepage": "https://github.com/vasille-js/vasille-js#readme",
48
48
  "dependencies": {
49
49
  "csstype": "^3.1.3",
50
- "vasille": "^4.1.0",
50
+ "vasille": "^4.3.1",
51
51
  "vasille-css": "^4.1.0",
52
- "vasille-jsx": "^4.2.0",
52
+ "vasille-jsx": "^4.3.0",
53
53
  "vasille-router": "^4.0.0"
54
54
  },
55
55
  "devDependencies": {
package/types/index.d.ts CHANGED
@@ -4,6 +4,7 @@ import { TagOptions } from "vasille/web-runner";
4
4
  import { WebRouterInitialization } from "vasille-router/web-router";
5
5
  export type { RawStyleProps as StyleProps } from "../spec/css.js";
6
6
  export type { ClassItem } from "./jsx-runtime.js";
7
+ export { safe } from "vasille";
7
8
  export { view, view as component, view as compose, forward, backward, ensure, ref, expr, expr as bind, expr as calculate, expr as watch, set, Debug, Delay, For, Slot, Watch, awaited, store, model, setModel, mapModel, arrayModel, Switch, setErrorHandler, match, } from "vasille-jsx";
8
9
  export { type QueryParams, type ScreenProps, type RouteParameters, screen, screen as page, type FallbackScreenProps, type ErrorScreenProps, } from "vasille-router";
9
10
  export { Router, type WebRouterInitialization, type NavigationMode, routeApp } from "vasille-router/web-router";