Comfy-Org / Comfy-Org/ComfyUI_frontend

Migrate module-level singleton state to Pinia stores (2 composables)

Open
#11,079 2 comments 0 reactions 0 assignees View on GitHub
audit:refactor code-audit effort:small priority:nice-to-have
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

## Recommendation

### ♻️ REFACTOR: Use Pinia for Singleton State

Two composables use module-level `Map`/`ref` as singleton state instead of Pinia stores, as noted by their own inline TODOs:

- `src/platform/workflow/sharing/composables/useComfyHubPublishWizard.ts:22`
> TODO: Migrate to a Pinia store alongside the profile gate singleton

- `src/platform/workflow/sharing/composables/useComfyHubProfileGate.ts:9`
> TODO: Migrate to a Pinia store for proper singleton state management

## How to Fix

Convert both to Pinia stores for:
- DevTools visibility
- Consistent state management patterns
- Proper SSR compatibility (if ever needed)

---
**Category:** Refactoring | **Priority:** Nice-to-have | **Effort:** Small
Part of #11022
_Filed by repo-audit skill_

┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-11079-Migrate-module-level-singleton-state-to-Pinia-stores-2-composables-33e6d73d365081c09777cbcf1f2c944d) by [Unito](https://www.unito.io)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.