ReactJS.NET v5.2 Release NotesRelease Date: 2020-06-19 // over 3 years ago
🚀 🚀 We're pleased to announce the release of ReactJS.NET 5.2. In this release:
⚡️ This update contains a brand new feature - templates! This feature makes it much easier to get started on a new project.
To start a new ASP.NET Core project using React and server-side rendering:
dotnet new -i React.Template dotnet new reactnet-webpack dotnet run
reactnet-vanillatemplate is also available for projects that don't need webpack.
👍 Webpack Asset Manifest Support
💅 If you've ever wanted to use hashes in the filenames of generated assets, this feature is for you! When using Webpack and
webpack-manifest-plugin, it's now possible to render the script and style tags automatically from the generated asset manifest. This can be especially helpful when using caching headers to instruct the client not to refetch these static assets from the server.
If using the filename pattern
'[name].[contenthash:8].js', webpack will emit files that look like this:
🔧 Configure reading these files server-side with
distis the directory where webpack emits the built assets.
In your view code, call:
@Html.ReactGetStylePaths() // in the doucment head next to other stylesheets @Html.ReactGetScriptPaths() // right before the body closing tag
Next, define an asset manifest format in your webpack config. Check out the sample webpack config for the format the asset manifest is expected to follow.
💅 At render time, the asset manifest will be read from the
distdirectory and be mapped into
styletags for the browser to download.
reactnet-webpacksample uses this layout, so give it a try if you're curious!
If this library has made a difference to you in either a work or personal project, I'd love to hear from you. We don't get paid at all to work on this, it's just for fun! Drop a line @dustinsoftware or @Daniel15
Previous changes from v5.1.2
🚀 🚀 We're pleased to announce the release of ReactJS.NET 5.1.2. A few small updates in this release:
- ⚡️ .NET Core 3.0 support. The tutorial project has also been updated to demonstrate the (simple!) migration path.
- ⚡️ React and ReactDOM updated to 16.12.0
- 🛠 Fix missing query parameter mapping for React.Router - thanks @mattywong
Please report any bugs in the issue tracker.