-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Custom service worker with msw integration (#104)
* Use custom serviceWorker in vite pwa plugin * Merge MSW into custom service worker * Fixed msw on dev environment * Updated packages * Wait for service worker to register before loading app * Fixed UI blocking if not using msw * Moved app loader to shared
- Loading branch information
Showing
97 changed files
with
1,584 additions
and
933 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file added
BIN
+9.35 KB
src/frontend/.yarn/cache/@babel-code-frame-npm-7.24.2-e104352cc7-7db8f5b36f.zip
Binary file not shown.
Binary file removed
BIN
-247 KB
src/frontend/.yarn/cache/@babel-core-npm-7.24.0-b1f835a8d5-1e22215cc8.zip
Binary file not shown.
Binary file added
BIN
+248 KB
src/frontend/.yarn/cache/@babel-core-npm-7.24.5-b52405e538-b0d02c51f3.zip
Binary file not shown.
Binary file removed
BIN
-120 KB
src/frontend/.yarn/cache/@babel-generator-npm-7.23.6-817ef5e591-864090d512.zip
Binary file not shown.
Binary file added
BIN
+120 KB
src/frontend/.yarn/cache/@babel-generator-npm-7.24.5-37b51e511b-7a3782f1d2.zip
Binary file not shown.
Binary file added
BIN
+18.2 KB
src/frontend/.yarn/cache/@babel-helper-module-imports-npm-7.24.3-edb733448b-42fe124130.zip
Binary file not shown.
Binary file added
BIN
+45.5 KB
...frontend/.yarn/cache/@babel-helper-module-transforms-npm-7.24.5-c2288b45c7-1a91e8abc2.zip
Binary file not shown.
Binary file added
BIN
+5.91 KB
src/frontend/.yarn/cache/@babel-helper-simple-access-npm-7.24.5-9de60df3e9-db8768a165.zip
Binary file not shown.
Binary file added
BIN
+5.24 KB
...d/.yarn/cache/@babel-helper-split-export-declaration-npm-7.24.5-3459ebfe18-84777b6304.zip
Binary file not shown.
Binary file added
BIN
+9.84 KB
src/frontend/.yarn/cache/@babel-helper-string-parser-npm-7.24.1-0a40ece7f8-04c0ede77b.zip
Binary file not shown.
Binary file added
BIN
+17.6 KB
...ntend/.yarn/cache/@babel-helper-validator-identifier-npm-7.24.5-d1938535fe-38aaf6a64a.zip
Binary file not shown.
Binary file removed
BIN
-184 KB
src/frontend/.yarn/cache/@babel-helpers-npm-7.24.0-e1943c9c06-cc82012161.zip
Binary file not shown.
Binary file added
BIN
+185 KB
src/frontend/.yarn/cache/@babel-helpers-npm-7.24.5-f70b14a27f-efd7432582.zip
Binary file not shown.
Binary file added
BIN
+8.34 KB
src/frontend/.yarn/cache/@babel-highlight-npm-7.24.5-fca4147cf6-afde040315.zip
Binary file not shown.
Binary file added
BIN
+408 KB
src/frontend/.yarn/cache/@babel-parser-npm-7.24.5-a19c3b8c3b-f5ed1c5fd4.zip
Binary file not shown.
Binary file removed
BIN
-176 KB
src/frontend/.yarn/cache/@babel-traverse-npm-7.24.0-52cc1f08fd-5cc482248e.zip
Binary file not shown.
Binary file added
BIN
+178 KB
src/frontend/.yarn/cache/@babel-traverse-npm-7.24.5-d9a5f00bfc-e237de56e0.zip
Binary file not shown.
Binary file added
BIN
+325 KB
src/frontend/.yarn/cache/@babel-types-npm-7.24.5-2710b35119-259e751247.zip
Binary file not shown.
Binary file added
BIN
+5.76 KB
src/frontend/.yarn/cache/@inquirer-confirm-npm-3.1.7-1579d2c722-15dc557240.zip
Binary file not shown.
Binary file added
BIN
+49.1 KB
src/frontend/.yarn/cache/@inquirer-core-npm-8.2.0-3fa87d3fde-704389b950.zip
Binary file not shown.
Binary file added
BIN
+10.8 KB
src/frontend/.yarn/cache/@inquirer-figures-npm-1.0.1-f82c732947-ed9f23ce88.zip
Binary file not shown.
Binary file added
BIN
+4.64 KB
src/frontend/.yarn/cache/@inquirer-type-npm-1.3.1-2a27fe8f6f-171af2cabb.zip
Binary file not shown.
Binary file added
BIN
+23 KB
src/frontend/.yarn/cache/@jridgewell-gen-mapping-npm-0.3.5-d8b85ebeaf-81587b3c4d.zip
Binary file not shown.
Binary file added
BIN
+8.72 KB
src/frontend/.yarn/cache/@jridgewell-set-array-npm-1.2.1-2312928209-832e513a85.zip
Binary file not shown.
Binary file added
BIN
+45.6 KB
src/frontend/.yarn/cache/@jridgewell-trace-mapping-npm-0.3.25-c076fd2279-dced32160a.zip
Binary file not shown.
Binary file added
BIN
+365 KB
src/frontend/.yarn/cache/@mswjs-interceptors-npm-0.29.1-b5be72ad54-6a6ee6eb3d.zip
Binary file not shown.
Binary file removed
BIN
-26.9 KB
src/frontend/.yarn/cache/@rollup-plugin-node-resolve-npm-11.2.1-1cea144df4-8007f6a01d.zip
Binary file not shown.
Binary file added
BIN
+31.1 KB
src/frontend/.yarn/cache/@rollup-plugin-node-resolve-npm-15.2.3-f49fe9c656-d36a6792fb.zip
Binary file not shown.
Binary file added
BIN
+12 KB
src/frontend/.yarn/cache/@rollup-plugin-terser-npm-0.4.4-c6896dd264-a5e066ddea.zip
Binary file not shown.
Binary file added
BIN
+15.9 KB
src/frontend/.yarn/cache/@rollup-pluginutils-npm-5.1.0-6939820ef8-abb15eaec5.zip
Binary file not shown.
Binary file added
BIN
+4.26 KB
src/frontend/.yarn/cache/@types-cookie-npm-0.6.0-1f4c3f48f0-b883348d5b.zip
Binary file not shown.
Binary file added
BIN
+6.66 KB
src/frontend/.yarn/cache/@types-estree-npm-1.0.5-5b7faed3b4-7de6d928dd.zip
Binary file not shown.
Binary file added
BIN
+3.16 KB
src/frontend/.yarn/cache/@types-mute-stream-npm-0.0.4-3e79ac07f9-af8d83ad7b.zip
Binary file not shown.
Binary file added
BIN
+400 KB
src/frontend/.yarn/cache/@types-node-npm-20.12.12-3a45001f1f-e3945da0a3.zip
Binary file not shown.
Binary file removed
BIN
-3.79 KB
src/frontend/.yarn/cache/@types-resolve-npm-1.17.1-9a8396bef2-dc6a6df507.zip
Binary file not shown.
Binary file added
BIN
+4.17 KB
src/frontend/.yarn/cache/@types-resolve-npm-1.20.2-5fccb2ad46-1bff0d3875.zip
Binary file not shown.
Binary file added
BIN
+2.92 KB
src/frontend/.yarn/cache/@types-statuses-npm-2.0.5-f46121f53f-3f2609f660.zip
Binary file not shown.
Binary file added
BIN
+2.62 KB
src/frontend/.yarn/cache/@types-wrap-ansi-npm-3.0.0-b7f3369360-8aa644946c.zip
Binary file not shown.
Binary file added
BIN
+3.16 KB
src/frontend/.yarn/cache/cli-width-npm-4.1.0-c08b53be83-b58876fbf0.zip
Binary file not shown.
Binary file added
BIN
+15 KB
src/frontend/.yarn/cache/estree-walker-npm-2.0.2-dfab42f65c-b02109c5d4.zip
Binary file not shown.
Binary file added
BIN
+33.9 KB
src/frontend/.yarn/cache/headers-polyfill-npm-4.0.3-65ca63b329-3a008aa2ef.zip
Binary file not shown.
Binary file removed
BIN
-28.1 KB
src/frontend/.yarn/cache/jest-worker-npm-26.6.2-46cbcd449f-5f6b94cf0e.zip
Binary file not shown.
Binary file removed
BIN
-2.94 KB
src/frontend/.yarn/cache/merge-stream-npm-2.0.0-2ac83efea5-6fa4dcc8d8.zip
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+3.57 KB
src/frontend/.yarn/cache/mute-stream-npm-1.0.0-b6e846d471-36fc968b0e.zip
Binary file not shown.
Binary file added
BIN
+10.1 KB
src/frontend/.yarn/cache/outvariant-npm-1.4.2-bef902b2a6-f16ba035fb.zip
Binary file not shown.
Binary file removed
BIN
-5.15 KB
src/frontend/.yarn/cache/rollup-plugin-terser-npm-7.0.2-3f55469f5a-af84bb7a7a.zip
Binary file not shown.
Binary file removed
BIN
-7.43 KB
src/frontend/.yarn/cache/serialize-javascript-npm-4.0.0-b4aeff413b-df68091689.zip
Binary file not shown.
Binary file added
BIN
+7.18 KB
src/frontend/.yarn/cache/serialize-javascript-npm-6.0.2-cc09461d45-445a420a6f.zip
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-443 KB
src/frontend/.yarn/cache/terser-npm-5.29.1-a1413d565f-e8c036e7cd.zip
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+152 KB
src/frontend/.yarn/cache/type-fest-npm-4.18.2-69922afa59-2c176de283.zip
Binary file not shown.
Binary file removed
BIN
-65.3 KB
src/frontend/.yarn/cache/vite-plugin-pwa-npm-0.19.2-9216c738f5-9da2d75285.zip
Binary file not shown.
Binary file added
BIN
+66 KB
src/frontend/.yarn/cache/vite-plugin-pwa-npm-0.20.0-a60c090b45-8850b1f735.zip
Binary file not shown.
Binary file removed
BIN
-91.9 KB
src/frontend/.yarn/cache/workbox-background-sync-npm-7.0.0-14047ed1d1-41f89cd970.zip
Binary file not shown.
Binary file added
BIN
+91.1 KB
src/frontend/.yarn/cache/workbox-background-sync-npm-7.1.0-0c93a1bdcb-0a303af41a.zip
Binary file not shown.
Binary file removed
BIN
-46.8 KB
src/frontend/.yarn/cache/workbox-broadcast-update-npm-7.0.0-1a464e19e7-e611020746.zip
Binary file not shown.
Binary file added
BIN
+46.6 KB
src/frontend/.yarn/cache/workbox-broadcast-update-npm-7.1.0-d15aa8e58b-8dd87c05b1.zip
Binary file not shown.
Binary file renamed
BIN
+168 KB
...build-npm-7.0.0-ab8b273753-b7b19cb270.zip → ...build-npm-7.1.0-7e6643ab99-6d2086899e.zip
Binary file not shown.
Binary file removed
BIN
-31.8 KB
src/frontend/.yarn/cache/workbox-cacheable-response-npm-7.0.0-0c00aa614a-b18de42a55.zip
Binary file not shown.
Binary file added
BIN
+31.7 KB
src/frontend/.yarn/cache/workbox-cacheable-response-npm-7.1.0-d3099c44c0-1eb2947652.zip
Binary file not shown.
Binary file renamed
BIN
+119 KB
...-core-npm-7.0.0-aa84335b7a-680c65e926.zip → ...-core-npm-7.1.0-2fe6da9059-b890e0e257.zip
Binary file not shown.
Binary file removed
BIN
-76.9 KB
src/frontend/.yarn/cache/workbox-expiration-npm-7.0.0-8f4817a6b1-a9b23c7c76.zip
Binary file not shown.
Binary file added
BIN
+76 KB
src/frontend/.yarn/cache/workbox-expiration-npm-7.1.0-d31f63a7ee-45c7a27b21.zip
Binary file not shown.
Binary file removed
BIN
-37.2 KB
src/frontend/.yarn/cache/workbox-google-analytics-npm-7.0.0-0dc29ffc74-e66b390a86.zip
Binary file not shown.
Binary file added
BIN
+37.1 KB
src/frontend/.yarn/cache/workbox-google-analytics-npm-7.1.0-059655d15e-e3652b7f37.zip
Binary file not shown.
Binary file removed
BIN
-27 KB
src/frontend/.yarn/cache/workbox-navigation-preload-npm-7.0.0-f84efe8e54-69bd82c12a.zip
Binary file not shown.
Binary file added
BIN
+26.9 KB
src/frontend/.yarn/cache/workbox-navigation-preload-npm-7.1.0-4226f75555-e4a2e40f12.zip
Binary file not shown.
Binary file renamed
BIN
+132 KB
...ching-npm-7.0.0-cbbffc1994-8882d5ba88.zip → ...ching-npm-7.1.0-a9e92c29b0-4f91a1cb1f.zip
Binary file not shown.
Binary file removed
BIN
-41 KB
src/frontend/.yarn/cache/workbox-range-requests-npm-7.0.0-259b3e7f3d-8cb991173d.zip
Binary file not shown.
Binary file added
BIN
+40.8 KB
src/frontend/.yarn/cache/workbox-range-requests-npm-7.1.0-cdc9d58012-a92d9c28a1.zip
Binary file not shown.
Binary file removed
BIN
-44.6 KB
src/frontend/.yarn/cache/workbox-recipes-npm-7.0.0-a584f2ff39-efb84b7eec.zip
Binary file not shown.
Binary file added
BIN
+44.4 KB
src/frontend/.yarn/cache/workbox-recipes-npm-7.1.0-774c1ec161-371daf94bc.zip
Binary file not shown.
Binary file removed
BIN
-89.1 KB
src/frontend/.yarn/cache/workbox-routing-npm-7.0.0-bf5455e8b7-294c4b0f13.zip
Binary file not shown.
Binary file added
BIN
+88.5 KB
src/frontend/.yarn/cache/workbox-routing-npm-7.1.0-7fb2b056c5-3598d65801.zip
Binary file not shown.
Binary file removed
BIN
-110 KB
src/frontend/.yarn/cache/workbox-strategies-npm-7.0.0-f284a2ca9a-7d7dbe9dff.zip
Binary file not shown.
Binary file added
BIN
+110 KB
src/frontend/.yarn/cache/workbox-strategies-npm-7.1.0-1962eb0d59-52734ecce9.zip
Binary file not shown.
Binary file removed
BIN
-46.1 KB
src/frontend/.yarn/cache/workbox-streams-npm-7.0.0-08e7253f1a-a11a134536.zip
Binary file not shown.
Binary file added
BIN
+45.9 KB
src/frontend/.yarn/cache/workbox-streams-npm-7.1.0-7a3405a237-759011add7.zip
Binary file not shown.
Binary file removed
BIN
-9.13 KB
src/frontend/.yarn/cache/workbox-sw-npm-7.0.0-f34a786f44-2b34da7efa.zip
Binary file not shown.
Binary file added
BIN
+9.19 KB
src/frontend/.yarn/cache/workbox-sw-npm-7.1.0-8b3106e426-ece8081e41.zip
Binary file not shown.
Binary file removed
BIN
-152 KB
src/frontend/.yarn/cache/workbox-window-npm-7.0.0-16d2736e3d-5511ed9b86.zip
Binary file not shown.
Binary file added
BIN
+154 KB
src/frontend/.yarn/cache/workbox-window-npm-7.1.0-6c9a58e6fd-2706c55b81.zip
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import { type PropsWithChildren, type FC } from 'react'; | ||
import { RouterProvider } from 'react-router-dom'; | ||
import { AppLoader } from '@/shared/ui'; | ||
import { createAppRouter } from '../router'; | ||
import { RootLoader } from './RootLoader'; | ||
|
||
export const Root: FC<PropsWithChildren> = ({ children }) => ( | ||
<RouterProvider router={createAppRouter(children)} fallbackElement={<RootLoader />} /> | ||
<RouterProvider router={createAppRouter(children)} fallbackElement={<AppLoader />} /> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { cleanupOutdatedCaches, precacheAndRoute } from 'workbox-precaching'; | ||
import { MSW_ENABLED } from '@/shared/config'; | ||
|
||
declare let self: ServiceWorkerGlobalScope; | ||
|
||
if (import.meta.env.PROD && MSW_ENABLED) { | ||
importScripts('/mockServiceWorker.js'); | ||
} | ||
|
||
self.addEventListener('message', event => { | ||
if (event.data?.type === 'SKIP_WAITING') { | ||
self.skipWaiting(); | ||
} | ||
}); | ||
|
||
cleanupOutdatedCaches(); | ||
|
||
precacheAndRoute(self.__WB_MANIFEST); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.