![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
redux-chrome-extension
Advanced tools
#Redux Chrome Extension
A starter boilerplate for a Chrome Extension using Redux and React.js. It handles store syncing throughout the whole Extension. Uses React for Popup window UI. Console.log in every part of extensions for better debugging.
##Schema
Uses https://developer.chrome.com/extensions/messaging
Background Page
Popup Window
Content Script
Options Page
*** code for functionality that is in parenthesis was commented out, see src/content.index.js and src/popup/index.js ***
npm i
gulp
Browserify and Watchify are used for building scripts. For more details see: (https://github.com/gulpjs/gulp/blob/master/docs/recipes/fast-browserify-builds-with-watchify.md)
gulp release
You can find .zip packages in the /dist folder.
##Data passing If you understand the Schema above, you see that not every part of extension talk to each other. That's because of in certain cases it doesn't make sense to notify the part, that would otherwise load the whole state from Background Page again.
It's not possible to have Content Script and Popup Window active both in the same time, since Popup Window is autoclosing when it loses focus, and after each invoking it's fetching the state from Background Page. So it doesn't make sense to send any changes from Content Script to Popup Window. Same with Popup Window and Options.
On the other hand Content Script is living behind every tab all the time, so we need to propagate store changes in Popop Window to Content Scripts immediately.
##Storage All the data we need to keep stored in extension after closing Chrome or disabling Extension are being saved to localStorage.
You can modify localStorage indirectly by changing state.persistent
property, like Options page in example.
##TODO
Replace browserify with webpack
Hot loading
Testing
Issues and pull requests are always welcome!!
FAQs
Unknown package
We found that redux-chrome-extension demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.