Skip to content

Commit 5a6a81d

Browse files
devversionzarend
authored andcommitted
build: update tooling to no longer support view engine mode
Updates the build setup to no longer support the View Engine mode through a Bazel define flag.
1 parent 464c1c4 commit 5a6a81d

File tree

9 files changed

+15
-118
lines changed

9 files changed

+15
-118
lines changed

.bazelrc

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,11 @@ build:release --stamp
5151
build:snapshot-build --workspace_status_command="yarn -s ng-dev release build-env-stamp --mode=snapshot"
5252
build:snapshot-build --stamp
5353

54-
################################
55-
# View Engine / Ivy toggle #
56-
################################
57-
build:view-engine --define=angular_ivy_enabled=False
58-
build:ivy --define=angular_ivy_enabled=True
5954

60-
# Set Ivy as the default
61-
build --config=ivy
55+
##################################
56+
# Always enable Ivy compilation #
57+
##################################
58+
build --define=angular_ivy_enabled=True
6259

6360
################################
6461
# Remote Execution Setup #

.circleci/config.yml

Lines changed: 0 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -197,28 +197,6 @@ jobs:
197197
- run: bazel build --build_tag_filters=-docs-package,-release-package -- src/...
198198
- *slack_notify_on_failure
199199

200-
# -----------------------------------
201-
# Job which ensures that all non-test Bazel targets build properly
202-
# in View Engine configuration.
203-
# -----------------------------------
204-
view_engine_build:
205-
<<: *job_defaults
206-
resource_class: xlarge
207-
environment:
208-
GCP_DECRYPT_TOKEN: *gcp_decrypt_token
209-
steps:
210-
- checkout_and_rebase
211-
- *restore_cache
212-
- *setup_bazel_ci_config
213-
- *setup_bazel_remote_execution
214-
- *yarn_install
215-
- *setup_bazel_binary
216-
217-
# Exclude release and docs packages here as those will be built within
218-
# the "build_release_packages" and "publish_snapshots" jobs.
219-
- run: bazel build --build_tag_filters=-docs-package,-release-package --config=view-engine -- src/...
220-
- *slack_notify_on_failure
221-
222200
# --------------------------------------------------------------------------------------------
223201
# Job that runs API golden tests in "tools/public_api_guard".
224202
# This job fails whenever an API has been updated but not explicitly approved through goldens.
@@ -525,48 +503,6 @@ jobs:
525503
- run: bazel test --build_tag_filters=-e2e --test_tag_filters=-e2e --build_tests_only -- src/...
526504
- *slack_notify_on_failure
527505

528-
# ----------------------------------------------------------------------------
529-
# Job that runs all Bazel tests against View Engine with the current Angular version
530-
# specified in the project dev dependencies.
531-
# ----------------------------------------------------------------------------
532-
view_engine_test:
533-
<<: *job_defaults
534-
resource_class: xlarge
535-
environment:
536-
GCP_DECRYPT_TOKEN: *gcp_decrypt_token
537-
steps:
538-
- checkout_and_rebase
539-
- *restore_cache
540-
- *setup_bazel_ci_config
541-
- *setup_bazel_remote_execution
542-
- *yarn_install
543-
- *setup_bazel_binary
544-
545-
# Run project tests with NGC and View Engine.
546-
- run: bazel test --build_tag_filters=-docs-package,-e2e --test_tag_filters=-e2e --config=view-engine --build_tests_only -- src/...
547-
- *slack_notify_on_failure
548-
549-
# ----------------------------------------------------------------------------
550-
# Job that runs all Bazel tests against View Engine from angular/angular#master.
551-
# ----------------------------------------------------------------------------
552-
view_engine_snapshot_test_cronjob:
553-
<<: *job_defaults
554-
resource_class: xlarge
555-
environment:
556-
GCP_DECRYPT_TOKEN: *gcp_decrypt_token
557-
steps:
558-
- checkout_and_rebase
559-
- *restore_cache
560-
- *setup_bazel_ci_config
561-
- *setup_bazel_remote_execution
562-
- *setup_snapshot_builds
563-
- *yarn_install_loose_lockfile
564-
- *setup_bazel_binary
565-
566-
# Run project tests with NGC and View Engine.
567-
- run: bazel test --build_tag_filters=-docs-package,-e2e --test_tag_filters=-e2e --config=view-engine --build_tests_only -- src/...
568-
- *slack_notify_on_failure
569-
570506
# ----------------------------------------------------------------------------
571507
# Job that runs all Bazel integration tests.
572508
# ----------------------------------------------------------------------------
@@ -584,7 +520,6 @@ jobs:
584520
- *setup_bazel_binary
585521

586522
- run: yarn integration-tests:partial-ivy
587-
- run: yarn integration-tests:view-engine
588523
# TODO: Re-enable when there are integration tests that should run with Ivy.
589524
# Currently this command fails as there are no tests.
590525
# - run: yarn integration-tests
@@ -654,10 +589,6 @@ workflows:
654589
jobs:
655590
- bazel_build:
656591
filters: *ignore_presubmit_branch_filter
657-
- view_engine_build:
658-
filters: *ignore_presubmit_branch_filter
659-
- view_engine_test:
660-
filters: *ignore_presubmit_branch_filter
661592
- api_golden_checks:
662593
filters: *ignore_presubmit_branch_filter
663594
- integration_tests:
@@ -702,8 +633,6 @@ workflows:
702633
# workflow. See: https://circleci.com/ideas/?idea=CCI-I-295
703634
- snapshot_tests_local_browsers:
704635
filters: *only_main_branch_filter
705-
- view_engine_snapshot_test_cronjob:
706-
filters: *only_main_branch_filter
707636
- mdc_snapshot_test_cronjob:
708637
filters: *only_main_branch_filter
709638
- integration_tests_snapshot:

integration/size-test/index.bzl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ def size_test(name, file, deps):
4848
},
4949
deps = [
5050
":%s_lib" % name,
51-
"//tools:angular_ivy_enabled",
5251
"@npm//rollup-plugin-node-resolve",
5352
"@npm//@angular-devkit/build-optimizer",
5453
],

integration/size-test/rollup.config.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
const {buildOptimizer} = require('@angular-devkit/build-optimizer/src/build-optimizer/build-optimizer');
22
const node = require('rollup-plugin-node-resolve');
3-
const {ivyEnabled} = require('angular_material/tools/angular_ivy_enabled');
4-
5-
console.info(`Processing rollup bundle in ${ivyEnabled ? 'Ivy' : 'View Engine'} mode.`);
63

74
const buildOptimizerPlugin = {
85
name: 'build-optimizer',
@@ -30,9 +27,7 @@ module.exports = {
3027
plugins: [
3128
buildOptimizerPlugin,
3229
node({
33-
mainFields: ivyEnabled ?
34-
['es2015_ivy_ngcc', 'module_ivy_ngcc','es2015', 'module'] :
35-
['es2015', 'module'],
30+
mainFields: ['es2020', 'module'],
3631
}),
3732
],
3833
};

integration/ts-compat/BUILD.bazel

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,6 @@ typescript_version_packages = [
3838
"@npm//@types/node",
3939
],
4040
entry_point = "test.js",
41-
tags = [
42-
# These tests run in view engine only as the release packages are
43-
# built with View Engine and we want to reproduce this here.
44-
"view-engine-only",
45-
],
4641
)
4742
for ts_pkg_name in typescript_version_packages
4843
]

scripts/build-packages-dist.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,27 +45,25 @@ if (module === require.main) {
4545

4646
/** Builds the release packages for NPM. */
4747
export function performNpmReleaseBuild(): BuiltPackage[] {
48-
return buildReleasePackages(false, defaultDistPath, /* isSnapshotBuild */ false);
48+
return buildReleasePackages(defaultDistPath, /* isSnapshotBuild */ false);
4949
}
5050

5151
/**
5252
* Builds the release packages as snapshot build. This means that the current
5353
* Git HEAD SHA is included in the version (for easier debugging and back tracing).
5454
*/
5555
export function performDefaultSnapshotBuild(): BuiltPackage[] {
56-
return buildReleasePackages(false, defaultDistPath, /* isSnapshotBuild */ true);
56+
return buildReleasePackages(defaultDistPath, /* isSnapshotBuild */ true);
5757
}
5858

5959
/**
6060
* Builds the release packages with the given compile mode and copies
6161
* the package output into the given directory.
6262
*/
63-
function buildReleasePackages(useIvy: boolean, distPath: string,
64-
isSnapshotBuild: boolean): BuiltPackage[] {
63+
function buildReleasePackages(distPath: string, isSnapshotBuild: boolean): BuiltPackage[] {
6564

6665
console.log('######################################');
6766
console.log(' Building release packages...');
68-
console.log(` Compiling with Ivy: ${useIvy}`);
6967
console.log('######################################');
7068

7169
// List of targets to build. e.g. "src/cdk:npm_package", or "src/material:npm_package".
@@ -78,7 +76,6 @@ function buildReleasePackages(useIvy: boolean, distPath: string,
7876
// runs the workspace stamping script. The stamping script ensures that the
7977
// version placeholder is populated in the release output.
8078
const stampConfigArg = `--config=${isSnapshotBuild ? 'snapshot-build' : 'release'}`;
81-
const ivySwitchConfigArg = `--config=${useIvy ? 'ivy' : 'view-engine'}`;
8279

8380
// Walk through each release package and clear previous "npm_package" outputs. This is
8481
// a workaround for: https://github.com/bazelbuild/rules_nodejs/issues/1219. We need to
@@ -91,7 +88,7 @@ function buildReleasePackages(useIvy: boolean, distPath: string,
9188
}
9289
});
9390

94-
exec(`${bazelCmd} build ${stampConfigArg} ${ivySwitchConfigArg} ${targets.join(' ')}`);
91+
exec(`${bazelCmd} build ${stampConfigArg} ${targets.join(' ')}`);
9592

9693
// Delete the distribution directory so that the output is guaranteed to be clean. Re-create
9794
// the empty directory so that we can copy the release packages into it later.

scripts/run-component-tests.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ shelljs.set('-e');
3535
shelljs.cd(projectDir);
3636

3737
// Extracts the supported command line options.
38-
const {_: components, local, firefox, watch, 'view-engine': viewEngine} = minimist(args, {
39-
boolean: ['local', 'firefox', 'watch', 'view-engine'],
40-
default: {watch: true, 'view-engine': false},
38+
const {_: components, local, firefox, watch} = minimist(args, {
39+
boolean: ['local', 'firefox', 'watch'],
40+
default: {watch: true},
4141
});
4242

4343
// Whether tests for all components should be run.
@@ -54,7 +54,6 @@ if (local && (components.length > 1 || all)) {
5454

5555
const browserName = firefox ? 'firefox' : 'chromium';
5656
const bazelBinary = `yarn -s ${watch ? 'ibazel' : 'bazel'}`;
57-
const configFlag = viewEngine ? '--config=view-engine' : '';
5857

5958
// If `all` has been specified as component, we run tests for all components
6059
// in the repository. The `--firefox` flag can be still specified.
@@ -68,7 +67,7 @@ if (all) {
6867
}
6968
shelljs.exec(
7069
`yarn -s bazel test --test_tag_filters=-e2e,browser:${browserName} ` +
71-
`--build_tag_filters=browser:${browserName} --build_tests_only ${configFlag} //src/...`);
70+
`--build_tag_filters=browser:${browserName} --build_tests_only //src/...`);
7271
return;
7372
}
7473

@@ -89,7 +88,7 @@ const testLabels = components
8988
.map(t => `${getBazelPackageOfComponentName(t)}:${getTargetName(t)}`);
9089

9190
// Runs Bazel for the determined test labels.
92-
shelljs.exec(`${bazelBinary} ${bazelAction} ${testLabels.join(' ')} ${configFlag}`);
91+
shelljs.exec(`${bazelBinary} ${bazelAction} ${testLabels.join(' ')}`);
9392

9493
/**
9594
* Gets the Bazel package label for the specified component name. Throws if

tools/BUILD.bazel

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,6 @@ exports_files([
77
"system-rxjs-operators.js",
88
])
99

10-
config_setting(
11-
name = "view_engine_mode",
12-
values = {
13-
"define": "angular_ivy_enabled=False",
14-
},
15-
)
16-
17-
# Bazel build setting for enabling partial compilation. The partial compilation
18-
# build setting can be set using `--//tools:partial_compilation=True`.
19-
bool_flag(
20-
name = "partial_compilation",
21-
build_setting_default = False,
22-
)
23-
2410
# Bazel config setting that matches if the partial compilation flag is set to `True`.
2511
config_setting(
2612
name = "partial_compilation_enabled",

tools/release-checks/npm-package-output/output-validations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const bazelManifestPath = /(angular_material|external)\//;
1717
* List of fields which are mandatory in entry-point "package.json" files and refer
1818
* to files in the release output.
1919
*/
20-
const packageJsonPathFields = ['main', 'module', 'typings', 'es2015', 'fesm2015', 'esm2015'];
20+
const packageJsonPathFields = ['module', 'typings', 'fesm2015', 'fesm2020', 'esm2020'];
2121

2222
/**
2323
* Checks the specified JavaScript file and ensures that it does not

0 commit comments

Comments
 (0)