Skip to content

Commit 49fd203

Browse files
committed
Update some outdated pages on the site
1 parent 5d9659d commit 49fd203

File tree

11 files changed

+36
-78
lines changed

11 files changed

+36
-78
lines changed

Diff for: site/jekyll/_posts/2015-10-17-2.0.0-release.md

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Full list of changes:
1414
* 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.
1515

1616
Under the hood:
17+
1718
* [#168](https://github.com/reactjs/React.NET/issues/168) - Everything relating to JSX transformer has been renamed to Babel (eg. `IJsxTransformer` is now `IBabel`).
1819
* 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.
1920
* Deprecated `IReactEnvironment.TransformJsxFile` and `IReactEnvironment.TransformJsx` have finally been removed. These methods have been obsolete since ReactJS.NET 0.2.

Diff for: site/jekyll/dev/code-structure.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ are just a regular user of ReactJS.NET, you don't have to read it.
88

99
Assemblies
1010
----------
11-
ReactJS.NET is split into several different dependencies (React, React.Web,
12-
etc.). Ideally, the main "React" assembly should have as few dependencies as
11+
ReactJS.NET is split into several different dependencies (React.Core, React.Web,
12+
etc.). Ideally, the main "React.Core" assembly should have as few dependencies as
1313
possible. Dependencies with third-party libraries should be kept in separate
1414
assemblies unless they're required by core ReactJS.NET functionality (such as
1515
JavaScript engines)

Diff for: site/jekyll/getting-started/aspnet5.md

+13-10
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ title: Getting Started on ASP.NET 5
66

77
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.
88

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.
1010

1111
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:
1212
```
@@ -27,7 +27,7 @@ services.AddReact();
2727
```
2828

2929

30-
Directly above:
30+
Directly **above**:
3131

3232
```csharp
3333
// Add static files to the request pipeline.
@@ -37,21 +37,24 @@ app.UseStaticFiles();
3737
Add:
3838

3939
```csharp
40+
// Initialise ReactJS.NET. Must be before static files.
4041
app.UseReact(config =>
4142
{
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);
4843
// If you want to use server-side rendering of React components,
4944
// add all the necessary JavaScript files here. This includes
5045
// your components as well as all of their dependencies.
5146
// See http://reactjs.net/ for more information. Example:
5247
//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
54+
// scripts. Example:
55+
//config
56+
// .SetLoadBabel(false)
57+
// .AddScriptWithoutTransform("~/Scripts/bundle.server.js");
5558
});
5659
```
5760

Diff for: site/jekyll/getting-started/download.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ feature or fixing a bug):
5151
2. Reference React.dll and React.Mvc4.dll (if using MVC 4) in your Web
5252
Application project
5353

54-
Your first build always needs to be done using the build script (build.bat) as
54+
Your first build always needs to be done using the build script (`dev-build.bat`) as
5555
this generates a few files required by the build (such as
5656
`SharedAssemblyVersionInfo.cs`). Once this build is completed, you can open
5757
`React.sln` in Visual Studio and compile directly from Visual Studio.

Diff for: site/jekyll/guides/cassette.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ bundles.Add<ScriptBundle>("main.js",
2424
This will add all three files into a `main.js` bundle that you can reference and
2525
render from your view using Cassette:
2626

27-
```html{2-3,13}
27+
```html{2-3,14}
2828
@{
2929
Bundles.Reference("main.css");
3030
Bundles.Reference("main.js");

Diff for: site/jekyll/guides/es6.md

+3-18
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
layout: docs
3-
title: ES6 Features
3+
title: ES6 Features (Babel)
44
---
55

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:
77

88
* **[Arrow functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/arrow_functions)** &mdash; A syntax for inline lambda functions similar to C#. These are very useful when combined with the `map` and `filter` methods of arrays:
99

@@ -52,19 +52,4 @@ foo.add(2, 3); // 5
5252
```
5353

5454
* **[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](/guides/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-
```
55+
* And more! See the [Babel website](http://babeljs.io/docs/learn-es2015/) for a full list of supported features.

Diff for: site/jekyll/guides/flow.md

-24
This file was deleted.

Diff for: site/jekyll/guides/mono.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ layout: docs
33
title: Linux (Mono)
44
---
55

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:
97

108
```sh
119
# Get a supported version of V8
@@ -32,6 +30,4 @@ cp libVroomJsNative.so /usr/local/lib/
3230
ldconfig
3331
```
3432

35-
Once this has been completed, install the **React.JavaScriptEngine.VroomJs** package to your website.
36-
3733
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/)

Diff for: site/jekyll/guides/msbuild.md

+5-7
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,28 @@ layout: docs
33
title: MSBuild
44
---
55

6-
**New in ReactJS.NET 0.2**
7-
86
ReactJS.NET includes an MSBuild task for compiling JSX into JavaScript. This is
97
handy to improve the start time of your application, especially if you have a
108
large number of JSX files.
119

12-
To use it, first reference the `TransformJsx` task, and then call it wherever
10+
To use it, first reference the `TransformBabel` task, and then call it wherever
1311
you like:
1412

1513
```xml
1614
<UsingTask
1715
AssemblyFile="tools\React\React.MSBuild.dll"
18-
TaskName="TransformJsx"
16+
TaskName="TransformBabel"
1917
/>
20-
<Target Name="TransformJsx">
21-
<TransformJsx SourceDir="$(MSBuildProjectDirectory)" TargetDir="" />
18+
<Target Name="TransformBabel">
19+
<TransformBabel SourceDir="$(MSBuildProjectDirectory)" TargetDir="" />
2220
</Target>
2321
```
2422

2523
To get started easily, you can install the [React.MSBuild]
2624
(https://www.nuget.org/packages/React.MSBuild/) NuGet package which will
2725
automatically modify your web application's `.csproj` file to reference the task
2826
and run it after every site compilation. To customise the process (for example,
29-
to only compile the JSX files for release builds), modify the `TransformJsx`
27+
to only compile the JSX files for release builds), modify the `TransformBabel`
3028
build target that was added to the csproj file.
3129

3230
The NuGet package is good for getting started quickly, but it has some

Diff for: site/jekyll/guides/server-side-rendering.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ If there is no need to have a React application client side and you just want to
8383
@Html.React("HelloWorld", new
8484
{
8585
name = "Daniel"
86-
}
87-
serverOnly:true)
86+
}, serverOnly: true)
8887
```
8988

9089
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
9695
<span>Daniel</span>
9796
</div>
9897
</div>
99-
```
98+
```

Diff for: site/jekyll/guides/weboptimizer.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ title: ASP.NET Bundling and Minification
55

66
ReactJS.NET supports the use of Microsoft's
77
[ASP.NET Bundling and Minification](http://www.asp.net/mvc/tutorials/mvc-4/bundling-and-minification)
8-
library to compile JSX into JavaScript and minify it along with all your other
9-
JavaScript. Simply create a `JsxBundle` containing any number of JSX or regular
8+
library to transform JavaScript via Babel, and minify it along with all your other
9+
JavaScript. Simply create a `BabelBundle` containing any number of JSX or regular
1010
JavaScript files:
1111

1212
```csharp
1313
// In BundleConfig.cs
14-
bundles.Add(new JsxBundle("~/bundles/main").Include(
14+
bundles.Add(new BabelBundle("~/bundles/main").Include(
1515
// Add your JSX files here
1616
"~/Content/HelloWorld.react.jsx",
1717
"~/Content/AnythingElse.react.jsx",
@@ -20,17 +20,17 @@ bundles.Add(new JsxBundle("~/bundles/main").Include(
2020
));
2121
```
2222

23-
`JsxBundle` will compile your JSX to JavaScript and then minify it. For more
23+
`BabelBundle` will compile your JSX to JavaScript and then minify it. For more
2424
control (eg. if you want to run other transforms as well), you can use
25-
`JsxTransform` directly:
25+
`BabelTransform` directly:
2626

2727
```csharp
2828
// In BundleConfig.cs
2929
bundles.Add(new Bundle("~/bundles/main", new IBundleTransform[]
3030
{
31-
// This works the same as JsxBundle (transform then minify) but you could
31+
// This works the same as BabelBundle (transform then minify) but you could
3232
//add your own transforms as well.
33-
new JsxTransform(),
33+
new BabelTransform(),
3434
new JsMinify(),
3535
}).Include(
3636
"~/Content/HelloWorld.react.jsx"

0 commit comments

Comments
 (0)