Skip to content
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

改变非移动端前端编译目标为 es2021 #7770

Merged
merged 3 commits into from Mar 24, 2023

Conversation

cijiugechu
Copy link
Contributor

  • Please commit to the dev branch 请提交到 dev 开发分支
  • For contributing new features, please supplement and improve the corresponding user guide documents 对于贡献新特性,请补充完善对应用户指南文档
  • For bug fixes, please describe the problem and solution via code comments 对于修复缺陷,请通过代码注释描述问题和解决方案
  • For text improvements (such as typos and wording adjustments), please submit directly 对于文案改进(比如错别字措辞调整)请直接提交

目前的 electron 版本是 21.4.2 , 当前版本chromiumNode.js 分别为 106 和 16.16 均已支持 ES2021 , 通过更改支持的 target 避免引入不必要的 polyfill 并减少包体积 .

兼容性问题参见: node , chromium

@88250 88250 requested a review from Vanessa219 March 24, 2023 08:12
@88250
Copy link
Member

88250 commented Mar 24, 2023

我不太确定修改 tsconfig.json 是否会影响移动端的编译,因为移动端得兼容较老的 WebView 版本。

@cijiugechu
Copy link
Contributor Author

我不太确定修改 tsconfig.json 是否会影响移动端的编译,因为移动端得兼容较老的 WebView 版本。

esbuild 似乎认为显式指定的 target 比 tsconfig 中的优先级要高,目前移动端编译也是显式指定了 target 的

@88250 88250 changed the title chore: change target to es2021 🎨 改变非移动端前端编译目标为 es2021 Mar 24, 2023
@88250 88250 added the Refactor label Mar 24, 2023
@88250 88250 added this to the 2.8.1 milestone Mar 24, 2023
@Soltus
Copy link
Contributor

Soltus commented Mar 24, 2023

现在目标设定为 es2021 对思源来说还是太早了,主要是伺服端浏览器并不一定支持,app端可以这么做,desktop建议不要动
image

@88250
Copy link
Member

88250 commented Mar 24, 2023

我同意 @Soltus 的观点,最好只改动 webpack.config.js,不然移动端的浏览器可能会报错。

@Vanessa219
Copy link
Member

desktop、api、export 这些浏览器是无法确定的,Pad 上应该是无法兼容的。还麻烦重新提交

@Vanessa219 Vanessa219 merged commit b0b5d20 into siyuan-note:dev Mar 24, 2023
@88250 88250 changed the title 🎨 改变非移动端前端编译目标为 es2021 改变非移动端前端编译目标为 es2021 Mar 24, 2023
Vanessa219 added a commit that referenced this pull request Mar 24, 2023
88250 pushed a commit that referenced this pull request Mar 28, 2023
* chore: target: es2021

* revert

* revert
88250 pushed a commit that referenced this pull request Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants