react-native-multibundler icon indicating copy to clipboard operation
react-native-multibundler copied to clipboard

旧的业务包已加载,如何重新加载通过热更新下发的新包?

Open superzcj opened this issue 4 years ago • 5 comments

当app内置的旧的业务包已加载,此时收到热更新下发的新包,加载新包,新代码并没有生效,仍是旧包的效果。

CodePush 热更新成功后,通过 reload 方法(ios)可以重新加载整个bundle,拆包后 reload 方法不能用了,请问有别的方式可以代替吗?

superzcj avatar Mar 19 '20 08:03 superzcj

重新实例化过bridge试过吗?

showlllw avatar Apr 03 '20 02:04 showlllw

重新实例化bridge,不太好吧,因为可能已经加载过几个业务包,页面也在导航栈中,重新创建bridge,这些已存在的业务包和页面怎么处理?

superzcj avatar Apr 03 '20 05:04 superzcj

目前的做法是,新的业务包改变初始索引,这样生成的新包跟旧包不一样,executeSourceCode 就能正常加载新包。

旧业务包

  "index_home_page.js":100000,

新业务包

  "index_home_page.js":110000,

superzcj avatar Apr 03 '20 05:04 superzcj

我修改了新业务包的索引,在android端还是不能正常加载业务包,还是原来的业务包,重启后能正常加载

liuchengjian avatar Sep 18 '20 02:09 liuchengjian

我试了改索引后还要业务包名字不一样, 比如旧的叫index_V1.android.bundle, 新的业务包叫index_V2.android.bundle.zip

ykl522 avatar Nov 05 '21 02:11 ykl522