Skip to content

feat: add storage metadata watchers#2445

Open
cookesan wants to merge 1 commit into
wxt-dev:mainfrom
cookesan:watch-storage-meta
Open

feat: add storage metadata watchers#2445
cookesan wants to merge 1 commit into
wxt-dev:mainfrom
cookesan:watch-storage-meta

Conversation

@cookesan

Copy link
Copy Markdown
Contributor

Summary

  • add storage.watchMeta and item.watchMeta for listening to metadata changes without using the internal metadata key
  • normalize removed metadata to {} so watcher callbacks match getMeta
  • document the new APIs and cover storage areas plus defined items in tests

Tests

  • bun run --filter @wxt-dev/storage test index.test.ts
  • bun run --filter @wxt-dev/storage check
  • bun run --filter @wxt-dev/storage build
  • bun run docs:build
  • bun run check
  • bunx prettier --check docs/storage.md packages/storage/src/index.ts packages/storage/src/__tests__/index.test.ts
  • git diff --check

Fixes #1988

@netlify

netlify Bot commented Jun 28, 2026

Copy link
Copy Markdown

Deploy Preview for creative-fairy-df92c4 ready!

Name Link
🔨 Latest commit 51cba87
🔍 Latest deploy log https://app.netlify.com/projects/creative-fairy-df92c4/deploys/6a416019d65bfb0008fb4039
😎 Deploy Preview https://deploy-preview-2445--creative-fairy-df92c4.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added the pkg/storage Includes changes to the `packages/storage` directory label Jun 28, 2026

const getMetaValue = (properties: any) =>
typeof properties === 'object' && !Array.isArray(properties)
properties != null &&

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This a breaking change? We used to return null when meta was empty, but now we don't?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg/storage Includes changes to the `packages/storage` directory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] support watch meta change in storage

2 participants