1
0
mirror of https://gitcode.com/gh_mirrors/re/react-native-pushy.git synced 2025-09-17 21:56:11 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee

Compare commits

...

7 Commits

Author SHA1 Message Date
sunnylqm
3353c16fa3 v5.2.4 2019-09-01 20:57:33 +08:00
sunnylqm
93d2a6cccb 使用第三方的SSZipArchive以避免重复 2019-09-01 20:55:59 +08:00
sunnylqm
cfdc26f71d hermes路径变化 2019-08-28 12:21:18 +08:00
DengYun
b6a08a19c8 fix merge conflict 2019-08-16 17:01:01 +08:00
DengYun
ef53716df3 发布5.2.2 2019-08-16 15:13:55 +08:00
DengYun
551cbc33cc [Fix] 更妥当的方式处理iOS更新后立即回滚的问题 2019-08-16 13:21:47 +08:00
DengYun
56e6d790c1 Fix: 解决RN 0.59+ iOS更新后依然提示更新(一直回滚)的问题 2019-08-16 13:06:16 +08:00
4 changed files with 13 additions and 11 deletions

View File

@@ -59,6 +59,8 @@ typedef NS_ENUM(NSInteger, HotUpdateType) {
HotUpdateTypePatchFromPpk = 3,
};
static BOOL ignoreRollback = false;
@implementation RCTHotUpdate {
RCTHotUpdateManager *_fileManager;
}
@@ -92,7 +94,7 @@ RCT_EXPORT_MODULE(RCTHotUpdate);
BOOL isFirstLoadOK = [updateInfo[paramIsFirstLoadOk] boolValue];
NSString *loadVersioin = curVersion;
BOOL needRollback = (isFirstTime == NO && isFirstLoadOK == NO) || loadVersioin.length<=0;
BOOL needRollback = (!ignoreRollback && isFirstTime == NO && isFirstLoadOK == NO) || loadVersioin.length<=0;
if (needRollback) {
loadVersioin = lastVersion;
@@ -112,7 +114,10 @@ RCT_EXPORT_MODULE(RCTHotUpdate);
[defaults synchronize];
// ...need clear files later
}
else if (isFirstTime){
else if (isFirstTime && !ignoreRollback){
// bundleURL may be called many times, ignore rollbacks before process restarted again.
ignoreRollback = true;
NSMutableDictionary *newInfo = [[NSMutableDictionary alloc] initWithDictionary:updateInfo];
newInfo[paramIsFirstTime] = @(NO);
[defaults setObject:newInfo forKey:keyUpdateInfo];

View File

@@ -110,8 +110,9 @@ async function compileHermesByteCode(bundleName, outputFolder) {
} catch (e) {}
if (enableHermes) {
console.log(`Hermes enabled, now compiling to hermes bytecode:\n`);
const hermesPath = fs.existsSync('node_modules/hermes-engine') ? 'node_modules/hermes-engine' : 'node_modules/hermesvm';
exec(`
node_modules/hermesvm/${getHermesOSBin()}/hermes -emit-binary -out ${outputFolder}/${bundleName} ${outputFolder}/${bundleName} -O
${hermesPath}/${getHermesOSBin()}/hermes -emit-binary -out ${outputFolder}/${bundleName} ${outputFolder}/${bundleName} -O
echo Compiling done.
`);
}
@@ -421,9 +422,9 @@ export const commands = {
throw new Error('Platform must be specified.');
}
// const { version, major, minor } = getRNVersion();
const { version, major, minor } = getRNVersion();
// console.log('Bundling with React Native version: ', version);
console.log('Bundling with React Native version: ', version);
await runReactNativeBundleCommand(bundleName, dev, entryFile, intermediaDir, platform);

View File

@@ -1,6 +1,6 @@
{
"name": "react-native-update",
"version": "5.2.1",
"version": "5.2.4",
"description": "react-native hot update",
"main": "lib/index.js",
"scripts": {

View File

@@ -18,17 +18,13 @@ Pod::Spec.new do |s|
s.pod_target_xcconfig = { 'USER_HEADER_SEARCH_PATHS' => '"$(SRCROOT)/../node_modules/react-native-update/ios"' }
s.dependency 'React'
s.dependency 'SSZipArchive'
s.subspec 'RCTHotUpdate' do |ss|
ss.source_files = 'ios/RCTHotUpdate/*.{h,m}'
ss.public_header_files = ['ios/RCTHotUpdate/RCTHotUpdate.h']
end
s.subspec 'SSZipArchive' do |ss|
ss.source_files = 'ios/RCTHotUpdate/SSZipArchive/**/*.{h,m,c}'
ss.private_header_files = 'ios/RCTHotUpdate/SSZipArchive/**/*.h'
end
s.subspec 'BSDiff' do |ss|
ss.source_files = 'ios/RCTHotUpdate/BSDiff/**/*.{h,m,c}'
ss.private_header_files = 'ios/RCTHotUpdate/BSDiff/**/*.h'