Skip to content

Commit 7d792b2

Browse files
clydindgp1130
authored andcommitted
refactor(@angular-devkit/build-angular): update esbuild builder option status messages
The status of the esbuild-based browser application builder has been changed to developer preview. Warning messages for unsupported options are now updated to reflect this change. (cherry picked from commit 3dd584a)
1 parent 4cc35f3 commit 7d792b2

File tree

2 files changed

+22
-11
lines changed

2 files changed

+22
-11
lines changed

packages/angular_devkit/build_angular/src/builders/browser-esbuild/experimental-warnings.ts renamed to packages/angular_devkit/build_angular/src/builders/browser-esbuild/builder-status-warnings.ts

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,22 @@ const UNSUPPORTED_OPTIONS: Array<keyof BrowserBuilderOptions> = [
2525
// * Always enabled with esbuild
2626
// 'commonChunk',
2727

28-
// * Currently unsupported by esbuild
28+
// * Unused by builder and will be removed in a future release
2929
'namedChunks',
3030
'vendorChunk',
31+
32+
// * Currently unsupported by esbuild
3133
'webWorkerTsConfig',
3234
];
3335

34-
export function logExperimentalWarnings(options: BrowserEsbuildOptions, context: BuilderContext) {
35-
// Warn about experimental status of this builder
36+
export function logBuilderStatusWarnings(options: BrowserEsbuildOptions, context: BuilderContext) {
3637
context.logger.warn(
37-
`The esbuild browser application builder ('browser-esbuild') is currently experimental.`,
38+
`The esbuild-based browser application builder ('browser-esbuild') is currently in developer preview` +
39+
' and is not yet recommended for production use.' +
40+
' For additional information, please see https://angular.io/guide/esbuild',
3841
);
3942

4043
// Validate supported options
41-
// Currently only a subset of the Webpack-based browser builder options are supported.
4244
for (const unsupportedOption of UNSUPPORTED_OPTIONS) {
4345
const value = (options as unknown as BrowserBuilderOptions)[unsupportedOption];
4446

@@ -52,8 +54,17 @@ export function logExperimentalWarnings(options: BrowserEsbuildOptions, context:
5254
continue;
5355
}
5456

55-
context.logger.warn(
56-
`The '${unsupportedOption}' option is currently unsupported by this experimental builder and will be ignored.`,
57-
);
57+
if (
58+
unsupportedOption === 'namedChunks' ||
59+
unsupportedOption === 'vendorChunk' ||
60+
unsupportedOption === 'deployUrl'
61+
) {
62+
context.logger.warn(
63+
`The '${unsupportedOption}' option is not used by this builder and will be ignored.`,
64+
);
65+
continue;
66+
}
67+
68+
context.logger.warn(`The '${unsupportedOption}' option is not yet supported by this builder.`);
5869
}
5970
}

packages/angular_devkit/build_angular/src/builders/browser-esbuild/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ import { Spinner } from '../../utils/spinner';
2222
import { getSupportedBrowsers } from '../../utils/supported-browsers';
2323
import { BundleStats, generateBuildStatsTable } from '../../webpack/utils/stats';
2424
import { SourceFileCache, createCompilerPlugin } from './angular/compiler-plugin';
25+
import { logBuilderStatusWarnings } from './builder-status-warnings';
2526
import { checkCommonJSModules } from './commonjs-checker';
2627
import { BundlerContext, logMessages } from './esbuild';
27-
import { logExperimentalWarnings } from './experimental-warnings';
2828
import { createGlobalScriptsBundleOptions } from './global-scripts';
2929
import { extractLicenses } from './license-extractor';
3030
import { LoadResultCache } from './load-result-cache';
@@ -623,8 +623,8 @@ export async function* buildEsbuildBrowserInternal(
623623
assetFiles?: { source: string; destination: string }[];
624624
}
625625
> {
626-
// Inform user of experimental status of builder and options
627-
logExperimentalWarnings(userOptions, context);
626+
// Inform user of status of builder and options
627+
logBuilderStatusWarnings(userOptions, context);
628628

629629
// Determine project name from builder context target
630630
const projectName = context.target?.project;

0 commit comments

Comments
 (0)