Skip to content

Commit b98d969

Browse files
clydinfilipesilva
authored andcommitted
refactor(@angular-devkit/build-angular): remove speed-measure-plugin usage
The plugin was only used when the `NG_BUILD_PROFILING` environment variable was used. The environment variable also enabled the Webpack builtin `ProfilingPlugin` which is retained. The builtin plugin provides a chrome events JSON output which can be loaded in Chrome DevTools and allows for graphical timeline views of the build. The `speed-measure-plugin` is also currently incompatible with Webpack 5 which would prevent the CLI profiling support from working with Webpack 5.
1 parent 0633551 commit b98d969

File tree

6 files changed

+0
-43
lines changed

6 files changed

+0
-43
lines changed

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@
117117
"@types/resolve": "^1.17.1",
118118
"@types/rimraf": "^3.0.0",
119119
"@types/semver": "^7.0.0",
120-
"@types/speed-measure-webpack-plugin": "^1.3.0",
121120
"@types/text-table": "^0.2.1",
122121
"@types/uuid": "^8.0.0",
123122
"@types/webpack": "^4.41.22",
@@ -206,7 +205,6 @@
206205
"source-map-loader": "1.1.3",
207206
"source-map-support": "0.5.19",
208207
"spdx-satisfies": "^5.0.0",
209-
"speed-measure-webpack-plugin": "1.4.2",
210208
"style-loader": "2.0.0",
211209
"stylus": "0.54.8",
212210
"stylus-loader": "4.3.3",

packages/angular_devkit/build_angular/BUILD.bazel

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ ts_library(
132132
"@npm//@types/postcss-preset-env",
133133
"@npm//@types/rimraf",
134134
"@npm//@types/semver",
135-
"@npm//@types/speed-measure-webpack-plugin",
136135
"@npm//@types/text-table",
137136
"@npm//@types/webpack",
138137
"@npm//@types/webpack-dev-server",
@@ -182,7 +181,6 @@ ts_library(
182181
"@npm//source-map",
183182
"@npm//source-map-loader",
184183
"@npm//source-map-support",
185-
"@npm//speed-measure-webpack-plugin",
186184
"@npm//style-loader",
187185
"@npm//stylus",
188186
"@npm//stylus-loader",

packages/angular_devkit/build_angular/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
"source-map": "0.7.3",
6363
"source-map-loader": "1.1.3",
6464
"source-map-support": "0.5.19",
65-
"speed-measure-webpack-plugin": "1.4.2",
6665
"style-loader": "2.0.0",
6766
"stylus": "0.54.8",
6867
"stylus-loader": "4.3.3",

packages/angular_devkit/build_angular/src/utils/webpack-browser-config.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ import {
2424
import { WebpackConfigOptions } from '../utils/build-options';
2525
import { readTsconfig } from '../utils/read-tsconfig';
2626
import { BuilderWatchPlugin, BuilderWatcherFactory } from '../webpack/plugins/builder-watch-plugin';
27-
import { getEsVersionForFileName } from '../webpack/utils/helpers';
28-
import { profilingEnabled } from './environment-options';
2927
import { I18nOptions, configureI18nBuild } from './i18n-options';
3028

3129
export type BrowserWebpackConfigOptions = WebpackConfigOptions<NormalizedBrowserBuilderSchema>;
@@ -50,8 +48,6 @@ export async function generateWebpackConfig(
5048
const ts = await import('typescript');
5149
const scriptTarget = tsConfig.options.target || ts.ScriptTarget.ES5;
5250

53-
const supportES2015 = scriptTarget !== ts.ScriptTarget.JSON && scriptTarget > ts.ScriptTarget.ES5;
54-
5551
const buildOptions: NormalizedBrowserBuilderSchema = { ...options, ...extraBuildOptions };
5652
const wco: BrowserWebpackConfigOptions = {
5753
root: workspaceRoot,
@@ -68,24 +64,6 @@ export async function generateWebpackConfig(
6864

6965
const webpackConfig = webpackMerge(webpackPartialGenerator(wco));
7066

71-
if (profilingEnabled) {
72-
const esVersionInFileName = getEsVersionForFileName(
73-
tsConfig.options.target,
74-
buildOptions.differentialLoadingNeeded,
75-
);
76-
77-
const SpeedMeasurePlugin = await import('speed-measure-webpack-plugin');
78-
const smp = new SpeedMeasurePlugin({
79-
outputFormat: 'json',
80-
outputTarget: path.resolve(
81-
workspaceRoot,
82-
`speed-measure-plugin${esVersionInFileName}.json`,
83-
),
84-
});
85-
86-
return smp.wrap(webpackConfig);
87-
}
88-
8967
return webpackConfig;
9068
}
9169

tests/legacy-cli/e2e/tests/build/profile.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ export default async function() {
66
process.env['NG_BUILD_PROFILING'] = '1';
77
await ng('build', '--configuration=development');
88
await expectFileToExist('chrome-profiler-events.json');
9-
await expectFileToExist('speed-measure-plugin.json');
10-
await expectFileToMatch('speed-measure-plugin.json', 'plugins');
119
} finally {
1210
process.env['NG_BUILD_PROFILING'] = undefined;
1311
}

yarn.lock

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1978,13 +1978,6 @@
19781978
resolved "https://registry.yarnpkg.com/@types/source-list-map/-/source-list-map-0.1.2.tgz#0078836063ffaf17412349bba364087e0ac02ec9"
19791979
integrity sha512-K5K+yml8LTo9bWJI/rECfIPrGgxdpeNbj+d53lwN4QjW1MCwlkhUms+gtdzigTeUyBr09+u8BwOIY3MXvHdcsA==
19801980

1981-
"@types/speed-measure-webpack-plugin@^1.3.0":
1982-
version "1.3.1"
1983-
resolved "https://registry.yarnpkg.com/@types/speed-measure-webpack-plugin/-/speed-measure-webpack-plugin-1.3.1.tgz#a9054bc32da286cbab2ffaed83bd09608c6ddfad"
1984-
integrity sha512-6wE+7uZBLSfTdJH041TQCrSoYd7M4ujgnapDNh1lJcHKnoVtE93UtY1FF4slHhTAdW3ADgyr87Gttyil18wIYQ==
1985-
dependencies:
1986-
"@types/webpack" "*"
1987-
19881981
"@types/tapable@*":
19891982
version "1.0.6"
19901983
resolved "https://registry.yarnpkg.com/@types/tapable/-/tapable-1.0.6.tgz#a9ca4b70a18b270ccb2bc0aaafefd1d486b7ea74"
@@ -11632,13 +11625,6 @@ spdy@^4.0.2:
1163211625
select-hose "^2.0.0"
1163311626
spdy-transport "^3.0.0"
1163411627

11635-
11636-
version "1.4.2"
11637-
resolved "https://registry.yarnpkg.com/speed-measure-webpack-plugin/-/speed-measure-webpack-plugin-1.4.2.tgz#1608e62d3bdb45f01810010e1b5bfedefedfa58f"
11638-
integrity sha512-AtVzD0bnIy2/B0fWqJpJgmhcrfWFhBlduzSo0uwplr/QvB33ZNZj2NEth3NONgdnZJqicK0W0mSxnLSbsVCDbw==
11639-
dependencies:
11640-
chalk "^4.1.0"
11641-
1164211628
split-string@^3.0.1, split-string@^3.0.2:
1164311629
version "3.1.0"
1164411630
resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2"

0 commit comments

Comments
 (0)