我正在尝试设置一个包含 3 个共享一些库代码的服务的 monorepo。
这是目前的情况:
repo: web
pdf/
package.json
reference to shared-ts using github url
tsconfig.json
frontend/
package.json
reference to shared-ts using github url
tsconfig.json
Run Code Online (Sandbox Code Playgroud)
repo: mobile (react-native)
package.json
reference to shared-ts using github url
tsconfig.json
Run Code Online (Sandbox Code Playgroud)
repo: shared-ts
package.json
tsconfig.json
Run Code Online (Sandbox Code Playgroud)
这可行,但提交shared-ts
、构建、更改哈希package.json
并再次提交是一件痛苦的事情。
这就是我想要实现的目标:
repo: monorepo
pdf/
package.json
reference to ../shared-ts
tsconfig.json
frontend/
package.json
reference to ../shared-ts
tsconfig.json
mobile/
package.json
reference to ../shared-ts
tsconfig.json
shared-ts/
package.json
tsconfig.json
Run Code Online (Sandbox Code Playgroud)
到目前为止我已经尝试过:
"shared-ts": "../shared-ts"
在 package.json 中,但它将共享 ts 复制到每个包的 node_modules 中,因此每次进行更改时我都必须重新运行yarn …我已经用 Expo 和 React-native 为智能手机开发了一个应用程序 - 现在我正在尝试将“.aab”文件上传到 Google Play 商店 - 但它似乎也适用于平板电脑和可穿戴设备。我真的不知道如何将其编码到“app.json”或代码本身中,只必须支持智能手机。
此外,甚至不应该从智能手机以外的任何其他设备下载该应用程序,因为这会导致糟糕的用户体验
我尝试了设备目录,但只能选择通过处理器或 RAM 进行阻止 - 有一个简单的解决方案吗?
“BaseVariant”已被弃用。我正在BaseVariant
这样使用
import com.android.build.gradle.api.BaseVariant
var bundleForVariant: (BaseVariant) -> Boolean = { variant ->
if (bundleIn.getting(variant.name).isPresent) bundleIn.getting(variant.name).get()
else if (bundleIn.getting(variant.buildType.name).isPresent)
bundleIn.getting(variant.buildType.name).get()
else variant.isRelease
}
var disableDevForVariant: (BaseVariant) -> Boolean = { variant ->
variant.name in devDisabledInVariants.get() || variant.isRelease
}
Run Code Online (Sandbox Code Playgroud)
我的问题是它的替代方案是什么?
我正在使用create-react-app。我想要反应路由器基本代码分割,但我想获取用户在浏览器中打开的第一个块,然后在后台异步获取其他块
路线
const HomeModule = React.lazy(() => import('./modules/ft_home_module/src/main'));
const AuthModule = React.lazy(() => import('./modules/ft_auth_module/src/main'));
const ProfileModule = React.lazy(() => import('./modules/ft_profile_module/src/main'));
const MerchantModule = React.lazy(() => import('./modules/ft_merchant_module/src/main'));
<Route path="/home" component={HomeModule} />
<Route path="/auth" component={AuthModule} />
<Route path="/profile" component={ProfileModule} />
<Route path="/merchant" component={MerchantModule} />
Run Code Online (Sandbox Code Playgroud)
假设,如果用户在浏览器中打开 /home,则在加载第一个块之后将首先加载 home 块,并在后台异步调用其他块
所需输出
/home
在浏览器中打开实际上我正在通过lighthouse chrome 扩展测试性能。路由器基本代码分割为我提供了第一页的良好性能,但是当我打开第二页时,它需要时间,但不应该花费时间。我认为如果我们在加载第一个块后在后台异步获取其他块,这是可能的
reactjs code-splitting create-react-app react-router-dom code-splitting-async
我在里面使用水平选项卡栏ListHeaderComponent
,我想将其ListHeaderComponent
作为SectionList中的粘性标题。我们可以在平面列表中制作粘性标题,但它在部分列表stickyHeaderIndices={[0]}
中不起作用
React Native Environment Info:
System:
OS: macOS 10.14.6
CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
Memory: 38.35 MB / 16.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 12.15.0 - /usr/local/bin/node
Yarn: 1.21.1 - /usr/local/bin/yarn
npm: 6.13.4 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3
Android SDK:
API Levels: 28, 29
Build Tools: 28.0.3, 29.0.1, 29.0.2
System Images: android-26 …
Run Code Online (Sandbox Code Playgroud) react-native expo react-native-flatlist react-native-sectionlist
我使用的"react-native": "0.72.3"
是 Xcode 14,一切都运行良好,但是当我将 Xcode 更新到Xcode 15时。然后它给出如下错误
注意:我使用的是 Live Activity 和 Dynamic Island 小部件扩展以及两个通知小部件扩展。
\nShowing Recent Messages\nCycle inside <Target>; building could produce unreliable results.\nCycle details:\n\xe2\x86\x92 Target \'<Target>\': ExtractAppIntentsMetadata\n\xe2\x97\x8b Target \'<Target>\' has copy command from \'/Users/apple/Library/Developer/Xcode/DerivedData/<Target>-hifbytcglbabrcgbkmfgnzgmwpmj/Build/Products/Debug-iphoneos/LiveActivityDynamicIslandExtension.appex\' to \'/Users/apple/Library/Developer/Xcode/DerivedData/<Target>-hifbytcglbabrcgbkmfgnzgmwpmj/Build/Products/Debug-iphoneos/<Target>.app/PlugIns/LiveActivityDynamicIslandExtension.appex\'\n\xe2\x97\x8b That command depends on command in Target \'<Target>\': script phase \xe2\x80\x9c[CP-User] [RNFB] Core Configuration\xe2\x80\x9d\n\xe2\x97\x8b Target \'<Target>\' has process command with output \'/Users/apple/Library/Developer/Xcode/DerivedData/<Target>-hifbytcglbabrcgbkmfgnzgmwpmj/Build/Products/Debug-iphoneos/<Target>.app/Info.plist\'\n\xe2\x97\x8b Target \'<Target>\' has copy command from \'/Users/apple/Library/Developer/Xcode/DerivedData/<Target>-hifbytcglbabrcgbkmfgnzgmwpmj/Build/Products/Debug-iphoneos/LiveActivityDynamicIslandExtension.appex\' to \'/Users/apple/Library/Developer/Xcode/DerivedData/<Target>-hifbytcglbabrcgbkmfgnzgmwpmj/Build/Products/Debug-iphoneos/<Target>.app/PlugIns/LiveActivityDynamicIslandExtension.appex\'\n
Run Code Online (Sandbox Code Playgroud)\n\n react-native ×4
expo ×3
android ×2
google-play ×1
gradle ×1
ios ×1
javascript ×1
kotlin ×1
monorepo ×1
npm ×1
reactjs ×1
typescript ×1
xcode ×1
xcode15 ×1