Releases: tshaddix/webext-redux
v4.0.0: Merge pull request #304 from tshaddix/async-response
This release fixes an issue in 3.0.0 that would cause Chrome to log a warning about a message channel being closed before a response was received. See #303.
This is a breaking change if you're using the channelName
argument; the option is now passed to createWrapStore()
insead of wrapStore()
:
import { createWrapStore } from "webext-redux";
const wrapStore = createWrapStore(
+ { channelName: 'mychannel' }
);
wrapStore(
store,
- { channelName: 'mychannel' }
);
The other options to wrapStore
haven't changed. If you're not using channelName
, no changes are required!
As part of this release, CI was also updated to use Node 18, 20, and 22 instead of 12, 14, and 16.
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
v2.1.9
What's Changed
- Bump lodash from 4.17.14 to 4.17.21 by @dependabot in #266
- Readme update: add storyful by @fredericrous in #272
- fix: undefined error issue #269 by @fredericrous in #270
New Contributors
- @fredericrous made their first contribution in #272
Full Changelog: v2.1.7...v2.1.9
v2.1.7
v2.1.6
v2.1.5
Thanks @craigsketchley for cleaning up dependencies and moving Redux v4 to a peer dependency.
v2.1.4
Thanks to @sneakypete81, all builds after 2.1.3 will include a UMD build in the /dist
directory.
v2.1.3
v2.1.2
Fixed embarrassing breaking bug introduced in the last release which added a message callback in the wrong place. Thanks, @jbarzegar for reporting!