Systems management can be a difficult task. Not only does one need to determine what the end state should be but, more importantly, how to ensure systems attain and remain at this state. Doing so in an automated fashion is just as critical, because there may be a large number of target instances. In regard to enterprise Java middleware application servers, these instances are typically configured using a set of XML based files. Although these files may be manually configured, most application servers have a command-line based tool or set of tools that abstracts the end user from having to worry about the underlying configuration. WebSphere Liberty includes a variety of tools to manage these resources, whereas JBoss contains the jboss-cli tool.
Although each tool accomplishes its utilitarian use case as it allows for proper server management, it does fail to adhere to one of the principles of automation and configuration management: idempotence. Ensuring the desired state does not equate to executing the same action with every iteration. Additional intelligence must be introduced. Along with idempotence, another core principle of configuration management is that values be expressed declaratively and stored in a version control system.
Jcliff is a Java-based utility that is built on top of the JBoss command-line interface and allows for the desired intent for the server configuration to be expressed declaratively, which in turn can be stored in a version control system. We’ll provide an overview of the Jcliff utility including inherent benefits, installation options, and several examples showcasing the use.
The problem space
Before beginning to work with Jcliff, one must be cognizant of the underlying JBoss architecture. The configuration of the JBoss server can be expressed using Dynamic Model Representation (DMR) notation. The following is an example of DMR:
The DMR example above describes several Java system properties that will be stored within the JBoss configuration. These properties can be added using the JBoss CLI by executing the following command:
Where Jcliff excels is that it includes the necessary intelligence to determine the current state of the JBoss configuration and then applying the appropriate configurations necessary. This is critical to adopting proper configuration management when working with JBoss.
Installing Jcliff
With a baseline understanding of Jcliff, let’s discuss the methods in which one can obtain the utility. First, Jcliff can be built from source from the project repository, given that it’s a freely open source project. Alternatively, Jcliff can be installed using popular software packaging tools in each of the primary operating system families.
Linux (rpm)
Jcliff can be consumed on a Linux package when capable of consuming an rpm using a package manager.
Once this repository has been added, JCliff can be installed by using Yum or Dnf:
Using yum:
$ sudo yum install jcliff
Or using dnf:
$ sudo dnf install jcliff
Manual installation
Jcliff can also be installed manually without the need to leverage a package manager. This is useful for those on Linux distributions that cannot consume rpm packages. Simply download and unpack the archive from the release artifact from the project repository.
$ curl -O \ https://github.com/bserdar/jcliff/releases/download/v2.12.1/jcliff-2.12.1-dist.tar.gz $ tar xzvf jcliff-2.12.1-dist.tar.gz
Place the resulting Jcliff folder in the destination of your choosing. This location is known as JCLIFF_HOME. Add this environment variable and add it to the path as described below:
At this point, you should be able to execute the jcliff command.
OSX
While users on OSX can take advantage of the manual installation option, those making use of the brew package manager can use this tool as well.
Execute the following commands to install Jcliff using Brew:
$ brew tap redhat-cop/redhat-cop $ brew install redhat-cop/redhat-cop/jcliff
Windows
Fear not, Windows users; you can also make use of Jcliff without having to compile from source. Windows, in the same vein as OSX, does not have an official package manager, but Chocolatey has been given this role.
Execute the following command to install Jcliff using Chocolatey:
$ choco install jcliff
Using Jcliff
With Jcliff properly installed on your machine, let’s walk through a simple example to demonstrate the use of the tool. As discussed previously, Jcliff makes use of files that describe the target configuration. At this point, you may have questions like: What is the format of these configurations, and where do I begin?
Let’s take a simple example and look into adding a new system property to the JBoss configuration. Launch an instance of JBoss and connect using the JBoss command-line interface:
$ /bin/jboss-cli.sh --connect [standalone@localhost:9990 /] ls /system-property [standalone@localhost:9990 /]
Now, use Jcliff to update the configuration. First, we’ll need to create a Jcliff rule. The rule resembles DMR format and appears similar to the following:
To demonstrate how Jcliff handles repetitive executions, run the previous Jcliff command again. Inspect the output.
$ jcliff jcliff-prop Jcliff version 2.12.4 2019-10-02 17:05:34:0107: /core-service=platform-mbean/type=runtime:read-attribute(name=system-properties)
Notice that only 1 command was executed against the JBoss server instead of two? This action was a result of assessing the current state within JBoss and determining that no action was necessary to reach the desired state. Mission accomplished.
Next steps
Although the preceding scenario was not overly complex, you should now have the knowledge necessary to understand the capabilities and functionality of the Jcliff utility as well as the benefits afforded through declarative configurations and automation. When building out enterprise-grade systems, however, Jcliff would not be executed manually. You would want to integrate the utility into a proper configuration management tool that employs many of the automation and configuration principles described earlier. Fortunately, Jcliff has been integrated into several popular configuration management tools.
In an upcoming article, we’ll provide an overview of the configuration management options available with Jcliff, along with examples that will allow you to quickly build out enterprise-grade confidence with Jcliff.
If you’re on Windows using Visual Studio, for the best experience we recommend installing the latest preview of Visual Studio 2019 16.4. Installing Visual Studio 2019 16.4 will also install .NET Core 3.1 Preview 2, so you don’t need to separately install it. For Blazor development with .NET Core 3.1, Visual Studio 2019 16.4 is required.
Alongside this .NET Core 3.1 Preview 2 release, we’ve also released a Blazor WebAssembly update. To install the latest Blazor WebAssembly template also run the following command:
dotnet new -i Microsoft.AspNetCore.Blazor.Templates::3.1.0-preview2.19528.8
Upgrade an existing project
To upgrade an existing ASP.NET Core 3.1 Preview 1 project to 3.1 Preview 2:
Update all Microsoft.AspNetCore.* package references to 3.1.0-preview2.19528.8
That’s it! You should now be all set to use .NET Core 3.1 Preview 2!
New component tag helper
Using Razor components from views and pages is now more convenient with the new component tag helper.
Previously, rendering a component from a view or page involved using the RenderComponentAsync HTML helper.
@(await Html.RenderComponentAsync<Counter>(RenderMode.ServerPrerendered, new { IncrementAmount = 10 }))
The new component tag helper simplifies the syntax for rendering components from pages and views. Simply specify the type of the component you wish to render as well as the desired render mode. You can also specify component parameters using attributes prefixed with param-.
The different render modes allow you to control how the component is rendered:
RenderMode
Description
Static
Renders the component into static HTML.
Server
Renders a marker for a Blazor Server application. This doesn’t include any output from the component. When the user-agent starts, it uses this marker to bootstrap the Blazor app.
ServerPrerendered
Renders the component into static HTML and includes a marker for a Blazor Server app. When the user-agent starts, it uses this marker to bootstrap the Blazor app.
Prevent default actions for events in Blazor apps
You can now prevent the default action for events in Blazor apps using the new @oneventname:preventDefault directive attribute. For example, the following component displays a count in a text box that can be changed by pressing the “+” or “-” keys:
<p>Press "+" or "-" in change the count.</p>
<input value="@count" @onkeypress="@KeyHandler" @onkeypress:preventDefault /> @code { int count = 0; void KeyHandler(KeyboardEventArgs ev) { if (ev.Key == "+") { count++; } else if (ev.Key == "-") { count--; } }
}
The @onkeypress:preventDefault directive attribute prevents the default action of showing the text typed by the user in the text box. Specifying this attribute without a value is equivalent to @onkeypress:preventDefault="true". The value of the attribute can also be an expression: @onkeypress:preventDefault="shouldPreventDefault". You don’t have to define an event handler to prevent the default action; both features can be used independently.
Stop event propagation in Blazor apps
Use the new @oneventname:stopPropagation directive attribute to stop event propagation in Blazor apps.
In the following example, checking the checkbox prevents click events from the child div from propagating to the parent div:
When your Blazor app isn’t functioning properly during development, it’s important to get detailed error information so that you can troubleshoot and fix the issues. Blazor apps now display a gold bar at the bottom of the screen when an error occurs.
During development, in Blazor Server apps, the gold bar will direct you to the browser console where you can see the exception that has occurred.
In production, the gold bar notifies the user that something has gone wrong, and recommends the user to refresh the browser.
The UI for this error handling experience is part of the updated Blazor project templates so that it can be easily customized:
_Host.cshtml
An error has occurred. This application may no longer respond until reloaded. An unhandled exception has occurred. See browser dev tools for details. Reload🗙
Validation of nested models in Blazor forms
Blazor provides support for validating form input using data annotations with the built-in DataAnnotationsValidator. However, the DataAnnotationsValidator only validates top-level properties of the model bound to the form.
To validate the entire object graph of the bound model, try out the new ObjectGraphDataAnnotationsValidator available in the experimental Microsoft.AspNetCore.Blazor.DataAnnotations.Validation package:
The Microsoft.AspNetCore.Blazor.DataAnnotations.Validation is not slated to ship with .NET Core 3.1, but is provided as an experimental package to get early feedback.
Give feedback
We hope you enjoy the new features in this preview release of ASP.NET Core! Please let us know what you think by filing issues on GitHub.
The Khronos Group have just released the Vulkan Unified Samples Repository, a single location for the best tutorials and code samples for learning and using the Vulkan API.
Today, The Khronos® Group releases the Vulkan® Unified Samples Repository, a new central location where anyone can access Khronos-reviewed, high-quality Vulkan code samples in order to make development easier and more streamlined for all abilities. Khronos and its members, in collaboration with external contributors, created the Vulkan Unified Samples Project in response to user demand for more accessible resources and best practices for developing with Vulkan. Within Khronos, the Vulkan Working Group discovered that there were many useful and high-quality samples available already (both from members and external contributors), but they were not all in one central location. Additionally, there was no top-level review of all the samples for interoperability or compatibility. This new repository project was created to solve this challenge by putting resources in one place, ensuring samples are reviewed and maintained by Khronos. They are then organized into a central library available for developers of all abilities to use, learn from, and gain ideas.
The first group of samples includes a generous donation of performance-based samples and best practice documents from Khronos member, Arm.
The repository is hosted entirely on GitHub under the Apache 2.0 source license. The code samples are located here.
The Haxe Programming Language just hit a major milestone with the release of version 4.0.0. The programming language gains several new features such as:
New function type syntax
Arrow function syntax
final keyword
New and faster Haxe built-in interpreter
Unicode support on all targets
Key-value iterators
Auto-“using” for types
IDE services protocol for better IDE support
New high-performance run-time HashLink, a successor of Neko
.. and much more!
Check the complete What’s New Guide for a full list of changes in this release, including possible breaking changes from Haxe 3.x. There is a thriving ecosystem of game engines and frameworks for Haxe which we showcased here. Of particular interest are the Blender based Armory3D engine (tutorial series here) and the popular and mature 2D frame HaxeFlixel (tutorial series here).
You can learn more about the Haxe 4.0.0 release in the video below.
Quarkus is revolutionizing the way that we develop Java applications for the cloud-native era, and in this presentation, Edson Yanaga explains why it also sparks joy.
Watch this live coding session to get familiar with Quarkus and learn how your old and new favorite APIs will start in a matter of milliseconds and consume tiny amounts of memory. Hot reload capabilities for development will bring you instant joy.
SameSite is a 2016 extension to HTTP cookies intended to mitigate cross site request forgery (CSRF). The original design was an opt-in feature which could be used by adding a new SameSite property to cookies. It had two values, Lax and Strict. Setting the value to Lax indicated the cookie should be sent on navigation within the same site, or through GET navigation to your site from other sites. A value of Strict limited the cookie to requests which only originated from the same site. Not setting the property at all placed no restrictions on how the cookie flowed in requests. OpenIdConnect authentication operations (e.g. login, logout), and other features that send POST requests from an external site to the site requesting the operation, can use cookies for correlation and/or CSRF protection. These operations would need to opt-out of SameSite, by not setting the property at all, to ensure these cookies will be sent during their specialized request flows.
Google is now updating the standard and implementing their proposed changes in an upcoming version of Chrome. The change adds a new SameSite value, “None”, and changes the default behavior to “Lax”. This breaks OpenIdConnect logins, and potentially other features your web site may rely on, these features will have to use cookies whose SameSite property is set to a value of “None”. However browsers which adhere to the original standard and are unaware of the new value have a different behavior to browsers which use the new standard as the SameSite standard states that if a browser sees a value for SameSite it does not understand it should treat that value as “Strict”. This means your .NET website will now have to add user agent sniffing to decide whether you send the new None value, or not send the attribute at all.
.NET will issue updates to change the behavior of its SameSite attribute behavior in .NET 4.7.2 and in .NET Core 2.1 and above to reflect Google’s introduction of a new value. The updates for the .NET Framework will be available on November 19th as an optional update via Microsoft Update and WSUS if you use the “Check for Update” functionality. On December 10th it will become widely available and appear in Microsoft Update without you having to specifically check for updates. .NET Core updates will be available with .NET Core 3.1 starting with preview 1, in November.
.NET Core 3.1 will contain an updated enum definition, SameSite.Unspecified which will not set the SameSite property.
The OpenIdConnect middleware for Microsoft.Owin v4.1 and .NET Core will be updated at the same time as their .NET Framework and .NET updates, however we cannot introduce the user agent sniffing code into the framework, this must be implemented in your site code. The implementation of agent sniffing will vary according to what version of ASP.NET or ASP.NET Core you are using and the browsers you wish to support.
For ASP.NET 4.7.2 with Microsoft.Owin 4.1.0 agent sniffing can be implemented using ICookieManager;
public class SameSiteCookieManager : ICookieManager
{ private readonly ICookieManager _innerManager; public SameSiteCookieManager() : this(new CookieManager()) { } public SameSiteCookieManager(ICookieManager innerManager) { _innerManager = innerManager; } public void AppendResponseCookie(IOwinContext context, string key, string value, CookieOptions options) { CheckSameSite(context, options); _innerManager.AppendResponseCookie(context, key, value, options); } public void DeleteCookie(IOwinContext context, string key, CookieOptions options) { CheckSameSite(context, options); _innerManager.DeleteCookie(context, key, options); } public string GetRequestCookie(IOwinContext context, string key) { return _innerManager.GetRequestCookie(context, key); } private void CheckSameSite(IOwinContext context, CookieOptions options) { if (DisallowsSameSiteNone(context) && options.SameSite == SameSiteMode.None) { options.SameSite = null; } } public static bool DisallowsSameSiteNone(IOwinContext context) { // TODO: Use your User Agent library of choice here. var userAgent = context.Request.Headers["User-Agent"]; return userAgent.Contains("BrokenUserAgent") || userAgent.Contains("BrokenUserAgent2") }
}
And then configure OpenIdConnect settings to use the new CookieManager;
app.UseOpenIdConnectAuthentication( new OpenIdConnectAuthenticationOptions { // … Your preexisting options … CookieManager = new SameSiteCookieManager(new SystemWebCookieManager())
});
SystemWebCookieManager will need the .NET 4.7.2 or later SameSite patch installed to work correctly.
For ASP.NET Core you should install the patches and then implement the agent sniffing code within a cookie policy. For versions prior to 3.1 replace SameSiteMode.Unspecified with (SameSiteMode)(-1).
private void CheckSameSite(HttpContext httpContext, CookieOptions options)
{ if (options.SameSite > SameSiteMode.Unspecified) { var userAgent = httpContext.Request.Headers["User-Agent"].ToString(); // TODO: Use your User Agent library of choice here. if (/* UserAgent doesn’t support new behavior */) { // For .NET Core < 3.1 set SameSite = -1 options.SameSite = SameSiteMode.Unspecified; } }
} public void ConfigureServices(IServiceCollection services)
{ services.Configure<CookiePolicyOptions>(options => { options.MinimumSameSitePolicy = SameSiteMode.Unspecified; options.OnAppendCookie = cookieContext => CheckSameSite(cookieContext.Context, cookieContext.CookieOptions); options.OnDeleteCookie = cookieContext => CheckSameSite(cookieContext.Context, cookieContext.CookieOptions); });
} public void Configure(IApplicationBuilder app)
{ app.UseCookiePolicy(); // Before UseAuthentication or anything else that writes cookies. app.UseAuthentication(); // …
}
Under testing with the Azure Active Directory team we have found the following checks work for all the common user agents that Azure Active Directory sees that don’t understand the new value.
public static bool DisallowsSameSiteNone(string userAgent)
{
// Cover all iOS based browsers here. This includes:
// - Safari on iOS 12 for iPhone, iPod Touch, iPad
// - WkWebview on iOS 12 for iPhone, iPod Touch, iPad
// - Chrome on iOS 12 for iPhone, iPod Touch, iPad
// All of which are broken by SameSite=None, because they use the iOS networking stack
if (userAgent.Contains("CPU iPhone OS 12") || userAgent.Contains("iPad; CPU OS 12"))
{
return true;
} // Cover Mac OS X based browsers that use the Mac OS networking stack. This includes:
// - Safari on Mac OS X.
// This does not include:
// - Chrome on Mac OS X
// Because they do not use the Mac OS networking stack.
if (userAgent.Contains("Macintosh; Intel Mac OS X 10_14") && userAgent.Contains("Version/") && userAgent.Contains("Safari"))
{
return true;
} // Cover Chrome 50-69, because some versions are broken by SameSite=None, // and none in this range require it.
// Note: this covers some pre-Chromium Edge versions, // but pre-Chromium Edge does not require SameSite=None.
if (userAgent.Contains("Chrome/5") || userAgent.Contains("Chrome/6"))
{
return true;
} return false;
}
This browser list is by no means canonical and you should validate that the common browsers and other user agents your system supports behave as expected once the update is in place.
Chrome 80 is scheduled to turn on the new behavior in February or March 2020, including a temporary mitigation added in Chrome 79 Beta. If you want to test the new behavior without the mitigation use Chromium 76. Older versions of Chromium are available for download.
If you cannot update your framework versions by the time Chrome turns the new behavior in early 2020 you may be able to change your OpenIdConnect flow to a Code flow, rather than the default implicit flow that ASP.NET and ASP.NET Core uses, but this should be viewed as a temporary measure.
We strongly encourage you to download the updated .NET Framework and .NET Core versions when they become available in November and start planning your update before Chrome’s changes are rolled out.
Here’s what’s new in this release for ASP.NET Core:
Partial class support for Razor components
Pass parameters to top-level components
Support for shared queues in HttpSysServer
Breaking changes for SameSite cookies
Alongside this .NET Core 3.1 Preview 1 release, we’ve also released a Blazor WebAssembly update, which now requires .NET Core 3.1. To use Blazor WebAssembly you will need to install .NET Core 3.1 Preview 1 as well as the latest preview of Visual Studio.
See the release notes for additional details and known issues.
If you’re on Windows using Visual Studio, for the best experience we recommend installing the latest preview of Visual Studio 2019 16.4. Installing Visual Studio 2019 16.4 will also install .NET Core 3.1 Preview 1, so you don’t need to separately install it. For Blazor development with .NET Core 3.1, Visual Studio 2019 16.4 is required.
To install the latest Blazor WebAssembly template run the following command:
dotnet new -i Microsoft.AspNetCore.Blazor.Templates::3.1.0-preview1.19508.20
Upgrade an existing project
To upgrade an existing ASP.NET Core 3.0 project to 3.1 Preview 1:
Update any projects targeting netcoreapp3.0 to target netcoreapp3.1
Update all Microsoft.AspNetCore.* package references to 3.1.0-preview1.19506.1
That’s it! You should now be all set to use .NET Core 3.1 Preview 1!
Partial class support for Razor components
Razor components are now generated as partial classes. You can author the code for a Razor component using a code-behind file defined as a partial class instead of defining all the code for the component in a single file.
For example, instead of defining the default Counter component with an @code block, like this:
namespace BlazorApp1.Pages
{ public partial class Counter { int currentCount = 0; void IncrementCount() { currentCount++; } }
}
Pass parameters to top-level components
Blazor Server apps can now pass parameters to top-level components during the initial render. Previously you could only pass parameters to a top-level component with RenderMode.Static. With this release, both RenderMode.Server and RenderModel.ServerPrerendered are now supported. Any specified parameter values are serialized as JSON and included in the initial response.
For example, you could prerender a Counter component with a specific current count like this:
@(await Html.RenderComponentAsync<Counter>(RenderMode.ServerPrerendered, new { CurrentCount = 123 }))
Support for shared queues in HttpSysServer
In addition to the existing behavior where HttpSysServer created anonymous request queues, we’ve added to ability to create or attach to an existing named HTTP.sys request queue. This should enable scenarios where the HTTP.Sys controller process that owns the queue is independent to the listener process making it possible to preserve existing connections and enqueued requests between across listener process restarts.
This release updates the behavior of SameSite cookies in ASP.NET Core to conform to the latest standards being enforced by browsers. For details on these changes and their impact on existing apps see https://github.com/aspnet/Announcements/issues/390.
Give feedback
We hope you enjoy the new features in this preview release of ASP.NET Core! Please let us know what you think by filing issues on GitHub.
We are excited to announce a new release of Red Hat Dependency Analytics, a solution that enables developers to create better applications by evaluating and adding high-quality open source components, directly from their IDE.
Red Hat Dependency Analytics helps your development team avoid security and licensing issues when building your applications. It plugs into the developer’s IDE, automatically analyzes your software composition, and provides recommendations to address security holes and licensing problems that your team may be missing.
Without further ado, let’s jump into the new capabilities offered in this release. This release includes a new version of the IDE plugin and the server-side analysis service hosted by Red Hat.
Support for Python applications
Along with Java (maven) and JavaScript (npm), Dependency Analytics now offers its full set of capabilities for Python (PyPI) applications. From your IDE, you can perform the vulnerability and license analysis of the “requirements.txt” file of your Python application, incorporate the recommended fixes, and generate the stack analysis report for more details.
Software composition analysis based on current vulnerability data
An estimated 15,000 open source packages get updated every day. On average, three new vulnerabilities get posted every day across JavaScript (npm) and Python (PyPi) packages. With this new release, the server-side analysis service hosted by Red Hat automatically processes the daily updates to open source packages that it is tracking. The hosted service also automatically ingests new vulnerability data posted to National Vulnerability Database (NVD) for JavaScript and Python packages. This allows the IDE plugin and API calls to provide source code analysis based on current vulnerability and release data.
Analyze transitive dependencies
In addition to the direct dependencies included in your application, Dependency Analytics now leverages the package managers to discover and add the dependencies of those dependencies, called “transitive” dependencies, to the dependency graph of your application. Analysis of your application is performed across the whole graph model and recommendations for fixes are provided across the entire set of dependencies.
Recommendations about complementary open source libraries
With this release, Dependency Analytics looks to recommend high-quality open source libraries that are complementary to the dependencies included in your application. The machine learning technology of the hosted service collects and analyzes various statistics on GitHub to curate a list of high-quality open source libraries that can be added to the current set of dependencies to augment your application. You can provide your feedback about the add-on libraries by clicking on the “thumbs-up” or “thumbs-down” icons shown for each recommendation. Your feedback is automatically processed to improve the quality of the recommendations.
IDE plugin support
The Dependency Analytics IDE plugin is now available for VS Code, Eclipse Che, and any JetBrains IDE, including IntelliJ and PyCharm.
We will continuously release new updates to our Dependency Analytics solution so you can minimize the delays in delivery of your applications due to last-minute security and licensing related issues.
Stay tuned for further updates; we look forward to your feedback about Dependency Analytics.
Since the release of Blazor Server with .NET Core 3.0 last month lots of folks have shared their excitement with us about being able to build client-side web UI with just .NET and C#. At the same time, we’ve also heard lots of questions about what Blazor Server is, how it relates to Blazor WebAssembly, and what scenarios Blazor Server is best suited for. Should you choose Blazor Server for your client-side web UI needs, or wait for Blazor WebAssembly? This post seeks to answer these questions, and to provide insights into how Blazor Server performs at scale and how we envision Blazor evolving in the future.
What is Blazor Server?
Blazor Server apps host Blazor components on the server and handle UI interactions over a real-time SignalR connection. As the user interacts with the app, the UI events are sent to the server over the connection to be handled by the various components that make up the app. When a component handles a UI event, it’s rendered based on its updated state. Blazor compares the newly rendered output with what was rendered previously and send the changes back to the browser and applies them to the DOM.
Since Blazor Server apps run on .NET Core on the server, they enjoy all the benefits of running on .NET Core including great runtime performance and tooling. Blazor Server apps can leverage the full ecosystem of .NET Standard libraries without any browser imposed limitations.
When should I use Blazor Server?
Blazor Server enables you to add rich interactive UI to your .NET apps today without having to write JavaScript. If you need the interactivity of a single-page app in your .NET app, then Blazor Server is a great solution.
Blazor Server can be used to write completely new apps or to complement existing MVC and Razor Pages apps. There’s no need to rewrite existing app logic. Blazor is designed to work together with MVC and Razor Pages, not replace them. You can continue to use MVC and Razor Pages for your server-rendering needs while using Blazor for client-side UI interactions.
Blazor Server works best for scenarios where you have a reliable low-latency network connection, which is normally achieved when the client and server are geographically on the same continent. Apps that require extremely high fidelity instant updates on every tiny mouse twitch, like real-time games or drawing apps, are not a good fit for Blazor Server. Because Blazor Server apps require an active network connection, offline scenarios are not supported.
Blazor Server is also useful when you want to offload work from the client to the server. Blazor Server apps require only a small download to establish the connection with the server and to process UI interactions. All the hard work of running the app logic and rendering the UI is then done on the server. This means Blazor Server apps load fast even as the app functionality grows. Because the client side of a Blazor Server app is so thin, it’s a great solution for apps that need to run on low-powered devices.
Using Blazor Server at scale
Blazor Server can scale from small internal line of business apps to large internet scale apps. While .NET Core 3.0 was still in preview we tested Blazor Server to see what its baseline scale characteristics look like. We put a Blazor Server app under load with active clients and monitored the latency of the user interactions. In our tests, a single Standard_D1_v2 instance on Azure (1 vCPU, 3.5 GB memory) could handle over 5,000 concurrent users without any degradation in latency. A Standard_D3_V2 instance (4 vCPU, 14GB memory) handled well over 20,000 concurrent clients. The main bottleneck for handling further load was available memory. Will you see this level of scale in your own app? That will depend in large part on how much additional memory your app requires per user. But for many apps, we believe this level of scale out is quite reasonable. We also plan to post additional updates on improvements in Blazor Server scalability in the weeks ahead. So stay tuned!
What is Blazor WebAssembly?
Blazor is a UI framework that can run in different environments. When you build UI components using Blazor, you get the flexibility to choose how and where they are hosted and run. As well as running your UI components on the server with Blazor Server, you can run those same components on the client with Blazor WebAssembly. This flexibility means you can adapt to your users’ needs and avoid the risk of being tied to a specific app hosting model.
Blazor WebAssembly apps host components in the browser using a WebAssembly-based .NET runtime. The components handle UI events and execute their rendering logic directly in the browser. Blazor WebAssembly apps use only open web standards to run .NET code client-side, without the need for any browser plugins or code transpilation. Just like with Blazor Server apps, the Blazor framework handles comparing the newly rendered output with what was rendered previous and updates the DOM accordingly, but with Blazor WebAssembly the UI rendering is handled client-side.
When should I use Blazor WebAssembly?
Blazor WebAssembly is still in preview and isn’t yet ready for production use yet. If you’re looking for a production ready solution, then Blazor Server is what we’d recommend.
Once Blazor WebAssembly ships (May 2020), it will enable running Razor components and .NET code in the browser on the user’s device. Blazor WebAssembly apps help offload work from the server to the client. A Blazor WebAssembly app can leverage the client device’s compute, memory, and storage resources, as well as other resources made available through standard browser APIs.
Blazor WebAssembly apps don’t require the use of .NET on the server and can be used to build static sites. A Blazor WebAssembly app is just a bunch of static files that can be hosted using any static site hosting solution, like GitHub pages or Azure Static Website Hosting. When combined with a service worker, a Blazor WebAssembly app can function completely offline.
When combined with .NET on the server, Blazor WebAssembly enables full stack web development. You can share code, leverage the .NET ecosystem, and reuse your existing .NET skills and infrastructure.
Including a .NET runtime with your web app does increase the app size, which will impact load time. While there are a variety of techniques to mitigate this (prerendering on the server, HTTP caching, IL linking, etc.), Blazor WebAssembly may not be the best choice for apps that are very sensitive to download size and load time.
Blazor WebAssembly apps also require a browser that supports WebAssembly. WebAssembly is supported by all modern browsers, including mobile and desktop browsers. However, if you need to support older browsers without WebAssembly support then Blazor WebAssembly isn’t for you.
Blazor WebAssembly is optimized for UI rendering scenarios, but isn’t currently great for running CPU intensive workloads. Blazor WebAssembly apps today use a .NET IL interpreter to execute your .NET code, which doesn’t have the same performance as a native .NET runtime with JIT compilation. We’re working to better address this scenario in the future by adding support for compiling your .NET code directly to WebAssembly instead of using an interpreter.
You can change your mind later
Regardless of whether you choose Blazor Server or Blazor WebAssembly, you can always change your mind later. All Blazor apps use a common component model, Razor components. The same components can be hosted in a Blazor Server app or a Blazor WebAssembly app. So if you start with one Blazor hosting model and then later decide you want to switch to a different one, doing so is very straight forward.
What’s next for Blazor?
After shipping Blazor WebAssembly, we plan to expand Blazor to support not just web apps, but also Progressive Web Apps (PWAs), hybrid apps, and even fully native apps.
Blazor PWAs: PWAs are web apps that leverage the latest web standards to provide a more native-like experience. PWAs can support offline scenarios, push notifications, and OS integrations, like support for pinning the app to your home screen or the Windows Start menu.
Blazor Hybrid: Hybrid apps are native apps that use web technologies for the UI. Examples include Electron apps and mobile apps that render to a web view. Blazor Hybrid apps don’t run on WebAssembly, but instead use a native .NET runtime like .NET Core or Xamarin. You can find an experimental sample for using Blazor with Electron on GitHub.
Blazor Native: Blazor apps today render HTML, but the renderer can be replaced to render native controls instead. A Blazor Native app runs natively on the devices and uses a common UI abstraction to render native controls for that device. This is very similar to how frameworks like Xamarin Forms or React Native work today.
These three efforts are all currently experimental. We expect to have official previews of support for Blazor PWAs and Blazor Hybrid apps using Electron in the .NET 5 time frame (Nov 2020). There isn’t a road map for Blazor Native support yet, but it’s an area we are actively investigating.
Summary
With .NET Core 3.0, you can build rich interactive client-side UI today with Blazor Server. Blazor Server is a great way to add client-side functionality to your existing and new web apps using your existing .NET skills and assets. Blazor Server is built to scale for all your web app needs. Blazor WebAssembly is still in preview, but is expected to ship in May of next year. In the future we expect to continue to evolve Blazor to support PWAs, hybrid apps, and native apps. For now, we hope you’ll give Blazor Server a try by installing .NET Core 3.0!
If you read or watched the prior guides, you are probably most interested in what has changed in the technology surrounding game development and laptops in general. The biggest new change is the introduction of Real-Time Raytracing, or RTX technology, that we will talk about in more detail later. Additionally, AMD released a new embedded mobile graphics chipset that appeared in some lower cost laptops, bringing low-mid range GPU to a few popular laptop models. Intel and AMD released a new generation of GPUs, with AMD making huge progress on the desktop but somewhat limited in mobile chips although rumours suggest something big from AMD coming soon. Intel chips are just incremental improvements on the previous gen, with several of their newest processors running into thermal issues. Finally, the thin and light laptop has become nearly universal, with all manufacturers making something. Oh, and prices went up for the most part… so it isn’t all great news.
What Kind of Game Development Are You Intending to Do?
Game Development is a BROAD subject and the kind of machine you need is entirely determined by what you are doing with it. Different tasks have different requirements, but here is a VERY vague summery.
2D Pixel Art
If you are looking to do mostly drawing and pixel art creation on your machine… good news! This isn’t a particularly demanding task. A touch screen and good color calibrate monitor are probably the most important traits in this case.
3D MODELLING and ANIMATION
If you are a 3D artist, especially if you are working with higher polygon count scenes or real-time sculpting, the GPU is the most important thing, followed by RAM and CPU.
Programmer
If you are mostly compiling large volumes of code the CPU is probably the most important part, but you want to avoid any bottlenecks, such as running out of RAM. Most importantly, you absolutely NEED to have an SSD. The difference an SSD drive makes to compiling code is staggering.
VR DEVELOPER
If you are intending to work with VR, you have some fixed limits, minimum requirements to run an HTC Vive, Oculus Rift or Microsoft Mixed Reality device. Generally, this means at least a 1060+ or better GPU. This is because VR is basically running two screens, one per eye, and each screen needs to run at a minimum framerate (often @ 90) or it will cause sickness or headaches.
Why no Apple Laptops this year?
To be honest, it’s just getting harder and harder to recommend getting a MacBook since 2016 for several reasons. First off, they removed the F-row of function keys and replaced it with a touchbar, and this is horrible for programmers who rely heavily on function keys in just about every single application. Additionally, this change makes it work even worse if you need to boot into Windows software.
Additionally, this generation has been absolutely plagued with quality issues. It started with heavy thermal throttling on any i9 based Mac and got worse from there. The failure rate on this generation of MacBook’s keyboard is off the chart. Finally, they have implemented a security chip, which coupled with anti-repair policies, makes repairing a MacBook more problematic and expensive than ever. If you want a MacBook Pro for development, I personally would highly recommend a 2016 MacBook Pro or earlier, used or refurbed, at least until the MBP gets a engineering overhaul.
My minimum spec recommendations?
There are a few things I consider mandatory if buying a laptop in 2019.
SSD (Solid State Drive)
This is hands down my biggest non-negotiable recommendation. Having your operating system on an SSD improves performance of just about everything… massively. Want to take a few seconds, or nearly a minute to boot or wake your laptop? That is the difference an SSD makes! They are more expensive and often systems will have a smaller SSD for the OS partition and larger cheaper SATA drive for storage.
8GB of RAM
You can buy systems with 4GB of RAM… this is not enough. 8GB is the realistic minimum, while I would personally go no lower than 16GB. Anything over 32GB is mostly a waste for most users. 16GB still seems to be the sweet spot.
I5, i7 or i9 Processor
Be careful will any other processor options. Low powered options like the Intel Atom aren’t powerful enough for most game development tasks. An i3 may be enough for you, but I would recommend an i5 or higher. If you are on the higher end, be careful with purchasing an i9 machine, many of the first gen of i9 laptops are having trouble dealing with the extra heat and are a waste of money as a result.
GPU
I personally wouldn’t buy a machine without a dedicated GPU, which is pretty much a must if you want to do any 3D work or play modern games. Using integrated graphics, you can often play modern games on lowest settings at lower resolutions. In terms of what GPU… that’s is a bit trickier. The new generation of 2060/2070 and 2080 Nvidia GPUs are strongly focused on RTX, or real time raytracing. They are also quite expensive. Later on, Nvidia released the 1650, a value priced slower GPU without RTX with a much lower price tag. Of course, if RTX isn’t important to you, several last generation GPUs are still very viable, especially the 1070 and 1080 cards.
BATTERY
Battery is important but limited. To legally fly on an airplane with a battery the limit for a laptop is just under 100 watts/hour, so this is the upper limit of what a battery can be. Generally the bigger the battery the longer it lasts, but the more battery sucking features you put in there (GPU, Processor, 4K or high refresh rate display, etc) the more draw they put on the battery.
SIZE/WEIGHT/THERMALS
Laptops are generally available in 13”, 14”, 15” and 17” models, with the unit being measured diagonally across the screen. Weight is pretty self explanatory… and with modern laptops, anything over 5lbs is started to get a bit heavy and you will notice it in a backpack if you are doing a fair bit of traveling. The final challenge designers face is thermals… that is, keeping everything cool. With modern hardware if it gets to hot it slows down or throttles. This is why machines like the new i9 MacBooks or XPS 15 machines from DELL don’t live up to the hardware they put into them. Doesn’t make sense to put an i9 and a 2080 GPU into a machine if they get throttled to speeds slower than competing hardware with lesser specs. Thermals are important and sadly harder to determine without reading user reviews.
DISPLAY
There are many different things to consider, the type of panel (Matte,TN, IPS, OLED), the resolution 1080p vs 4K and the refresh rate ( 60hz, 120 +). The panel determines how colors and blacks will look, as well as how glossy the display will be in daylight. A lot of it comes down to personal opinion. Refresh rate is important if you are interested in real-time games and want your game to be as responsive as possible. That said, you need to be able to push framerates to match the refresh rate to take advantage of it. There is a hybrid approach with monitors enabling a variable refresh rate called GSync and FreeSync. Personally I would go for a 4K/60hz display but I don’t do a lot of twitch gaming.
Recommendations
The following is a list of game dev suitable laptops from the major providers at a variety of price points. If you purchase through our provided links on Amazon, GFS makes a small commission (and thank you!)
For around $1,000 you can get a 1660 GPU with a 6 core Intel CPU, 16GB of RAM and more.There are a few dozen specs available in this range to fit your need.Weighs in at 5lbs with a reported 6-hour battery life (which is optimistic…).A classic entry level line with good gaming credentials.
A step up in both price and power from the Helios, the Triton line contains a 2070 Max-Q GPU and a 144hz display for a price range of 1600 – 2000 (1600 for a 2060 equipped model).It is also lighter, thinner and supports a longer lasting battery than the Helios.
The Strix G is available in several different configurations, with the 1650 equipped model starting around the 1K USD mark.It has impressive internals in a 5.2lb form factor and impressively comes with a 1GB SSD drive.It is sadly let down by poor real-world battery life.
The Zephyrus line is a series of high-end laptops, with up to a 2080 card, 6 core Intel GPU all in a 0.6” slim design, weighting about 4.5lbs.The keyboard is at the front of the case however, something that can take some getting used to.
The Dell XPS line are stunning, thin and of a build quality.You pay a premium, for a XPS with a 1650 GPU costing almost $1700.I have trouble recommending this years XPS as the case design seems to struggle with heat, making thermal throttling a common complaint, meaning you wont get full use of the hardware you’ve paid for.
Dell has owned Alienware for a number of years, but only recently have they started releasing laptops that are actually portable, instead of gigantic desktop replacements.The M15 model is now 4.75 lbs and 0.8” thick, much easier to throw in a backpack.Available in a number of configs, this M15 has a 2060 GPU, i7-9750 CPU, 16GB of RAM, 512GB SSD for $1850.
The G5 is Dell’s dedicated gamer series of laptops.You will get better thermal performance at a lower price than the XPS line.The trade-off is louder fans, a nearly 1” thick laptop and close to 6lbs, making it one of the heavier laptops on this list.You can however get a 1650 GPU, 6 core Intel processor, 16GB of RAM, great battery life and an SSD for just over $1100, making it a solid value if you can handle the size.
A powerhouse laptop with a powerhouse pricetag.Available with up to a 2080 GPU, i9 9980 CPU one of the largest batteries you can legally put in a laptop, all in a 0.75” thick 4.5lb design.There are a huge number of configurations available in this highly portable long lasting laptop, including a rare OLED screen option.
Much of the same power as the Aero 15, in a big, cheaper package, that describes the AORUS.At 5.3lbs and nearly 1” thick, it’s certainly bigger and heavier.It also is about 50% cheaper!Unfortunately you don’t also get the monster battery of the more expensive Aero.Available in a range of GPUs from the 1650 to the 2070.
The HP Omen line is HP’s gaming series and is available in a wide range of configurations for prices ranging from $1100 to $2000.Battery life is reviewed as fair, chassis is 5.2lbs and 0.83” thick.In many ways you can look at the Omen line as incredibly average.
One of the best values on the list.Coming in at around $1000 USD with a 1650 GPU, 6 core i7-9750 CPU, 512GB SSD in a decent package.The only major downside is the anemic 45 WHr battery and 5.2lb weight.
A refresh of the Surface lineup is expected in the next few weeks.Microsoft’s machines are unique and of a high build quality, but only a few offer a GPU.Rumour has it the next generation will be AMD powered.
MSI have far too many brands, but the good news is almost all models are capable game development laptops, even though choosing the right version can be tricky. My personal choice is a the Stealth GS line, which is a good combination of power and portability and a reasonable price.
Razer started the thin and light high-end laptop craze and they continue to be one of the best… and most expensive.They have however split their line into 2 different products, the Blade and the Advanced.The Blade is limited to a 2060 GPU but also supports a lower price tag.Both machines sport the same processor and RAM, although oddly this model has better storage options.This model is 4.6lbs and 0.78” thick.
The Razer Blade advanced is slightly thinner and heavier than the Blade.It also ships with your choice of a 2070 or 2080 GPU and more display options, including a 4K display.Plus, it’s got a hefty price tag attached.This model is 4.83lbs and 0.7” thick.
The Razer Blade stealth is the only ultra book with a GPU.If you are looking for a 13” laptop with an all-day battery, but a decent GPU, the Stealth is a one of a kind machine.Unfortunately, the version linked here is last years MX150 based model, as the newly announced 1650 version has not shipped yet.
Too Rich For My Blood
I wont lie, this generation is expensive and in many cases isn’t a huge upgrade on the previous generation. If you find the above machines too expensive but need to purchase a machine, I would highly recommend looking for a model from the previous year on clearance. If you aren’t interested in raytracing, you can easily get by with a laptop from the previous generation. The 1070 and 1080 GPUs are plenty fast and capable of handling raytracing and most AAA games at high settings, while the CPU is rarely a bottleneck, so a last generation higher end i5 or i7 CPU should be more than enough.
Personally, I am skipping this generation and will wait till next year when the second generation of RTX hardware is released at which point RTX will be more prevalent (or a fading fad). If I didn’t already have a decent laptop however, I would personally pick up the Razer Blade Stealth with a 1650 GPU. Small form factor, long battery life, quality build and an OK (but unmatched in the 13” form factor) GPU is a hard to beat combination.