ReactJS.NET v5.2 Release Notes

Release Date: 2020-06-19 // over 1 year ago
  • ๐Ÿš€ ๐Ÿš€ We're pleased to announce the release of ReactJS.NET 5.2. In this release:

    Templates

    โšก๏ธ 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
    

    The reactnet-vanilla template 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:

    vendor.8faee7f5.js
    main-0c14766b.js
    

    ๐Ÿ”ง Configure reading these files server-side with config.SetReactAppBuildPath("~/dist"); where dist is 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 dist directory and be mapped into script and style tags for the browser to download.

    The reactnet-webpack sample uses this layout, so give it a try if you're curious!

    Thanks

    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

    Cheers,
    Dustin


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.

    Cheers!