blazor_Blazor现已正式发布

blazor

With this newest Blazor release we’re pleased to announce that Blazor is now in official preview! Blazor is no longer experimental and we are committing to ship it as a supported web UI framework including support for running client-side in the browser on WebAssembly.

在此最新的Blazor版本中,我们很高兴地宣布Blazor现已正式发布! Blazor不再处于试验阶段,我们致力于将其作为受支持的Web UI框架进行发布,包括支持在WebAssembly的浏览器中运行客户端。

A little over a year ago we started the Blazor experimental project with the goal of building a client web UI framework based on .NET and WebAssembly. At the time Blazor was little more than a prototype and there were lots of open questions about the viability of running .NET in the browser. Since then we’ve shipped nine experimental Blazor releases addressing a variety of concerns including component model, data binding, event handling, routing, layouts, app size, hosting models, debugging, and tooling. We’re now at the point where we think Blazor is ready to take its next step.

一年多前,我们开始了Blazor实验项目,其目标是基于.NET和WebAssembly构建客户端Web UI框架。 当时,Blazor只是一个原型而已,关于在浏览器中运行.NET的可行性存在很多悬而未决的问题。 从那时起,我们已经发布了九个实验性Blazor版本,以解决各种问题,包括组件模型,数据绑定,事件处理,路由,布局,应用程序大小,托管模型,调试和工具。 现在,我们认为Blazor已准备好迈出下一步。

Blazor icon

简化命名和版本控制 (Simplifying the naming and versioning)

For a while, we’ve used the terminology Razor Components in some cases, and Blazor in other cases. This has proven to be confusing, so following a lot of community feedback, we’ve decided to drop the name ASP.NET Core Razor Components, and return to the name Server-side Blazor instead.

一段时间以来,我们在某些情况下使用术语“ 剃刀组件” ,而在其他情况下使用Blazor 。 事实证明,这很令人困惑,因此,在获得社区的广泛反馈之后,我们决定删除名称ASP.NET Core Razor Components ,而改名为Server-side Blazor

This emphasizes that Blazor is a single client app model with multiple hosting models:

这强调了Blazor是具有多个托管模型的单个客户端应用程序模型:

  • Server-side Blazor runs on the server via SignalR

    服务器端Blazor通过SignalR在服务器上运行

  • Client-side Blazor runs client-side on WebAssembly

    客户端Blazor在WebAssembly上运行客户端

… but either way, it’s the same programming model. The same Blazor components can be hosted in both environments.

…但是无论哪种方式,它都是相同的编程模型。 可以在两个环境中托管相同的Blazor组件。

Also, since Blazor is now part of .NET Core, the client-side Blazor package versions now align with the .NET Core 3.0 versions. For example, the version number of all the preview packages we are shipping today is 3.0.0-preview4-19216-03. We no longer use separate 0.x version numbers for client-side Blazor packages.

另外,由于Blazor现在是.NET Core的一部分,因此客户端Blazor软件包版本现在与.NET Core 3.0版本保持一致。 例如,我们今天发货的所有预览软件包的版本号是3.0.0-preview4-19216-03 。 我们不再为客户端Blazor软件包使用单独的0.x版本号。

什么时候发货 (What will ship when)

  • Server-side Blazor will ship as part of .NET Core 3.0. This was already announced last October.

    服务器端Blazor将作为.NET Core 3.0的一部分提供。 这已经在去年十月宣布。
  • Client-side Blazor won’t ship as part of the initial .NET Core 3.0 release, but we are now announcing it is committed to ship as part of a future .NET Core release (and hence is no longer an “experiment”).

    客户端Blazor不会作为.NET Core 3.0初始发行版的一部分提供,但我们现在宣布,它承诺将作为未来.NET Core版本的一部分提供(因此不再是“实验”)。

With each preview release of .NET Core 3.0, we will continue to ship preview releases of both server and client-side Blazor.

在.NET Core 3.0的每个预览版本中,我们将继续发布服务器和客户端Blazor的预览版本。

今天的预览版 (Today’s preview release)

New features in this preview release:

此预览版本中的新功能:

  • Templates updated to use the .razor file extension

    模板已更新为使用.razor文件扩展名
  • _Imports.razor

    _Imports.razor
  • Scope components with @using

    使用@using作用域组件

  • New component item template

    新组件项目模板
  • New Blazor icons

    新的Blazor图标
  • Blazor support in Visual Studio Code

    Visual Studio Code中的Blazor支持

Check out the ASP.NET Core 3.0 Preview 4 announcement for details on these improvements. See also the Blazor release notes for additional details on this preview release.

有关这些改进的详细信息,请查看ASP.NET Core 3.0 Preview 4公告 。 另请参阅Blazor 发行说明,以获取有关此预览版的其他详细信息。

获取Blazor预览 (Get the Blazor preview)

To get started with the Blazor preview install the following:

要开始使用Blazor预览版,请安装以下内容:

  1. .NET Core 3.0 Preview 4 SDK (3.0.100-preview4-011223)

    .NET Core 3.0预览版4 SDK (3.0.100-preview4-011223)

  2. The Blazor templates on the command-line:

    命令行上的Blazor模板:

    dotnet new -i Microsoft.AspNetCore.Blazor.Templates::3.0.0-preview4-19216-03
  3. Visual Studio 2019 Preview with the ASP.NET and web development workload selected as well as the latest Blazor extension from the Visual Studio Marketplace, or Visual Studio Code with the latest C# extension (now with Blazor support!).

    选择ASP.NET和Web开发工作负载的Visual Studio 2019预览版 ,以及来自Visual Studio Marketplace的最新Blazor扩展, 具有最新C#扩展的 Visual Studio Code (现已支持Blazor! )。

You can find getting started instructions, docs, and tutorials for Blazor at our new Blazor home page at blazor.net.

您可以在blazor.net的 Blazor主页上找到Blazor的入门说明,文档和教程。

Blazor home page

升级到Blazor预览: (Upgrade to the Blazor preview:)

To upgrade your existing Blazor apps to the new Blazor preview first make sure you’ve installed the prerequisites listed above then follow these steps:

要将现有的Blazor应用程序升级到新的Blazor预览,请首先确保已安装上面列出的先决条件,然后执行以下步骤:

  • Update all Microsoft.AspNetCore.Blazor.* package references to 3.0.0-preview4-19216-03.

    将所有Microsoft.AspNetCore.Blazor。*包参考更新为3.0.0-preview4-19216-03。
  • Remove any package reference to Microsoft.AspNetCore.Components.Server.

    删除任何对Microsoft.AspNetCore.Components.Server的包引用。
  • Remove any DotNetCliToolReference to Microsoft.AspNetCore.Blazor.Cli and replace with a package reference to Microsoft.AspNetCore.Blazor.DevServer.

    删除任何对Microsoft.AspNetCore.Blazor.Cli的DotNetCliToolReference并替换为对Microsoft.AspNetCore.Blazor.DevServer的程序包引用。

  • In client Blazor projects remove the <RunCommand>dotnet</RunCommand> and <RunArguments>blazor serve</RunArguments> properties.

    在客户端Blazor项目中,删除<RunCommand>dotnet</RunCommand><RunArguments>blazor serve</RunArguments>属性。

  • In client Blazor projects add the <RazorLangVersion>3.0</RazorLangVersion> property.

    在客户端Blazor项目中,添加<RazorLangVersion>3.0</RazorLangVersion>属性。

  • Rename all _ViewImports.cshtml files to _Imports.razor.

    将所有_ViewImports.cshtml文件重命名为_Imports.razor

  • Rename all remaining .cshtml files to .razor.

    将所有剩余的.cshtml文件重命名为.razor。
  • Rename components.webassembly.js to blazor.webassembly.js

    components.webassembly.js重命名为blazor.webassembly.js

  • Remove any use of the Microsoft.AspNetCore.Components.Services namespace and replace with Microsoft.AspNetCore.Components as required.

    删除对Microsoft.AspNetCore.Components.Services命名空间的任何使用,并根据需要替换为Microsoft.AspNetCore.Components

  • Update server projects to use endpoint routing:

    更新服务器项目以使用端点路由:
// Replace this:
app.UseMvc(routes =>
{
    routes.MapRoute(name: "default", template: "{controller}/{action}/{id?}");
});

// With this:
app.UseRouting();

app.UseEndpoints(routes =>
{
    routes.MapDefaultControllerRoute();
});
  • Run dotnet clean on the solution to clear out old Razor declarations.

    在解决方案上运行dotnet clean清除旧的Razor声明。

Blazor社区页面现已更名为Blazor (Blazor community page is now Awesome Blazor)

As part of updating the Blazor site, we’ve decided to retire the Blazor community page and instead direct folks to the community driven Awesome Blazor site. Thank you Adrien Torris for maintaining this truly “awesome” list of Blazor resources!

作为更新Blazor网站的一部分,我们已决定退出Blazor社区页面,而是将人们定向到社区驱动的Awesome Blazor网站。 感谢Adrien Torris维护了Blazor这份真正“很棒的”资源清单!

试用Telerik,DevExpress和Syncfusion的Blazor UI预览产品 (Try out preview Blazor UI offerings from Telerik, DevExpress, and Syncfusion)

Blazor benefits from an active and supportive community that has contributed all sorts of sample apps, components, and libraries to the Blazor ecosystem. Recently popular component vendors like TelerikDevExpress, and Syncfusion have joined in the fun and shipped previews of Blazor UI components. We encourage you to give these Blazor UI offerings a try and let them know what you think.

Blazor受益于一个积极支持的社区,该社区为Blazor生态系统贡献了各种示例应用程序,组件和库。 最近流行的组件供应商(例如TelerikDevExpressSyncfusion)加入了Blazor UI组件的娱乐和预览。 我们鼓励您尝试这些Blazor UI产品,并让他们知道您的想法。

给予反馈 (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的最新预览版。 与以前的版本一样,您的反馈对我们很重要。 如果您在尝试Blazor时遇到问题或有疑问,请在GitHub上提交问题 。 如果您遇到困难,也可以在Gitter上与我们和Blazor社区聊天,或分享Blazor为您工作的方式。 在试用Blazor一段时间后,请通过产品内调查让我们知道您的想法。 运行Blazor项目模板之一时,单击应用程序主页上显示的调查链接:

Blazor survey

Thanks for trying out Blazor!

感谢您试用Blazor!

Daniel Roth
丹尼尔·罗斯 (Daniel Roth)

Principal Program Manager, ASP.NET

ASP.NET首席程序经理

翻译自: https://habr.com/en/company/microsoft/blog/449774/

blazor

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值