This persists the current docs page so that it is used on page reload
of the app. This is mostly useful for development since users should
not be refreshing the page.
It also remembers the selected page between sessions, so new windows
will open to the previous page.
Checks are added to default back to the docs index page in case the
"remembered" page is no longer valid.
This fixes issues where the index.html page can be served if we have
something that requests a static resource that does not exist. In the
worst case, this would the app appear recursively in the docs pane.
Also remove some unnecessary typing while we are touching this.
The application icons, like favicon.ico were not being cached properly
and were missing when the app was used offline.
Changing the strategy to CacheFirst and changing the test to include
all images fixes the problem.
- registration is moved from top-level index to app/sagas.
- mock implementation is provided for tests
- actions are renamed to include "app" prefix
- actions are changed to not use non-serializable arguments
- reducers are changed to not use non-serializable state
This grabs the docs via the @pybricks/ide-docs package and copies them
to the build directory with copy-webpack-plugin.
The service worker automatically picks up these files for precache
since they go through webpack.