ECMAScript.Pinia
1.0.0-preview.4
dotnet add package ECMAScript.Pinia --version 1.0.0-preview.4
NuGet\Install-Package ECMAScript.Pinia -Version 1.0.0-preview.4
<PackageReference Include="ECMAScript.Pinia" Version="1.0.0-preview.4" />
<PackageVersion Include="ECMAScript.Pinia" Version="1.0.0-preview.4" />
<PackageReference Include="ECMAScript.Pinia" />
paket add ECMAScript.Pinia --version 1.0.0-preview.4
#r "nuget: ECMAScript.Pinia, 1.0.0-preview.4"
#:package ECMAScript.Pinia@1.0.0-preview.4
#addin nuget:?package=ECMAScript.Pinia&version=1.0.0-preview.4&prerelease
#tool nuget:?package=ECMAScript.Pinia&version=1.0.0-preview.4&prerelease
ECMAScript.Pinia
定位:Pinia runtime 的独立强类型 C# binding,不向 compiler 引入 Pinia 特判。
本包属于 JS resource library:manifest.json 与 inventory.json 记录锁定的 Pinia npm
package、入口和依赖元数据;运行时由 Emit 生成的标准 jazor/package.json 声明,随后由
Deno 恢复到 jazor/node_modules。C# 程序集只提供映射和 authoring contract。消费方编写的
RazorVue 模块生成到消费程序集的 Jazor.Generated.ModuleCatalog,不会改写上游 package。
安装
<ItemGroup>
<PackageReference Include="Jazor" Version="1.0.0-preview.3" />
<PackageReference Include="Jazor.Vue" Version="1.0.0-preview.3" PrivateAssets="all" />
<PackageReference Include="ECMAScript.Pinia" Version="1.0.0-preview.3" />
</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模拟 JavaScriptany。 StoreActionListenerContext.After<TResult>(...)和四参数以上的方法组有 C# 推断限制时,调用方应显式声明泛型参数或先落到委托局部变量。TestingOptions、TestingStubActions与测试 runner 相关 contract 位于独立ECMAScript.Pinia.Testing包。- runtime import 使用
pinia,最终版本解析由资源 manifest 的 package dependency 与宿主 Emit 依赖闭包处理。 - Pinia 4 的 development entry 会按官方依赖闭包带入
nostics与@vue/devtools-api。调用app.Use(pinia)后,Pinia 自行向已安装的 Vue Devtools 浏览器扩展注册面板;这不是额外的 C# authoring API,也不会进入 production entry。
代码结构
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 | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
NuGet packages (1)
Showing the top 1 NuGet packages that depend on ECMAScript.Pinia:
| Package | Downloads |
|---|---|
|
ECMAScript.Pinia.Testing
@pinia/testing C# host bindings backed by package metadata and the restored npm package for Jazor tests. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0-preview.4 | 0 | 9/23/2026 |
| 1.0.0-preview.3 | 54 | 9/16/2026 |
| 1.0.0-preview.2 | 51 | 9/15/2026 |
| 1.0.0-preview.1 | 55 | 9/14/2026 |
| 0.60.0 | 98 | 9/12/2026 |
| 0.50.0 | 95 | 9/11/2026 |
| 0.40.0 | 92 | 9/11/2026 |
| 0.35.0 | 98 | 9/10/2026 |
| 0.34.1 | 100 | 9/9/2026 |
| 0.34.0 | 100 | 9/9/2026 |
| 0.33.0 | 99 | 9/9/2026 |
| 0.32.0 | 101 | 9/8/2026 |
| 0.31.2 | 104 | 9/6/2026 |
| 0.31.1 | 98 | 9/6/2026 |
| 0.31.0 | 91 | 9/4/2026 |
| 0.30.0 | 94 | 9/4/2026 |
| 0.29.0 | 102 | 9/3/2026 |
| 0.28.1 | 103 | 9/2/2026 |
| 0.28.0 | 96 | 9/2/2026 |
| 0.27.0 | 93 | 9/2/2026 |