Skip to content

Commit

Permalink
feat: merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
fancyzhong committed Aug 31, 2024
2 parents dbb0627 + f5f92a5 commit 5f7c039
Show file tree
Hide file tree
Showing 24 changed files with 103 additions and 157 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 腾讯TNTWeb前端团队
Copyright (c) 2024 fantasticsoul

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"@types/node": ">=12.0.0",
"esbuild-plugin-external-global": "^1.0.1",
"helux": "workspace:^",
"limu": "^3.11.10"
"limu": "^3.13.0"
},
"devDependencies": {
"@babel/core": "^7.19.3",
Expand Down
12 changes: 12 additions & 0 deletions packages/helux-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# @helux/core

## 4.4.0

### Minor Changes

- a228a34: build(4.4.0): bump limu to support autoRevoke, avoid limu deepDrill maximum call

### Patch Changes

- @helux/hooks-impl@4.4.0
- @helux/types@4.4.0
- @helux/utils@4.4.0

## 4.3.6

### Patch 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.3.6",
"version": "4.4.0",
"description": "A reactive atomic state engine for React like.",
"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.4"
"limu": "^3.13.0"
},
"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.3.6';
export const VER = '4.4.0';

export const LIMU_VER = limuVer;

Expand Down
1 change: 1 addition & 0 deletions packages/helux-core/src/factory/creator/mutateDeep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ export function prepareDeepMutate(opts: IPrepareMutateOpts) {
const { forAtom, rawState } = internal;
const mutateCtx = newMutateCtx(setFactoryOpts);
const draftRoot = createDraft(rawState, {
autoRevoke: false,
customKeys: OP_KEYS,
onOperate: (opParams: IOperateParams) => {
if (opParams.isCustom) {
Expand Down
10 changes: 6 additions & 4 deletions packages/helux-core/src/helpers/state.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getSafeNext, warn } from '@helux/utils';
import { getSafeNext, warn, noop } from '@helux/utils';
import { RUN_AT_SERVER, SHARED_KEY } from '../consts';
import { getInternalMap } from '../factory/common/internal';
import { getSharedScope } from '../factory/common/speedup';
Expand Down Expand Up @@ -29,7 +29,9 @@ export function getRawState<T = Dict>(state: T): T {
}

/** TODO: get sub node of state */
export function getRawNode() {}
export function getRawNode() {
noop();
}

export function getSnap<T = Dict>(state: T, isPrev = true): T {
const internal = getInternal(state);
Expand Down Expand Up @@ -94,8 +96,8 @@ export function recordMod(sharedState: Dict, options: ParsedOptions) {
const locInfo = `\nloc1:${existedInternal.loc} \nloc2:${options.loc}`;
warn(
`only-dev-mode tip: moduleName ${moduleName} duplicate! `
+ 'this does not effect helux but the duplicated module will be ignored by devtool'
+ locInfo,
+ 'this does not effect helux but the duplicated module will be ignored by devtool'
+ locInfo,
);
}
return;
Expand Down
3 changes: 2 additions & 1 deletion packages/helux-core/src/hooks/useMutable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ export function useMutable<T extends object = PlainObject>(apiCtx: CoreApiCtx, i
const handleState = (partialStateOrCb: Partial<T> | PartialStateCb<T>, prevState: T) => {
let final = null;
if (isFn(partialStateOrCb)) {
const draft = createDraft(prevState);
// 不自动撤销结束后的草稿 proxy,使用户的闭包了子节点使用的场景不报错,但是此节点在结束草稿后只能读取不能修改(修改时无效的)
const draft = createDraft(prevState, { autoRevoke: false });
const mayPartial = partialStateOrCb(draft);
final = finishDraft(draft);
if (isObj(mayPartial)) {
Expand Down
2 changes: 1 addition & 1 deletion packages/helux-core/src/types/api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ import type {
} from './base';

export declare const cst: {
VER: '4.3.6';
VER: '4.4.0';
LIMU_VER: string;
EVENT_NAME: {
/** 共享状态创建时的事件 */
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.3.6",
"helux": "^4.4.0",
"react": ">=16.10.2",
"react-dom": ">=16.10.2"
},
Expand Down
7 changes: 7 additions & 0 deletions packages/helux-hooks-impl/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @helux/hooks-impl

## 4.4.0

### Patch Changes

- @helux/types@4.4.0
- @helux/utils@4.4.0

## 4.3.6

### Patch 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.3.6",
"version": "4.4.0",
"description": "helux hooks implement lib",
"bugs": {
"url": "https://github.com/heluxjs/helux/issues"
Expand Down
8 changes: 8 additions & 0 deletions packages/helux-hooks/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @helux/hooks

## 4.4.0

### Patch Changes

- @helux/hooks-impl@4.4.0
- @helux/types@4.4.0
- @helux/utils@4.4.0

## 4.3.6

### Patch 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.3.6",
"version": "4.4.0",
"description": "helux hooks lib for react",
"keywords": [
"helux",
Expand Down
11 changes: 11 additions & 0 deletions packages/helux-openinula/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# @helux/openinula

## 4.4.0

### Minor Changes

- a228a34: build(4.4.0): bump limu to support autoRevoke, avoid limu deepDrill maximum call

### Patch Changes

- Updated dependencies [a228a34]
- @helux/core@4.4.0

## 4.3.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/helux-openinula/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@helux/openinula",
"version": "4.3.6",
"version": "4.4.0",
"description": "State library for preact that integrates atom, signal, collection dep, derive and watch.",
"bugs": {
"url": "https://github.com/heluxjs/helux/issues"
Expand Down
2 changes: 1 addition & 1 deletion packages/helux-plugin-devtool/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"helux": "^4.3.6",
"helux": "^4.4.0",
"redux": "^4.2.1"
},
"devDependencies": {
Expand Down
2 changes: 2 additions & 0 deletions packages/helux-types/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# @helux/types

## 4.4.0

## 4.3.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/helux-types/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@helux/types",
"version": "4.3.6",
"version": "4.4.0",
"description": "helux common types lib",
"keywords": [
"helux",
Expand Down
6 changes: 6 additions & 0 deletions packages/helux-utils/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @helux/utils

## 4.4.0

### Patch Changes

- @helux/types@4.4.0

## 4.3.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/helux-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@helux/utils",
"version": "4.3.6",
"version": "4.4.0",
"description": "helux utils lib",
"keywords": [
"helux",
Expand Down
11 changes: 11 additions & 0 deletions packages/helux/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# helux

## 4.4.0

### Minor Changes

- a228a34: build(4.4.0): bump limu to support autoRevoke, avoid limu deepDrill maximum call

### Patch Changes

- Updated dependencies [a228a34]
- @helux/core@4.4.0

## 4.3.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/helux/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "helux",
"version": "4.3.6",
"version": "4.4.0",
"description": "A reactive atomic state engine for React( including React 18).",
"bugs": {
"url": "https://github.com/heluxjs/helux/issues"
Expand Down
Loading

0 comments on commit 5f7c039

Please sign in to comment.