@@ -431,7 +431,7 @@ __Открытие файла__
431431Метод отправляет клиенту запрос типа:
432432
433433```
434- const response = yield openFile(file: {
434+ const response = yield openFile(file: {
435435 "type": <string> | null
436436 "file": <string>
437437 "fileMimeType": <string> | null
@@ -443,9 +443,9 @@ const response = yield openFile(file: {
443443 "fileHash": <string> | null
444444 "fileEncryptionAlgo": <string> | null
445445 "chunkSize": <number> | null
446- "fileId": <string> | null
446+ "fileId": <string> | null
447447 "key": {} | null
448- }
448+ }
449449)
450450```
451451
@@ -537,77 +537,3 @@ const response = yield requestSelfProfile()
537537 }
538538}
539539```
540-
541- __ Кеширование статики с помощью WorkboxWebpackPlugin__
542-
543- Если приложение было создано с помощью ` create-react-app ` , добавляем строчку в ` package.json ` :
544-
545- ```
546-
547- "scripts": {
548- "eject": "react-scripts eject",
549- }
550-
551- ```
552-
553- В зависимости приложения добавляем ` smartapp-sdk ` версии ` 1.2.2 ` или выше:
554-
555- ```
556-
557- "dependencies": {
558- "@unlimited/smartapp-sdk": "^1.2.2",
559- }
560-
561- ```
562-
563- Устанавливаем пакет и выполняем команду ` npm run eject ` .
564-
565- Далее, делаем следующие изменения в файлах:
566-
567- Добавляем код в ` index.tsx ` :
568-
569- ```
570-
571- if (module.hot) module.hot.accept()
572-
573- if ("serviceWorker" in navigator) {
574- window.addEventListener("load", () => {
575- navigator.serviceWorker.register("./sw.js")
576- })
577- }
578-
579- ```
580-
581- Добавляем код в файл ` webpack.config.js ` :
582-
583- ```
584-
585- plugins: [
586- new WorkboxWebpackPlugin.InjectManifest({
587- swSrc: "@unlimited/smartapp-sdk/workers/workbox.js", // path to worker
588- swDest: "sw.js"
589- }),
590-
591- ```
592-
593- Удаляем в файле ` webpack.config.js ` следующий код:
594-
595- ```
596-
597- // Generate a service worker script that will precache, and keep up to date,
598- // the HTML & assets that are part of the webpack build.
599- isEnvProduction &&
600- fs.existsSync(swSrc) &&
601- new WorkboxWebpackPlugin.InjectManifest({
602- swSrc,
603- dontCacheBustURLsMatching: /\.[0-9a-f]{8}\./,
604- exclude: [/\.map$/, /asset-manifest\.json$/, /LICENSE/],
605- // Bump up the default maximum size (2mb) that"s precached,
606- // to make lazy-loading failure scenarios less likely.
607- // See <https://github.com/cra-template/pwa/issues/13#issuecomment-722667270>
608- maximumFileSizeToCacheInBytes: 5 _ 1024 _ 1024,
609- }),
610-
611- ```
612-
613- Запускаем приложение, проверяем регистрацию сервис-воркера.
0 commit comments