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

chore: node version locked #355

Merged
merged 6 commits into from
Jun 14, 2023
Merged

chore: node version locked #355

merged 6 commits into from
Jun 14, 2023

Conversation

tyn1998
Copy link
Collaborator

@tyn1998 tyn1998 commented Jun 13, 2023

👀 PR includes

✨ Feature

  • New feature

🎨 Enhance

  • Code style optimization
  • Refactoring
  • Change the UI
  • Improve the performance
  • Type optimization

🐛 Bugfix

  • Solve the issue and close #0

🔧 Chore

  • Test case
  • Docs / demos update
  • CI / workflow
  • Release version
  • Other (environment/requirements)

📝 Description

锁定 Node 版本为 16,因为:

  1. 高版本 Node下安装依赖和运行项目都会出现问题
  2. 最新的pnpm已经不支持 Node 14

此外,还在根目录添加了.nvmrc文件,这样的话进入子包目录也会自动切换node版本为16。根据这个调整修改了README和CONTRIBUTION文件。

另外经过测试,Node 18版本及以上不需要--experimental-json-modules这个flag就能import json modules,但是16及以下版本需要,否则会报错,于是像 #271 那样在gi-site/package.json中添加了这个flag。

🔗 Related issue link

close #257,还可以参考的:#254 (review)

🔍 Self-Check before the merge

  • Add or update relevant docs.
  • Add or update relevant demos.
  • Add or update test case.
  • Add or update relevant TypeScript definitions.

@tyn1998
Copy link
Collaborator Author

tyn1998 commented Jun 13, 2023

@pomelo-nwu CI好像得修下,都是红的 😆

@pomelo-nwu
Copy link
Member

@pomelo-nwu CI好像得修下,都是红的 😆

是 build g6vp docker 镜像挂了...

@pomelo-nwu
Copy link
Member

pomelo-nwu commented Jun 14, 2023

@pomelo-nwu CI好像得修下,都是红的 😆

@tyn1998 刚看了下是这个问题:https://stackoverflow.com/questions/76435306/babel-preset-react-app-is-importing-the-babel-plugin-proposal-private-propert

在另一个分支上提个了 commit 修复了:721a661#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R60

你的这个我就先合并了,影响不大

@pomelo-nwu pomelo-nwu closed this Jun 14, 2023
@pomelo-nwu pomelo-nwu reopened this Jun 14, 2023
@pomelo-nwu pomelo-nwu merged commit 280adce into antvis:master Jun 14, 2023
@tyn1998 tyn1998 deleted the docs/gh-257 branch June 14, 2023 15:07
Comment on lines +14 to +17
"build": "node --experimental-json-modules scripts/pre-build.mjs && NODE_OPTIONS=--max_old_space_size=4096 umi build",
"build:docker": "cd ../../ && npm run build:all:umd && cd packages/gi-site/ && BUILD_MODE=docker node scripts/pre-build.mjs && node scripts/copy-assets.mjs && BUILD_MODE=docker NODE_OPTIONS=--max_old_space_size=4096 umi build",
"deploy": "node ./scripts/deploy.js",
"start": "node scripts/pre-build.mjs && cross-env NODE_OPTIONS=--max_old_space_size=4096 cross-env PORT=8000 umi dev"
"start": "node --experimental-json-modules scripts/pre-build.mjs && cross-env NODE_OPTIONS=--max_old_space_size=4096 cross-env PORT=8000 umi dev"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个--experimental-json-modules在16.14版本还是需要的,但是16.20版本就已经不需要了。具体是哪个版本开始不需要这个flag的我没有实测,总之是追加一个评论FYI。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Chore] 当前阶段建议限制Node版本为14~16
2 participants