ant-design / ant-design/pro-components

🧐[问题]如何在antd3的项目中使用pro-components?

Open
#8,548 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4.8k
Forks
1.4k
Avg merge
10h 44m
Merged PRs (30d)
3

Description

### 🧐 问题描述
我有一个很老的项目使用了antd3,并且安装了很多其他与antd3配套的库,所以我不太好改动antd的版本。但是pro-components声明了peerDependencies需要antd4或者antd5,因此在安装时会提示依赖冲突。即使使用--force强行安装上了,也跑不起来,因为pro-components中确实用到了很多antd4才有的新特性。那我怎样才能在这个老项目中用上pro-components呢?

现在我初步有两个方案:
1. 开另外一个新项目,使用pro-components。老项目中使用iframe把新项目的内容嵌入进去。这样老项目还是antd3,新开发的部分就能用pro-components了。
2. 自已fork一份pro-components的npm包,将其中的antd的依赖声明从peerDependencies移动到dependencies中,npm安装pro-components使用我自己的fork版本。这样npm在解析时就可以把antd4也安装上,并且不会和antd3相冲突。

不知道还有哪些方案可供选择呢?希望各位大佬可以指点一二。

Contributor guide

Open the contributing guide

Research direction

No source files, tests, or entry points are identified. First review the compatibility requirements between the antd3 project and pro-components, then determine whether a supported integration path exists; done would require a documented, maintainable approach rather than an unverified forced installation.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.