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-03-02-1.4.0-release.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ I'm happy to announce the release of ReactJS.NET 1.4! This release adds support
8
8
9
9
Full list of changes:
10
10
11
-
*[#47](https://github.com/reactjs/React.NET/issues/47) and [#94](https://github.com/reactjs/React.NET/pull/94) — Support for ASP.NET 5. You must be using Visual Studio 2015 CTP6 and ASP.NET 5 Beta 3. Documentation will be added to the site shortly.
11
+
*[#47](https://github.com/reactjs/React.NET/issues/47) and [#94](https://github.com/reactjs/React.NET/pull/94) — [Support for ASP.NET 5](/getting-started/aspnet5.html). You must be using Visual Studio 2015 CTP6 and ASP.NET 5 Beta 3. Documentation will be added to the site shortly.
12
12
*[#86](https://github.com/reactjs/React.NET/issues/86) — `console` calls such as `console.log` during server-side rendering will automatically be propagated to the client-side. This can greatly assist in debugging server-side rendering. Nicer debugging tools will come in the future!
13
13
*[#96](https://github.com/reactjs/React.NET/issues/96) — Bundle V8 support by default, stop relying on MSIE engine as much.
14
14
*[#97](https://github.com/reactjs/React.NET/issues/97) — Upgrade to JSPool 0.2. This improves the handling of JavaScript engines by recycling them after a number of uses, which ensures memory usage doesn't keep growing over time.
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
+
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 CTP6 and ASP.NET 5 Beta 3. 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 `"aspnetcore50": { }` line from your `project.json` file.
10
+
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
+
```
13
+
using React.AspNet;
14
+
```
15
+
16
+
Directly above:
17
+
18
+
```csharp
19
+
// Add MVC services to the services container.
20
+
services.AddMvc();
21
+
```
22
+
23
+
Add:
24
+
25
+
```csharp
26
+
services.AddReact();
27
+
```
28
+
29
+
30
+
Directly above:
31
+
32
+
```csharp
33
+
// Add static files to the request pipeline.
34
+
app.UseStaticFiles();
35
+
```
36
+
37
+
Add:
38
+
39
+
```csharp
40
+
app.UseRequestServices();
41
+
app.UseReact(config=>
42
+
{
43
+
// ES6 features are enabled by default. Uncomment the below line to disable them.
44
+
// See http://reactjs.net/guides/es6.html for more information.
45
+
//config.SetUseHarmony(false);
46
+
// Uncomment the below line if you are using Flow
47
+
// See http://reactjs.net/guides/flow.html for more information.
48
+
//config.SetStripTypes(true);
49
+
// If you want to use server-side rendering of React components,
50
+
// add all the necessary JavaScript files here. This includes
51
+
// your components as well as all of their dependencies.
52
+
// See http://reactjs.net/ for more information. Example:
53
+
//config
54
+
// .AddScript("~/Scripts/First.jsx")
55
+
// .AddScript("~/Scripts/Second.jsx");
56
+
});
57
+
```
58
+
59
+
Finally, add this to `Views/_GlobalImport.cshtml` (or create it if it doesn't exist):
60
+
61
+
```csharp
62
+
@usingReact.AspNet
63
+
```
64
+
65
+
Once ReactJS.NET has been configured, you will be able to use [on-the-fly JSX to JavaScript compilation](http://reactjs.net/getting-started/usage.html) and [server-side rendering](http://reactjs.net/guides/server-side-rendering.html).
0 commit comments