@unsetsoft/ryunixjs 1.2.4 → 1.2.5-canary.0
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 +91 -19
- package/dist/Ryunix.esm.js +3266 -1677
- package/dist/Ryunix.esm.js.map +1 -1
- package/dist/Ryunix.umd.js +3291 -1676
- 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.js +6 -6
- package/jsx/jsx-runtime.js +56 -56
- package/package.json +17 -20
package/README.md
CHANGED
|
@@ -1,19 +1,91 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/UnSetSoft/Ryunixjs/canary/assets/logo.png" width="200" height="200" alt="RyunixJS Logo" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">@unsetsoft/ryunixjs</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://www.npmjs.com/package/@unsetsoft/ryunixjs">
|
|
9
|
+
<img src="https://img.shields.io/npm/v/@unsetsoft/ryunixjs.svg?style=flat-square" alt="npm version" />
|
|
10
|
+
</a>
|
|
11
|
+
<a href="https://www.npmjs.com/package/@unsetsoft/ryunixjs/v/canary">
|
|
12
|
+
<img src="https://img.shields.io/npm/v/@unsetsoft/ryunixjs/canary.svg?style=flat-square&label=canary" alt="canary version" />
|
|
13
|
+
</a>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 🧠 What is the Core?
|
|
19
|
+
|
|
20
|
+
`@unsetsoft/ryunixjs` is the **foundational engine** of the RyunixJS framework. It's a lightweight, high-performance library responsible for:
|
|
21
|
+
|
|
22
|
+
- **Reconciliation & Fiber Architecture**: Efficiently updating the DOM by comparing Virtual DOM trees.
|
|
23
|
+
- **Hooks System**: Providing the core state and lifecycle management (e.g., `useStore`, `useEffect`).
|
|
24
|
+
- **Concurrent Rendering**: Support for prioritized updates and transitions.
|
|
25
|
+
- **SSR & Hydration**: Server-Side Rendering engines for both Node.js and Edge environments.
|
|
26
|
+
|
|
27
|
+
While you can use it standalone for custom integrations, it is typically used via `@unsetsoft/ryunix-presets` and our official CLI.
|
|
28
|
+
|
|
29
|
+
## 🚀 Installation
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm install @unsetsoft/ryunixjs
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## 🛠️ API Reference
|
|
36
|
+
|
|
37
|
+
### Core Functions
|
|
38
|
+
|
|
39
|
+
- `createElement(type, props, ...children)`: Creates a Vitual DOM element.
|
|
40
|
+
- `render(element, container)`: Renders a Ryunix element into the DOM.
|
|
41
|
+
- `hydrate(element, container)`: Hydrates server-rendered HTML.
|
|
42
|
+
- `init()`: Initializes the Ryunix state.
|
|
43
|
+
|
|
44
|
+
### Hooks
|
|
45
|
+
|
|
46
|
+
| Hook | Description |
|
|
47
|
+
| :--- | :--- |
|
|
48
|
+
| `useStore(initial)` | State management (Ryunix equivalent of `useState`). |
|
|
49
|
+
| `useReducer(reducer, initial)` | Advanced state management with reducers. |
|
|
50
|
+
| `useEffect(cb, deps)` | Side effects management. |
|
|
51
|
+
| `useLayoutEffect(cb, deps)` | Synchronous side effects before browser paint. |
|
|
52
|
+
| `useRef(initial)` | Persistent reference across renders. |
|
|
53
|
+
| `useMemo(cb, deps)` | Memoized values. |
|
|
54
|
+
| `useCallback(cb, deps)` | Memoized functions. |
|
|
55
|
+
| `useContext(id)` | Consumes a context value. |
|
|
56
|
+
| `useId()` | Generates unique, stable IDs for SSR. |
|
|
57
|
+
|
|
58
|
+
### Specialized Hooks
|
|
59
|
+
|
|
60
|
+
- `usePersistentStore(key, initial)`: Automatically syncs state with `localStorage`.
|
|
61
|
+
- `useSwitch(initial)`: Optimized toggle state hook.
|
|
62
|
+
- `useDebounce(value, delay)`: Debounces a value update.
|
|
63
|
+
- `useThrottle(value, interval)`: Throttles value updates.
|
|
64
|
+
- `useQuery()` / `useHash()`: Reactive URL parameters and hash.
|
|
65
|
+
|
|
66
|
+
### Concurrency & Server-Side
|
|
67
|
+
|
|
68
|
+
- **Prioritized Updates**: Use `useTransition` and `useDeferredValue` to manage non-urgent UI updates.
|
|
69
|
+
- **SSR Engine**: `renderToString` and `renderToReadableStream` for flexible server rendering.
|
|
70
|
+
- **Boundaries**: `ServerBoundary` and `ErrorBoundary` for resilient applications.
|
|
71
|
+
|
|
72
|
+
## 🏗️ Example Usage
|
|
73
|
+
|
|
74
|
+
```javascript
|
|
75
|
+
import { render, useStore, createElement } from "@unsetsoft/ryunixjs";
|
|
76
|
+
|
|
77
|
+
function App() {
|
|
78
|
+
const [count, setCount] = useStore(0);
|
|
79
|
+
|
|
80
|
+
return createElement("div", null,
|
|
81
|
+
createElement("h1", null, `Count: ${count}`),
|
|
82
|
+
createElement("button", { onClick: () => setCount(count + 1) }, "Increment")
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
render(createElement(App), document.getElementById("root"));
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## 📄 License
|
|
90
|
+
|
|
91
|
+
RyunixJS is [MIT Licensed](file:///e:/proyects/Ryunixjs/LICENSE).
|