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
20 changes: 19 additions & 1 deletion .ng-dev/release.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,25 @@ import { releasePackages } from '../scripts/packages.mts';
*/
export const release = {
representativeNpmPackage: '@angular/cli',
npmPackages: releasePackages.map(({ name, experimental }) => ({ name, experimental })),
npmPackages: releasePackages.map(({ name, experimental }) => {
if (
name === '@angular-devkit/build-angular' ||
name === '@angular-devkit/build-webpack' ||
name === '@ngtools/webpack'
) {
return {
name,
experimental,
deprecated: {
version: '>=22.0.0-next.0',
message:
'Angular\'s Webpack support is deprecated. Use the esbuild and Vite-based "@angular/build" package instead.',
},
};
}

return { name, experimental };
}),
buildPackages: async () => {
// The `performNpmReleaseBuild` function is loaded at runtime to avoid loading additional
// files and dependencies unless a build is required.
Expand Down
6 changes: 3 additions & 3 deletions goldens/public-api/angular/ssr/node/index.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@ export class AngularNodeAppEngine {
export interface AngularNodeAppEngineOptions extends AngularAppEngineOptions {
}

// @public
// @public @deprecated
export class CommonEngine {
constructor(options?: CommonEngineOptions | undefined);
render(opts: CommonEngineRenderOptions): Promise<string>;
}

// @public (undocumented)
// @public @deprecated (undocumented)
export interface CommonEngineOptions {
allowedHosts?: readonly string[];
bootstrap?: Type<{}> | ((context: BootstrapContext) => Promise<ApplicationRef>);
enablePerformanceProfiler?: boolean;
providers?: StaticProvider[];
}

// @public (undocumented)
// @public @deprecated (undocumented)
export interface CommonEngineRenderOptions {
bootstrap?: Type<{}> | ((context: BootstrapContext) => Promise<ApplicationRef>);
// (undocumented)
Expand Down
4 changes: 2 additions & 2 deletions goldens/public-api/angular_devkit/build_webpack/index.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ export interface EmittedFiles {
name?: string;
}

// @public (undocumented)
// @public @deprecated (undocumented)
export function runWebpack(config: webpack.Configuration, context: BuilderContext, options?: {
logging?: WebpackLoggingCallback;
webpackFactory?: WebpackFactory;
shouldProvideStats?: boolean;
}): Observable<BuildResult>;

// @public (undocumented)
// @public @deprecated (undocumented)
export function runWebpackDevServer(config: webpack.Configuration, context: BuilderContext, options?: {
shouldProvideStats?: boolean;
devServerConfig?: WebpackDevServer.Configuration;
Expand Down
10 changes: 5 additions & 5 deletions goldens/public-api/ngtools/webpack/index.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import type { Compiler } from 'webpack';
import type { CompilerOptions } from '@angular/compiler-cli';
import type { LoaderContext } from 'webpack';

// @public (undocumented)
// @public @deprecated (undocumented)
function angularWebpackLoader(this: LoaderContext<unknown>, content: string, map: string): void;
export default angularWebpackLoader;

// @public (undocumented)
// @public @deprecated (undocumented)
export const AngularWebpackLoaderPath: string;

// @public (undocumented)
// @public @deprecated (undocumented)
export class AngularWebpackPlugin {
constructor(options?: Partial<AngularWebpackPluginOptions>);
// (undocumented)
Expand All @@ -24,7 +24,7 @@ export class AngularWebpackPlugin {
get options(): AngularWebpackPluginOptions;
}

// @public (undocumented)
// @public @deprecated (undocumented)
export interface AngularWebpackPluginOptions {
// (undocumented)
compilerOptions?: CompilerOptions;
Expand All @@ -48,7 +48,7 @@ export interface AngularWebpackPluginOptions {
tsconfig: string;
}

// @public (undocumented)
// @public @deprecated (undocumented)
export const imageDomains: Set<string>;

// (No @packageDocumentation comment for this package)
Expand Down
12 changes: 11 additions & 1 deletion packages/angular/ssr/node/src/common-engine/common-engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ import {

const SSG_MARKER_REGEXP = /ng-server-context=["']\w*\|?ssg\|?\w*["']/;

/**
* @deprecated Use `AngularNodeAppEngine` or `AngularAppEngine` instead.
* Deprecated since v22.
*/
export interface CommonEngineOptions {
/** A method that when invoked returns a promise that returns an `ApplicationRef` instance once resolved or an NgModule. */
bootstrap?: Type<{}> | ((context: BootstrapContext) => Promise<ApplicationRef>);
Expand All @@ -38,6 +42,10 @@ export interface CommonEngineOptions {
allowedHosts?: readonly string[];
}

/**
* @deprecated Use `AngularNodeAppEngine` or `AngularAppEngine` instead.
* Deprecated since v22.
*/
export interface CommonEngineRenderOptions {
/** A method that when invoked returns a promise that returns an `ApplicationRef` instance once resolved or an NgModule. */
bootstrap?: Type<{}> | ((context: BootstrapContext) => Promise<ApplicationRef>);
Expand All @@ -63,8 +71,10 @@ export interface CommonEngineRenderOptions {

/**
* A common engine to use to server render an application.
*
* @deprecated Use `AngularNodeAppEngine` or `AngularAppEngine` instead.
* Deprecated since v22.
*/

export class CommonEngine {
private readonly templateCache = new Map<string, string>();
private readonly inlineCriticalCssProcessor = new CommonEngineInlineCriticalCssProcessor();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@ async function _appShellBuilder(
options: BuildWebpackAppShellSchema,
context: BuilderContext,
): Promise<BuilderOutput> {
context.logger.warn(
'The "@angular-devkit/build-angular:app-shell" builder is deprecated as part of Angular\'s Webpack support deprecation. ' +
'Use "@angular/build:application" instead. For more information, see https://angular.dev/tools/cli/build-system-migration.',
);

const browserTarget = targetFromTargetString(options.browserTarget);
const serverTarget = targetFromTargetString(options.serverTarget);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ export async function* buildEsbuildBrowser(
},
plugins?: Plugin[],
): AsyncIterable<BuilderOutput> {
context.logger.warn(
'The "@angular-devkit/build-angular:browser-esbuild" builder is deprecated as part of Angular\'s Webpack support deprecation. ' +
'Use "@angular/build:application" instead. For more information, see https://angular.dev/tools/cli/build-system-migration.',
);

// Warn about any unsupported options
if (userOptions['vendorChunk']) {
context.logger.warn(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ export function buildWebpackBrowser(
throw new Error('The builder requires a target.');
}

context.logger.warn(
'The "@angular-devkit/build-angular:browser" builder is deprecated as part of Angular\'s Webpack support deprecation. ' +
'Use "@angular/build:application" instead. For more information, see https://angular.dev/tools/cli/build-system-migration.',
);

const baseOutputPath = path.resolve(context.workspaceRoot, options.outputPath);
let outputPaths: undefined | Map<string, string>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ export function execute(
return EMPTY;
}

context.logger.warn(
'The "@angular-devkit/build-angular:dev-server" builder is deprecated as part of Angular\'s Webpack support deprecation. ' +
'Use "@angular/build:dev-server" instead. For more information, see https://angular.dev/tools/cli/build-system-migration.',
);

return defer(() => initialize(options, projectName, context, extensions?.builderSelector)).pipe(
switchMap(({ builderName, normalizedOptions }) => {
// Use vite-based development server for esbuild-based builds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ export async function execute(
return { success: false };
}

context.logger.warn(
'The "@angular-devkit/build-angular:extract-i18n" builder is deprecated as part of Angular\'s Webpack support deprecation. ' +
'Use "@angular/build:extract-i18n" instead. For more information, see https://angular.dev/tools/cli/build-system-migration.',
);

const { projectType } = (await context.getProjectMetadata(projectName)) as {
projectType?: string;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ export async function* execute(
karmaOptions?: (options: KarmaConfigOptions) => KarmaConfigOptions;
} = {},
): AsyncIterable<BuilderOutput> {
context.logger.warn(
'The "@angular-devkit/build-angular:karma" builder is deprecated as part of Angular\'s Webpack support deprecation. ' +
'Use "@angular/build:karma" instead. For more information, see https://angular.dev/tools/cli/build-system-migration.',
);

// Check Angular version.
assertCompatibleAngularVersion(context.workspaceRoot);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ export function execute(
options: NgPackagrBuilderOptions,
context: BuilderContext,
): Observable<BuilderOutput> {
context.logger.warn(
'The "@angular-devkit/build-angular:ng-packagr" builder is deprecated as part of Angular\'s Webpack support deprecation. ' +
'Use "@angular/build:ng-packagr" instead. For more information, see https://angular.dev/tools/cli/build-system-migration.',
);

return from(
(async () => {
// Purge old build disk cache.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,11 @@ export async function execute(
options: PrerenderBuilderOptions,
context: BuilderContext,
): Promise<PrerenderBuilderOutput> {
context.logger.warn(
'The "@angular-devkit/build-angular:prerender" builder is deprecated as part of Angular\'s Webpack support deprecation. ' +
'Use "@angular/build:application" instead. For more information, see https://angular.dev/tools/cli/build-system-migration.',
);

const browserTarget = targetFromTargetString(options.browserTarget);
const browserOptions = (await context.getTargetOptions(
browserTarget,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ export function execute(
): Observable<ServerBuilderOutput> {
const root = context.workspaceRoot;

context.logger.warn(
'The "@angular-devkit/build-angular:server" builder is deprecated as part of Angular\'s Webpack support deprecation. ' +
'Use "@angular/build:application" instead. For more information, see https://angular.dev/tools/cli/build-system-migration.',
);

// Check Angular version.
assertCompatibleAngularVersion(root);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ export function execute(
options: SSRDevServerBuilderOptions,
context: BuilderContext,
): Observable<SSRDevServerBuilderOutput> {
context.logger.warn(
'The "@angular-devkit/build-angular:ssr-dev-server" builder is deprecated as part of Angular\'s Webpack support deprecation. ' +
'Use "@angular/build:ssr-dev-server" instead. For more information, see https://angular.dev/tools/cli/build-system-migration.',
);

let browserSync: typeof import('browser-sync');
try {
browserSync = createRequire(context.workspaceRoot + '/')('browser-sync');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ export type DevServerBuildOutput = BuildResult & {
address: string;
};

/**
* @deprecated Part of Angular's Webpack support deprecation. Use `@angular/build` APIs instead.
* Deprecated since v22.
*/
export function runWebpackDevServer(
config: webpack.Configuration,
context: BuilderContext,
Expand Down Expand Up @@ -136,6 +140,11 @@ const builder: Builder<WebpackDevServerBuilderSchema> = createBuilder<
WebpackDevServerBuilderSchema,
DevServerBuildOutput
>((options, context) => {
context.logger.warn(
'The "@angular-devkit/build-webpack:webpack-dev-server" builder is deprecated as part of Angular\'s Webpack support deprecation. ' +
'Use "@angular/build" instead.',
);

const configPath = pathResolve(context.workspaceRoot, options.webpackConfig);

return from(getWebpackConfig(configPath)).pipe(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ export type BuildResult = BuilderOutput & {
outputPath: string;
};

/**
* @deprecated Part of Angular's Webpack support deprecation. Use `@angular/build` APIs instead.
* Deprecated since v22.
*/
export function runWebpack(
config: webpack.Configuration,
context: BuilderContext,
Expand Down Expand Up @@ -125,6 +129,11 @@ export function runWebpack(

const builder: Builder<WebpackBuilderSchema> = createBuilder<WebpackBuilderSchema>(
(options, context) => {
context.logger.warn(
'The "@angular-devkit/build-webpack:webpack" builder is deprecated as part of Angular\'s Webpack support deprecation. ' +
'Use "@angular/build" instead.',
);

const configPath = pathResolve(context.workspaceRoot, options.webpackConfig);

return from(getWebpackConfig(configPath)).pipe(
Expand Down
4 changes: 4 additions & 0 deletions packages/ngtools/webpack/src/ivy/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@
export { angularWebpackLoader as default } from './loader';
export { type AngularWebpackPluginOptions, AngularWebpackPlugin, imageDomains } from './plugin';

/**
* @deprecated Part of Angular's Webpack support deprecation.
* Deprecated since v22.
*/
export const AngularWebpackLoaderPath: string = __filename;
4 changes: 4 additions & 0 deletions packages/ngtools/webpack/src/ivy/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ type SourceMap = NonNullable<

const JS_FILE_REGEXP = /\.[cm]?js$/;

/**
* @deprecated Part of Angular's Webpack support deprecation.
* Deprecated since v22.
*/
export function angularWebpackLoader(
this: LoaderContext<unknown>,
content: string,
Expand Down
12 changes: 12 additions & 0 deletions packages/ngtools/webpack/src/ivy/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,16 @@ import { createAotTransformers, createJitTransformers, mergeTransformers } from
*/
const DIAGNOSTICS_AFFECTED_THRESHOLD = 1;

/**
* @deprecated Part of Angular's Webpack support deprecation.
* Deprecated since v22.
*/
export const imageDomains: Set<string> = new Set();

/**
* @deprecated Part of Angular's Webpack support deprecation.
* Deprecated since v22.
*/
export interface AngularWebpackPluginOptions {
tsconfig: string;
compilerOptions?: CompilerOptions;
Expand Down Expand Up @@ -71,6 +79,10 @@ interface FileEmitHistoryItem {
hash: Uint8Array;
}

/**
* @deprecated Part of Angular's Webpack support deprecation.
* Deprecated since v22.
*/
export class AngularWebpackPlugin {
private readonly pluginOptions: AngularWebpackPluginOptions;
private compilerCliModule?: typeof import('@angular/compiler-cli');
Expand Down
Loading