Skip to content
devhxjPublic

Repository files navigation

Today's Verse

Jazor

Compile C# modules to ECMAScript with Jazor and build Vue applications in C# with Jolt.

.NET 11 NuGet GitHub release MIT License

At least 10,000 compiler tests pass At least 98 percent compiler line coverage At least 97 percent compiler branch coverage

Get started with Jazor · Get started with Jolt · C# SPA example · Documentation · Changelog

English · 简体中文

Jazor compiles C# into JavaScript modules

Jazor is a C# compiler packaged as a .NET SDK. Write a method in a .cs file and Jazor compiles the supported C# code into a standard ES module at build time. An existing JavaScript app can import the method directly. The browser runs it without loading a .NET runtime.

using ECMAScript;

[ECMAScriptModule("features/greetings.js")]
public static class Greetings
{
    public static string Create(string name) => $"Hello, {name}";
}

After building, a JavaScript file at the root of the generated output can import the method by name.

import { Create } from "./features/greetings.js";

console.log(Create("Ada")); // Hello, Ada

You can use Jazor on its own to share C# logic with a frontend. It can also compile methods from referenced .NET libraries when the APIs those methods use have JavaScript implementations. Compile your first module · Use a .NET library

dotnet add package Jazor --version 2.7.7

Jolt builds Vue components from C#

Jolt builds on Jazor. Write the template and its C# event handler in a .jazor file. Jazor compiles the C# and Jolt turns the whole file into a Vue component. When you click the button below, Increment adds one to Count and Vue displays the new value on the button.

<button @onclick="@Increment">Count: @Count</button>

@code {
    private int Count;
    private void Increment() => Count++;
}

Each .jazor file becomes one ES module. The Vue component is the default export. Public static methods and fields and public constants become named exports. Instance state belongs to each mounted component. Jolt checks npm components against their public TypeScript declarations and imports their published ESM exports. Component authoring

How does the same button work in Blazor?

You can write this counter in C# with either Jolt or Blazor. The differences are where Increment runs, how the page updates, and which components you can reuse.

Topic Jolt Blazor
Components A .jazor file produces a Vue component you can use alongside .vue files. A .razor file compiles into a .NET Razor component. Existing Blazor component libraries work directly.
Button clicks The browser executes JavaScript compiled from C#, and Vue updates the count. Interactive Server sends the event over SignalR to run on the server. Interactive WebAssembly runs the handler in the browser's .NET runtime.
Existing libraries Jero uses Vue Router and Element Plus directly. Jolt checks component parameters against TypeScript declarations from the npm package. C# code can call .NET libraries supported on the hosting platform. JS interop lets components call JavaScript libraries.

Start with Jolt to add a page written in C# to a Vue app. Start with Blazor to reuse a Razor component library or run component event handlers on the server. Blazor Web Apps also offer static SSR and Interactive Auto. Static SSR produces HTML. Auto starts with server interactivity and can run in the browser on subsequent visits after the download completes. Jero sample · Microsoft Learn: Blazor render modes · JavaScript interop

Run a Jolt app

With the .NET 11 SDK, open samples/Jolt.AspNetCore/Jolt.AspNetCore.csproj in Visual Studio, select the Jolt.AspNetCore launch profile, and press F5. To start the same application in a terminal, run from the repository root.

cd samples/Jolt.AspNetCore
dotnet watch --launch-profile Jolt.AspNetCore

Open http://localhost:5168/portal/frontend/index.html, increment the counter, and edit the heading in Counter.jazor at the project root. The page updates and keeps the count. The web host starts the Jolt development service built from this repository. Jero, a full administration app, also supports F5 and dotnet watch. Counter project · Jero development guide

Edit and build

Editor Extension
VS Code Install jolt-2.7.7.vsix with Extensions: Install from VSIX. VS Code setup
Visual Studio 2026 on Windows x64 Open Jolt.VisualStudio.vsix with the VSIX Installer. Visual Studio setup
JetBrains Rider 2026.3 Install jolt-rider-2.7.7.zip from disk in Settings → Plugins. Rider setup

The 2.7.7 extensions launch the language server from the matching .NET tool. Follow the setup for your editor above, then open Counter.jazor in the sample project to use completion and go to definition. 2.7.7 release

From the web project directory, use dotnet build to build the project and dotnet publish -c Release to publish the host, frontend entry and production assets together. Counter project publish target

Related documentation

Topic Documentation
SDK configuration, output modes and ASP.NET Core SSR Installation and configuration
Reusing C# libraries and NuGet packages Managed library imports
Compiler and artifact pipeline System architecture
Supported features and test requirements Current status

Develop Jazor

Run from the repository root with the .NET SDK selected by global.json.

dotnet build Jazor.slnx
dotnet run --file scripts/csharp/test-dotnet.cs -- --project jolt
dotnet run --file scripts/csharp/test-dotnet.cs

The Jolt release workflow verifies an isolated CLI install, the language server and browser interaction, and builds both VSIX packages. Development and testing

Latest release

Jazor 2.7.7 adds source-defined operators, events and constructor chains. The editor now points to unsupported C# expressions in Jolt components and shared source. 2.7.7 release notes

AI-assisted development

The initial implementations of Jazor's core compiler and CLR support, together with the first 500 tests, were written by hand over nearly two years. This work established the project's technical foundation.

AI assistance has primarily helped advance documentation, test coverage, external library bindings, iterative improvements, CI, and version management. The Zhipu GLM-5 and GPT-5 series have been the main AI collaborators in this subsequent work; maintainers continue to guide the project, review changes, and make release decisions.

Acknowledgements

Jazor builds on Roslyn, Acornima, node-api-dotnet, pnpm, Vite, and WebRef. Earlier work also benefited from Netpack, DenoHost, and C#-to-JavaScript projects including WootzJs, h5, and SharpKit.

License and Feedback

Jazor is licensed under the MIT License. Report security issues privately through GitHub Security Advisories; use issues and discussions for other feedback.

Releases

Packages

Contributors

Languages