-
Notifications
You must be signed in to change notification settings - Fork 115
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
fix: use esm import as the default import way for fix use in Remix #520
Conversation
🦋 Changeset detectedLatest commit: 46df349 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #520 +/- ##
=======================================
Coverage 99.63% 99.63%
=======================================
Files 96 96
Lines 4338 4338
Branches 447 447
=======================================
Hits 4322 4322
Misses 15 15
Partials 1 1 ☔ View full report in Codecov by Sentry. |
同理, |
|
@PeachScript Peach 可以看看这个 PR,antd antd-icons 也会有类似的问题,目前 NextJS、Remix 这些框架在 ESM 的支持方式上都走得比较激进了,感觉 antd 下面一些列的库看看是不是可以跟进,不然现在这些框架默认跑 antd 跑不起来。 |
或许可以考虑改用 |
这个改了。换 unbuild 先不换吧,更重要的其实是要推动 antd 和 antd-icons 的改动,不然 antd-web3 还是默认跑不起来,需要配置 antd 相关内容。 |
我尝试用 remix 复现了原 issue 中的问题,排查下来和 NPM 包是否是 pure esm 无关,原因有两个:
只要上面两个问题解了,remix 是可以正常编译的,另外 antd 我试了下 remix 也是可以正常编译的;pure esm 还是属于 breaking change,通常 major 版本才会做此改动,所以建议是把这个 PR 的改动还原回去解上面两个问题,具体你们可以再评估下 @yutingzhao1991 @jeasonstudio @thinkasany @kiner-tang father 4 是有计划支持 pure esm 的,但一直没时间跟进,目前也没遇到特别刚需的场景,关联 issue:umijs/father#609 也许今年会搞 👀 |
混用的问题我解一下, #522 这个 PR 会处理。 |
main
字段默认改为 esm 的,对应type
也修改为module
,这样在大部分框架中得以更好的默认支持。在 NextJS 和 Remix 中都是如此。可以 close remix use ant-design-web3 Error #519.js
的后缀,不然在 NexJS 和 Remix 这样可能在 NodeJS 环境运行 esm 的框架中会报找不到模块。