Skip to content

Commit e65a533

Browse files
committed
Documentation for 1.1.0 release
1 parent 87e2ca7 commit e65a533

File tree

2 files changed

+87
-0
lines changed

2 files changed

+87
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
title: "ReactJS.NET 1.1 - Upgraded React and fixed a crash"
3+
layout: post
4+
author: Daniel Lo Nigro
5+
---
6+
7+
I'm happy to announce the release of ReactJS.NET 1.1! This is a minor release and includes a number of changes and fixes since version 1.1:
8+
9+
* React version upgraded from 0.10.0 to 0.11.1.
10+
* Fixed an [access violation exception](https://github.com/reactjs/React.NET/issues/28) when running in Release mode. *Thanks to [Paul Irwin](https://github.com/paulirwin) for reporting and [jlchmura](https://github.com/jlchmura) for fixing*.
11+
* Always transform JSX in bundles, even when the very first file doesn't have the `/** @jsx React.DOM */` directive. *Thanks to [Rick Beerendonk](https://github.com/rickbeerendonk)*.
12+
* [ES6 transforms](/guides/es6.html) are now turned off by default since they can conflict with other ES6 transpilers like Traceur. [Check the documentation](/guides/es6.html) to see how to enable them. *Thanks to [Aleksander Heintz](https://github.com/Alxandr)*.
13+
14+
Have fun, and as always, please feel free to send feedback or bug reports
15+
[on GitHub](https://github.com/reactjs/React.NET).
16+
17+
— Daniel

site/jekyll/guides/es6.md

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
layout: docs
3+
title: ES6 Features
4+
---
5+
6+
React can optionally use some ECMAScript 6 features thanks to the bundled version of [JSTransform](https://github.com/facebook/jstransform). ECMAScript 6 (or "ES6" for short) is the next version of ECMAScript/JavaScript and contains several useful features:
7+
8+
* **[Arrow functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/arrow_functions)** — A syntax for inline lambda functions similar to C#. These are very useful when combined with the `map` and `filter` methods of arrays:
9+
10+
```javascript
11+
var numbers = [1, 2, 3, 4];
12+
var doubled = numbers.map(number => number * 2); // [2, 4, 6, 8]
13+
```
14+
15+
Arrow functions also implicitly bind `this`, so you do not need to write `.bind(this)` when passing around a function as a callback.
16+
17+
* **Concise methods** — You no longer need to write `: function` in your object literals:
18+
19+
```javascript{13,16}
20+
// The old way
21+
var OldAndBusted = React.createClass({
22+
render: function() {
23+
// ...
24+
},
25+
doStuff: function() {
26+
// ...
27+
}
28+
});
29+
30+
// The new way
31+
var NewHotness = React.createClass({
32+
render() {
33+
// ...
34+
},
35+
doStuff() {
36+
// ...
37+
}
38+
});
39+
```
40+
41+
* **[Classes](http://wiki.ecmascript.org/doku.php?id=strawman:maximally_minimal_classes)** — Similar to the class systems included in JavaScript frameworks such as Prototype and MooTools, but will (eventually) be native to JavaScript
42+
43+
```javascript
44+
class AwesomeStuff {
45+
add(first, second) {
46+
return first + second;
47+
}
48+
}
49+
50+
var foo = new AwesomeStuff();
51+
foo.add(2, 3); // 5
52+
```
53+
54+
* **[Short object notation](http://ariya.ofilabs.com/2013/02/es6-and-object-literal-property-value-shorthand.html)**
55+
* And more! See the [JSTransform source code](https://github.com/facebook/jstransform/tree/master/visitors), you never know what goodies you'll find.
56+
57+
How to use
58+
----------
59+
To use the ES6 transforms, you'll need to enable them. For ASP.NET MVC sites, this is done in your `ReactConfig.cs` by calling `.SetUseHarmony(true)`:
60+
61+
```csharp{2}
62+
ReactSiteConfiguration.Configuration
63+
.SetUseHarmony(true)
64+
.AddScript("~/Content/Sample.jsx");
65+
```
66+
If you are using [MSBuild to precompile your JSX](/guide/msbuild.html), you also need to enable it in MSBuild via the `UseHarmony="true"` flag in your build script (`TransformJsx.proj` by default):
67+
68+
```xml
69+
<TransformJsx SourceDir="$(MSBuildProjectDirectory)" UseHarmony="true" />
70+
```

0 commit comments

Comments
 (0)