@virtuoso.dev/gurx
Advanced tools
+6
-0
| # Change Log - @virtuoso.dev/gurx | ||
| ## 1.2.0 | ||
| ### Minor Changes | ||
| - [#1318](https://github.com/petyosi/react-virtuoso/pull/1318) [`8d47a4d`](https://github.com/petyosi/react-virtuoso/commit/8d47a4d8a7ecdd4caa36eb336b6921738d73f425) Thanks [@petyosi](https://github.com/petyosi)! - Updated API reference | ||
| ## 1.1.1 | ||
@@ -4,0 +10,0 @@ |
+5
-5
@@ -1,2 +0,2 @@ | ||
| import { JSX as JSX_2 } from 'react/jsx-runtime'; | ||
| import { JSX } from 'react/jsx-runtime'; | ||
| import * as React_2 from 'react'; | ||
@@ -17,3 +17,3 @@ | ||
| * @category Nodes | ||
| * @remark An action is just a signal with `void` value. It can be used to trigger side effects. | ||
| * @remarks An action is just a signal with `void` value. It can be used to trigger side effects. | ||
| */ | ||
@@ -589,3 +589,3 @@ export declare function Action(init?: NodeInit<void>): NodeRef<void>; | ||
| * Gets the current value of a node. The node must be stateful. | ||
| * @remark if possible, use {@link withLatestFrom} or {@link combine}, as getValue will not create a dependency to the passed node, | ||
| * @remarks If possible, use {@link withLatestFrom} or {@link combine}, as getValue will not create a dependency to the passed node, | ||
| * which means that if you call it within a computational cycle, you may not get the correct value. | ||
@@ -818,3 +818,3 @@ * @param node - the node instance. | ||
| updateWith?: Record<string, unknown>; | ||
| }): JSX_2.Element; | ||
| }): JSX.Element; | ||
@@ -879,3 +879,3 @@ /** | ||
| * | ||
| * @remark If you need the values of multiple nodes from the realm and those nodes might change in the same computiation, you can `useCellValues` to reduce re-renders. | ||
| * @remarks If you need the values of multiple nodes from the realm and those nodes might change in the same computation, you can `useCellValues` to reduce re-renders. | ||
| * | ||
@@ -882,0 +882,0 @@ * @returns The current value of the cell. |
+5
-5
@@ -160,3 +160,3 @@ var T = Object.defineProperty; | ||
| * Gets the current value of a node. The node must be stateful. | ||
| * @remark if possible, use {@link withLatestFrom} or {@link combine}, as getValue will not create a dependency to the passed node, | ||
| * @remarks If possible, use {@link withLatestFrom} or {@link combine}, as getValue will not create a dependency to the passed node, | ||
| * which means that if you call it within a computational cycle, you may not get the correct value. | ||
@@ -511,3 +511,3 @@ * @param node - the node instance. | ||
| function ct(s) { | ||
| return (t, e) => { | ||
| return ((t, e) => { | ||
| const n = e.signalInstance(); | ||
@@ -521,6 +521,6 @@ return e.connect({ | ||
| }), n; | ||
| }; | ||
| }); | ||
| } | ||
| function at(...s) { | ||
| return (t, e) => { | ||
| return ((t, e) => { | ||
| const n = e.signalInstance(); | ||
@@ -535,3 +535,3 @@ return e.connect({ | ||
| }), n; | ||
| }; | ||
| }); | ||
| } | ||
@@ -538,0 +538,0 @@ function lt(s) { |
+28
-25
@@ -6,19 +6,14 @@ { | ||
| "type": "module", | ||
| "version": "1.1.1", | ||
| "version": "1.2.0", | ||
| "module": "dist/index.js", | ||
| "main": "dist/index.js", | ||
| "types": "dist/index.d.ts", | ||
| "scripts": { | ||
| "build": "tsc && vite build", | ||
| "test": "vitest", | ||
| "ci-lint": "eslint", | ||
| "lint": "eslint", | ||
| "typecheck": "tsc --noEmit" | ||
| }, | ||
| "publishConfig": { | ||
| "access": "public" | ||
| "access": "public", | ||
| "provenance": true | ||
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "https://github.com/petyosi/react-virtuoso.git" | ||
| "url": "git+https://github.com/petyosi/react-virtuoso.git", | ||
| "directory": "packages/gurx" | ||
| }, | ||
@@ -31,19 +26,20 @@ "license": "MIT", | ||
| "devDependencies": { | ||
| "@microsoft/api-extractor": "^7.48.0", | ||
| "@microsoft/api-extractor": "^7.55.1", | ||
| "@types/node": "^22.10.1", | ||
| "@types/react": "^18.3.12", | ||
| "@types/react-dom": "^18.3.1", | ||
| "@virtuoso.dev/tooling": "*", | ||
| "@vitejs/plugin-react-swc": "^3.7.2", | ||
| "@vitest/browser": "3.1.1", | ||
| "@types/react": "^19.2.7", | ||
| "@types/react-dom": "^19.2.3", | ||
| "@vitejs/plugin-react": "^4.7.0", | ||
| "@vitest/browser": "^4.0.16", | ||
| "@vitest/browser-playwright": "^4.0.16", | ||
| "eslint": "^9.24.0", | ||
| "playwright": "^1.49.0", | ||
| "prettier": "^3.5.3", | ||
| "react": "^18.3.1", | ||
| "react-dom": "^18.3.1", | ||
| "typescript": "~5.7.2", | ||
| "vite": "^6.2.6", | ||
| "vite-plugin-dts": "~4.4.0", | ||
| "vitest": "3.1.1", | ||
| "vitest-browser-react": "^0.1.1" | ||
| "react": "^19.2.0", | ||
| "react-dom": "^19.2.0", | ||
| "typescript": "~5.9.3", | ||
| "vite": "^6.4.1", | ||
| "vite-plugin-dts": "^4.5.4", | ||
| "vitest": "^4.0.16", | ||
| "vitest-browser-react": "^2.0.2", | ||
| "@virtuoso.dev/tooling": "0.1.0" | ||
| }, | ||
@@ -53,3 +49,10 @@ "files": [ | ||
| "CHANGELOG.md" | ||
| ] | ||
| } | ||
| ], | ||
| "scripts": { | ||
| "build": "tsc && vite build", | ||
| "test": "vitest", | ||
| "ci-lint": "eslint", | ||
| "lint": "eslint", | ||
| "typecheck": "tsgo --noEmit" | ||
| } | ||
| } |
+18
-13
@@ -1,19 +0,16 @@ | ||
| # Push-based state management | ||
| # Gurx | ||
| Welcome to the README of Gurx, an typescript-native reactive state management library for complex web applications and components that do not have the symmetry of the store object and the component tree. | ||
| [](https://www.npmjs.com/package/@virtuoso.dev/gurx) [](https://www.npmjs.com/package/@virtuoso.dev/gurx) [](https://github.com/petyosi/react-virtuoso/blob/master/LICENSE) [](https://www.typescriptlang.org/) | ||
| ## Why should you consider Gurx? | ||
| A TypeScript-native reactive state management library for complex web applications and components that do not have the symmetry of the store object and the component tree. | ||
| - **Push-based recalculation model**. Unlike the regular, "pull", imperative state recalculation model. Gurx uses a push-based model, where data flows through pipes described with functional operators. Among other benefits, this lets you publish values into multiple nodes **and** subscribe for changes in multiple nodes simultaneously, reducing the amount of UI re-renders. | ||
| ## Features | ||
| - **Open and Extendable**. The cell/signal definition approach lets you extend the logic of the state management by connecting more nodes and interactions to the existing ones in multiple modules. This lets you design your state management as smaller distributed pieces and even build a plugin system on top of it. | ||
| - **Push-based recalculation model** - data flows through pipes described with functional operators, reducing UI re-renders | ||
| - **Open and extendable** - cell/signal definition approach lets you extend logic by connecting more nodes in multiple modules | ||
| - **Optimized** - nodes are distinct by default, pushing through subscribers only when values change | ||
| - **Type-safe** - cells and signals are typed and carry the right value types through operators and React hooks | ||
| - **Testable** - easily initiate a realm and interact with nodes outside of React for unit testing | ||
| - **React friendly** - ships with a Realm provider component and hooks using `useSyncExternalStore` | ||
| - **Optimized**. The Gurx nodes are distinct by default. A distinct node pushes through its subscribers only when a value different than the previous one is published. This allows you to avoid expensive computations and re-renders. | ||
| - **Type-safe**. cells and signals are typed and carry the right value types through the node operators and the React hooks that refer them. | ||
| - **Testable**. You can easily initiate a realm and interact with your nodes outside of React. This makes it easy to unit-test your state management logic. | ||
| - **React friendly**. Gurx ships a Realm provider component and set of hooks that let you access the values and publish new values in the given nodes. Under the hood, the hooks use `useSyncExternalStore`. | ||
| ## Conceptual Overview | ||
@@ -163,1 +160,9 @@ | ||
| The README is meant to give you a breath-first overview of the library. More details about the operators, hooks, and realm capabilities can be found in the API Reference. | ||
| ## Links | ||
| - [Documentation](https://virtuoso.dev/gurx/) | ||
| - [API Reference](https://virtuoso.dev/gurx/api-reference/) | ||
| - [Contributing](https://github.com/petyosi/react-virtuoso/blob/master/CONTRIBUTING.md) | ||
| - [Changelog](./CHANGELOG.md) | ||
| - [License](./LICENSE) |
73433
0.36%168
3.07%18
5.88%