Skip to content

Commit a00b21a

Browse files
clydinalan-agius4
authored andcommitted
build: use bazel ts_library rule to build @angular/ssr
The `@angular/ssr` package does not require the Angular compiler and can instead use the `ts_library` to compile the TypeScript code. The `@angular/bazel` package has also been update and a more limited patch is now used due to only needing the `ng_package` rule. The continued use of the `ng_package` rule maintains the existing output structure for the `@angular/ssr` package.
1 parent 51414b6 commit a00b21a

File tree

6 files changed

+21
-121
lines changed

6 files changed

+21
-121
lines changed

WORKSPACE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ yarn_install(
6969
data = [
7070
"//:.yarn/releases/yarn-1.22.17.cjs",
7171
"//:.yarnrc",
72-
"//:tools/postinstall/patches/@angular+bazel+16.0.0-next.6.patch",
72+
"//:tools/postinstall/patches/@angular+bazel+17.0.0-next.1.patch",
7373
"//:tools/postinstall/patches/@bazel+concatjs+5.8.1.patch",
7474
],
7575
# Currently disabled due to:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"devDependencies": {
6161
"@ampproject/remapping": "2.2.1",
6262
"@angular/animations": "17.0.0-next.1",
63-
"@angular/bazel": "https://github.com/angular/bazel-builds.git#bac9c1abe1e6ac1801fbbccb53353a1ed7126469",
63+
"@angular/bazel": "https://github.com/angular/bazel-builds.git#392c26f29f65e6141cf336e9eb372c4e5b7e9c3d",
6464
"@angular/build-tooling": "https://github.com/angular/dev-infra-private-build-tooling-builds.git#22a9a75114d5e80907054f01b9fa360972de1c05",
6565
"@angular/cdk": "17.0.0-next.0",
6666
"@angular/common": "17.0.0-next.1",

packages/angular/ssr/BUILD.bazel

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
load("@rules_pkg//:pkg.bzl", "pkg_tar")
2-
load("//tools:defaults.bzl", "ng_module", "ng_package")
2+
load("//tools:defaults.bzl", "ng_package", "ts_library")
33
load("@npm//@angular/build-tooling/bazel/api-golden:index.bzl", "api_golden_test_npm_package")
44

55
package(default_visibility = ["//visibility:public"])
66

7-
ng_module(
7+
ts_library(
88
name = "ssr",
99
package_name = "@angular/ssr",
1010
srcs = glob([
1111
"*.ts",
1212
"src/**/*.ts",
1313
]),
14+
module_name = "@angular/ssr",
1415
deps = [
1516
"@npm//@angular/core",
1617
"@npm//@angular/platform-server",

tools/postinstall/patches/@angular+bazel+16.0.0-next.6.patch

Lines changed: 0 additions & 101 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/node_modules/@angular/bazel/src/ng_package/packager.mjs b/node_modules/@angular/bazel/src/ng_package/packager.mjs
2+
index 9454623..d28910a 100755
3+
--- a/node_modules/@angular/bazel/src/ng_package/packager.mjs
4+
+++ b/node_modules/@angular/bazel/src/ng_package/packager.mjs
5+
@@ -7,7 +7,7 @@
6+
*/
7+
import * as fs from 'fs';
8+
import * as path from 'path';
9+
-import { analyzeFileAndEnsureNoCrossImports } from './cross_entry_points_imports';
10+
+import { analyzeFileAndEnsureNoCrossImports } from './cross_entry_points_imports.mjs';
11+
/**
12+
* List of known `package.json` fields which provide information about
13+
* supported package formats and their associated entry paths.

yarn.lock

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,12 @@
121121
dependencies:
122122
tslib "^2.3.0"
123123

124-
"@angular/bazel@https://github.com/angular/bazel-builds.git#bac9c1abe1e6ac1801fbbccb53353a1ed7126469":
125-
version "16.0.0-next.6"
126-
resolved "https://github.com/angular/bazel-builds.git#bac9c1abe1e6ac1801fbbccb53353a1ed7126469"
124+
"@angular/bazel@https://github.com/angular/bazel-builds.git#392c26f29f65e6141cf336e9eb372c4e5b7e9c3d":
125+
version "17.0.0-next.1"
126+
resolved "https://github.com/angular/bazel-builds.git#392c26f29f65e6141cf336e9eb372c4e5b7e9c3d"
127127
dependencies:
128128
"@microsoft/api-extractor" "^7.24.2"
129129
magic-string "^0.30.0"
130-
tsickle "^0.46.3"
131130
tslib "^2.3.0"
132131

133132
"@angular/[email protected]":
@@ -3626,11 +3625,6 @@
36263625
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-5.1.2.tgz#07508b45797cb81ec3f273011b054cd0755eddca"
36273626
integrity sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==
36283627

3629-
"@types/minimist@^1.2.1":
3630-
version "1.2.2"
3631-
resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c"
3632-
integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==
3633-
36343628
"@types/node-fetch@*", "@types/node-fetch@^2.1.6":
36353629
version "2.6.4"
36363630
resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.4.tgz#1bc3a26de814f6bf466b25aeb1473fa1afe6a660"
@@ -12146,13 +12140,6 @@ tsconfig-paths@^3.14.2:
1214612140
minimist "^1.2.6"
1214712141
strip-bom "^3.0.0"
1214812142

12149-
tsickle@^0.46.3:
12150-
version "0.46.3"
12151-
resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.46.3.tgz#b74918a77e3ca1310a2ce4d019f5d6294360b56d"
12152-
integrity sha512-9PDXxOrtn2AdpvDin6FLGveXVGg8ec3ga8fh8mPR5lz9KtitW6riVgxgagicdfF1rgiBxDeH+5hVowPXhmZbYQ==
12153-
dependencies:
12154-
"@types/minimist" "^1.2.1"
12155-
1215612143
1215712144
version "2.6.1"
1215812145
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.1.tgz#fd8c9a0ff42590b25703c0acb3de3d3f4ede0410"

0 commit comments

Comments
 (0)