Skip to content

Releases: wxt-dev/wxt

v0.17.2

23 Feb 21:50
Compare
Choose a tag to compare

compare changes

🩹 Fixes

  • Don't use sub-dependency binaries directly (#482)

v0.17.1

23 Feb 18:54
Compare
Choose a tag to compare

compare changes

🩹 Fixes

  • Content scripts not loading in dev mode (3fbbe2c)

📖 Documentation

  • Lots of small typo fixes (#480)

❤️ Contributors

v0.17.0

22 Feb 17:55
Compare
Choose a tag to compare

compare changes

🚀 Enhancements

  • storage: ⚠️ Improved support for default values on storage items (#477)

🩹 Fixes

  • storage: ⚠️ Only run migrations when the extension is updated (#478)
  • Improve dev mode for content scripts registered at runtime (#474)

📖 Documentation

⚠️ Breaking Changes

v0.17.0 introduces several breaking changes to wxt/storage.

First, if you were using defineItem with versioning and no default value, you will need to add defaultValue: null to the options and update the first type parameter:

// < 0.17
const item = storage.defineItem<number>("local:count", {
  version: ...,
  migrations: ...,
})

// >= 0.17
const item = storage.defineItem<number | null>("local:count", {
  defaultValue: null,
  version: ...,
  migrations: ...,
})

The defaultValue property is now required if passing in the second options argument.

If you exclude the second options argument, it will default to being nullable, as before.

const item: WxtStorageItem<number | null> =
  storage.defineItem<number>('local:count');
const value: number | null = await item.getValue();

If you don't use typescript, there aren't any breaking changes, this is just a type change.

For storage items that are not nullable, the watch callback types has improved and will use the default value instead of null when the value is missing:

// >=0.17
const item = storage.defineItem<number>('local:count', { defaultValue: 0 });
item.watch((newValue: number | null, oldValue: number | null) => {
  // ...
});

// >=0.17
const item = storage.defineItem<number>('local:count', { defaultValue: 0 });
item.watch((newValue: number, oldValue: number) => {
  // ...
});

You can also access the default value directly off the item:

console.log(item.defaultValue); // 0

The second breaking change is that migrations for versioned items only run when the extension is updated. Before, they were ran whenever the storage item was created, in any entrypoint (background, popup, content script, etc). Now, in v0.17, storage items will only run migrations when the browser.runtime.onInstalled event is fired with reason = "update" in the background. See the updated docs to make sure they run correctly: https://wxt.dev/guide/storage.html#running-migrations. TLDR: you need to import all storage items into the background entrypoint for the onInstalled hook to fire properly and thus run the migrations.

To keep the old behavior, call the new migrate function to run migrations as soon as an item is defined:

const item = storage.defineItem(...);
item.migrate();

v0.16.11

21 Feb 14:18
Compare
Choose a tag to compare

compare changes

🩹 Fixes

  • Output main JS file for HTML entrypoints to chunks directory (#473)

🏡 Chore

🤖 CI

  • Fix codecov warning in release workflow (7c6973f)
  • Upgrade pnpm/action-setup to v3 (905bfc7)

v0.16.10

20 Feb 20:33
Compare
Choose a tag to compare

compare changes

🚀 Enhancements

  • Customize when content scripts are registered, in the manifest or at runtime (#471)

🩹 Fixes

  • Don't assume react when importing JSX entrypoints during build (#470)
  • Respect configFile option (#472)

v0.16.9

20 Feb 14:18
Compare
Choose a tag to compare

compare changes

🚀 Enhancements

  • Support setting side panel options in HTML file (#468)

🩹 Fixes

  • Fix order of ShadowRootUI hooks calling (#459)

📖 Documentation

  • Add wrapper div to react's createShadowRootUi example (bc24ea4)

🏡 Chore

  • Simplify entrypoint types (#464)

❤️ Contributors

v0.16.8

15 Feb 21:42
Compare
Choose a tag to compare

compare changes

🩹 Fixes

  • Watch files outside project root during development (#454)

📖 Documentation

  • Add loading and error states for "Who's using WXT" section (447a48f)

v0.16.7

15 Feb 16:35
Compare
Choose a tag to compare

compare changes

🚀 Enhancements

  • Generate ESLint globals file for auto-imports (#450)

🔥 Performance

  • Upgrade Vite to 5.1 (#452)

📖 Documentation

  • Add section about dev mode differences (a0d1643)
  • Remove anchor from content script ui examples (87a62a1)

🏡 Chore

  • e2e: Use wxt prepare instead of wxt build when possible to speed up E2E tests (#451)

v0.16.6

10 Feb 10:30
Compare
Choose a tag to compare

compare changes

🚀 Enhancements

  • Add option to customize the analysis artifacts output (#431)

🩹 Fixes

  • Use insertBefore on mounting content script UI (ba85fdf)

💅 Refactors

  • Use Element.prepend on mounting UI (295f860)

📖 Documentation

  • Fix createShadowRootUi unmount calls (946072f)

🏡 Chore

  • Enable skipped test since it works now (6b8dfdf)

❤️ Contributors

v0.16.5

09 Feb 06:01
Compare
Choose a tag to compare

compare changes

🩹 Fixes

  • Support node 20 when running wxt submit (e835502)

📖 Documentation

  • Remove "coming soon" from automated publishing feature (2b374b9)