Skip to content

Commit 8fb7e58

Browse files
alan-agius4mgechev
authored andcommitted
refactor(@angular-devkit/build-angular): remove deprecated evalSourceMap, vendorSourceMap, profile and skipAppShell options
BREAKING CHANGE: The following deprecated devkit builders options have been removed: - `skipAppShell:` This has no effect - `evalSourceMap`: This done to improve performance in older versions of the CLI and is no longer needed - `vendorSourceMap`: Use `sourceMap.vendor` instead - `profile`: Use `NG_BUILD_PROFILING` environment variable instead
1 parent 254994d commit 8fb7e58

File tree

16 files changed

+26
-181
lines changed

16 files changed

+26
-181
lines changed

packages/angular/cli/lib/config/schema.json

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -765,16 +765,6 @@
765765
}
766766
]
767767
},
768-
"vendorSourceMap": {
769-
"type": "boolean",
770-
"description": "Resolve vendor packages sourcemaps.",
771-
"default": false
772-
},
773-
"evalSourceMap": {
774-
"type": "boolean",
775-
"description": "Output in-file eval sourcemaps.",
776-
"default": false
777-
},
778768
"vendorChunk": {
779769
"type": "boolean",
780770
"description": "Use a separate bundle containing only vendor libraries.",
@@ -892,11 +882,6 @@
892882
"type": "string",
893883
"description": "Path to ngsw-config.json."
894884
},
895-
"skipAppShell": {
896-
"type": "boolean",
897-
"description": "Flag to prevent building an app shell.",
898-
"default": false
899-
},
900885
"index": {
901886
"description": "Configures the generation of the application's HTML index.",
902887
"oneOf": [
@@ -1290,15 +1275,6 @@
12901275
}
12911276
]
12921277
},
1293-
"vendorSourceMap": {
1294-
"type": "boolean",
1295-
"description": "When true, resolve vendor packages sourcemaps.",
1296-
"default": false
1297-
},
1298-
"evalSourceMap": {
1299-
"type": "boolean",
1300-
"description": "When true, output in-file eval sourcemaps."
1301-
},
13021278
"vendorChunk": {
13031279
"type": "boolean",
13041280
"description": "When true, use a separate bundle containing only vendor libraries."
@@ -1807,16 +1783,6 @@
18071783
}
18081784
]
18091785
},
1810-
"vendorSourceMap": {
1811-
"type": "boolean",
1812-
"description": "Resolve vendor packages sourcemaps.",
1813-
"default": false
1814-
},
1815-
"evalSourceMap": {
1816-
"type": "boolean",
1817-
"description": "Output in-file eval sourcemaps.",
1818-
"default": false
1819-
},
18201786
"vendorChunk": {
18211787
"type": "boolean",
18221788
"description": "Use a separate bundle containing only vendor libraries.",

packages/angular_devkit/build_angular/src/angular-cli-files/models/build-options.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ export interface BuildOptions {
2929
resourcesOutputPath?: string;
3030
aot?: boolean;
3131
sourceMap: SourceMapClass;
32-
/** @deprecated since version 8. use sourceMap instead. */
33-
vendorSourceMap?: boolean;
34-
/** @deprecated since version 8 */
35-
evalSourceMap?: boolean;
3632
vendorChunk?: boolean;
3733
commonChunk?: boolean;
3834
baseHref?: string;
@@ -63,11 +59,8 @@ export interface BuildOptions {
6359
subresourceIntegrity?: boolean;
6460
serviceWorker?: boolean;
6561
webWorkerTsConfig?: string;
66-
/** @deprecated since version 8 **/
67-
skipAppShell?: boolean;
6862
statsJson: boolean;
6963
forkTypeChecker: boolean;
70-
profile?: boolean;
7164

7265
main: string;
7366
polyfills?: string;

packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs/browser.ts

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,21 @@ export function getBrowserConfig(wco: WebpackConfigOptions): webpack.Configurati
1919
const {
2020
crossOrigin = 'none',
2121
subresourceIntegrity,
22-
evalSourceMap,
2322
extractLicenses,
2423
vendorChunk,
2524
commonChunk,
2625
styles,
2726
allowedCommonJsDependencies,
28-
optimization,
2927
} = buildOptions;
3028

3129
const extraPlugins = [];
3230

33-
let isEval = false;
34-
const { styles: stylesOptimization, scripts: scriptsOptimization } = optimization;
3531
const {
3632
styles: stylesSourceMap,
3733
scripts: scriptsSourceMap,
3834
hidden: hiddenSourceMap,
3935
} = buildOptions.sourceMap;
4036

41-
// See https://webpack.js.org/configuration/devtool/ for sourcemap types.
42-
if ((stylesSourceMap || scriptsSourceMap) &&
43-
evalSourceMap &&
44-
!stylesOptimization &&
45-
!scriptsOptimization) {
46-
// Produce eval sourcemaps for development with serve, which are faster.
47-
isEval = true;
48-
}
49-
5037
if (subresourceIntegrity) {
5138
extraPlugins.push(new SubresourceIntegrityPlugin({
5239
hashFuncNames: ['sha384'],
@@ -59,7 +46,7 @@ export function getBrowserConfig(wco: WebpackConfigOptions): webpack.Configurati
5946
}));
6047
}
6148

62-
if (!isEval && (scriptsSourceMap || stylesSourceMap)) {
49+
if (scriptsSourceMap || stylesSourceMap) {
6350
extraPlugins.push(getSourceMapDevTool(
6451
scriptsSourceMap,
6552
stylesSourceMap,
@@ -78,7 +65,7 @@ export function getBrowserConfig(wco: WebpackConfigOptions): webpack.Configurati
7865
}
7966

8067
return {
81-
devtool: isEval ? 'eval' : false,
68+
devtool: false,
8269
resolve: {
8370
mainFields: [
8471
...(wco.supportES2015 ? ['es2015'] : []),

packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs/common.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import {
3434
allowMangle,
3535
allowMinify,
3636
cachingDisabled,
37+
profilingEnabled,
3738
shouldBeautify,
3839
} from '../../../utils/environment-options';
3940
import {
@@ -189,7 +190,7 @@ export function getCommonConfig(wco: WebpackConfigOptions): Configuration {
189190
}
190191
}
191192

192-
if (buildOptions.profile || process.env['NG_BUILD_PROFILING']) {
193+
if (profilingEnabled) {
193194
extraPlugins.push(
194195
new debug.ProfilingPlugin({
195196
outputPath: path.resolve(root, `chrome-profiler-events${targetInFileName}.json`),

packages/angular_devkit/build_angular/src/browser/schema.json

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -139,18 +139,6 @@
139139
}
140140
]
141141
},
142-
"vendorSourceMap": {
143-
"type": "boolean",
144-
"description": "Resolve vendor packages sourcemaps.",
145-
"x-deprecated": true,
146-
"default": false
147-
},
148-
"evalSourceMap": {
149-
"type": "boolean",
150-
"description": "Output in-file eval sourcemaps.",
151-
"default": false,
152-
"x-deprecated": true
153-
},
154142
"vendorChunk": {
155143
"type": "boolean",
156144
"description": "Use a separate bundle containing only vendor libraries.",
@@ -284,12 +272,6 @@
284272
"type": "string",
285273
"description": "Path to ngsw-config.json."
286274
},
287-
"skipAppShell": {
288-
"type": "boolean",
289-
"description": "Flag to prevent building an app shell.",
290-
"default": false,
291-
"x-deprecated": true
292-
},
293275
"index": {
294276
"description": "Configures the generation of the application's HTML index.",
295277
"oneOf": [
@@ -344,12 +326,6 @@
344326
},
345327
"default": []
346328
},
347-
"profile": {
348-
"type": "boolean",
349-
"description": "Output profile events for Chrome profiler.",
350-
"default": false,
351-
"x-deprecated": "Use \"NG_BUILD_PROFILING\" environment variable instead."
352-
},
353329
"rebaseRootRelativeCssUrls": {
354330
"description": "Change root relative URLs in stylesheets to include base HREF and deploy URL. Use only for compatibility and transition. The behavior of this option is non-standard and will be removed in the next major release.",
355331
"type": "boolean",

packages/angular_devkit/build_angular/src/dev-server/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ const devServerBuildOverriddenKeys: (keyof DevServerBuilderOptions)[] = [
4545
'optimization',
4646
'aot',
4747
'sourceMap',
48-
'vendorSourceMap',
49-
'evalSourceMap',
5048
'vendorChunk',
5149
'commonChunk',
5250
'baseHref',

packages/angular_devkit/build_angular/src/dev-server/schema.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -156,16 +156,6 @@
156156
}
157157
]
158158
},
159-
"vendorSourceMap": {
160-
"type": "boolean",
161-
"description": "Resolve vendor packages sourcemaps.",
162-
"x-deprecated": true
163-
},
164-
"evalSourceMap": {
165-
"type": "boolean",
166-
"description": "Output in-file eval sourcemaps.",
167-
"x-deprecated": true
168-
},
169159
"vendorChunk": {
170160
"type": "boolean",
171161
"description": "Use a separate bundle containing only vendor libraries."

packages/angular_devkit/build_angular/src/karma/schema.json

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -101,17 +101,6 @@
101101
}
102102
]
103103
},
104-
"vendorSourceMap": {
105-
"type": "boolean",
106-
"description": "Resolve vendor packages sourcemaps.",
107-
"x-deprecated": true,
108-
"default": false
109-
},
110-
"evalSourceMap": {
111-
"type": "boolean",
112-
"description": "Output in-file eval sourcemaps.",
113-
"x-deprecated": true
114-
},
115104
"progress": {
116105
"type": "boolean",
117106
"description": "Log progress to the console while building."

packages/angular_devkit/build_angular/src/server/schema.json

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -105,18 +105,6 @@
105105
}
106106
]
107107
},
108-
"vendorSourceMap": {
109-
"type": "boolean",
110-
"description": "Resolve vendor packages sourcemaps.",
111-
"x-deprecated": true,
112-
"default": false
113-
},
114-
"evalSourceMap": {
115-
"type": "boolean",
116-
"description": "Output in-file eval sourcemaps.",
117-
"default": false,
118-
"x-deprecated": true
119-
},
120108
"vendorChunk": {
121109
"type": "boolean",
122110
"description": "Use a separate bundle containing only vendor libraries.",

packages/angular_devkit/build_angular/src/utils/environment-options.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ function isPresent(variable: string | undefined): variable is string {
1919
return typeof variable === 'string' && variable !== '';
2020
}
2121

22+
// Optimization and mangling
2223
const debugOptimizeVariable = process.env['NG_BUILD_DEBUG_OPTIMIZE'];
2324
const debugOptimize = (() => {
2425
if (!isPresent(debugOptimizeVariable) || isDisabled(debugOptimizeVariable)) {
@@ -64,6 +65,7 @@ export const allowMangle = isPresent(mangleVariable)
6465
export const shouldBeautify = debugOptimize.beautify;
6566
export const allowMinify = debugOptimize.minify;
6667

68+
// Build cache
6769
const cacheVariable = process.env['NG_BUILD_CACHE'];
6870
export const cachingDisabled = isPresent(cacheVariable) && isDisabled(cacheVariable);
6971
export const cachingBasePath = (() => {
@@ -76,3 +78,7 @@ export const cachingBasePath = (() => {
7678

7779
return cacheVariable;
7880
})();
81+
82+
// Build profiling
83+
const profilingVariable = process.env['NG_BUILD_PROFILING'];
84+
export const profilingEnabled = isPresent(profilingVariable) && isEnabled(profilingVariable);

0 commit comments

Comments
 (0)