Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc #119

Merged
merged 10 commits into from
Jan 12, 2024
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": true,
"fixed": [["helux", "@helux/core", "@helux/hooks", "@helux/hooks-impl", "@helux/types", "@helux/utils"]],
"fixed": [["helux", "@helux/core", "@helux/openinula", "@helux/hooks", "@helux/hooks-impl", "@helux/types", "@helux/utils"]],
"linked": [],
"access": "restricted",
"baseBranch": "master",
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ function Demo2() {

```tsx
// 只会引起h1标签内部重渲染
<h1>${numAtom}</h1>
<h1>{$(numAtom)}</h1>

// 格式化
<h1>{$(numAtom, num=>`hi helux ${num.val}`)}</h1>
<h1>{$(numAtom.val, num=>`hi helux ${num}`)}</h1>
```

块响应
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/api/hooks/use-watch-effect.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ order: 4

# useWatchEffect

`useWatchEffect` 功能同 `watchEffect``一样,区别在于 `useWatchEffect` 会立即执行回调,自动对首次运行时函数内读取到的值完成变化监听。
`useWatchEffect` 功能同 `watchEffect`一样,区别在于 `useWatchEffect` 会立即执行回调,自动对首次运行时函数内读取到的值完成变化监听。

:::info
其他使用方式可参考[watchEffect](/api/hooks/use-effect)
Expand Down Expand Up @@ -46,4 +46,4 @@ export default function Comp(props: any) {
</div>
);
}
```
```
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"@makotot/ghostui": "^2.0.0",
"animated-scroll-to": "^2.3.0",
"classnames": "^2.5.0",
"helux": "4.1.0",
"helux": "4.1.3",
"lodash": "^4.17.21",
"lodash.throttle": "^4.1.1",
"prism-react-renderer": "^2.3.1",
Expand Down
2 changes: 1 addition & 1 deletion docs/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
"helux-docs/*": ["src/*", "*"]
}
},
"include": [".dumirc.ts", "src/**/*"]
"include": [".dumirc.ts", "src/**/*", "docs/**/*"]
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "helux",
"version": "4.0.3",
"version": "4.1.2",
"description": "A state engine integrates atom, signal, derive, watch and dep tracking, supports fine-grained responsive updates, it is compatible with all react like libs (including React 18).",
"keywords": [],
"author": {
Expand Down
28 changes: 28 additions & 0 deletions packages/helux-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# @helux/core

## 4.1.3

### Patch Changes

- @helux/[email protected]
- @helux/[email protected]
- @helux/[email protected]

## 4.1.2

### Patch Changes

- b4a9cee: build(4.1.2): bump limu to get length and size dep
- Updated dependencies [b4a9cee]
- @helux/[email protected]
- @helux/[email protected]
- @helux/[email protected]

## 4.1.1

### Patch Changes

- b8d690b: build(4.1.1):bump limu to fix reading IS_RAW problem
- Updated dependencies [b8d690b]
- @helux/[email protected]
- @helux/[email protected]
- @helux/[email protected]

## 4.1.0

### Minor Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/helux-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@helux/core",
"version": "4.1.0",
"version": "4.1.3",
"description": "A state library core integrates atom, signal, collection dep, derive and watch, it supports all react like frameworks.",
"bugs": {
"url": "https://github.com/heluxjs/helux/issues"
Expand Down Expand Up @@ -35,7 +35,7 @@
"@helux/hooks-impl": "workspace:^",
"@helux/types": "workspace:^",
"@helux/utils": "workspace:^",
"limu": "^3.12.1"
"limu": "^3.12.3"
},
"devDependencies": {
"esbuild-copy-static-files": "^0.1.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/helux-core/src/consts/user.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { VER as limuVer } from 'limu';

export const VER = '4.1.0';
export const VER = '4.1.2';

export const LIMU_VER = limuVer;

Expand Down
6 changes: 3 additions & 3 deletions packages/helux-core/src/types/api.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
|------------------------------------------------------------------------------------------------
| [email protected].0
| [email protected].2
| A state library core that integrates atom, signal, collection dep, derive and watch,
| it supports all react like frameworks ( including react 18 ).
|------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -68,7 +68,7 @@ import type {
} from './base';

export declare const cst: {
VER: '4.1.0';
VER: '4.1.2';
LIMU_VER: string;
EVENT_NAME: {
ON_DATA_CHANGED: 'ON_DATA_CHANGED';
Expand Down Expand Up @@ -261,7 +261,7 @@ export function watchEffect(
* });
* ```
*/
export function useAtom<T = any>(
export function useAtom<T extends SharedState = any>(
sharedState: T,
options?: IUseSharedStateOptions<T>,
): [
Expand Down
2 changes: 1 addition & 1 deletion packages/helux-demo-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"dependencies": {
"@types/react": ">=16.0.0",
"@types/react-dom": ">=16.0.0",
"helux": "^4.1.0",
"helux": "^4.1.3",
"react": ">=16.10.2",
"react-dom": ">=16.10.2"
},
Expand Down
25 changes: 25 additions & 0 deletions packages/helux-hooks-impl/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# @helux/hooks-impl

## 4.1.3

### Patch Changes

- @helux/[email protected]
- @helux/[email protected]

## 4.1.2

### Patch Changes

- b4a9cee: build(4.1.2): bump limu to get length and size dep
- Updated dependencies [b4a9cee]
- @helux/[email protected]
- @helux/[email protected]

## 4.1.1

### Patch Changes

- b8d690b: build(4.1.1):bump limu to fix reading IS_RAW problem
- Updated dependencies [b8d690b]
- @helux/[email protected]
- @helux/[email protected]

## 4.1.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/helux-hooks-impl/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@helux/hooks-impl",
"version": "4.1.0",
"version": "4.1.3",
"description": "helux hooks implement lib",
"bugs": {
"url": "https://github.com/heluxjs/helux/issues"
Expand Down
28 changes: 28 additions & 0 deletions packages/helux-hooks/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# @helux/hooks

## 4.1.3

### Patch Changes

- @helux/[email protected]
- @helux/[email protected]
- @helux/[email protected]

## 4.1.2

### Patch Changes

- b4a9cee: build(4.1.2): bump limu to get length and size dep
- Updated dependencies [b4a9cee]
- @helux/[email protected]
- @helux/[email protected]
- @helux/[email protected]

## 4.1.1

### Patch Changes

- b8d690b: build(4.1.1):bump limu to fix reading IS_RAW problem
- Updated dependencies [b8d690b]
- @helux/[email protected]
- @helux/[email protected]
- @helux/[email protected]

## 4.1.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/helux-hooks/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@helux/hooks",
"version": "4.1.0",
"version": "4.1.3",
"description": "helux hooks lib for react",
"keywords": [
"helux",
Expand Down
10 changes: 10 additions & 0 deletions packages/helux-openinula/.babelrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
presets: [
[
'@babel/preset-env',
{
modules: false,
},
],
],
};
24 changes: 24 additions & 0 deletions packages/helux-openinula/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# @helux/openinula

## 4.1.3

### Patch Changes

- dc97a2f: build(4.1.3): openinula
- @helux/[email protected]

## 4.1.2

### Patch Changes

- b4a9cee: build(4.1.2): bump limu to get length and size dep
- Updated dependencies [b4a9cee]
- @helux/[email protected]

## 4.1.1

### Patch Changes

- b8d690b: build(4.1.1):bump limu to fix reading IS_RAW problem
- Updated dependencies [b8d690b]
- @helux/[email protected]
17 changes: 17 additions & 0 deletions packages/helux-openinula/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# helux-openinula

对接 helux-core 供 `openinula` 使用的状态库

## desc

[helux](https://heluxjs.github.io/helux),集原子,信号、依赖追踪为一体,支持细粒度响应式更新的状态引擎(兼容所有类 react 库,包括 react18)

### install

```bash
npm i @helux/openinula
```

### online demo

https://codesandbox.io/p/devbox/helux-openinula-66gfj2
3 changes: 3 additions & 0 deletions packages/helux-openinula/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from '@helux/core/src/types/api';
export * from '@helux/core/src/types/base';
export * from '@helux/core/src/types/model';
45 changes: 45 additions & 0 deletions packages/helux-openinula/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "@helux/openinula",
"version": "4.1.3",
"description": "State library for preact that integrates atom, signal, collection dep, derive and watch.",
"bugs": {
"url": "https://github.com/heluxjs/helux/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/heluxjs/helux",
"directory": "packages/helux"
},
"license": "MIT",
"author": {
"name": "fantasticsoul",
"email": "[email protected]",
"url": "https://github.com/fantasticsoul"
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "src/index.d.ts",
"files": [
"dist",
"src",
"README.md",
"tsconfig.json"
],
"scripts": {
"build": "tsup",
"build:watch": "tsup --watch",
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"@helux/core": "workspace:^"
},
"peerDependencies": {
"openinula": "0.1.2-SNAPSHOT"
},
"bundleDependencies": [],
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
},
"deprecated": false
}
Loading