The library for web and native user interfaces.
add working with your environment section
petehunt committed
Jul 14, 2013 at 16:11 UTC
21ea1ac61e087fe5d6d273f7e129cd5287b134c1
2 files changed
+31
-2
docs/docs/refactor/00-table-of-contents.md
+2
-2
@@ -53,11 +53,11 @@ Working with the browser
53
- Component lifecycle
54
- Browser support and polyfills
55
56
-Working with your development and production environments
56
+Working with your environment
57
- CDN-hosted React
58
- Using master
59
- In-browser JSX transform
60
-- Precompiled JSX
60
+- Productionizing: precompiled JSX
61
- Helpful open-source projects
62
63
Integrating with other UI libraries
docs/docs/refactor/08-working-with-your-environment.md
new
+29
@@ -0,0 +1,29 @@
1
+# Working with your environment
2
+
3
+Every project uses a different system for building and deploying JavaScript. We've tried to make React as environment-agnostic as possible.
4
+
5
+## CDN-hosted React
6
+
7
+We provide CDN-hosted versions of React [on our download page](/react/downloads.html). These prebuilt files use the UMD module format. Dropping them in with a simple `<script>` tag will inject a `React` global into your environment. It also works out-of-the-box in CommonJS and AMD environments.
8
+
9
+## Using master
10
+
11
+We have instructions for building from master [in our GitHub repository](https://github.com/facebook/react). We build a tree of CommonJS modules under `build/modules` which you can drop into any environment or packaging tool that supports CommonJS.
12
+
13
+## In-browser JSX transform
14
+
15
+If you like using JSX, we provide an in-browser JSX transformer for development [on our download page](/react/downloads.html). Simply include a `<script type="text/jsx">` tag to engage the JSX transformer. Be sure to include the `/** @jsx React.DOM */` comment as well, otherwise the transformer will not run the transforms.
16
+
17
+**Warning:** the in-browser JSX transformer is fairly large and is extra computation. Do not use it in production -- see the next section.
18
+
19
+## Productionizing: precompiled JSX
20
+
21
+If you have [npm](http://npmjs.org/), you can simply run `npm install -g react-tools` to install our command-line `jsx` tool. This tool will translate files that use JSX syntax to plain JavaScript files that can run directly in the browser. It will also watch directories for you and automatically transform files when they are changed; for example: `jsx --watch src/ build/`. Run `jsx --help` for more information on how to use this tool.
22
+
23
+## Helpful open-source projects
24
+
25
+The open-source community has built tools that integrate JSX with several build systems.
26
+
27
+* [reactify](https://github.com/andreypopp/reactify) - use JSX with [browserify](http://browserify.org/).
28
+* [grunt-react](https://github.com/ericclemmons/grunt-react) - [grunt](http://gruntjs.com/) task for JSX
29
+* [require-jsx](https://github.com/seiffert/require-jsx) - use JSX with [require.js](http://requirejs.org/)
\ No newline at end of file