Skip to content

use vue instance level 'provide/inject' mechanism for pinia store#26438

Merged
rijkvanzanten merged 9 commits intodirectus:mainfrom
kekekuli:fix/useSystem
Feb 10, 2026
Merged

use vue instance level 'provide/inject' mechanism for pinia store#26438
rijkvanzanten merged 9 commits intodirectus:mainfrom
kekekuli:fix/useSystem

Conversation

@kekekuli
Copy link
Contributor

@kekekuli kekekuli commented Dec 29, 2025

Scope

What's changed:

  • useSystem now require one arg, the vue app instance, to ensure 'provide' is effect at vue app level, not component level

Potential Risks / Drawbacks

  • I updated the useSystem signature, which requires an app instance. I have conducted a global search to find all callers but only find app.vue. Did I missed other callers?
  • And useSystem is not suitable as one composable, its name and source file path would bring mess I think, it's effect is more like 'initProvide' or 'registerContext' such like.

Tested Scenarios

  • Lorem ipsum dolor sit amet
  • Consectetur adipiscing elit

Review Notes / Questions

  • I would like to lorem ipsum
  • Special attention should be paid to dolor sit amet

Checklist

  • Added or updated tests
  • Documentation PR created here or not required
  • OpenAPI package PR created here or not required

Fixes #26411, #25410

By the way, as describe at #26411, it breaks for a long time. I belive it is ad5361a this commit bring out ( update vue from 3.4.xx to 3.5.xx, which introduce break changes), which means it seems to break 1 years.. I am a little suprised.

Edits: As a Amateur code sleuth, I use git to do time travel, It is exactly the ad5361a caused. After ad5361a, all attempts to call useStore in extension source code will throw error. A impressive learning course Lol.

@Nitwel Nitwel self-requested a review February 10, 2026 12:41
Copy link
Member

@rijkvanzanten rijkvanzanten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this @kekekuli! Opened on my birthday no less 🍰

Couple of tiny nits, but this generally looks good to go to me

@rijkvanzanten rijkvanzanten enabled auto-merge (squash) February 10, 2026 18:32
Copy link
Member

@Nitwel Nitwel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just confirmed this fixed the problem. Nice work!

@rijkvanzanten rijkvanzanten merged commit ef5773d into directus:main Feb 10, 2026
5 checks passed
@github-actions github-actions bot added this to the Next Release milestone Feb 10, 2026
@kekekuli
Copy link
Contributor Author

Thank you for this @kekekuli! Opened on my birthday no less 🍰

Happy birthday for you! Thank you to review

AlexGaillard pushed a commit that referenced this pull request Feb 18, 2026
…6438)

* fix: use vue app level provide/inject (#26411)

* changeset update

* sort imports

* Update .changeset/goofy-fans-bow.md

* Update app/src/main.ts

* Update .changeset/goofy-fans-bow.md

* Update app/src/composables/use-system.ts

---------

Co-authored-by: Nitwel <[email protected]>
Co-authored-by: Rijk van Zanten <[email protected]>
@kekekuli kekekuli deleted the fix/useSystem branch February 24, 2026 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error: [useStores]: The stores could not be found.

3 participants