Skip to content

Conversation

@pascal-mueller
Copy link

…toragehook fromsharedtostorage`

* denotes required fields

Priority*

  • High: This PR needs to be merged first, before other tasks.
  • Medium: This PR should be merged quickly to prevent conflicts due to common changes. (default)
  • Low: This PR does not affect other tasks, so it can be merged later.

Purpose of the PR*

The shared packaged is described as code that's being shared between other packages and the main application. One application is to move type declarations into shared. Which works unless you need a type for a storage. The shared packaged held the useStorage hook, which made it dependent on storage because it imported types from storage, which in turn means that if you define a new type in shared and wanna use that in a storage, you'd end up with a circular dependency.

Changes*

  1. Moved useStorage from packages/lib/shared/hooks to packages/storage/lib/hooks.
  2. Adjusted all imports

Before the change one had to do:

import { useStorage } from '@extension/shared';`
import { exampleThemeStorage } from '@extension/storage';
const { isLight } = useStorage(exampleThemeStorage);

Now:

import { useStorage, exampleThemeStorage } from '@extension/storage';
const { isLight } = useStorage(exampleThemeStorage);

and you can use types defined in the shared package inside your storages

How to check the feature

Just do a code review, nothing changed visually and the changes aren't that big. Pretty straight forward.

Reference

dependabot bot and others added 3 commits May 26, 2025 06:19
Copy link

@github-actions github-actions bot 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 your contribution. We will check and reply to you as soon as possible.

@pascal-mueller
Copy link
Author

I just realized I need to change a few more things. Will add it later today.

@PatrykKuniczak PatrykKuniczak deleted the branch Jonghakseo:dev July 18, 2025 17:03
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.

2 participants