Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/rude-pets-flash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'modular-scripts': minor
---

Remove service worker support for applications as we are focussed on client
application frameworks.
1 change: 0 additions & 1 deletion packages/modular-scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@
"webpack": "4.46.0",
"webpack-dev-server": "4.6.0",
"webpack-manifest-plugin": "2.2.0",
"workbox-webpack-plugin": "5.1.4",
"ws": "7.4.6"
},
"peerDependencies": {
Expand Down
1 change: 0 additions & 1 deletion packages/modular-scripts/react-scripts/config/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ module.exports = {
appJsConfig: resolveApp('jsconfig.json'),
proxySetup: resolveApp('src/setupProxy.js'),
appNodeModules: resolveApp('node_modules'),
swSrc: resolveModule(resolveApp, 'src/service-worker'),
publicUrlOrPath,
modularRoot,
modularPackage,
Expand Down
17 changes: 0 additions & 17 deletions packages/modular-scripts/react-scripts/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const safePostCssParser = require('postcss-safe-parser');
const ManifestPlugin = require('webpack-manifest-plugin');
const { info } = require('../../react-dev-utils/logger');
const InterpolateHtmlPlugin = require('../../react-dev-utils/InterpolateHtmlPlugin');
const WorkboxWebpackPlugin = require('workbox-webpack-plugin');
const WatchMissingNodeModulesPlugin = require('../../react-dev-utils/WatchMissingNodeModulesPlugin');
const ModuleScopePlugin = require('../../react-dev-utils/ModuleScopePlugin');
const getCSSModuleLocalIdent = require('../../react-dev-utils/getCSSModuleLocalIdent');
Expand Down Expand Up @@ -56,9 +55,6 @@ const imageInlineSizeLimit = parseInt(
// Check if TypeScript is setup
const useTypeScript = fs.existsSync(paths.appTsConfig);

// Get the path to the uncompiled service worker (if it exists).
const swSrc = paths.swSrc;

// style files regexes
const cssRegex = /\.css$/;
const cssModuleRegex = /\.module\.css$/;
Expand Down Expand Up @@ -606,19 +602,6 @@ module.exports = function (webpackEnv) {
// https://github.com/jmblog/how-to-optimize-momentjs-with-webpack
// You can remove this if you don't use Moment.js:
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
// Generate a service worker script that will precache, and keep up to date,
// the HTML & assets that are part of the webpack build.
isEnvProduction &&
fs.existsSync(swSrc) &&
new WorkboxWebpackPlugin.InjectManifest({
swSrc,
dontCacheBustURLsMatching: /\.[0-9a-f]{8}\./,
exclude: [/\.map$/, /asset-manifest\.json$/, /LICENSE/],
// Bump up the default maximum size (2mb) that's precached,
// to make lazy-loading failure scenarios less likely.
// See https://github.com/cra-template/pwa/issues/13#issuecomment-722667270
maximumFileSizeToCacheInBytes: 5 * 1024 * 1024,
}),
// TypeScript type checking turned off for CI envs
// https://github.com/jpmorganchase/modular/issues/605
useTypeScript &&
Expand Down
3 changes: 0 additions & 3 deletions packages/modular-scripts/src/utils/createPaths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export interface Paths {
testsSetup: string;
proxySetup: string;
appNodeModules: string;
swSrc: string;
ownNodeModules: string;
appTypeDeclarations: string;
ownTypeDeclarations: string;
Expand Down Expand Up @@ -100,7 +99,6 @@ export default async function createPaths(target: string): Promise<Paths> {
const testsSetup = resolveModule(resolveApp, 'src/setupTests');
const proxySetup = resolveApp('src/setupProxy.js');
const appNodeModules = resolveApp('node_modules');
const swSrc = resolveModule(resolveApp, 'src/service-worker');
const ownNodeModules = resolveOwn('node_modules');
const appTypeDeclarations = resolveApp('src/react-app-env.d.ts');
const ownTypeDeclarations = resolveOwn('react-app.d.ts');
Expand All @@ -122,7 +120,6 @@ export default async function createPaths(target: string): Promise<Paths> {
testsSetup,
proxySetup,
appNodeModules,
swSrc,
ownNodeModules,
appTypeDeclarations,
ownTypeDeclarations,
Expand Down
Loading