Migrate frontend data fetching to Pinia Colada#1542
Draft
Conversation
- Install @pinia/colada and @pinia/colada-nuxt - Add @pinia/colada-nuxt module to nuxt.config.ts - Create queries/ folder with domain-organized query definitions - Rewrite useData.ts composables to delegate to Pinia Colada queries - Simplify useDataLoader.ts (remove old useData function) - Update consumer components for immutable optimistic updates - Use useQueryCache().setQueryData() for cache mutations Co-authored-by: MiniDigger <2185527+MiniDigger@users.noreply.github.com>
- Fix undefined values in query keys (use nullish coalescing) - Remove unused imports and parameters - Fix read-only computed assignment in notifications.vue - Make notification/invite data writable for optimistic updates - Run prettier and eslint fixes Co-authored-by: MiniDigger <2185527+MiniDigger@users.noreply.github.com>
Co-authored-by: MiniDigger <2185527+MiniDigger@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Refactor frontend state logic with pinia/pina-colada
Migrate frontend data fetching to Pinia Colada
Mar 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace custom
useData/useDataLoadercomposables with Pinia Colada (@pinia/colada) for query caching, SSR hydration, and reactive data fetching.New dependencies
@pinia/colada@1.0.0— query/mutation cache layer on top of Pinia@pinia/colada-nuxt@0.3.2— Nuxt module for SSR payload serialization and auto-importsQuery definitions (
app/queries/)Domain-organized query files using
useQuery():useProjectQueries.ts— projects, starred, watching, pinned, channels, versions, pages, watchers, stargazersuseUserQueries.ts— users, orgs, staff, authorsuseNotificationQueries.ts— notifications, unread count, invitesuseAdminQueries.ts— stats, health, flags, approvals, action logsuseMiscQueries.ts— version info, owners, auth settings, API keys, reviews, jar scansBridge layer (
useData.ts)The 35+ composables in
useData.tsnow delegate to Pinia Colada queries while preserving the same public API. No consumer changes needed for read-only usage.Optimistic updates
Consumers that mutate cached data now use
useQueryCache().setQueryData()via writable computed refs instead of direct.valueassignment:Removed
useData()generic function (~150 LOC) with manualuseStatecaching,watchDebounced, Sentry spans, SSR prefetch orchestrationcheckEqual()deep comparison utilityWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
hangar.papermc.dev/home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/Hangar/Hangar/frontend/node_modules/.bin/../.pnpm/nuxt@4.1.2_@netlify+blobs@9.1.2_@parcel+watcher@2.5.1_@types+node@24.6.2_@vue+compiler-_212c46afb5675bb5e2449a7f71efdee6/node_modules/nuxt/bin/nuxt.mjs typecheck(dns block)/home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/Hangar/Hangar/frontend/node_modules/.bin/../.pnpm/nuxt@4.1.2_@netlify+blobs@9.1.2_@parcel+watcher@2.5.1_@types+node@24.6.2_@vue+compiler-_212c46afb5675bb5e2449a7f71efdee6/node_modules/nuxt/bin/nuxt.mjs typecheck git conf�� s --global tools/pnpm/10.20.0_tmp_4187_0/node_modules/pnpm/dist/node-gyp-bin/node pages/notifications.vue app/pages/auth/settings/api-keys.vue "$k=".$v["local/home/REDACTED/work/Hangar/Hangar/frontend/node_modules/.bin/../.pnpm/��(dns block)hangar.papermc.io/home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/Hangar/Hangar/frontend/node_modules/.bin/../.pnpm/nuxt@4.1.2_@netlify+blobs@9.1.2_@parcel+watcher@2.5.1_@types+node@24.6.2_@vue+compiler-_212c46afb5675bb5e2449a7f71efdee6/node_modules/nuxt/bin/nuxt.mjs typecheck(dns block)/home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/Hangar/Hangar/frontend/node_modules/.bin/../.pnpm/nuxt@4.1.2_@netlify+blobs@9.1.2_@parcel+watcher@2.5.1_@types+node@24.6.2_@vue+compiler-_212c46afb5675bb5e2449a7f71efdee6/node_modules/nuxt/bin/nuxt.mjs typecheck git conf�� s --global tools/pnpm/10.20.0_tmp_4187_0/node_modules/pnpm/dist/node-gyp-bin/node pages/notifications.vue app/pages/auth/settings/api-keys.vue "$k=".$v["local/home/REDACTED/work/Hangar/Hangar/frontend/node_modules/.bin/../.pnpm/��(dns block)o1.ingest.sentry.io/home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/Hangar/Hangar/frontend/node_modules/.bin/../.pnpm/nuxt@4.1.2_@netlify+blobs@9.1.2_@parcel+watcher@2.5.1_@types+node@24.6.2_@vue+compiler-_212c46afb5675bb5e2449a7f71efdee6/node_modules/nuxt/bin/nuxt.mjs typecheck(dns block)/home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/Hangar/Hangar/frontend/node_modules/.bin/../.pnpm/nuxt@4.1.2_@netlify+blobs@9.1.2_@parcel+watcher@2.5.1_@types+node@24.6.2_@vue+compiler-_212c46afb5675bb5e2449a7f71efdee6/node_modules/nuxt/bin/nuxt.mjs typecheck git conf�� s --global tools/pnpm/10.20.0_tmp_4187_0/node_modules/pnpm/dist/node-gyp-bin/node pages/notifications.vue app/pages/auth/settings/api-keys.vue "$k=".$v["local/home/REDACTED/work/Hangar/Hangar/frontend/node_modules/.bin/../.pnpm/��(dns block)pinia-colada.esm.dev/home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js(dns block)www.npmjs.com/home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js(dns block)If you need me to access, download, or install something from one of these locations, you can either:
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.