-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Update to angular 7.0.4 and latest rules_nodejs #14181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Notes for releasing | ||
|
||
## Angular version | ||
|
||
For Bazel support downstream, the version of the @angular/bazel npm package | ||
in `package.json` and `tools/npm/package.json` must match the version of the | ||
`@angular` `http_archive` in `WORKSPACE`. For this reason, `@angular/bazel` | ||
should be pinned to a specific version in both `package.json` files. If updating | ||
the version of the angular http_archive, ensure sure that all 3 versions line up. | ||
|
||
For example: | ||
|
||
``` | ||
http_archive( | ||
name = "angular", | ||
url = "https://github.com/angular/angular/archive/7.0.4.zip", | ||
strip_prefix = "angular-7.0.4", | ||
) | ||
``` | ||
|
||
in `WORKSPACE` must match the version in in `package.json` and `tools/npm/package.json`: | ||
|
||
``` | ||
"@angular/bazel": "7.0.4", | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,10 +3,11 @@ workspace(name = "angular_material") | |
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
|
||
# Add NodeJS rules (explicitly used for sass bundle rules) | ||
# TODO(gmagolan): update to rules_nodejs 0.16.2 when it is released | ||
http_archive( | ||
name = "build_bazel_rules_nodejs", | ||
url = "https://github.com/bazelbuild/rules_nodejs/archive/0.15.3.zip", | ||
strip_prefix = "rules_nodejs-0.15.3", | ||
url = "https://github.com/bazelbuild/rules_nodejs/archive/e373001c571fe879884395f3b8492c9043962eeb.zip", | ||
strip_prefix = "rules_nodejs-e373001c571fe879884395f3b8492c9043962eeb", | ||
) | ||
|
||
# Add TypeScript rules | ||
|
@@ -19,8 +20,8 @@ http_archive( | |
# Add Angular source and Bazel rules. | ||
http_archive( | ||
name = "angular", | ||
url = "https://github.com/angular/angular/archive/2ec05415e24137d44f24b07202c34c5054c968ed.zip", | ||
strip_prefix = "angular-2ec05415e24137d44f24b07202c34c5054c968ed", | ||
url = "https://github.com/angular/angular/archive/7.0.4.zip", | ||
strip_prefix = "angular-7.0.4", | ||
) | ||
|
||
# Add RxJS as repository because those are needed in order to build Angular from source. | ||
|
@@ -38,10 +39,8 @@ http_archive( | |
# Add sass rules | ||
http_archive( | ||
name = "io_bazel_rules_sass", | ||
# Explicitly depend on SHA c93cadb20753f4e4d4eabe83f8ea882bfb8f2efe because this one includes | ||
# the major API overhaul and fix for the NodeJS source map warnings. | ||
url = "https://github.com/bazelbuild/rules_sass/archive/c93cadb20753f4e4d4eabe83f8ea882bfb8f2efe.zip", | ||
strip_prefix = "rules_sass-c93cadb20753f4e4d4eabe83f8ea882bfb8f2efe", | ||
url = "https://github.com/bazelbuild/rules_sass/archive/1.15.0.zip", | ||
strip_prefix = "rules_sass-1.15.0", | ||
) | ||
|
||
# Since we are explitly fetching @build_bazel_rules_typescript, we should explicitly ask for | ||
|
@@ -66,12 +65,14 @@ load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_reposi | |
"yarn_install") | ||
|
||
# The minimum bazel version to use with this repo is 0.18.0 | ||
# 0.18.0: support for .bazelignore | ||
check_bazel_version("0.18.0") | ||
|
||
node_repositories( | ||
# For deterministic builds, specify explicit NodeJS and Yarn versions. | ||
node_version = "10.10.0", | ||
yarn_version = "1.9.4", | ||
node_version = "10.13.0", | ||
# Use latest yarn version to support integrity field (added in yarn 1.10) | ||
yarn_version = "1.12.1", | ||
) | ||
|
||
# @npm is temporarily needed to build @rxjs from source since its ts_library | ||
|
@@ -89,7 +90,7 @@ load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") | |
ts_setup_workspace() | ||
|
||
# Setup the Sass rule repositories. | ||
load("@io_bazel_rules_sass//:defs.bzl", "sass_repositories") | ||
load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AFAIK this should stay There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, that's the new public API. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You guys are right. It's the downstream repo that is out of date. Thanks. |
||
sass_repositories() | ||
|
||
# Setup Angular workspace for building (Bazel managed node modules) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to just be an automatic check in our release script, otherwise it will 100% get broken
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should chat about that
tools/npm/package.json
file. Based on some testing it's just needed because the Angular Bazel rules fall back to@npm
for the compiler binaries etc.RxJS apparently uses their own workspace now, and the comment about why we need this (just for rxjs) is no longer up-to date I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's still needed for rxjs since it uses ts_library in there which depends on the
@npm
workspace. An rxjs release with a named UMD bundle is in the works (ReactiveX/rxjs#4309). When that lands and makes it into a release then the build can be updated to no longer build RXJS from source.