@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 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
- ## 🚀 Instalación
44
-
45
- ```bash
46
- npm install @unsetsoft/ryunixjs
47
- ```
48
-
49
- ## 🛠️ Referencia de API
50
-
51
- ### Funciones principales
52
-
53
- - `createElement(type, props, ...children)`: crea un elemento de Virtual DOM.
54
- - `render(element, container)`: renderiza un elemento Ryunix en el DOM.
55
- - `hydrate(element, container)`: hidrata HTML generado en servidor.
56
- - `init()`: inicializa el estado de Ryunix.
57
-
58
- ### Hooks
59
-
60
- | Hook | Descripción |
61
- | :----------------------------- | :------------------------------------------------------- |
62
- | `useStore(initial)` | Gestión de estado (equivalente Ryunix de `useState`). |
63
- | `useReducer(reducer, initial)` | Estado avanzado con reducers. |
64
- | `useEffect(cb, deps)` | Efectos secundarios. |
65
- | `useLayoutEffect(cb, deps)` | Efectos síncronos antes del pintado del navegador. |
66
- | `useRef(initial)` | Referencia persistente entre renders. |
67
- | `useMemo(cb, deps)` | Valores memorizados. |
68
- | `useCallback(cb, deps)` | Funciones memorizadas. |
69
- | `useContext(id)` | Consume un valor de contexto. |
70
- | `useId()` | Genera IDs únicos y estables para SSR. |
71
-
72
- ### Hooks especializados
73
-
74
- - `usePersistentStore(key, initial)`: sincroniza el estado con
75
-
76
- `localStorage` automáticamente.
77
-
78
- - `useSwitch(initial)`: hook optimizado para estado booleano.
79
- - `useDebounce(value, delay)`: aplaza actualizaciones de un valor.
80
- - `useThrottle(value, interval)`: limita la frecuencia de actualizaciones.
81
- - `useQuery()` / `useHash()`: parámetros de URL y hash reactivos.
82
-
83
- ### Concurrencia y servidor
84
-
85
- - **Actualizaciones priorizadas**: usa `useTransition` y `useDeferredValue` para
86
-
87
- actualizaciones de UI no urgentes.
88
-
89
- - **Motor SSR**: `renderToString` y `renderToReadableStream` para renderizado
90
-
91
- flexible en servidor.
92
-
93
- - **Límites**: `ServerBoundary` y `ErrorBoundary` para aplicaciones resilientes.
94
-
95
- ## 🏗️ Ejemplo de uso
96
-
97
- ```javascript
98
- import { render, useStore, createElement } from '@unsetsoft/ryunixjs'
99
-
100
- function App() {
101
- const [count, setCount] = useStore(0)
102
-
103
- return createElement(
104
- 'div',
105
- null,
106
- createElement('h1', null, `Count: ${count}`),
107
- createElement(
108
- 'button',
109
- { onClick: () => setCount(count + 1) },
110
- 'Increment',
111
- ),
112
- )
113
- }
114
-
115
- render(createElement(App), document.getElementById('root'))
116
- ```
117
-
118
- ## 📄 Licencia
119
-
120
- RyunixJS tiene [licencia MIT](../../LICENSE).
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
- ## 🚀 Installation
44
-
45
- ```bash
46
- npm install @unsetsoft/ryunixjs
47
- ```
48
-
49
- ## 🛠️ API Reference
50
-
51
- ### Core Functions
52
-
53
- - `createElement(type, props, ...children)`: Creates a Virtual DOM element.
54
- - `render(element, container)`: Renders a Ryunix element into the DOM.
55
- - `hydrate(element, container)`: Hydrates server-rendered HTML.
56
- - `init()`: Initializes the Ryunix state.
57
-
58
- ### Hooks
59
-
60
- | Hook | Description |
61
- | :----------------------------- | :-------------------------------------------------- |
62
- | `useStore(initial)` | State management (Ryunix equivalent of `useState`). |
63
- | `useReducer(reducer, initial)` | Advanced state management with reducers. |
64
- | `useEffect(cb, deps)` | Side effects management. |
65
- | `useLayoutEffect(cb, deps)` | Synchronous side effects before browser paint. |
66
- | `useRef(initial)` | Persistent reference across renders. |
67
- | `useMemo(cb, deps)` | Memoized values. |
68
- | `useCallback(cb, deps)` | Memoized functions. |
69
- | `useContext(id)` | Consumes a context value. |
70
- | `useId()` | Generates unique, stable IDs for SSR. |
71
-
72
- ### Specialized Hooks
73
-
74
- - `usePersistentStore(key, initial)`: Automatically syncs state with
75
-
76
- `localStorage`.
77
-
78
- - `useSwitch(initial)`: Optimized toggle state hook.
79
- - `useDebounce(value, delay)`: Debounces a value update.
80
- - `useThrottle(value, interval)`: Throttles value updates.
81
- - `useQuery()` / `useHash()`: Reactive URL parameters and hash.
82
-
83
- ### Concurrency & Server-Side
84
-
85
- - **Prioritized Updates**: Use `useTransition` and `useDeferredValue` to manage
86
-
87
- non-urgent UI updates.
88
-
89
- - **SSR Engine**: `renderToString` and `renderToReadableStream` for flexible
90
-
91
- server rendering.
92
-
93
- - **Boundaries**: `ServerBoundary` and `ErrorBoundary` for resilient
94
-
95
- applications.
96
-
97
- ## 🏗️ Example Usage
98
-
99
- ```javascript
100
- import { render, useStore, createElement } from '@unsetsoft/ryunixjs'
101
-
102
- function App() {
103
- const [count, setCount] = useStore(0)
104
-
105
- return createElement(
106
- 'div',
107
- null,
108
- createElement('h1', null, `Count: ${count}`),
109
- createElement(
110
- 'button',
111
- { onClick: () => setCount(count + 1) },
112
- 'Increment',
113
- ),
114
- )
115
- }
116
-
117
- render(createElement(App), document.getElementById('root'))
118
- ```
119
-
120
- ## 📄 License
121
-
122
- RyunixJS is [MIT Licensed](../../LICENSE).
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).