Change Log
3.0.1 (2023-08-02)
Bug Fix
- Resolving the error
Error: Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.in the SSR (Server-Side Rendering) scenario for Natur.
Improvements
- Introducing the
NaturBaseFactoryutility class to enhance the user development experience.
3.0.0 (2023-03-04)
- now
natur-serviceis deprecated,watchprops of module is recommended.import { ModuleEvent, AllModuleEvent, WatchAPI } from 'natur';export const moduleA = {state: {},actions: {/* ... */},watch: {moduleB(event: ModuleEvent, api: WatchAPI) {// any update of moduleB will trigger this function// event have any data of this change// api contain, getState, getMaps, localDispatch, getStore API etc.}}}export const moduleB = {state: {},actions: {/* ... */},// watch also can be a function to watch all module of storewatch: (event: AllModuleEvent, api: WatchAPI) => {// any update of any module will trigger this function// event have any data of this change// api contain, getState, getMaps, localDispatch, getStore API etc.}} - The dispatch API in
thunkMiddlewarewill soon be scrapped and replaced with a newlocalDispatchAPI that will only call actions from this module - The
subscribeandSubscribeAllAPI is enhanced to provide more comprehensive event information, as well as API argument to control the business
3.0.0-beta1 (2023-02-25)
Big change
- complete the refactoring of the typescript part
2.2.0 (2023-02-25)
Big Change
- Refactor inject from Class Component to Functional Component
- New
CreateUseInjectAPI.useInjectis recommended now. - New
store.subscribeAllAPI, listen to all module changes, no need to specify a module to listen to - New
ProviderAPI, better support for SSR and more than one store case. - New
CreateUseStoreAPI. - New
getStoreArguments of Middleware and Interceptor - Generics
Middleware/Interceptorchanged,They need 2 params(Modules and Lazy Modules, same asStore), and also have default params
Break Change
- Remove
watchAPI - Upgrade to React version 18, no longer compatible with React versions below 17
- if you want upgrade natur in react18-, you could try to use
use-sync-external-store, and put it into React object, before calling createInject/createUseInject
import {useSyncExternalStore} from 'use-sync-external-store/shim';import React from 'react';React.useSyncExternalStore = useSyncExternalStore; - if you want upgrade natur in react18-, you could try to use
2.2.0-beta7 (2023-02-10)
Big Change
- Add
flatoption inuseInjectAPI
bug fix
- type of createStore bug fix
3.0.0-alpha2 (2023-02-06)
Big change
-
The function of
Natur-servicewill be transplanted to natur itself and changed into a newwatchAPI for module communication and better grasp of businessimport { ModuleEvent, AllModuleEvent, WatchAPI } from 'natur';export const moduleA = {state: {},actions: {/* ... */},watch: {moduleB(event: ModuleEvent, api: WatchAPI) {// any update of moduleB will trigger this function// event have any data of this change// api contain, getState, getMaps, localDispatch, getStore API etc.}}}export const moduleB = {state: {},actions: {/* ... */},// watch also can be a function to watch all module of storewatch: (event: AllModuleEvent, api: WatchAPI) => {// any update of any module will trigger this function// event have any data of this change// api contain, getState, getMaps, localDispatch, getStore API etc.}} -
The dispatch API in
thunkMiddlewarewill soon be scrapped and replaced with a newlocalDispatchAPI that will only call actions from this module -
The
subscribeandSubscribeAllAPI is enhanced to provide more comprehensive event information, as well as API argument to control the business
2.2.0-beta5 (2023-02-04)
Big Change
- New
ProviderAPI, better support for SSR and more than one store case. - New
CreateUseStoreAPI. - New
getStoreArguments of Middleware and Interceptor - Generics
Middleware/Interceptorchanged,They need 2 params(Modules and Lazy Modules, same asStore), and also have default params
2.2.0-beta2 (2022-12-18)
Big Change
- Refactor inject from Class Component to Functional Component
- New
CreateUseInjectAPI.useInjectis recommended now. - New
store.subscribeAllAPI, listen to all module changes, no need to specify a module to listen to
Break Change
- Remove
watchAPI - Upgrade to React version 18, no longer compatible with React versions below 17