@unsetsoft/ryunixjs 1.2.5-canary.7 → 1.2.5-canary.9
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.es.md +143 -120
- package/README.md +144 -122
- package/dist/Ryunix.esm.js +3670 -3722
- package/dist/Ryunix.esm.js.map +1 -1
- package/dist/Ryunix.umd.js +3762 -3814
- package/dist/Ryunix.umd.js.map +1 -1
- package/dist/Ryunix.umd.min.js +1 -1
- package/dist/Ryunix.umd.min.js.map +1 -1
- package/jsx/jsx-dev-runtime.d.ts +1 -0
- package/jsx/jsx-dev-runtime.js +6 -6
- package/jsx/jsx-runtime.d.ts +34 -0
- package/jsx/jsx-runtime.js +56 -56
- package/package.json +19 -4
- package/types/index.d.ts +529 -0
- package/types/index.typetest.ts +19 -0
package/README.es.md
CHANGED
|
@@ -1,120 +1,143 @@
|
|
|
1
|
-
<!-- markdownlint-disable MD033 MD041 MD013 -->
|
|
2
|
-
|
|
3
|
-
> **Language / Idioma:** [English](./README.md) · [Español](./README.es.md)
|
|
4
|
-
|
|
5
|
-
<p align="center">
|
|
6
|
-
<img src="https://raw.githubusercontent.com/UnSetSoft/Ryunixjs/canary/assets/logo.png" width="200" height="200" alt="RyunixJS Logo" />
|
|
7
|
-
</p>
|
|
8
|
-
|
|
9
|
-
<h1 align="center">@unsetsoft/ryunixjs</h1>
|
|
10
|
-
|
|
11
|
-
<p align="center">
|
|
12
|
-
<a href="https://www.npmjs.com/package/@unsetsoft/ryunixjs">
|
|
13
|
-
<img src="https://img.shields.io/npm/v/@unsetsoft/ryunixjs.svg?style=flat-square" alt="versión npm" />
|
|
14
|
-
</a>
|
|
15
|
-
<a href="https://www.npmjs.com/package/@unsetsoft/ryunixjs/v/canary">
|
|
16
|
-
<img src="https://img.shields.io/npm/v/@unsetsoft/ryunixjs/canary.svg?style=flat-square&label=canary" alt="versión canary" />
|
|
17
|
-
</a>
|
|
18
|
-
</p>
|
|
19
|
-
|
|
20
|
-
## <!-- markdownlint-enable MD013 -->
|
|
21
|
-
|
|
22
|
-
## 🧠 ¿Qué es el Core?
|
|
23
|
-
|
|
24
|
-
`@unsetsoft/ryunixjs` es el **motor fundamental** del framework RyunixJS.
|
|
25
|
-
Es una biblioteca ligera y de alto rendimiento responsable de:
|
|
26
|
-
|
|
27
|
-
- **Reconciliación y arquitectura Fiber**: actualiza el DOM de forma eficiente
|
|
28
|
-
|
|
29
|
-
comparando árboles de Virtual DOM.
|
|
30
|
-
|
|
31
|
-
- **Sistema de hooks**: gestión de estado y ciclo de vida (p. ej.
|
|
32
|
-
|
|
33
|
-
`useStore`, `useEffect`).
|
|
34
|
-
|
|
35
|
-
- **Renderizado concurrente**: soporte para actualizaciones priorizadas y transiciones.
|
|
36
|
-
- **SSR e hidratación**: motores de renderizado en servidor para Node.js y entornos
|
|
37
|
-
|
|
38
|
-
Edge.
|
|
39
|
-
|
|
40
|
-
Aunque puedes usarlo de forma independiente en integraciones personalizadas, lo habitual
|
|
41
|
-
es consumirlo mediante `@unsetsoft/ryunix-presets` y el CLI oficial.
|
|
42
|
-
|
|
43
|
-
##
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
- `
|
|
79
|
-
- `
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
##
|
|
119
|
-
|
|
120
|
-
|
|
1
|
+
<!-- markdownlint-disable MD033 MD041 MD013 -->
|
|
2
|
+
|
|
3
|
+
> **Language / Idioma:** [English](./README.md) · [Español](./README.es.md)
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<img src="https://raw.githubusercontent.com/UnSetSoft/Ryunixjs/canary/assets/logo.png" width="200" height="200" alt="RyunixJS Logo" />
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<h1 align="center">@unsetsoft/ryunixjs</h1>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="https://www.npmjs.com/package/@unsetsoft/ryunixjs">
|
|
13
|
+
<img src="https://img.shields.io/npm/v/@unsetsoft/ryunixjs.svg?style=flat-square" alt="versión npm" />
|
|
14
|
+
</a>
|
|
15
|
+
<a href="https://www.npmjs.com/package/@unsetsoft/ryunixjs/v/canary">
|
|
16
|
+
<img src="https://img.shields.io/npm/v/@unsetsoft/ryunixjs/canary.svg?style=flat-square&label=canary" alt="versión canary" />
|
|
17
|
+
</a>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
## <!-- markdownlint-enable MD013 -->
|
|
21
|
+
|
|
22
|
+
## 🧠 ¿Qué es el Core?
|
|
23
|
+
|
|
24
|
+
`@unsetsoft/ryunixjs` es el **motor fundamental** del framework RyunixJS.
|
|
25
|
+
Es una biblioteca ligera y de alto rendimiento responsable de:
|
|
26
|
+
|
|
27
|
+
- **Reconciliación y arquitectura Fiber**: actualiza el DOM de forma eficiente
|
|
28
|
+
|
|
29
|
+
comparando árboles de Virtual DOM.
|
|
30
|
+
|
|
31
|
+
- **Sistema de hooks**: gestión de estado y ciclo de vida (p. ej.
|
|
32
|
+
|
|
33
|
+
`useStore`, `useEffect`).
|
|
34
|
+
|
|
35
|
+
- **Renderizado concurrente**: soporte para actualizaciones priorizadas y transiciones.
|
|
36
|
+
- **SSR e hidratación**: motores de renderizado en servidor para Node.js y entornos
|
|
37
|
+
|
|
38
|
+
Edge.
|
|
39
|
+
|
|
40
|
+
Aunque puedes usarlo de forma independiente en integraciones personalizadas, lo habitual
|
|
41
|
+
es consumirlo mediante `@unsetsoft/ryunix-presets` y el CLI oficial.
|
|
42
|
+
|
|
43
|
+
## 📘 TypeScript
|
|
44
|
+
|
|
45
|
+
Los tipos están en `types/index.d.ts` (entrada principal) y
|
|
46
|
+
`jsx/jsx-runtime.d.ts` (JSX automático). Instala `@unsetsoft/ryunixjs` como
|
|
47
|
+
dependencia; no hace falta un paquete `@types` aparte.
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
import {
|
|
51
|
+
useStore,
|
|
52
|
+
createElement,
|
|
53
|
+
type RyunixElement,
|
|
54
|
+
} from '@unsetsoft/ryunixjs'
|
|
55
|
+
|
|
56
|
+
function Counter(): RyunixElement {
|
|
57
|
+
const [count, setCount] = useStore(0)
|
|
58
|
+
return createElement('button', { onClick: () => setCount(count + 1) }, count)
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Para JSX, configura `"jsxImportSource": "@unsetsoft/ryunixjs"` en tu
|
|
63
|
+
`tsconfig.json` (o usa el preset Webpack/SWC de Ryunix, que lo aplica en
|
|
64
|
+
archivos `.ryx`).
|
|
65
|
+
|
|
66
|
+
## 🚀 Instalación
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
npm install @unsetsoft/ryunixjs
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## 🛠️ Referencia de API
|
|
73
|
+
|
|
74
|
+
### Funciones principales
|
|
75
|
+
|
|
76
|
+
- `createElement(type, props, ...children)`: crea un elemento de Virtual DOM.
|
|
77
|
+
- `render(element, container)`: renderiza un elemento Ryunix en el DOM.
|
|
78
|
+
- `hydrate(element, container)`: hidrata HTML generado en servidor.
|
|
79
|
+
- `init()`: inicializa el estado de Ryunix.
|
|
80
|
+
|
|
81
|
+
### Hooks
|
|
82
|
+
|
|
83
|
+
| Hook | Descripción |
|
|
84
|
+
| :----------------------------- | :---------------------------------------------------- |
|
|
85
|
+
| `useStore(initial)` | Gestión de estado (equivalente Ryunix de `useState`). |
|
|
86
|
+
| `useReducer(reducer, initial)` | Estado avanzado con reducers. |
|
|
87
|
+
| `useEffect(cb, deps)` | Efectos secundarios. |
|
|
88
|
+
| `useLayoutEffect(cb, deps)` | Efectos síncronos antes del pintado del navegador. |
|
|
89
|
+
| `useRef(initial)` | Referencia persistente entre renders. |
|
|
90
|
+
| `useMemo(cb, deps)` | Valores memorizados. |
|
|
91
|
+
| `useCallback(cb, deps)` | Funciones memorizadas. |
|
|
92
|
+
| `useContext(id)` | Consume un valor de contexto. |
|
|
93
|
+
| `useId()` | Genera IDs únicos y estables para SSR. |
|
|
94
|
+
|
|
95
|
+
### Hooks especializados
|
|
96
|
+
|
|
97
|
+
- `usePersistentStore(key, initial)`: sincroniza el estado con
|
|
98
|
+
|
|
99
|
+
`localStorage` automáticamente.
|
|
100
|
+
|
|
101
|
+
- `useSwitch(initial)`: hook optimizado para estado booleano.
|
|
102
|
+
- `useDebounce(value, delay)`: aplaza actualizaciones de un valor.
|
|
103
|
+
- `useThrottle(value, interval)`: limita la frecuencia de actualizaciones.
|
|
104
|
+
- `useQuery()` / `useHash()`: parámetros de URL y hash reactivos.
|
|
105
|
+
|
|
106
|
+
### Concurrencia y servidor
|
|
107
|
+
|
|
108
|
+
- **Actualizaciones priorizadas**: usa `useTransition` y `useDeferredValue` para
|
|
109
|
+
|
|
110
|
+
actualizaciones de UI no urgentes.
|
|
111
|
+
|
|
112
|
+
- **Motor SSR**: `renderToString` y `renderToReadableStream` para renderizado
|
|
113
|
+
|
|
114
|
+
flexible en servidor.
|
|
115
|
+
|
|
116
|
+
- **Límites**: `ServerBoundary` y `ErrorBoundary` para aplicaciones resilientes.
|
|
117
|
+
|
|
118
|
+
## 🏗️ Ejemplo de uso
|
|
119
|
+
|
|
120
|
+
```javascript
|
|
121
|
+
import { render, useStore, createElement } from '@unsetsoft/ryunixjs'
|
|
122
|
+
|
|
123
|
+
function App() {
|
|
124
|
+
const [count, setCount] = useStore(0)
|
|
125
|
+
|
|
126
|
+
return createElement(
|
|
127
|
+
'div',
|
|
128
|
+
null,
|
|
129
|
+
createElement('h1', null, `Count: ${count}`),
|
|
130
|
+
createElement(
|
|
131
|
+
'button',
|
|
132
|
+
{ onClick: () => setCount(count + 1) },
|
|
133
|
+
'Increment',
|
|
134
|
+
),
|
|
135
|
+
)
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
render(createElement(App), document.getElementById('root'))
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## 📄 Licencia
|
|
142
|
+
|
|
143
|
+
RyunixJS tiene [licencia MIT](../../LICENSE).
|
package/README.md
CHANGED
|
@@ -1,122 +1,144 @@
|
|
|
1
|
-
<!-- markdownlint-disable MD033 MD041 MD013 -->
|
|
2
|
-
|
|
3
|
-
> **Language / Idioma:** [English](./README.md) · [Español](./README.es.md)
|
|
4
|
-
|
|
5
|
-
<p align="center">
|
|
6
|
-
<img src="https://raw.githubusercontent.com/UnSetSoft/Ryunixjs/canary/assets/logo.png" width="200" height="200" alt="RyunixJS Logo" />
|
|
7
|
-
</p>
|
|
8
|
-
|
|
9
|
-
<h1 align="center">@unsetsoft/ryunixjs</h1>
|
|
10
|
-
|
|
11
|
-
<p align="center">
|
|
12
|
-
<a href="https://www.npmjs.com/package/@unsetsoft/ryunixjs">
|
|
13
|
-
<img src="https://img.shields.io/npm/v/@unsetsoft/ryunixjs.svg?style=flat-square" alt="npm version" />
|
|
14
|
-
</a>
|
|
15
|
-
<a href="https://www.npmjs.com/package/@unsetsoft/ryunixjs/v/canary">
|
|
16
|
-
<img src="https://img.shields.io/npm/v/@unsetsoft/ryunixjs/canary.svg?style=flat-square&label=canary" alt="canary version" />
|
|
17
|
-
</a>
|
|
18
|
-
</p>
|
|
19
|
-
|
|
20
|
-
## <!-- markdownlint-enable MD013 -->
|
|
21
|
-
|
|
22
|
-
## 🧠 What is the Core?
|
|
23
|
-
|
|
24
|
-
`@unsetsoft/ryunixjs` is the **foundational engine** of the RyunixJS framework.
|
|
25
|
-
It's a lightweight, high-performance library responsible for:
|
|
26
|
-
|
|
27
|
-
- **Reconciliation & Fiber Architecture**: Efficiently updating the DOM by
|
|
28
|
-
|
|
29
|
-
comparing Virtual DOM trees.
|
|
30
|
-
|
|
31
|
-
- **Hooks System**: Providing the core state and lifecycle management (e.g.,
|
|
32
|
-
|
|
33
|
-
`useStore`, `useEffect`).
|
|
34
|
-
|
|
35
|
-
- **Concurrent Rendering**: Support for prioritized updates and transitions.
|
|
36
|
-
- **SSR & Hydration**: Server-Side Rendering engines for both Node.js and Edge
|
|
37
|
-
|
|
38
|
-
environments.
|
|
39
|
-
|
|
40
|
-
While you can use it standalone for custom integrations, it is typically used
|
|
41
|
-
via `@unsetsoft/ryunix-presets` and our official CLI.
|
|
42
|
-
|
|
43
|
-
##
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
- `
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
1
|
+
<!-- markdownlint-disable MD033 MD041 MD013 -->
|
|
2
|
+
|
|
3
|
+
> **Language / Idioma:** [English](./README.md) · [Español](./README.es.md)
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<img src="https://raw.githubusercontent.com/UnSetSoft/Ryunixjs/canary/assets/logo.png" width="200" height="200" alt="RyunixJS Logo" />
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<h1 align="center">@unsetsoft/ryunixjs</h1>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="https://www.npmjs.com/package/@unsetsoft/ryunixjs">
|
|
13
|
+
<img src="https://img.shields.io/npm/v/@unsetsoft/ryunixjs.svg?style=flat-square" alt="npm version" />
|
|
14
|
+
</a>
|
|
15
|
+
<a href="https://www.npmjs.com/package/@unsetsoft/ryunixjs/v/canary">
|
|
16
|
+
<img src="https://img.shields.io/npm/v/@unsetsoft/ryunixjs/canary.svg?style=flat-square&label=canary" alt="canary version" />
|
|
17
|
+
</a>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
## <!-- markdownlint-enable MD013 -->
|
|
21
|
+
|
|
22
|
+
## 🧠 What is the Core?
|
|
23
|
+
|
|
24
|
+
`@unsetsoft/ryunixjs` is the **foundational engine** of the RyunixJS framework.
|
|
25
|
+
It's a lightweight, high-performance library responsible for:
|
|
26
|
+
|
|
27
|
+
- **Reconciliation & Fiber Architecture**: Efficiently updating the DOM by
|
|
28
|
+
|
|
29
|
+
comparing Virtual DOM trees.
|
|
30
|
+
|
|
31
|
+
- **Hooks System**: Providing the core state and lifecycle management (e.g.,
|
|
32
|
+
|
|
33
|
+
`useStore`, `useEffect`).
|
|
34
|
+
|
|
35
|
+
- **Concurrent Rendering**: Support for prioritized updates and transitions.
|
|
36
|
+
- **SSR & Hydration**: Server-Side Rendering engines for both Node.js and Edge
|
|
37
|
+
|
|
38
|
+
environments.
|
|
39
|
+
|
|
40
|
+
While you can use it standalone for custom integrations, it is typically used
|
|
41
|
+
via `@unsetsoft/ryunix-presets` and our official CLI.
|
|
42
|
+
|
|
43
|
+
## 📘 TypeScript
|
|
44
|
+
|
|
45
|
+
Types ship in `types/index.d.ts` (main entry) and `jsx/jsx-runtime.d.ts`
|
|
46
|
+
(automatic JSX). Install `@unsetsoft/ryunixjs` as a dependency; no separate
|
|
47
|
+
`@types` package is required.
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
import {
|
|
51
|
+
useStore,
|
|
52
|
+
createElement,
|
|
53
|
+
type RyunixElement,
|
|
54
|
+
} from '@unsetsoft/ryunixjs'
|
|
55
|
+
|
|
56
|
+
function Counter(): RyunixElement {
|
|
57
|
+
const [count, setCount] = useStore(0)
|
|
58
|
+
return createElement('button', { onClick: () => setCount(count + 1) }, count)
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
For JSX, set `"jsxImportSource": "@unsetsoft/ryunixjs"` in your `tsconfig.json`
|
|
63
|
+
(or use the Ryunix Webpack/SWC preset, which configures it for `.ryx` files).
|
|
64
|
+
|
|
65
|
+
## 🚀 Installation
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
npm install @unsetsoft/ryunixjs
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## 🛠️ API Reference
|
|
72
|
+
|
|
73
|
+
### Core Functions
|
|
74
|
+
|
|
75
|
+
- `createElement(type, props, ...children)`: Creates a Virtual DOM element.
|
|
76
|
+
- `render(element, container)`: Renders a Ryunix element into the DOM.
|
|
77
|
+
- `hydrate(element, container)`: Hydrates server-rendered HTML.
|
|
78
|
+
- `init()`: Initializes the Ryunix state.
|
|
79
|
+
|
|
80
|
+
### Hooks
|
|
81
|
+
|
|
82
|
+
| Hook | Description |
|
|
83
|
+
| :----------------------------- | :-------------------------------------------------- |
|
|
84
|
+
| `useStore(initial)` | State management (Ryunix equivalent of `useState`). |
|
|
85
|
+
| `useReducer(reducer, initial)` | Advanced state management with reducers. |
|
|
86
|
+
| `useEffect(cb, deps)` | Side effects management. |
|
|
87
|
+
| `useLayoutEffect(cb, deps)` | Synchronous side effects before browser paint. |
|
|
88
|
+
| `useRef(initial)` | Persistent reference across renders. |
|
|
89
|
+
| `useMemo(cb, deps)` | Memoized values. |
|
|
90
|
+
| `useCallback(cb, deps)` | Memoized functions. |
|
|
91
|
+
| `useContext(id)` | Consumes a context value. |
|
|
92
|
+
| `useId()` | Generates unique, stable IDs for SSR. |
|
|
93
|
+
|
|
94
|
+
### Specialized Hooks
|
|
95
|
+
|
|
96
|
+
- `usePersistentStore(key, initial)`: Automatically syncs state with
|
|
97
|
+
|
|
98
|
+
`localStorage`.
|
|
99
|
+
|
|
100
|
+
- `useSwitch(initial)`: Optimized toggle state hook.
|
|
101
|
+
- `useDebounce(value, delay)`: Debounces a value update.
|
|
102
|
+
- `useThrottle(value, interval)`: Throttles value updates.
|
|
103
|
+
- `useQuery()` / `useHash()`: Reactive URL parameters and hash.
|
|
104
|
+
|
|
105
|
+
### Concurrency & Server-Side
|
|
106
|
+
|
|
107
|
+
- **Prioritized Updates**: Use `useTransition` and `useDeferredValue` to manage
|
|
108
|
+
|
|
109
|
+
non-urgent UI updates.
|
|
110
|
+
|
|
111
|
+
- **SSR Engine**: `renderToString` and `renderToReadableStream` for flexible
|
|
112
|
+
|
|
113
|
+
server rendering.
|
|
114
|
+
|
|
115
|
+
- **Boundaries**: `ServerBoundary` and `ErrorBoundary` for resilient
|
|
116
|
+
|
|
117
|
+
applications.
|
|
118
|
+
|
|
119
|
+
## 🏗️ Example Usage
|
|
120
|
+
|
|
121
|
+
```javascript
|
|
122
|
+
import { render, useStore, createElement } from '@unsetsoft/ryunixjs'
|
|
123
|
+
|
|
124
|
+
function App() {
|
|
125
|
+
const [count, setCount] = useStore(0)
|
|
126
|
+
|
|
127
|
+
return createElement(
|
|
128
|
+
'div',
|
|
129
|
+
null,
|
|
130
|
+
createElement('h1', null, `Count: ${count}`),
|
|
131
|
+
createElement(
|
|
132
|
+
'button',
|
|
133
|
+
{ onClick: () => setCount(count + 1) },
|
|
134
|
+
'Increment',
|
|
135
|
+
),
|
|
136
|
+
)
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
render(createElement(App), document.getElementById('root'))
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## 📄 License
|
|
143
|
+
|
|
144
|
+
RyunixJS is [MIT Licensed](../../LICENSE).
|