ХабрПостыНовостиМегапосты?

Blazor 0.8.0 experimental release now available

Blazor 0.8.0 is now available! This release updates Blazor to use Razor Components in .NET Core 3.0 and adds some critical bug fixes.


Get Blazor 0.8.0


To get started with Blazor 0.8.0 install the following:


  1. .NET Core 3.0 Preview 2 SDK (3.0.100-preview-010184)
  2. Visual Studio 2019 (Preview 2 or later) with the ASP.NET and web development workload selected.
  3. The latest Blazor extension from the Visual Studio Marketplace.
  4. The Blazor templates on the command-line:


    dotnet new -i Microsoft.AspNetCore.Blazor.Templates::0.8.0-preview-19104-04

You can find getting started instructions, docs, and tutorials for Blazor at https://blazor.net.


Upgrade to Blazor 0.8.0


To upgrade your existing Blazor apps to Blazor 0.8.0 first make sure you've installed the prerequisites listed above.


To upgrade a standalone Blazor 0.7.0 project to 0.8.0:



To upgrade an ASP.NET Core hosted Blazor app to 0.8.0:



To upgrade a Blazor class library to 0.8.0:



Server-side Blazor is now ASP.NET Core Razor Components in .NET Core 3.0


As was recently announced, server-side Blazor is now shipping as ASP.NET Core Razor Components in .NET Core 3.0. We've integrated the Blazor component model into ASP.NET Core 3.0 and renamed it to Razor Components. Blazor 0.8.0 is now built on Razor Components and enables you to host Razor Components in the browser on WebAssembly.


Upgrade a server-side Blazor project to ASP.NET Core Razor Components in .NET Core 3.0


If you've been working with server-side Blazor, we recommend upgrading to use ASP.NET Core Razor Components in .NET Core 3.0.


To upgrade a server-side Blazor app to ASP.NET Core Razor Components:



Switching between ASP.NET Core Razor Components and client-side Blazor


Sometimes it's convenient to be able to switch between running your Razor Components on the server (ASP.NET Core Razor Components) and on the client (Blazor). For example, you might run on the server during development so that you can easily debug, but then publish your app to run on the client.


To update an ASP.NET Core hosted Blazor app so that it can be run as an ASP.NET Core Razor Components app:



Tooling for Blazor projects is now included with Visual Studio 2019


Previously to get tooling support for Blazor projects you needed to install the Blazor extension for Visual Studio. Starting with Visual Studio 2019 Preview 2, tooling support for Razor Components (and hence Blazor apps) is already included without having to install anything else. The Blazor extension is now only needed to install the Blazor project templates in Visual Studio.


Runtime improvements


Blazor 0.8.0 includes some .NET runtime improvements like improved runtime performance on Chrome and an improved IL linker. In our performance benchmarks, Blazor 0.8.0 performance on Chrome is now about 25% faster. You can now also reference existing libraries like Json.NET from a Blazor app without any additional linker configuration:


@functions {
    WeatherForecast[] forecasts;

    protected override async Task OnInitAsync()
    {
        var json = await Http.GetStringAsync("api/SampleData/WeatherForecasts");
        forecasts = Newtonsoft.Json.JsonConvert.DeserializeObject<WeatherForecast[]>(json);
    }
}

Known issues


There are a couple of known issues with this release that you may run into:



These issues will be addressed in a future Blazor update.


Future updates


This release of Blazor was primarily focused on first integrating Razor Components into ASP.NET Core 3.0 and then rebuilding Blazor on top of that. Going forward, we plan to ship Blazor updates with each .NET Core 3.0 update.


Blazor, and support for running Razor Components on WebAssembly in the browser, won't ship with .NET Core 3.0, but we continue to work towards shipping Blazor some later date.


Give feedback


We hope you enjoy this latest preview release of Blazor. As with previous releases, your feedback is important to us. If you run into issues or have questions while trying out Blazor, file issues on GitHub. You can also chat with us and the Blazor community on Gitter if you get stuck or to share how Blazor is working for you. After you've tried out Blazor for a while please let us know what you think by taking our in-product survey. Click the survey link shown on the app home page when running one of the Blazor project templates:


Blazor survey


Thanks for trying out Blazor!

@sahsAGU
21.02.2019 12:00 UTC
Первоисточник