@furystack/shades 11.0.18 → 11.0.20
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 +25 -26
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,43 +1,42 @@
|
|
|
1
1
|
# @furystack/shades
|
|
2
2
|
|
|
3
|
-
Shades is a UI
|
|
3
|
+
Shades is a UI library for FuryStack that uses type-safe JSX components, unidirectional data binding, and the same DI/IoC, logging, and utility libraries as FuryStack backend services.
|
|
4
4
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
7
7
|
You can check the [@furystack/boilerplate](https://github.com/furystack/boilerplate) repository for a working example.
|
|
8
8
|
|
|
9
|
-
### A Shade (
|
|
9
|
+
### A Shade (Component)
|
|
10
10
|
|
|
11
11
|
A shade (component) can be constructed from the following properties:
|
|
12
12
|
|
|
13
|
-
- `
|
|
14
|
-
- `initialState`
|
|
15
|
-
- `shadowDomName`
|
|
16
|
-
- `
|
|
17
|
-
- `
|
|
18
|
-
- `
|
|
13
|
+
- `render:(options: RenderOptions)=>JSX.Element` – A required method that will be executed on each render.
|
|
14
|
+
- `initialState` – A default state that can be updated during the component lifecycle.
|
|
15
|
+
- `shadowDomName` – Can be specified as the custom element's name in the DOM.
|
|
16
|
+
- `constructed: (options: RenderOptions)=>void` – Optional callback executed after component construction. It can return a cleanup method (e.g., free up resources, dispose value observers, etc.).
|
|
17
|
+
- `onAttach: (options: RenderOptions)=>void` – Executed when the component is attached to the DOM.
|
|
18
|
+
- `onDetach: (options: RenderOptions)=>void` – Executed when the component is detached from the DOM.
|
|
19
19
|
|
|
20
|
-
### Render
|
|
20
|
+
### Render Options
|
|
21
21
|
|
|
22
|
-
The lifecycle methods
|
|
22
|
+
The lifecycle methods receive the following options as a parameter:
|
|
23
23
|
|
|
24
|
-
- props
|
|
25
|
-
- getState()
|
|
26
|
-
- updateState(newState: TState, skipRender?: boolean)
|
|
27
|
-
- injector
|
|
28
|
-
- children
|
|
29
|
-
- element
|
|
30
|
-
- logger
|
|
24
|
+
- `props` – The current readonly props object for the element. As props are passed from the parent, it is read-only.
|
|
25
|
+
- `getState()` – Returns the current state. The state object is also read-only and immutable and can be updated only with a corresponding method.
|
|
26
|
+
- `updateState(newState: TState, skipRender?: boolean)` – Updates (patches) the component state. An optional flag can indicate that this state change shouldn't trigger a re-render (e.g., form input fields change, etc.).
|
|
27
|
+
- `injector` – An injector instance. It can be retrieved from the closest parent or specified on the state or props.
|
|
28
|
+
- `children` – The children element(s) of the component.
|
|
29
|
+
- `element` – A reference to the current component's custom element (root).
|
|
30
|
+
- `logger` – A specified logger instance with a pre-defined scope.
|
|
31
31
|
|
|
32
|
-
### Bundled
|
|
32
|
+
### Bundled Goodies
|
|
33
33
|
|
|
34
|
-
The **@furystack/shades** package contains a router component, a router-link component, a location
|
|
34
|
+
The **@furystack/shades** package contains a router component, a router-link component, a location service, and a lazy-load component.
|
|
35
35
|
|
|
36
|
-
## Core
|
|
36
|
+
## Core Concepts
|
|
37
37
|
|
|
38
|
-
- Shade is close to the DOM and the natives. You are encouraged to use native browser methods
|
|
39
|
-
- You can use small independent services for state tracking with the
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
- Nothing is true, everything is permitted 🗡
|
|
38
|
+
- Shade is close to the DOM and the natives. You are encouraged to use native browser methods when possible.
|
|
39
|
+
- You can use small independent services for state tracking with the injector.
|
|
40
|
+
- You can use resources (value observers) that will be disposed automatically when your component is removed from the DOM.
|
|
41
|
+
- Re-rendering can be skipped on state update. For example, why re-render a whole form if only one field has changed?
|
|
42
|
+
- Nothing is true, everything is permitted. 🗡️
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@furystack/shades",
|
|
3
|
-
"version": "11.0.
|
|
3
|
+
"version": "11.0.20",
|
|
4
4
|
"description": "Google Authentication Provider for FuryStack",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -38,15 +38,15 @@
|
|
|
38
38
|
"homepage": "https://github.com/furystack/furystack",
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/jsdom": "^21.1.7",
|
|
41
|
-
"@types/node": "^22.
|
|
41
|
+
"@types/node": "^22.15.30",
|
|
42
42
|
"jsdom": "^26.1.0",
|
|
43
43
|
"typescript": "^5.8.3",
|
|
44
|
-
"vitest": "^3.
|
|
44
|
+
"vitest": "^3.2.2"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@furystack/inject": "^12.0.
|
|
48
|
-
"@furystack/rest": "^8.0.
|
|
49
|
-
"@furystack/utils": "^8.0.
|
|
47
|
+
"@furystack/inject": "^12.0.16",
|
|
48
|
+
"@furystack/rest": "^8.0.19",
|
|
49
|
+
"@furystack/utils": "^8.0.15",
|
|
50
50
|
"path-to-regexp": "^8.2.0",
|
|
51
51
|
"semaphore-async-await": "^1.5.1"
|
|
52
52
|
},
|