Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load global storage object in a lazy manner #32

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cyber-barrista
Copy link

Community guidelines:

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:

Description

The global storage object is loaded eagerly, as a result it's evaluated as a side effect whenever the package is loaded, even when just pure functions (e.g. getBucket) are imported/used. It is quite unexpected from user's perspective and makes testing troublesome (e,g. testing the UI part of an extension in non extension environment always fails simply because @extend-chrome/storage is loaded to the bundle)

P.S. There's no system test setup in the repo to test these sort of problems, hence no extra tests added.

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