Skip to content
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

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

Open
superzcj opened this issue Mar 19, 2020 · 5 comments

Comments

@superzcj
Copy link

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

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

@showlllw
Copy link

showlllw commented Apr 3, 2020

重新实例化过bridge试过吗?

@superzcj
Copy link
Author

superzcj commented Apr 3, 2020

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

@superzcj
Copy link
Author

superzcj commented Apr 3, 2020

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

旧业务包

  "index_home_page.js":100000,

新业务包

  "index_home_page.js":110000,

@liuchengjian
Copy link

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

@ykl522
Copy link

ykl522 commented Nov 5, 2021

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

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

No branches or pull requests

4 participants