Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

[jsfm] Enhance the multi-instance isolation (sandbox) #960

Closed
wants to merge 5 commits into from

Conversation

Hanks10100
Copy link
Contributor

According to the discussion in the mailing list (Use multi-context for Weex page), the current isolation strategy is vulnerable, distinguish the "Global Context" and the "Instance Context" is a more reasonable solution.

In practice, the logic of instance management and code execution will be moved from js framework to native render engines.

This PR implement a new createInstanceContext API instead of the former createInstance to create the instance context for each page. Refer to this PR to see the modification in the Vue.js framework. Rax doesn't support it yet.

As for native render engines, they should also call createInstanceContext instead of createInstance, and parse the bundle type of the code (Vue or Rax) and then send it to js framework.

upgrade weex-vue-framework to 2.5.11-weex.1
upgrade weex-rax-framework to 0.4.20
Use "createInstanceContext" instead of "createInstance".
JS Framework only needs to prepare the instance context and no longer
execute the js code. The js code will be executed by native.
This *sandbox* feature requires native to cooperate to achieve.
@weex-bot
Copy link

weex-bot commented Dec 28, 2017

Messages
📖 android test finished.

Generated by 🚫 dangerJS

@Hanks10100 Hanks10100 closed this Dec 28, 2017
@Hanks10100 Hanks10100 reopened this Dec 28, 2017
@Hanks10100
Copy link
Contributor Author

Hanks10100 commented Dec 28, 2017

@yacheng @acton393 @yuhun-alibaba Please take a review.

@Hanks10100 Hanks10100 force-pushed the jsfm-feature-sandbox branch 2 times, most recently from 0074792 to 9807474 Compare December 28, 2017 09:28
Copy link
Contributor

@yuhun-alibaba yuhun-alibaba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good work

@asfgit asfgit closed this in dc42844 Dec 29, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants