Match-id-42e6b77b81d3f947899d8ede0998c2c788be124a

This commit is contained in:
* 2023-03-15 21:04:26 +08:00
parent 1aa5c9041a
commit 1f39614397
5 changed files with 49 additions and 25 deletions

View File

@ -1,3 +1,7 @@
## 0.0.41 (2023-03-15)
- **core**: #105 redux + forwardRef组合使用场景会报错redux获取组件类型不对
- **core**: 增加jsx-dev-runtime文件给vite使用
## 0.0.40 (2023-03-08)
- **core**: #103 使用Memo、React.forwardRef包装组件后defaultProps失效
- **core**: #104 --max-segment-num的style无法使用

View File

@ -18,6 +18,8 @@ import {
TYPE_PROFILER as Profiler,
TYPE_STRICT_MODE as StrictMode,
TYPE_SUSPENSE as Suspense,
TYPE_FORWARD_REF as ForwardRef,
TYPE_MEMO as Memo,
} from './src/external/JSXElementType';
import { Component, PureComponent } from './src/renderer/components/BaseClassComponent';
@ -87,10 +89,6 @@ const Horizon = {
useReducer,
useRef,
useState,
Fragment,
Profiler,
StrictMode,
Suspense,
createElement,
cloneElement,
isValidElement,
@ -115,9 +113,16 @@ const Horizon = {
isPortal,
isContextProvider,
isContextConsumer,
ForwardRef,
Memo,
Fragment,
Profiler,
StrictMode,
Suspense,
};
export const version = __VERSION__;
// export const version = __VERSION__;
export const version = '0.0.40';
export {
Children,
createRef,
@ -137,10 +142,6 @@ export {
useReducer,
useRef,
useState,
Fragment,
Profiler,
StrictMode,
Suspense,
createElement,
cloneElement,
isValidElement,
@ -167,6 +168,12 @@ export {
isPortal,
isContextProvider,
isContextConsumer,
ForwardRef,
Memo,
Fragment,
Profiler,
StrictMode,
Suspense,
};
export default Horizon;

View File

@ -4,7 +4,7 @@
"keywords": [
"horizon"
],
"version": "0.0.40",
"version": "0.0.41",
"homepage": "",
"bugs": "",
"main": "index.js",

View File

@ -18,6 +18,7 @@ import { TYPE_FORWARD_REF } from '../../external/JSXElementType';
export function forwardRef(render: Function) {
return {
vtype: TYPE_FORWARD_REF,
$$typeof: TYPE_FORWARD_REF, // 规避三方件hoist-non-react-statics中通过$$typeof获取类型但获取不到导致的错误
render,
};
}

View File

@ -20,8 +20,8 @@ import fs from 'fs';
import replace from '@rollup/plugin-replace';
import copy from './copy-plugin';
import execute from 'rollup-plugin-execute';
import { terser } from 'rollup-plugin-terser';
import { version as horizonVersion } from '@cloudsop/horizon/package.json';
import {terser} from 'rollup-plugin-terser';
import {version as horizonVersion} from '@cloudsop/horizon/package.json';
const extensions = ['.js', '.ts'];
@ -107,17 +107,29 @@ function genConfig(mode) {
}
function genJSXRuntimeConfig(mode) {
return {
input: path.resolve(libDir, 'jsx-runtime.ts'),
output: [
{
file: outputResolve('jsx-runtime.js'),
format: 'cjs',
}
],
plugins: [
...getBasicPlugins(mode)
]
};
return {
input: path.resolve(libDir, 'jsx-runtime.ts'),
output: {
file: outputResolve('jsx-runtime.js'),
format: 'cjs',
},
plugins: [
...getBasicPlugins(mode)
]
};
}
export default [genConfig('development'), genConfig('production'), genJSXRuntimeConfig('')];
function genJSXDEVRuntimeConfig(mode) {
return {
input: path.resolve(libDir, 'jsx-dev-runtime.ts'),
output: {
file: outputResolve('jsx-dev-runtime.js'),
format: 'cjs',
},
plugins: [
...getBasicPlugins(mode)
]
};
}
export default [genConfig('development'), genConfig('production'), genJSXRuntimeConfig(''), genJSXDEVRuntimeConfig('')];