Skip to content

feat: add rslib #570

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

Open
wants to merge 1 commit into
base: v3
Choose a base branch
from
Open

feat: add rslib #570

wants to merge 1 commit into from

Conversation

ianzone
Copy link
Contributor

@ianzone ianzone commented Apr 23, 2025

  1. 将 react 升级为 19
  2. 采用 rslib 进行构建

@yvonneyx
Copy link
Contributor

需要考虑对 react >=16.18.0 的兼容性

@ianzone
Copy link
Contributor Author

ianzone commented Apr 24, 2025

需要考虑对 react >=16.18.0 的兼容性

16也太旧了吧。。要不发大版本?

@ianzone
Copy link
Contributor Author

ianzone commented Apr 24, 2025

需要考虑对 react >=16.18.0 的兼容性

这个PR没有用到任何react19的新特性,如果原来就支持16,那现在应该也支持,我可以把peer改回>=16

@ianzone
Copy link
Contributor Author

ianzone commented Apr 24, 2025

需要考虑对 react >=16.18.0 的兼容性

但是 @antv/graphin 本来的 peer 就是 18,@antv/gi-sdk 依赖 @antv/graphin@antv/gi-core-assets 又依赖 @antv/gi-sdk,所以原本就没保证支持 16

@ianzone
Copy link
Contributor Author

ianzone commented Apr 24, 2025

@yvonneyx 给个意见哈,我在用react19重构ant-design-charts,需要更新这个依赖

@hustcc
Copy link
Member

hustcc commented Apr 24, 2025

@yvonneyx 给个意见哈,我在用react19重构ant-design-charts,需要更新这个依赖

重构 ant design charts 什么版本?旧版本没有依赖 graphin 吧?

@yvonneyx
Copy link
Contributor

yvonneyx commented Apr 24, 2025

@yvonneyx 给个意见哈,我在用react19重构ant-design-charts,需要更新这个依赖

哦哦,我记岔了,@antv/g6-extension-react 目前是支持 >=16.18.0。但现在的 graphin 应该也是支持 react19 的吧

@ianzone
Copy link
Contributor Author

ianzone commented Apr 24, 2025

@yvonneyx 给个意见哈,我在用react19重构ant-design-charts,需要更新这个依赖

重构 ant design charts 什么版本?旧版本没有依赖 graphin 吧?

这里依赖了 https://github.com/ant-design/ant-design-charts/blob/67204059b7c0dbac0d89d5d090e755397196cabd/packages/graphs/src/core/base-graph.tsx#L3

@ianzone
Copy link
Contributor Author

ianzone commented Apr 24, 2025

@yvonneyx 给个意见哈,我在用react19重构ant-design-charts,需要更新这个依赖

哦哦,我记岔了,@antv/g6-extension-react 目前是支持 >=16.18.0。但现在的 graphin 应该也是支持 react19 的吧

现在的 graphin 的 peer 是

  "peerDependencies": {
    "react": "^18.0.0",
    "react-dom": "^18.0.0"
  }

@Aarebecca
Copy link
Contributor

@hustcc @yvonneyx 要不把 https://github.com/antvis/G6/blob/v5/packages/g6-extension-react/src/react-node/render.ts 单独抽成一个包,给 G6 / Graphin / ADC 来用?

@hustcc
Copy link
Member

hustcc commented Apr 24, 2025

好像 adc 中也有类似的一段代码,单独有发一个包。

@ianzone
Copy link
Contributor Author

ianzone commented Apr 24, 2025

@hustcc @yvonneyx 要不把 https://github.com/antvis/G6/blob/v5/packages/g6-extension-react/src/react-node/render.ts 单独抽成一个包,给 G6 / Graphin / ADC 来用?

也可以考虑使用 react compiler 进行向后兼容

@yvonneyx
Copy link
Contributor

@yvonneyx 给个意见哈,我在用react19重构ant-design-charts,需要更新这个依赖

哦哦,我记岔了,@antv/g6-extension-react 目前是支持 >=16.18.0。但现在的 graphin 应该也是支持 react19 的吧

现在的 graphin 的 peer 是

  "peerDependencies": {
    "react": "^18.0.0",
    "react-dom": "^18.0.0"
  }

😯~ 那改成 >=18.0.0 应该就行了吧

@ianzone
Copy link
Contributor Author

ianzone commented Apr 24, 2025

@yvonneyx 给个意见哈,我在用react19重构ant-design-charts,需要更新这个依赖

哦哦,我记岔了,@antv/g6-extension-react 目前是支持 >=16.18.0。但现在的 graphin 应该也是支持 react19 的吧

现在的 graphin 的 peer 是

  "peerDependencies": {
    "react": "^18.0.0",
    "react-dom": "^18.0.0"
  }

😯~ 那改成 >=18.0.0 应该就行了吧

那 graphin 我改 >=18,另外两个包保持 >=16 ?

@yvonneyx
Copy link
Contributor

@yvonneyx 给个意见哈,我在用react19重构ant-design-charts,需要更新这个依赖

哦哦,我记岔了,@antv/g6-extension-react 目前是支持 >=16.18.0。但现在的 graphin 应该也是支持 react19 的吧

现在的 graphin 的 peer 是

  "peerDependencies": {
    "react": "^18.0.0",
    "react-dom": "^18.0.0"
  }

😯~ 那改成 >=18.0.0 应该就行了吧

那 graphin 我改 >=18,另外两个包保持 >=16 ?

可以呀,react 升级和构建拆成两个 PR 吧。发个包不阻碍你的项目,构建这个还需要 @hustcc 评估一下,现在 antv 其他项目也用的是 tsc

@ianzone
Copy link
Contributor Author

ianzone commented Apr 24, 2025

@yvonneyx 给个意见哈,我在用react19重构ant-design-charts,需要更新这个依赖

哦哦,我记岔了,@antv/g6-extension-react 目前是支持 >=16.18.0。但现在的 graphin 应该也是支持 react19 的吧

现在的 graphin 的 peer 是

  "peerDependencies": {
    "react": "^18.0.0",
    "react-dom": "^18.0.0"
  }

😯~ 那改成 >=18.0.0 应该就行了吧

那 graphin 我改 >=18,另外两个包保持 >=16 ?

可以呀,react 升级和构建拆成两个 PR 吧。发个包不阻碍你的项目,构建这个还需要 @hustcc 评估一下,现在 antv 其他项目也用的是 tsc

#571

@ianzone ianzone changed the title feat: add react19 feat: add rsbuild Apr 24, 2025
@ianzone ianzone changed the title feat: add rsbuild feat: add rslib Apr 24, 2025
@ianzone
Copy link
Contributor Author

ianzone commented Apr 24, 2025

我觉得rslib挺方便的,mjs、cjs、umd、d.ts可以同时生成,速度也不错,配合rsdoctor还可以进行分析优化。

@hustcc
Copy link
Member

hustcc commented Apr 24, 2025

@ianzone 感谢感谢,要不先维持现状,特别是 Graphin 其实本身迭代不多,小项目也不存在构建问题。

之前也有一些库使用的蚂蚁的 father,长期不迭代,构建不起来还得排查原因。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants