You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by GitBox <gi...@apache.org> on 2018/11/16 09:04:33 UTC

[GitHub] HJaycee opened a new pull request #1770: [iOS]Fix bug: register service method needs a callback

HJaycee opened a new pull request #1770: [iOS]Fix bug: register service method needs a callback
URL: https://github.com/apache/incubator-weex/pull/1770
 
 
   The operation of registering service is in a child thread named jsthread. We must render page js after downloaded js service file and make sure it’s executed. So the register service method need a callback. In this callback, we render the page js.
   
   You can reproduce this bug, If you try to register a large size of js service file.
   
   中文解释:
   由于页面中用到了js service文件中的模块,所以我在iOS中先调用register service再调用render page,以确保页面加载前js service已经注册进来。
   但是当我注册了一个1.8M大小的js-service文件,我发现页面加载失败了。查看sdk源码发现register service内部执行js的过程是放在子线程进行的,所以我render page很可能会晚于register service。
   所以,register service方法需要支持回调,这样我们在回调中再去render page就不会出现页面加载出来但是register service还没执行完的情况了。

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services