-
Notifications
You must be signed in to change notification settings - Fork 267
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
refactor: remove special handling for rntaro's environment configuration and component #2934
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
import { Component } from 'react' | ||
import Taro from '@tarojs/taro' | ||
import './app.scss' | ||
|
||
if (Taro.getEnv() !== 'RN') { | ||
import('@/sites/assets/styles/reset.scss'); | ||
import('@/packages/nutui.react.scss.taro'); | ||
import('@nutui/touch-emulator'); | ||
} | ||
import('@/sites/assets/styles/reset.scss') | ||
import('@/packages/nutui.react.scss.taro') | ||
import('@nutui/touch-emulator') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification 建议使用条件导入 touch-emulator 当前实现会在所有环境下加载 touch-emulator,建议参考以下方案优化:
示例代码: import { web } from '@/utils/platform-taro'
if (web()) {
import('@nutui/touch-emulator')
} 🔗 Analysis chain建议评估 touch-emulator 的必要性 由于移除了环境检查,touch-emulator 现在会在所有环境下加载。建议:
运行以下命令检查 touch-emulator 的使用情况: 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# 检查 touch-emulator 的使用范围
rg -g '*.{ts,tsx,js,jsx}' '@nutui/touch-emulator' -A 2
Length of output: 435 Script: #!/bin/bash
# Check for environment detection utilities
rg -g '*.{ts,tsx,js,jsx}' 'isMobile|isH5|getEnv|ENV_TYPE' -A 2
Length of output: 32880 Script: #!/bin/bash
# Check platform detection utilities
cat src/utils/platform-taro.ts
Length of output: 373 |
||
|
||
// console.log(NutUI) | ||
class App extends Component { | ||
render() { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
需要完整清理 React Native 相关代码
检测发现多处遗留的 RN 相关引用:
dev:taro:rn:dark
脚本命令建议进行全面清理,确保完全移除 React Native 支持。
🔗 Analysis chain
脚本路径更新符合架构调整
将 Taro 入口更新脚本从 RN 目录迁移到 harmony 目录,与移除 React Native 支持的目标一致。建议确保相关的构建和测试流程都已更新。
运行以下脚本验证相关脚本和配置:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 22
Script:
Length of output: 1458