Skip to content

fix(vite): 深色模式的tabbar无法引用theme.json变量#18789

Merged
Single-Dancer merged 2 commits into
NervJS:mainfrom
NiuGuohui:patch-2
Apr 13, 2026
Merged

fix(vite): 深色模式的tabbar无法引用theme.json变量#18789
Single-Dancer merged 2 commits into
NervJS:mainfrom
NiuGuohui:patch-2

Conversation

@NiuGuohui
Copy link
Copy Markdown
Contributor

@NiuGuohui NiuGuohui commented Jan 23, 2026

这个 PR 做了什么? (简要描述所做更改)

解决了微信小程序平台,深色模式适配下,tabbar中的icon无法引用theme.json变量的问题

这个 PR 是什么类型? (至少选择一个)

  • 错误修复 (Bugfix) issue: fix #
  • 新功能 (Feature)
  • 代码重构 (Refactor)
  • TypeScript 类型定义修改 (Types)
  • 文档修改 (Docs)
  • 代码风格更新 (Code style update)
  • 构建优化 (Chore)
  • 其他,请描述 (Other, please describe):

这个 PR 涉及以下平台:

  • 所有平台
  • Web 端(H5)
  • 移动端(React-Native)
  • 鸿蒙(Harmony)
  • 鸿蒙容器(Harmony Hybrid)
  • ASCF 元服务
  • 快应用(QuickApp)
  • 所有小程序
  • 微信小程序
  • 企业微信小程序
  • 京东小程序
  • 百度小程序
  • 支付宝小程序
  • 支付宝 IOT 小程序
  • 钉钉小程序
  • QQ 小程序
  • 飞书小程序
  • 快手小程序
  • 头条小程序

Summary by CodeRabbit

  • Bug Fixes
    • 优化了标签栏图标路径的处理逻辑:当图标路径为空或为内部别名(以 @ 开头)时,跳过资源读取、发出和文件监视,避免对无效或内部引用执行不必要操作,降低构建开销并提高构建稳定性。

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8f0868e7-4925-4aa6-9fb6-c69f26659036

📥 Commits

Reviewing files that changed from the base of the PR and between 795086b and ccc4b52.

📒 Files selected for processing (1)
  • packages/taro-vite-runner/src/mini/entry.ts
✅ Files skipped from review due to trivial changes (1)
  • packages/taro-vite-runner/src/mini/entry.ts

Walkthrough

在 tabBar 处理分支中新增守卫:当 iconPathselectedIconPath 为假值或以 @ 开头时跳过处理,避免为内部/别名路径发射资产或添加文件监视。

Changes

Cohort / File(s) Summary
Vite 运行器入口文件
packages/taro-vite-runner/src/mini/entry.ts
在 tabBar 图标路径处理中新增两处守卫检查:若 iconPathselectedIconPath 为假值或以 @ 开头则跳过后续的资产发射(emitFile)与文件监视(addWatchFile)逻辑。

Estimated code review effort

🎯 2 (简单) | ⏱️ ~8 分钟

诗句

我是小兔来报到,🐰
两行守卫守路径,
碰到 '@' 就轻轻绕,
空值亦不去招摇,
构建安宁且欢笑 ~ ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR标题准确反映了主要修复内容:修复深色模式下tabbar无法引用theme.json变量的问题,与代码更改(对@开头的路径进行额外过滤)的目的相符。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@NiuGuohui NiuGuohui changed the title fix: 深色模式的tabbar无法引用theme.json变量 fix(vite): 深色模式的tabbar无法引用theme.json变量 Jan 23, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.07%. Comparing base (438bcb6) to head (b0734be).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #18789   +/-   ##
=======================================
  Coverage   56.07%   56.07%           
=======================================
  Files         447      447           
  Lines       23454    23454           
  Branches     5808     5792   -16     
=======================================
  Hits        13151    13151           
+ Misses       8449     8448    -1     
- Partials     1854     1855    +1     
Flag Coverage Δ
taro-cli 72.85% <ø> (ø)
taro-runtime 58.33% <ø> (ø)
taro-web 53.12% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This was referenced Jan 24, 2026
@Single-Dancer Single-Dancer added this to the 4.1.12 milestone Jan 29, 2026
解决了微信小程序平台,深色模式适配下,tabbar中的icon无法引用theme.json变量的问题
@Single-Dancer Single-Dancer merged commit 7911462 into NervJS:main Apr 13, 2026
25 checks passed
This was referenced Apr 18, 2026
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.

2 participants