ReactJS.NET 0.2 - MSBuild and Linux Support

April 16, 2014 by Daniel Lo Nigro


I'm happy to announce the release of ReactJS.NET 0.2! This is a minor release and adds a number of new features:

  • Precompilation of JSX files via MSBuild
  • Partial Linux (Mono) support. Server-side component rendering is supported, but JSX compilation is not yet supported. To use JSX on Mono, you will need to precompile your JSX files via MSBuild.
  • Cassette MSBuild support - Bundle and minify your JavaScript before deployment to improve performance

Internal technical changes:

  • React core no longer depends on System.Web, for easier use outside of an ASP.NET context (eg. in a command-line or OWIN application)
  • JSX transformation split from IReactEnvironment into new IJsxTransformer interface. The previous IReactEnvironment.LoadJsxFile and IReactEnvironment.TransformJsx methods have been marked as obsolete, please use IReactEnvironment.JsxTransformer.TransformJsxFile instead.

Have fun, and as always, please feel free to send feedback or bug reports on GitHub.

— Daniel

Use React and JSX in ASP.NET MVC

April 4, 2014 by Daniel Lo Nigro


Cross-posted from the official React blog.


Today we're happy to announce the initial release of ReactJS.NET, which makes it easier to use React and JSX in .NET applications, focusing specifically on ASP.NET MVC web applications. It has several purposes:

  • On-the-fly JSX to JavaScript compilation. Simply reference JSX files and they will be compiled and cached server-side.

    <script src="@Url.Content("/Scripts/HelloWorld.jsx")"></script>
    
  • JSX to JavaScript compilation via popular minification/combination libraries (Cassette and ASP.NET Bundling and Minification). This is suggested for production websites.

  • Server-side component rendering to make your initial render super fast.

Even though we are focusing on ASP.NET MVC, ReactJS.NET can also be used in Web Forms applications as well as non-web applications (for example, in build scripts). ReactJS.NET currently only works on Microsoft .NET but we are working on support for Linux and Mac OS X via Mono as well.

Installation #

ReactJS.NET is packaged in NuGet. Simply run Install-Package React.Mvc4 in the package manager console or search NuGet for "React" to install it. See the documentation for more information. The GitHub project contains a sample website demonstrating all of the features.

Let us know what you think, and feel free to send through any feedback and report bugs on GitHub.