Jazor 0.3.4

There is a newer version of this package available.
See the version list below for details.
dotnet add package Jazor --version 0.3.4
                    
NuGet\Install-Package Jazor -Version 0.3.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Jazor" Version="0.3.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Jazor" Version="0.3.4" />
                    
Directory.Packages.props
<PackageReference Include="Jazor" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Jazor --version 0.3.4
                    
#r "nuget: Jazor, 0.3.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Jazor@0.3.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Jazor&version=0.3.4
                    
Install as a Cake Addin
#tool nuget:?package=Jazor&version=0.3.4
                    
Install as a Cake Tool

Jazor

Write JavaScript in C#.

Jazor is a C#-to-JavaScript compiler that translates Roslyn IOperation semantics into standard ECMAScript AST. The Jazor package carries the core runtime, analyzer, source generator, emit tool, MSBuild integration, and the baseline Vue 3 authoring surface. Razor-to-Vue integration is provided separately by Jazor.Vue.

Features

  • C# → JS compilation — lowers Roslyn semantic model (IOperation) to ESTree-compliant JavaScript via Acornima, preserving evaluation order and side-effect semantics.
  • Whitelist-gated runtime surface — only explicitly mapped CLR APIs are emitted as JavaScript. The bundled analyzer enforces these boundaries at compile time.
  • Vue 3 authoring surface — write defineComponent(), h(), typed props/slots, and reactive setups in C#; emitted JS is standard Vue 3 component shapes with no private runtime wrapper.
  • Record structural lowering — C# records lower to plain JS objects with [Spread] flattening and static null omission, no runtime overhead.
  • Source Generator + MSBuild — whitelist generation, emit, and optional bundling run automatically during build. No extra toolchain required.
  • Source Maps — every emitted .mjs ships with an accompanying .mjs.map.

Install

<ItemGroup>
  <PackageReference Include="Jazor" Version="0.1.33" />
</ItemGroup>

Usage

Class libraries

Every project that declares [ECMAScriptModule] must reference Jazor:

<ItemGroup>
  <PackageReference Include="Jazor" Version="0.1.33" />
</ItemGroup>

Library projects keep the default JazorMode=none.

Optional frontend ecosystem packages

Jazor no longer bundles higher-level Vue ecosystem libraries by default. Add them explicitly when your authoring surface needs them:

<ItemGroup>
  <PackageReference Include="Jazor" Version="0.1.33" />
  <PackageReference Include="ECMAScript.VueRoute" Version="0.1.33" />
  <PackageReference Include="ECMAScript.Pinia" Version="0.1.33" />
  <PackageReference Include="ECMAScript.Vuetify" Version="0.1.33" />
  <PackageReference Include="ECMAScript.TDesign" Version="0.1.33" />
  <PackageReference Include="ECMAScript.Style" Version="0.1.33" />
</ItemGroup>
  • ECMAScript.Vue3 remains part of the default Jazor package.
  • ECMAScript.Pinia.Testing is a separate opt-in testing package layered on top of ECMAScript.Pinia.
  • ECMAScript.Style is a framework-neutral module in the ECMAScript ecosystem. It depends on the exact same Jazor version and reuses this package's compiler and MSBuild integration.

Host / executable projects

The final executable or web host project selects one output mode:

<ItemGroup>
  <PackageReference Include="Jazor" Version="0.1.33" />
</ItemGroup>

<PropertyGroup>
  <JazorMode>debug</JazorMode>
  <JazorDir>$(MSBuildProjectDirectory)\wwwroot\jazor\</JazorDir>
  <JazorTool>Deno</JazorTool> 
</PropertyGroup>
  • JazorMode=none is the default and writes no artifacts.
  • JazorMode=debug scans the host output and referenced assemblies, then writes debug modules and jazor-manifest.json.
  • JazorMode=release performs its internal materialization in an intermediate directory, then writes only the production bundle and source map through JazorTool; Deno uses the bundled runtime, and Netpack uses the packaged NetPack lane.

Razor-to-Vue integration

Add Jazor.Vue to a Razor SDK project to opt into the official Razor Source Generator final-compilation boundary:

<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>net11.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Jazor" Version="0.1.33" />
    <PackageReference Include="Jazor.Vue" Version="0.1.33" PrivateAssets="all" />
  </ItemGroup>
</Project>

Jazor.Vue hooks the completed Roslyn generator-driver result, then binds final generated C# and BuildRenderTree against that final compilation. Razor component modules lower to Vue render-function .mjs artifacts through the shared compiler/render-context path. Jazor alone neither installs the hook nor scans Razor components.

The integration directly consumes the final Compilation; it does not require EnableRazorHostOutputs, RazorCodeDocument, RazorCSharpDocument, or reparsing generated C#.

Current MSBuild emit behavior

The existing emit targets continue to handle declared ECMAScript modules independently of the future Razor component lowering:

  • JazorMode defaults to none; debug and release are mutually exclusive build outputs.
  • JazorDir defaults to $(MSBuildProjectDirectory)\wwwroot\jazor\.
  • debug writes modules plus jazor-manifest.json; release clears JazorDir, materializes internally, and writes only production bundle assets.
  • JazorTool defaults to Deno and is used only by release; bundle builds pass the intermediate manifest, artifact root, source root, and output root to the selected Deno or Netpack lane.
Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net11.0

    • No dependencies.

NuGet packages (8)

Showing the top 5 NuGet packages that depend on Jazor:

Package Downloads
ECMAScript.Vuetify

Vuetify bindings and RazorVue authoring component stubs for ECMAScript.

ECMAScript.TDesign

TDesign Vue Next bindings and RazorVue authoring component stubs for ECMAScript.

ECMAScript.VueRoute

Vue Router 4 host bindings for ECMAScript runtime authoring.

ECMAScript.Pinia

Pinia host bindings for ECMAScript runtime authoring.

Jazor.Admin

Jazor admin-shell contracts and native RazorVue components.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.11.0 0 8/11/2026
0.10.0 0 8/11/2026
0.9.0 0 8/11/2026
0.8.3 28 8/11/2026
0.8.2 33 8/11/2026
0.7.0 48 8/10/2026
0.6.0 48 8/10/2026
0.5.0 48 8/9/2026
0.4.0 51 8/9/2026
0.3.4 53 8/9/2026
0.3.3 57 8/7/2026
0.3.2 48 8/6/2026
0.1.48 53 8/5/2026
0.1.47 54 8/5/2026
0.1.46 50 8/5/2026
0.1.45 61 8/5/2026
0.1.43 94 8/4/2026
0.1.42 100 8/4/2026
0.1.41 98 8/4/2026
0.1.40 105 8/3/2026
Loading failed