v3.0.0
Webext-redux now supports manifest v3! Here's a quick guide on how to update for webext-redux 3.0.0. Full changelog below.
Use createWrapStore()
to init wrapStore
import {
- wrapStore,
+ createWrapStore
} from "webext-redux";
+ const wrapStore = createWrapStore();
wrapStore(store);
Remember to call createWrapStore()
at the top-level.
Correct 👍
const wrapStore = createWrapStore()
chrome.storage.local.get('state').then(({ state }) => {
const store = ...
wrapStore(store);
});
Incorrect 👎
chrome.storage.local.get('state').then(({ state }) => {
const store = ...
// Incorrect: createWrapStore must be called synchronously
const wrapStore = createWrapStore()
wrapStore(store);
});
Replace portName
with channelName
Store({
- portName: 'custom-name'
+ channelName: 'custom-name'
})
wrapStore(store, {
- portName: 'custom-name'
+ channelName: 'custom-name'
})
Breaking Changes
- Option
portName
renamed tochannelName
.
For manifest v3 support, webext-redux no longer uses ports. Thus, "portName" doesn't describe the purpose anymore. It still allows multiple independent stores orwrapStore
calls. #297. - Function
wrapStore
is now created bycreateWrapStore
.
This new function sets up listeners to ensure webext-redux works in manifest v3.createWrapStore
must be called synchronously at the top level of your extension, just like browser event handlers. More details in #297. - Removed external messaging (listening or passing store updates to other extensions).
Since ports are no longer used, there's no mechanism to track which external contexts are still subscribed to updates. If you have a use case for this feature, please open an issue and we'll brainstorm ways to re-implement this. Details in 5c7d998.
Fixes / Updates
- Bind getState and subscribe in Store constructor (@dermeck in #289). This fixes compatibility with react-redux v8.
- Update Redux peer dependency to include v5 (@SidneyNemzer in #299).
- Internal string constants changed. These aren't part of the public API, but I figured I'd mention them here just in case someone depends on them. See the change in 7fe2113.
- Minor/patch updates for some dependencies. #300.
New Contributors
- @dermeck made their first contribution in #289
- @SidneyNemzer made their first contribution in #297
All Changes: v2.1.9...v3.0.0