The add-on where ideas come to idea
npm install
npm test
runs the unit test suite
npm start
will build the addon and post it to the Extension Auto-Installer
see ../docs/development/environment.md
to configure which server environment the addon connects to.
A relatively easy path for working on this addon involves the following steps:
-
Install Firefox Developer Edition.
-
Install the DevPrefs Add-on, which sets a number of preferences necessary for Add-on development, importantly
xpinstall.signatures.required
andxpinstall.whitelist.required
. -
Install the Extension Auto-Installer Add-on in Firefox Developer Edition.
-
In the this directory, run
npm start
to build and run the addon in firefox. -
Read all about setting up an extension development environment on MDN.
npm test
- just runs the unit tests quickly
npm run slow-test
- runs flow and the unit tests with coverage
npm run coverage
- runs both flow and the unit tests with coverage
npm run package
builds an unsigned xpi for local testing
npm run sign
builds a signed xpi
The addon uses Redux to manage app state. Side effects are handled in a similar way to the Elm Architecture Effects Model. Actions that trigger side effects do so by returning a function from the sideEffects
reducer. That function gets executed by a store subscriber (created by sideEffects.enable(store)
in main.js
) after the dispatch has completed, keeping the reducers pure. You'll notice that the default return value of the reducer is an empty function which prevents the previous side effect from running again.
/src/main.js
- the main entrypoint for the addon
/src/lib/actionCreators
- contains modules that create actions
- most of the "work" happens here
/src/lib/metrics
- contains the API for experiment metrics
/src/lib/middleware
- contains Redux middleware for communicating with the web app.
/src/lib/reducers
- all state changes are made here
/data
- assets for the addon
/flow-typed
- Flow type declarations
/tasks
- build tasks, etc.
/test
- unit tests
tools
- helpful development tools