0.4.17 • Published 6 months ago
@ringcentral/mfe-service-worker v0.4.17
@ringcentral/mfe-service-worker
A micro frontends framework for building Web applications
Usage
npm install @ringcentral/mfe-service-worker
# or
yarn add @ringcentral/mfe-service-workerYou can visit https://github.com/ringcentral/ringcentral-mfe for more documentation.
- init service worker
 
importScripts('/public-path/service-worker.mfe.js');
const subAppServiceWorkerManager = new mfe.SubAppServiceWorkerManager();
subAppServiceWorkerManager.listener();- register service worker
 
import mfe from '@ringcentral/mfe-service-worker';
await navigator.serviceWorker.register('/service-worker.js').then((res) => {
  console.log('[MAIN] register success');
});
// receive prefixes parmas which will match request path, if matched, will
// return cache file
mfe
  .registerSubApp({
    name: 'phone',
    scope: 'https://app.ringcentral.com/mfe/platform/23.2.10/',
    version: '0.0.1',
    manifestRelativePath: 'precache-manifest',
  })
  .then(() => {
    console.log('phone register success');
  });- add webpack plugin
 
import { GenerateManifestWebpackPlugin } from '@ringcentral/mfe-service-worker/generate-manifest-webpack-plugin';
{
    plugin: [
      new GenerateManifestWebpackPlugin();
    ]
}0.4.9
7 months ago
0.4.8
8 months ago
0.4.10
7 months ago
0.4.17
6 months ago
0.4.15
6 months ago
0.4.16
6 months ago
0.4.13
6 months ago
0.4.14
6 months ago
0.4.11
7 months ago
0.4.12
7 months ago
0.4.5
11 months ago
0.4.4
11 months ago
0.4.7
9 months ago
0.4.6
9 months ago
0.4.1
12 months ago
0.4.3
11 months ago
0.4.2
12 months ago
0.4.0
1 year ago
0.3.9
1 year ago
0.3.8
1 year ago
0.3.7
2 years ago
0.3.6
2 years ago
0.3.5
2 years ago
0.3.4
2 years ago
0.3.3
2 years ago
0.3.2
2 years ago
0.3.1
2 years ago
0.3.0
2 years ago
0.2.1
2 years ago
0.1.2
2 years ago
0.1.1
2 years ago