ECMAScript.Pinia 0.10.0

dotnet add package ECMAScript.Pinia --version 0.10.0
                    
NuGet\Install-Package ECMAScript.Pinia -Version 0.10.0
                    
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="ECMAScript.Pinia" Version="0.10.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ECMAScript.Pinia" Version="0.10.0" />
                    
Directory.Packages.props
<PackageReference Include="ECMAScript.Pinia" />
                    
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 ECMAScript.Pinia --version 0.10.0
                    
#r "nuget: ECMAScript.Pinia, 0.10.0"
                    
#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 ECMAScript.Pinia@0.10.0
                    
#: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=ECMAScript.Pinia&version=0.10.0
                    
Install as a Cake Addin
#tool nuget:?package=ECMAScript.Pinia&version=0.10.0
                    
Install as a Cake Tool

ECMAScript.Pinia

定位:Pinia runtime 的独立强类型 C# binding,不向 compiler 引入 Pinia 特判。

安装

<ItemGroup>
  <PackageReference Include="Jazor" Version="0.9.0" />
  <PackageReference Include="ECMAScript.Pinia" Version="0.9.0" />
</ItemGroup>

需要 @pinia/testing 时额外引用 ECMAScript.Pinia.Testing,并保持所有包版本一致。

职责

  • 提供 createPinia()defineStore()storeToRefs()、active Pinia、HMR 与 hydration binding。
  • 提供 Options API helper:mapState()mapGetters()mapWritableState()mapActions()mapStores()setMapStoreSuffix()
  • 提供 store、definition、plugin context、setup-store options 与 projected store 的强类型 runtime shape。
  • 通过显式 projection helper 支持 $onAction(...)$subscribe(...)pinia.use(...)、plugin-added state 与 setup-store action authoring。

authoring 边界

  • 公开 API 优先表达为具体 C# 类型、overload 或 named union;不使用 object 模拟 JavaScript any
  • StoreActionListenerContext.After<TResult>(...) 和四参数以上的方法组有 C# 推断限制时,调用方应显式声明泛型参数或先落到委托局部变量。
  • TestingOptionsTestingStubActions 与测试 runner 相关 contract 位于独立 ECMAScript.Pinia.Testing 包。
  • runtime import 使用 pinia,最终版本解析由 Jazor 的本地 manifest 与宿主输出链路处理。

代码结构

  • Pinia.cs:模块入口与委托声明。
  • Api/Pinia.Api.cs:Pinia API、Options API helper 与 HMR/hydration 入口。
  • Types/Pinia.Types.*.cs:store/runtime shape、options、callback context 与 helper value type。

相关文档

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

NuGet packages (1)

Showing the top 1 NuGet packages that depend on ECMAScript.Pinia:

Package Downloads
ECMAScript.Pinia.Testing

@pinia/testing host bindings for ECMAScript runtime authoring.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.10.0 0 8/11/2026
0.9.0 0 8/11/2026
0.8.3 28 8/11/2026
0.8.2 32 8/11/2026
0.7.0 49 8/10/2026
0.6.0 49 8/10/2026
0.5.0 46 8/9/2026
0.4.0 49 8/9/2026
0.3.4 50 8/9/2026
0.3.3 50 8/7/2026
0.3.2 51 8/6/2026
0.1.48 64 8/5/2026
0.1.47 67 8/5/2026
0.1.46 70 8/5/2026
0.1.45 77 8/5/2026
0.1.43 94 8/4/2026
0.1.42 93 8/4/2026
0.1.41 100 8/4/2026
0.1.40 96 8/3/2026
0.1.39 91 8/3/2026
Loading failed