A typed .NET toolchain for compiling supported C# semantics into deterministic ECMAScript modules.
Quick start · Documentation · Changelog
English · 简体中文
Jazor 1.0.0-preview.1 is the current preview release.
Jazor is a typed .NET toolchain for compiling supported C# semantics into deterministic ECMAScript modules. It is framework-neutral at its core: Roslyn supplies the semantic model, Jazor.Compiler lowers it to ESTree, and Jazor.Emit materializes browser artifacts.
Razor-to-Vue is a separate application direction built on that core. Jazor.RazorVue binds the final output of the official Razor Source Generator, then delegates all C# expression and member semantics to the same Jazor compiler before it frames Vue render-function modules.
The first compiler version, its first 500 tests, and the initial RazorVue implementation were written by humans. Subsequent development has been collaborative and primarily AI-led, with the Zhipu GLM-5 series and GPT-5 series serving as the main AI collaborators; maintainers continue to review changes, run the gates, and make release decisions.
Jazor builds on Roslyn, Acornima, Netpack, DenoHost, WebRef, and earlier C#-to-JavaScript projects including WootzJs, h5, and SharpKit.
flowchart LR
subgraph Core["Jazor core platform: C# -> ECMAScript"]
CSharp["C# modules"] --> Roslyn["Roslyn semantic model"]
Roslyn --> Compiler["Jazor.Compiler"]
Bindings["CLR and ECMAScript bindings"] --> Compiler
Compiler --> Ast["ESTree"] --> Emit["Jazor.Emit"]
Emit --> Artifacts[".mjs, source maps, manifest, bundle"]
end
subgraph Integrations["Framework integration layer"]
Razor["Razor components"] --> RazorSG["Official Razor SG"] --> Compilation["Final Compilation"]
Compilation --> RazorVue["Jazor.RazorVue"]
RazorVue -. uses core translation hooks .-> Compiler
RazorVue --> Emit
end
Jazor.RazorVue is the current framework integration. Future directions such as Jazor.React or Jazor.RazorReact may reuse the same core, but they are not current supported APIs.
The badges above show maintained acceptance thresholds rather than a stale one-off result. The repository verifies the following minimums through repeatable scripts:
- Core compiler: at least 10,000 passing
IOperationscenarios, 98% line coverage, and 97% branch coverage. - Current Razor-to-Vue integration: at least 4,000 passing scenarios, 90% line coverage, and 94% branch coverage while the integration work continues.
- Vue ecosystem bindings: at least 90% audited public binding-contract coverage per target.
Run verify-compiler-coverage.cs, verify-razorvue-coverage.cs, or verify-vue-binding-coverage.cs under scripts/csharp/ to reproduce the relevant gate. The active scope and test entry points are listed in Current Status.
| Package | Responsibility |
|---|---|
Jazor |
Framework-neutral compiler, CLR contracts, analyzer, emit tooling, MSBuild and ASP.NET Core integration; suitable for ordinary ECMAScript libraries |
Jazor.Vue |
Vue authoring, Razor-to-Vue opt-in, Vue runtime assets, ECMAScript.Vue, ECMAScript.VueContract, and ECMAScript.Blazor payload |
ECMAScript.* |
Framework-neutral ECMAScript bindings plus optional Vue ecosystem bindings and CSS-in-JS libraries |
ECMAScript.VueDataUi |
Typed vue-data-ui RazorVue charts with per-component local ESM materialization |
ECMAScript.VuIcons |
Typed vu-icons RazorVue icons with static per-icon and dynamic catalog paths |
Jazor.Admin |
UI-library-neutral admin-shell library and RazorVue components |
samples/JazorAdmin is the production-grade admin reference application that consumes Jazor.Admin; it is not part of the library's public contract.
A library has exactly one of these two JavaScript carriers. RazorVue is an authoring mode of the pure Jazor form, not a third carrier.
| Library form | Carrier | Direct reference rule |
|---|---|---|
JS resource library (ECMAScript, Vue, Vuetify, Pinia, and other libraries that already own .mjs/.js) |
Package-local manifest.json + dist/** |
The package declares its resource dependencies. A consumer does not acquire Jazor tooling transitively. |
Pure Jazor library (ECMAScript.Style, Jazor.Admin, or other developer-authored C# and RazorVue) |
Assembly Jazor.Generated.ModuleCatalog (ECMAScriptCode) |
A pure Jazor authoring project directly references Jazor; a RazorVue authoring project directly references both Jazor and Jazor.Vue. |
The final executable or web host directly references Jazor when it runs Emit. It collects the
selected ModuleCatalog modules and manifest resources once; Debug, Release, SSR, and HMR are
output projections of that same closure, not additional library forms.
ModuleCatalog is the standard assembly output for pure Jazor because the analysis/source-generator
pipeline emits C#; it is not a legacy compatibility carrier.
For a pure Jazor library (C# compiled to ECMAScript) or the final host, add the core package directly:
dotnet add package Jazor --version 1.0.0-preview.1For a Razor SDK project that authors RazorVue components, add both packages directly and keep their versions aligned:
<ItemGroup>
<PackageReference Include="Jazor" Version="1.0.0-preview.1" />
<PackageReference Include="Jazor.Vue" Version="1.0.0-preview.1" PrivateAssets="all" />
</ItemGroup>Detailed package selection, output settings, SSR configuration, and ecosystem bindings are in Installation and Configuration.
Use [ECMAScriptModule] to make a C# module eligible for JavaScript emission:
using ECMAScript;
namespace MyApp;
[ECMAScriptModule("shared/greetings.mjs")]
public static class GreetingModule
{
public static string Compose(string name) => $"Hello, {name}";
}The core compiler emits a standard named-export ECMAScript module. Cross-module calls are resolved through compiler-owned imports rather than hand-written JavaScript.
For a complete runnable path, see Quick Start.
The executable or web host selects its artifact mode through MSBuild:
<PropertyGroup>
<JazorMode>debug</JazorMode>
<JazorDir>$(MSBuildProjectDirectory)\jazor\</JazorDir>
</PropertyGroup>| Mode | Result |
|---|---|
none |
Default; no Jazor artifacts are written |
debug |
Inspectable modules, external source maps, and jazor-manifest.json |
release |
Production browser bundle through the packaged Netpack lane |
Set JazorSSR=true with the supported SSR setup when an ASP.NET Core application needs Vue server rendering and hydration. See Artifact Pipeline.
| Need | Entry |
|---|---|
| Product overview | docs/README.md |
| Core compiler architecture | Compiler |
| Framework integration rules | Framework Integrations |
| Current Razor-to-Vue implementation | Razor-to-Vue |
| Install, configure, and author | Guides |
| Examples | Examples |
| Current scope | Roadmap |
| Historical context | Evolution |
| Release history | CHANGELOG.md |
Use the .NET 11 SDK preview selected by global.json. From the repository root:
dotnet restore Jazor.slnx
dotnet build Jazor.slnx
dotnet run --file scripts/csharp/test-dotnet.csFocused suites include:
dotnet test src/Jazor.CompilerTest/Jazor.CompilerTest.csproj
dotnet test src/Jazor.RazorVue.Sg.Test/Jazor.RazorVue.Sg.Test.csproj
dotnet test src/Jazor.EmitTest/Jazor.EmitTest.csprojRepository automation uses single-file C# entry points under scripts/csharp/. See Development and Testing for the full workflow.
- The first 1.0 preview is available for evaluating the frozen-candidate API and supported feature set.
- The preview has passed the public API, compiler, Razor-to-Vue, SSR, binding-contract, typed-bootstrap, Release package-consumer, and Chrome sample gates described below.
- Release candidates run one archived verification path covering API compatibility, quality gates, package shape, and Windows SPA/SSR consumers.
- Vue binding contracts for Element Plus, Vuetify, and TDesign are checked against generated snapshots, manifests, and upstream versions before release.
- RazorVue diagnostics emit SARIF and schema
1.0remediation reports with stable IDs, HelpLinks, authored source locations, and minimal fixes. - Quality Gates continuously exercise the diagnostics protocol with isolated success and failure fixtures, preserving JSON and SARIF evidence.
- The public API snapshot matches the frozen baseline:
76,108entries,0added, and0removed. - The Release mainline is green: Compiler
10,711/10,711, CLR5,089/5,089, Razor SG4,982/4,982, and Emit202/202, with the remaining ecosystem suites passing as well. - The Release sample matrix passes for both
RazorVue.AuthoringandJazorAdmin, including isolated NuGet consumers and Chrome browser smoke. Typed bootstrap and Element Plus, Vuetify, and TDesign binding contract gates also pass. - This is preview evidence; a stable 1.0 package has not been published. The supported scope and explicit reject boundaries remain documented in Current Status.
Read the release notes for the complete history.
Jazor is licensed under the MIT License. Report security issues privately through GitHub Security Advisories; use issues and discussions for other feedback.