Skip to content

chore: upgrade core babel dependencies to 8#937

Open
sonofmagic wants to merge 1 commit into
mainfrom
codex/babel-8-upgrade
Open

chore: upgrade core babel dependencies to 8#937
sonofmagic wants to merge 1 commit into
mainfrom
codex/babel-8-upgrade

Conversation

@sonofmagic

Copy link
Copy Markdown
Owner

变更内容

  • 将核心 Babel 链路升级到 Babel 8:@babel/core@babel/generator@babel/parser@babel/traverse@babel/types
  • 仅调整 weapp-tailwindcss@weapp-tailwindcss/babel 相关依赖;uni-app、Taro、MPX、templates、website 仍保留 Babel 7。
  • 适配 Babel 8 的 ESM-only 与同步 transform API 变化。
  • 将相关包 Node engine 调整为 Babel 8 要求的 ^22.18.0 || >=24.11.0
  • 添加中文 changeset,按 major 记录 Node 支持范围变化。

验证

  • pnpm install
  • pnpm --filter @weapp-tailwindcss/babel test
  • pnpm vitest run --project=weapp-tailwindcss packages/weapp-tailwindcss/test/babel/index.test.ts packages/weapp-tailwindcss/test/js/babel-utils.test.ts packages/weapp-tailwindcss/test/js/babel-branches.test.ts --coverage.enabled=false
  • pnpm vitest run --project=@weapp-tailwindcss/minify-preserve packages/minify-preserve/test/bundler-config.test.ts --coverage.enabled=false
  • pnpm typecheck
  • pnpm build:pkgs

兼容性记录

  • HBuilderX 5.07.2026041006 内置 Node 为 v18.20.0,低于 Babel 8 的 engine 要求。
  • HBuilderX dev:mp-weixin 目前会在加载 vite.config.ts 时遇到 Babel 8 ESM / Node API 兼容问题,例如 require() of ES Module @babel/traversenode:util.styleText 不存在。
  • 普通外部 uni CLI 在当前 Node v25 环境下,H5 和 mp-weixin 构建/启动路径已验证可用。

已知非本次改动失败

pnpm --filter weapp-tailwindcss test -- --coverage.enabled=false 仍有 3 个文件 6 个失败,集中在 CI workflow 断言和 Vite/Webpack watch/cache 用例,和本次 Babel 8 适配路径不重合。

@changeset-bot

changeset-bot Bot commented Jun 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: fd5d5fc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
weapp-tailwindcss Major
@weapp-tailwindcss/babel Major
@weapp-tailwindcss/build-all Patch
@weapp-tailwindcss/website Patch

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

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.

1 participant