@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 CHANGED
@@ -1,19 +1,91 @@
1
- <img src="https://raw.githubusercontent.com/UnSetSoft/Ryunixjs/canary/assets/logo.png" width="200" height="200" style="
2
- display: block;
3
- margin: 0 auto;" />
4
-
5
- ## RyunixJS [![npm version](https://img.shields.io/npm/v/@unsetsoft/ryunixjs.svg?style=flat)](https://www.npmjs.com/package/@unsetsoft/ryunixjs)[![npm version](https://img.shields.io/npm/v/@unsetsoft/ryunixjs/canary.svg?style=flat)](https://www.npmjs.com/package/@unsetsoft/ryunixjs/v/canary)
6
-
7
- ### What is RyunixJS?
8
-
9
- Like React, NextJS, Preact, Vite. Ryunix allows you to build static websites from JavaScript in a similar way to the aforementioned frameworks. However, Ryunix is planned to be completely standalone, i.e. without including React internally. This way allowing it to be more manageable and moldable for each developer. The reactivity of Ryunix is similar to Preact, however, it does not pretend to follow any standard of React or any similar Framework, but to allow to generate an SPA in its own way.
10
-
11
- ### Usage
12
-
13
- `npx @unsetsoft/cra@latest <my-app>`
14
-
15
- ### Do you want to contribute?
16
-
17
- You can make any change as long as it does not affect the `canary` branches. Make changes that are important, necessary or to add something new if you see it necessary, include your proposal before in an issue and then create a PR referencing that issue.
18
-
19
- To be able to work more comfortably you should create a branch with this name `gh/[user]/[branch name]`, all changes should always go to the canary version. Once the changes are applied and no problems are detected, they will become part of the nightly version for further testing and finally the final version will be released. make each change with a simple descriptive message, and remember not to change the version of the mono repo or packages, such changes are made manually when a new update is about to be made.
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).