H5 is a modern fork of the original Bridge C# to Javascript compiler, updated to support multi-platform development using .NET Core 3.1 and .NET Standard 2.0 projects, while dropping support for legacy features and dependencies.
H5 is under active development, and targets a more integrated and faster development experience for C# web-developers. We're also planning to experiment with new ideas to improve compilation speed (such as aggressive caching of emitted code) and possibly integrating C# Source Generators) for even faster code generation.
Package | NuGet | Azure DevOps |
---|---|---|
Compiler | ||
Base Library | ||
Core Library | ||
SDK Target | ||
Json Library | ||
dotnet template | ||
Tesserae UI toolkit |
H5 is fully based on netstandard2.0 & netcore3.1, and removes all dependencies on the legacy .NET Framework coming from the original source-code.
To get started with it, you can use the following project template
<Project Sdk="h5.Target/0.0.*">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="h5" Version="*" />
<PackageReference Include="h5.Core" Version="*" />
</ItemGroup>
</Project>
The Sdk target above (<Project Sdk="h5.Target/0.0.*">
) will automatically install (and update) the compiler as a dotnet global tool
. You need to update the version /0.0.*
to the latest package.
Don't forget to run dotnet restore
to fill the versions with the latest values. You can also manually install it with:
dotnet tool update --global h5-compiler
You can also install a dotnet new template (latest version: ):
dotnet new --install h5.Template::0.0.8152
And create a new project with:
dotnet new h5
This fork introduces a series of breaking changes as part of the modernization effort:
- Projects must explicitly target
netstandard2.0
. - Drop support to the legacy .csproj format (only SDK-style projects are supported)
- Drop support for legacy (and unused) command line arguments (check h5 -h for the current supported arguments)
- Compiler is now distributed as a
dotnet global
tool and have it's own versioning and auto-update on build (this can be disable by setting<UpdateH5>false<UpdateH5/>
on your project file. - Retyped packages are not supported (as those are maintained by the Bridge authors, and cannot be built separately or consumed without the Bridge NuGet package).
- Logging and Report options have been removed from the h5.json config file. Logging settings will be available only as a command line argument (and exposed as a Project file option in the future)
- Hosted Compiler process (to speed up compilation and avoiding reloading assemblies that don't change often (like nuget packages), h5 introduces an off-process compiler server. For now, this process will open a terminal with the compilation logs - but this will be hidden in the future)
To avoid any conflicts with the original Bridge ecosystem, all packages have been renamed. For upgrading, you can use the following mapping:
- H5 (replaces the base Bridge library)
- H5.Core (replaces Retyped.Core, Retyped.es5 and Retyped.dom)
- H5.Newtonsoft.Json (replaces Bridge.Newtonsoft.Json)
Other packages might be added in the future as we experiment with this fork, but we do not aim on providing any kind of Retyped replacement here.