make DataProvider an interface
维护者通常 1 天内回复
还没有人认领这个 Issue。
- #7351 来自 @antdking —— 已关闭,未合并
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- react, typescript
- 领域
- frontend
调研方向
定位 DataProvider 类型别名,并检查它在 hooks 以及 resource/model typings 中的使用情况。检查将其改为 interface 如何影响泛型传播和 injectable 类型定义,然后使用提议的 demo 验证行为;完成的标准是:无需显式的泛型 wrapper,resourceName 到 RaRecord 的关联就能在各个 hooks 中正常工作。
由索引模型根据 Issue 内容生成。
描述
Is your feature request related to a problem? Please describe.
Currently, to extend the DataProvider, we have to be very explicit about generics, and do a fair amount of hackery to expose Models/Resources everywhere.
The aim here is to build an abstraction around the pieces in react-admin, to make wiring up APIs/Models/Views a lot more seamless within editor environments (fully static with plain JS for users).
Describe the solution you'd like
Currently, DataProvider is a TypeAlias, which are not injectable.
By allowing us to inject the DataProvider, we can cause resourceName -> RaRecord associations to propagate to all the hooks (useGetList('cats') should automatically find my Cat Model).
For now, changing it from type to interface might be enough, however I'm unsure of the fallout. I'll spin up a PR with a Demo to verify how it all goes, and so you have something physical to see.
I suspect this will be beneficial for the no-code project, however I've yet to do a dive into what that is in detail.
Describe alternatives you've considered
Wrapping + explicit types == Code too noisy
Additional context
n/a
- 主要语言
- TypeScript
- 星标
- 27k
- 派生
- 5.5k
- 平均合并
- 1 天 3 分钟
- 30 天内合并 PR
- 32
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
marmelab/react-admin 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
marmelab/react-admin#11431 ·
维护者通常 1 天内回复
-
Pagination: page button aria-labels are not translated on small screens可能已有人在做 @Singmin 于 2 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
marmelab/react-admin#11427 ·
维护者通常 1 天内回复
-
Add emptyText property to SelectArrayInput可能已有人在做 @kwitykwity 于 60 天前认领。 未关闭enhancement good first issue
难度 2/5 1-3 小时 新手友好度 72/100
marmelab/react-admin#10454 · 7 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 一周以上 新手友好度 38/100
marmelab/react-admin#11426 · 1 个 reaction ·
维护者通常 1 天内回复
-
ra-data-graphql-simple: outdated graphql-ast-types-browser dependency causes npm peer warnings可能重新可做 @bipul724 于 13 天前认领,目前没有进行中的 PR。 未关闭
难度 4/5 3-5 天 新手友好度 25/100
marmelab/react-admin#11395 · 1 条评论 ·
维护者通常 1 天内回复
查看 marmelab/react-admin 的全部 Issue
相似的 Issue
-
Replace discontinued crypto-js in the theme可能已有人在做 @aelmanaa 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
PaloAltoNetworks/docusaurus-openapi-docs#1689 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
solana-foundation/solana-web3.js#4015 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
documentation
难度 1/5 1-3 小时 新手友好度 90/100
ivopogace/opencode-courier#422 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
chapel-lang/chapel-vscode#158 ·
维护者通常 1 天内回复