You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: site/jekyll/_posts/2015-10-17-2.0.0-release.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,7 @@ Full list of changes:
14
14
* By default, only handle `*.jsx` files in ASP.NET 5 and OWIN middleware. You can modify the `Extensions` setting in `BabelFileOptions` to change this behaviour.
15
15
16
16
Under the hood:
17
+
17
18
*[#168](https://github.com/reactjs/React.NET/issues/168) - Everything relating to JSX transformer has been renamed to Babel (eg. `IJsxTransformer` is now `IBabel`).
18
19
* Renamed `React` assembly to `React.Core`. The NuGet package has been called "React.Core" forever, but the corresponding assembly name didn't match, resulting in confusion.
19
20
* Deprecated `IReactEnvironment.TransformJsxFile` and `IReactEnvironment.TransformJsx` have finally been removed. These methods have been obsolete since ReactJS.NET 0.2.
Copy file name to clipboardExpand all lines: site/jekyll/getting-started/aspnet5.md
+13-10Lines changed: 13 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ title: Getting Started on ASP.NET 5
6
6
7
7
Getting started with ReactJS.NET on ASP.NET 5 and MVC 6 requires a few more steps compared to previous versions of ASP.NET and MVC. A more fully featured tutorial will be released once the stable release of ASP.NET 5 is out.
8
8
9
-
Note that ASP.NET 5 is still in beta, and so there may still be some sharp edges. ReactJS.NET requires at least Visual Studio 2015 and ASP.NET 5 Beta 6. Additionally, ReactJS.NET does not support the Core CLR at this point in time, so you will need to ensure your project is not referencing it. Remove the `"dnxcore50": { }` line from your `project.json` file.
9
+
Note that ASP.NET 5 is still in beta, and so there may still be some sharp edges. ReactJS.NET requires at least Visual Studio 2015 and ASP.NET 5 **Beta 8**. Additionally, ReactJS.NET does not support the Core CLR at this point in time, so you will need to ensure your project is not referencing it. Remove the `"dnxcore50": { }` line from your `project.json` file.
10
10
11
11
Once this has been removed, install the `React.AspNet` package through NuGet. After the package is installed, ReactJS.NET needs to be initialised in your `Startup.cs` file (unfortunately this can not be done automatically like in previous versions of ASP.NET with WebActivator). At the top of the file, add:
12
12
```
@@ -27,7 +27,7 @@ services.AddReact();
27
27
```
28
28
29
29
30
-
Directly above:
30
+
Directly **above**:
31
31
32
32
```csharp
33
33
// Add static files to the request pipeline.
@@ -37,21 +37,24 @@ app.UseStaticFiles();
37
37
Add:
38
38
39
39
```csharp
40
+
// Initialise ReactJS.NET. Must be before static files.
40
41
app.UseReact(config=>
41
42
{
42
-
// ES6 features are enabled by default. Uncomment the below line to disable them.
43
-
// See http://reactjs.net/guides/es6.html for more information.
44
-
//config.SetUseHarmony(false);
45
-
// Uncomment the below line if you are using Flow
46
-
// See http://reactjs.net/guides/flow.html for more information.
47
-
//config.SetStripTypes(true);
48
43
// If you want to use server-side rendering of React components,
49
44
// add all the necessary JavaScript files here. This includes
50
45
// your components as well as all of their dependencies.
51
46
// See http://reactjs.net/ for more information. Example:
52
47
//config
53
-
// .AddScript("~/Scripts/First.jsx")
54
-
// .AddScript("~/Scripts/Second.jsx");
48
+
// .AddScript("~/Scripts/First.jsx")
49
+
// .AddScript("~/Scripts/Second.jsx");
50
+
51
+
// If you use an external build too (for example, Babel, Webpack,
52
+
// Browserify or Gulp), you can improve performance by disabling
53
+
// ReactJS.NET's version of Babel and loading the pre-transpiled
Copy file name to clipboardExpand all lines: site/jekyll/guides/es6.md
+3-18Lines changed: 3 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
1
---
2
2
layout: docs
3
-
title: ES6 Features
3
+
title: ES6 Features (Babel)
4
4
---
5
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:
6
+
ReactJS.NET supports the use of ECMAScript 6 features, thanks to [Babel](http://babeljs.io/). These features include:
7
7
8
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:
* 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](/guides/msbuild.html), you also need to enable it in MSBuild via the `UseHarmony="true"` flag in your build script (`TransformJsx.proj` by default):
Copy file name to clipboardExpand all lines: site/jekyll/guides/mono.md
+1-5Lines changed: 1 addition & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,9 +3,7 @@ layout: docs
3
3
title: Linux (Mono)
4
4
---
5
5
6
-
**New in ReactJS.NET 1.0**
7
-
8
-
ReactJS.NET 1.0 includes full support for Mono via Google's [V8 JavaScript engine](https://code.google.com/p/v8/), the same engine used by Google Chrome and Node.js. To use ReactJS.NET with Mono, you need to compile V8 and VroomJs (a .NET wrapper around V8). This can be accomplished by running the following shell commands on your Linux or Mac OS X machine:
6
+
ReactJS.NET includes full support for Mono via Google's [V8 JavaScript engine](https://code.google.com/p/v8/), the same engine used by Google Chrome and Node.js. To use ReactJS.NET with Mono, you need to compile V8 and VroomJs (a .NET wrapper around V8). This can be accomplished by running the following shell commands on your Linux or Mac OS X machine:
Once this has been completed, install the **React.JavaScriptEngine.VroomJs** package to your website.
36
-
37
33
If VroomJs fails to load, you will see an exception when your application is started. If this happens, run Mono with the `MONO_LOG_LEVEL=debug` environment variable to get more useful debugging information. Often, this occurs when Mono is unable to locate V8 (ie. it's not in /usr/lib/ or /usr/local/lib/)
Copy file name to clipboardExpand all lines: site/jekyll/guides/server-side-rendering.md
+2-3Lines changed: 2 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,8 +83,7 @@ If there is no need to have a React application client side and you just want to
83
83
@Html.React("HelloWorld", new
84
84
{
85
85
name="Daniel"
86
-
}
87
-
serverOnly:true)
86
+
}, serverOnly: true)
88
87
```
89
88
90
89
And the Html mark up will look like the one following which is a lot cleaner. In this case there is no need to load the React script or call the `Html.ReactInitJavaScript()` method.
@@ -96,4 +95,4 @@ And the Html mark up will look like the one following which is a lot cleaner. In
0 commit comments