GitShow/vuejs/pinia
vuejs

pinia

๐Ÿ Intuitive, type safe, light and flexible Store for Vue using the composition api with DevTools support

by vuejs
composition-apissrstorevuevuex
Star on GitHubForkWebsitenpm

TypeScript

14.7k stars1.2k forks306 contributorsActive ยท 2w agoSince 2019@pinia/nuxt@1.0.2MIT

Meet the team

See all 306 on GitHub โ†’
posva
posva1.6k contributions
dependabot[bot]Bot
dependabot[bot]213 contributions
dependabot-preview[bot]Bot
dependabot-preview[bot]49 contributions
renovate-bot
renovate-bot27 contributions
pi0
pi018 contributions
renovate[bot]Bot
renovate[bot]15 contributions
nicodevs
nicodevs14 contributions
danielroe
danielroe13 contributions

Languages

View on GitHub โ†’
TypeScript76.9%
Vue18.7%
JavaScript2%
CSS1.8%
HTML0.5%
Shell0.2%

Commit activity

Last 12 weeks ยท 49 commits

Full graph โ†’

Community health

6 of 6 standards met

Community profile โ†’
100
โœ“READMEโœ“Licenseโœ“Contributingโœ“Code of Conductโœ“Issue Templateโœ“PR Template

Recent PRs & issues

Active ยท 10 in progress ยท Last activity 2w ago
See all on GitHub โ†’
haoku123
feat(types): expose store options to plugins via PiniaCustomOptionsPropertiesOpenPR

Problem Closes #1247 Plugins can add custom options through (module augmentation) and read them in the plugin callback via , but there is no way to type properties returned by the plugin from those options. only receives , , , โ€” the options type is never threaded into the store type, so (or any other option-derived property) can only be typed with the widest / types. Solution Add a dedicated interface intersected into , mirroring the existing pattern: The resolved options of each store flow into without any change to user-facing signatures: returns (and the setup overload passes ), and forward , and intersects . defaults to , so existing code that writes or is unaffected. The plugin from the issue then works with full typing: is updated so keeps the options type through its inference (previously the 4-parameter would have silently dropped , losing the plugin properties on mapped stores). Tests Added recreating the #1247 plugin scenario: custom / options declared through augmentation are resolved on the store instance, with and without the custom options. Full suite passes: , , and (260 tests). Notes This is type-only: no runtime changes. The earlier attempt at #3042 (closed) added a runtime field; this approach keeps everything at the type level, matching how already works.

haoku123 ยท 1w ago
b-strauss
Plugins: Expose `DefineStoreOptionsBase` in `PiniaCustomProperties`OpenIssue

What problem is this solving I wrote a plugin to solve #625. This is basically working, but the types of the stores defined in the new stores option in are not accessible inside . Proposed solution If the store options would be accessible inside , the actual types of the concrete stores could be accessed with . Describe alternatives you've considered _No response_

b-strauss ยท 1w ago
alexzhang1030
Pinia devtools will not call `setupDevtoolsPlugin` until `useStore` is calledOpenIssue

Reproduction N/A Steps to reproduce the bug There is a related issue https://github.com/vuejs/devtools/issues/672 The reproduction steps are there. Expected behavior Call immediately instead of calling it after . otherwise devtools cannot read at mounted. Actual behavior Call after someone calls Additional information _No response_

alexzhang1030 ยท 1w ago

Recent fixes

View closed PRs โ†’
guilledll
Pinia 4 + nuxt: fail on building pre-rendered pagesClosedIssue

Reproduction https://stackblitz.com/edit/github-jm6ehxba?file=package.json Steps to reproduce the bug Hi ๐Ÿ‘‹ After updating to @pinia/nuxt 1.0 from version 0.11 and also from pinia 3 to 4 I saw that started to fail on pre-rendered pages. The reproduction repo has: Nuxt 4.5 Pinia 4 + @pinia/nuxt 1.0 Nitro pre-rendering on "/" page To reproduce 1. Run with + 2. Run , it fails with access to undefined state 3. Downgrade to + 4. Run to see the build passing fine If you remove the prerendering from the route on everything works like in Expected behavior While running on Pinia 3, Nitro pre-rendering worked fine on Build, this is expected on Pinia 4 too Actual behavior While building a pre-rendered route using Pinia 4 the build process fails with a mention on: Additional information _No response_

guilledll ยท 2w ago
andreyshivas
createPinia() throws "__VUE_PROD_DEVTOOLS__ is not defined" under SSR when NODE_ENV=production (v4 ships no Node build)ClosedIssue

Reproduction https://github.com/andreyshivas/pinia4-nitro-ssr-repro Steps to reproduce the bug Minimal Nuxt 4 app โ€” is the only module and no store is defined, since runs on every request regardless. Expected behavior works in a Node SSR server regardless of , as it did on Pinia 3. Actual behavior Every SSR render fails once : Pinia 4 publishes only a bundler build. contains: and the exports map is a single unconditional entry: still references the Vue compile-time flag (5 occurrences). Nitro externalises pinia for the Node server build, so the file is copied to and loaded as-is โ€” nothing ever substitutes the flag. Pinia 3 shipped with the flags already substituted, so the same app works on 3.0.4. This looks like an unintended packaging regression in 4. Additional information Why it only appears in production. The reference sits behind a short-circuit: Any other than makes the left operand true, so the missing global is never evaluated. A local run looks perfectly healthy and the app only fails once deployed. The reported error is misleading. Nuxt catches the failing plugin chain, hands the error to , sets and carries on rendering. 's hook then runs against a that was never provided, and only that secondary error reaches the logs: It mentions neither , nor , nor Pinia at all. Recovering the real cause required registering a custom hook. Results. Workaround. Force Pinia through the bundler so the flag gets defined: Possible fixes. Ship a Node production build again behind conditional exports, as 3.x did. Or guard the reference โ€” โ€” so an unsubstituted flag degrades instead of throwing. Environment. pinia 4.0.2, @pinia/nuxt 1.0.1, nuxt 4.5.2, vue 3.5.41, Node 24.19.0 (also reproduced on the Linux deploy that surfaced it). Verified against the published npm tarball for โ€” same listing and the same 5 references to the flag, so this is not an install artefact.

andreyshivas ยท 2w ago
2499166657
V4.0.2 version of Object. hasOwn is compatible with Android 11 and below. We hope it can be compatibleClosedIssue

What problem is this solving V4.0.2 version Object. hasOwn is not compatible with Android 11 and below versions Proposed solution Suggest using Object. hasOwnProperty for compatibility Describe alternatives you've considered _No response_

2499166657 ยท 2w ago
Structured data for AI agents

Repository: vuejs/pinia. Description: ๐Ÿ Intuitive, type safe, light and flexible Store for Vue using the composition api with DevTools support Stars: 14707, Forks: 1198. Primary language: TypeScript. Languages: TypeScript (76.9%), Vue (18.7%), JavaScript (2%), CSS (1.8%), HTML (0.5%). License: MIT. Homepage: https://pinia.vuejs.org Topics: composition-api, ssr, store, vue, vuex. Latest release: @pinia/nuxt@1.0.2 (2w ago). Open PRs: 10, open issues: 15. Last activity: 2w ago. Community health: 100%. Top contributors: posva, dependabot[bot], dependabot-preview[bot], renovate-bot, pi0, renovate[bot], nicodevs, danielroe, idorenyinudoh, skirtles-code and others.

ยท@ofershap

Replace github.com with gitshow.dev