-
Notifications
You must be signed in to change notification settings - Fork 34
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
迁移到ESM上 #39
Comments
现在来看,所有最表面的CLI包是可以ESM化的。如果改造 遗留问题:
一堆需要修类型的包: |
otakustay
added a commit
that referenced
this issue
Jan 4, 2022
BREAKING CHANGE: 发布的包为纯ESM格式,无法通过CommonJS的`require`引入。参考[sinderesorhus的建议](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c)
otakustay
added a commit
that referenced
this issue
Jan 6, 2022
BREAKING CHANGE: 发布的包为纯ESM格式,无法通过CommonJS的`require`引入。参考[sinderesorhus的建议](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c)
otakustay
added a commit
that referenced
this issue
Jan 6, 2022
BREAKING CHANGE: 发布的包为纯ESM格式,无法通过CommonJS的`require`引入。参考[sinderesorhus的建议](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c)
otakustay
added a commit
that referenced
this issue
Jan 12, 2022
当前完成了最认本部分逻辑的ESM化,剩余的包主要为: - 各类插件包,这需要先支持`reskript.config.{mjs|ts}`的ESM化 - 几个webpack loader,要等待webpack支持 - eslint插件无法ESM化 - jest配置无法ESM化 - 受前几项影响,`core`和`settings`暂未ESM化 BREAKING CHANGE: 发布的包为纯ESM格式,无法通过CommonJS的`require`引入。参考[sinderesorhus的建议](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c)
otakustay
added a commit
that referenced
this issue
Jan 12, 2022
当前完成了最认本部分逻辑的ESM化,剩余的包主要为: - 各类插件包,这需要先支持`reskript.config.{mjs|ts}`的ESM化 - 几个webpack loader,要等待webpack支持 - eslint插件无法ESM化 - jest配置无法ESM化 - 受前几项影响,`core`和`settings`暂未ESM化 BREAKING CHANGE: 发布的包为纯ESM格式,无法通过CommonJS的`require`引入。参考[sinderesorhus的建议](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c)
otakustay
added a commit
that referenced
this issue
Jan 12, 2022
当前完成了最认本部分逻辑的ESM化,剩余的包主要为: - 各类插件包,这需要先支持`reskript.config.{mjs|ts}`的ESM化 - 几个webpack loader,要等待webpack支持 - eslint插件无法ESM化 - jest配置无法ESM化 - 受前几项影响,`core`和`settings`暂未ESM化 BREAKING CHANGE: 发布的包为纯ESM格式,无法通过CommonJS的`require`引入。参考[sinderesorhus的建议](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c)
otakustay
added a commit
that referenced
this issue
Jan 12, 2022
当前完成了最认本部分逻辑的ESM化,剩余的包主要为: - 各类插件包,这需要先支持`reskript.config.{mjs|ts}`的ESM化 - 几个webpack loader,要等待webpack支持 - eslint插件无法ESM化 - jest配置无法ESM化 - 受前几项影响,`core`和`settings`暂未ESM化 BREAKING CHANGE: 发布的包为纯ESM格式,无法通过CommonJS的`require`引入。参考[sinderesorhus的建议](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c)
otakustay
added a commit
that referenced
this issue
Jan 12, 2022
当前完成了最认本部分逻辑的ESM化,剩余的包主要为: - 各类插件包,这需要先支持`reskript.config.{mjs|ts}`的ESM化 - 几个webpack loader,要等待webpack支持 - eslint插件无法ESM化 - jest配置无法ESM化 - 受前几项影响,`core`和`settings`暂未ESM化 BREAKING CHANGE: 发布的包为纯ESM格式,无法通过CommonJS的`require`引入。参考[sinderesorhus的建议](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c)
otakustay
added a commit
that referenced
this issue
Jan 12, 2022
当前完成了最认本部分逻辑的ESM化,剩余的包主要为: - 各类插件包,这需要先支持`reskript.config.{mjs|ts}`的ESM化 - 几个webpack loader,要等待webpack支持 - eslint插件无法ESM化 - jest配置无法ESM化 - 受前几项影响,`core`和`settings`暂未ESM化 BREAKING CHANGE: 发布的包为纯ESM格式,无法通过CommonJS的`require`引入。参考[sinderesorhus的建议](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c)
otakustay
added a commit
that referenced
this issue
Jan 12, 2022
当前完成了最认本部分逻辑的ESM化,剩余的包主要为: - 各类插件包,这需要先支持`reskript.config.{mjs|ts}`的ESM化 - 几个webpack loader,要等待webpack支持 - eslint插件无法ESM化 - jest配置无法ESM化 - 受前几项影响,`core`和`settings`暂未ESM化 BREAKING CHANGE: 发布的包为纯ESM格式,无法通过CommonJS的`require`引入。参考[sinderesorhus的建议](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c)
otakustay
added a commit
that referenced
this issue
Jan 13, 2022
当前完成了最认本部分逻辑的ESM化,剩余的包主要为: - 各类插件包,这需要先支持`reskript.config.{mjs|ts}`的ESM化 - 几个webpack loader,要等待webpack支持 - eslint插件无法ESM化 - jest配置无法ESM化 - 受前几项影响,`core`和`settings`暂未ESM化 BREAKING CHANGE: 发布的包为纯ESM格式,无法通过CommonJS的`require`引入。参考[sinderesorhus的建议](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c)
otakustay
added a commit
that referenced
this issue
Jan 15, 2022
otakustay
added a commit
that referenced
this issue
Jan 15, 2022
otakustay
added a commit
that referenced
this issue
Jan 15, 2022
otakustay
added a commit
that referenced
this issue
Jan 17, 2022
otakustay
added a commit
that referenced
this issue
Jan 18, 2022
otakustay
added a commit
that referenced
this issue
Jan 18, 2022
otakustay
added a commit
that referenced
this issue
Jan 18, 2022
otakustay
added a commit
that referenced
this issue
Jan 18, 2022
otakustay
added a commit
that referenced
this issue
Jan 20, 2022
当前完成了最认本部分逻辑的ESM化,剩余的包主要为: - 各类插件包,这需要先支持`reskript.config.{mjs|ts}`的ESM化 - 几个webpack loader,要等待webpack支持 - eslint插件无法ESM化 - jest配置无法ESM化 - 受前几项影响,`core`和`settings`暂未ESM化 BREAKING CHANGE: 发布的包为纯ESM格式,无法通过CommonJS的`require`引入。参考[sinderesorhus的建议](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c)
otakustay
added a commit
that referenced
this issue
Jan 20, 2022
otakustay
added a commit
that referenced
this issue
Jan 20, 2022
otakustay
added a commit
that referenced
this issue
Jan 20, 2022
otakustay
added a commit
that referenced
this issue
Jan 20, 2022
otakustay
added a commit
that referenced
this issue
Jan 20, 2022
otakustay
added a commit
that referenced
this issue
Jan 21, 2022
当前完成了最认本部分逻辑的ESM化,剩余的包主要为: - 各类插件包,这需要先支持`reskript.config.{mjs|ts}`的ESM化 - 几个webpack loader,要等待webpack支持 - eslint插件无法ESM化 - jest配置无法ESM化 - 受前几项影响,`core`和`settings`暂未ESM化 BREAKING CHANGE: 发布的包为纯ESM格式,无法通过CommonJS的`require`引入。参考[sinderesorhus的建议](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c)
otakustay
added a commit
that referenced
this issue
Jan 21, 2022
otakustay
added a commit
that referenced
this issue
Jan 21, 2022
otakustay
added a commit
that referenced
this issue
Jan 21, 2022
otakustay
added a commit
that referenced
this issue
Jan 21, 2022
otakustay
added a commit
that referenced
this issue
Jan 21, 2022
otakustay
added a commit
that referenced
this issue
Jan 23, 2022
当前完成了最认本部分逻辑的ESM化,剩余的包主要为: - 各类插件包,这需要先支持`reskript.config.{mjs|ts}`的ESM化 - 几个webpack loader,要等待webpack支持 - eslint插件无法ESM化 - jest配置无法ESM化 - 受前几项影响,`core`和`settings`暂未ESM化 BREAKING CHANGE: 发布的包为纯ESM格式,无法通过CommonJS的`require`引入。参考[sinderesorhus的建议](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c) x
otakustay
added a commit
that referenced
this issue
Jan 23, 2022
otakustay
added a commit
that referenced
this issue
Jan 23, 2022
otakustay
added a commit
that referenced
this issue
Jan 23, 2022
otakustay
added a commit
that referenced
this issue
Jan 23, 2022
otakustay
added a commit
that referenced
this issue
Jan 23, 2022
otakustay
added a commit
that referenced
this issue
Jan 29, 2022
当前完成了最认本部分逻辑的ESM化,剩余的包主要为: - 各类插件包,这需要先支持`reskript.config.{mjs|ts}`的ESM化 - 几个webpack loader,要等待webpack支持 - eslint插件无法ESM化 - jest配置无法ESM化 - 受前几项影响,`core`和`settings`暂未ESM化 BREAKING CHANGE: 发布的包为纯ESM格式,无法通过CommonJS的`require`引入。参考[sinderesorhus的建议](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c)
otakustay
added a commit
that referenced
this issue
Jan 29, 2022
otakustay
added a commit
that referenced
this issue
Jan 29, 2022
otakustay
added a commit
that referenced
this issue
Jan 29, 2022
otakustay
added a commit
that referenced
this issue
Jan 29, 2022
otakustay
added a commit
that referenced
this issue
Jan 29, 2022
otakustay
added a commit
that referenced
this issue
Feb 1, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
根据这个更新纪要,社区有大量的库正在向纯ESM的方向发展,编译为CommonJS的
reSKRipt
不跟上的话会无法继续使用社区最新的成果使用ESM会需要Node >= 12,在近期版本中先加上这一限制
已知当前升级到了ESM不再兼容CommonJS的库,这些库以后不能再继续升版本了:
imagemin
log-symbols
我们需要做的:
import
加上文件后缀名,保持全路径require
干掉,可以异步的就用await import
,不可以的就做成静态import
。这可能会因为增加过多的import
导致初始化性能有所下降,要做一次测试__dirname
和__filename
,转用import.meta.url
处理require
包在ESM下工作不符合预期,用@reskript/core
的resolveSync
替换import 'xxx.json'
的情况,改用fs.readFile
处理bin
是不是兼容,是否能直接执行reskript.config.js
变为reskript.config.mjs
并使用类似export const build = {}
的形式编写配置jest
的配置怎么去解析,现在用的是require('jest.config.js')
require
reskript.config.js
的多次加载,可以用import 'reskript.config.js?v=xxx'
这种形式来实现,但可能用久了内存会爆,需要小心:Invalidate cache when using import nodejs/node#49442一些社区相关的需要解决的问题:
jest-resolve
jestjs/jest#9771The text was updated successfully, but these errors were encountered: