From 6efb29fac49b20fb7f3fb566cea97a71056869a4 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Wed, 3 Jun 2015 17:02:50 +0000 Subject: [PATCH] update website --- docs/javascript-environment.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/javascript-environment.html b/docs/javascript-environment.html index 2de13e105ee..f30a4026535 100644 --- a/docs/javascript-environment.html +++ b/docs/javascript-environment.html @@ -1,4 +1,4 @@ -React Native | A framework for building native apps using React

JavaScript Environment

JavaScript Runtime #

When using React Native, you're going to be running your JavaScript code in two environments:

  • In the simulator and on the phone: JavaScriptCore which is the JavaScript engine that powers Safari and web views. Due to the absence of writable executable memory in iOS apps, it doesn't run with JIT.
  • When using Chrome debugging, it runs all the JavaScript code within Chrome itself and communicates with Objective-C via WebSocket. So you are using V8.

While both environments are very similar, you may end up hitting some inconsistencies. We're likely going to experiment with other JS engines in the future, so it's best to avoid relying on specifics of any runtime.

JavaScript Syntax Transformers #

Syntax transformers make writing code more enjoyable by allowing you to use new JavaScript syntax without having to wait for support on all interpreters.

As of version 0.5.0, React Native ships with the Babel JavaScript compiler. Check Babel documentation on its supported transformations for more details.

Here's a full list of React Native's enabled transformations.

ES5

  • Reserved Words: promise.catch(function() { });

ES6

ES7

© 2015 Facebook Inc.

JavaScript Environment

JavaScript Runtime #

When using React Native, you're going to be running your JavaScript code in two environments:

  • In the simulator and on the phone: JavaScriptCore which is the JavaScript engine that powers Safari and web views. Due to the absence of writable executable memory in iOS apps, it doesn't run with JIT.
  • When using Chrome debugging, it runs all the JavaScript code within Chrome itself and communicates with Objective-C via WebSocket. So you are using V8.

While both environments are very similar, you may end up hitting some inconsistencies. We're likely going to experiment with other JS engines in the future, so it's best to avoid relying on specifics of any runtime.

JavaScript Syntax Transformers #

Syntax transformers make writing code more enjoyable by allowing you to use new JavaScript syntax without having to wait for support on all interpreters.

As of version 0.5.0, React Native ships with the Babel JavaScript compiler. Check Babel documentation on its supported transformations for more details.

Here's a full list of React Native's enabled transformations.

ES5

  • Reserved Words: promise.catch(function() { });

ES6

ES7

© 2015 Facebook Inc.