Uh oh!
There was an error while loading. Please reload this page.
Add a way to access the underlying JavaScriptCore context - #10399
Conversation
facebook-github-bot
commented
Oct 15, 2016
By analyzing the blame information on this pull request, we identified @adamjernst and @cjhopman to be potential reviewers. |
@nikki93 I believe this will be extremely useful for a project I'm working on. Could this be extended to also allow access for creating a separate JSCore context from JS-land? I'm currently using a WebView context to evaluate user generated code but would prefer access to a context without having to write a bridge into a native module. |
ide
commented
Oct 15, 2016
@dannycochran there's an experimental WebWorker API on RN which allows for that, but this PR is substantially different. It exposes a JSContext pointer to native code and doesn't create a new JSContext with a new RN environment (this is what WebWorkers do) or interact with JavaScript at all. I recommend you write a native module that addresses your use cases because they sound rather different than the ones this PR addresses. |
lexs
commented
Oct 26, 2016
nikki93
commented
Oct 26, 2016
@lexs Oh great! Yeah I'm ready for a merge! |
lexs
commented
Oct 26, 2016
@nikki93 Github reports a conflict in |
3dc2b5b to
c8405d1Comparenikki93
commented
Oct 26, 2016
@lexs Fixed! |
facebook-github-bot
commented
Oct 26, 2016
@lexs has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Summary: **Motivation** I'm working on a project that uses React Native and needs to add direct synchronous bindings to native stuff through the JavaScriptCore C API. This is because it's performance-sensitive and would benefit from the quickest JS->C path. It does this using cross-platform C++ code that works on both iOS and Android. Most of the infrastructure for getting access to the JSC context is already in React Native actually, just had to add a few more things. (lexs you mentioned to tag you in this pull request) **Test plan** Modify the JavaScriptCore context through the `JSContextRef` returned (eg. add an object at global scope) and verify that it exists in JavaScript. Closesreact#10399 Differential Revision: D4080945 Pulled By: lexs fbshipit-source-id: 6659b7a01e09fd84475adde183c1d3aca2d4cf09
Summary: **Motivation** I'm working on a project that uses React Native and needs to add direct synchronous bindings to native stuff through the JavaScriptCore C API. This is because it's performance-sensitive and would benefit from the quickest JS->C path. It does this using cross-platform C++ code that works on both iOS and Android. Most of the infrastructure for getting access to the JSC context is already in React Native actually, just had to add a few more things. (lexs you mentioned to tag you in this pull request) **Test plan** Modify the JavaScriptCore context through the `JSContextRef` returned (eg. add an object at global scope) and verify that it exists in JavaScript. Closesreact#10399 Differential Revision: D4080945 Pulled By: lexs fbshipit-source-id: 6659b7a01e09fd84475adde183c1d3aca2d4cf09
Motivation
I'm working on a project that uses React Native and needs to add direct synchronous bindings to native stuff through the JavaScriptCore C API. This is because it's performance-sensitive and would benefit from the quickest JS->C path. It does this using cross-platform C++ code that works on both iOS and Android. Most of the infrastructure for getting access to the JSC context is already in React Native actually, just had to add a few more things.
(@lexs you mentioned to tag you in this pull request)
Test plan
Modify the JavaScriptCore context through the
JSContextRefreturned (eg. add an object at global scope) and verify that it exists in JavaScript.