Compare commits

..

1 Commits

Author SHA1 Message Date
90e9a8e100 build: set a default module_name for ts_library rules (#28051)
PR Close #28051
2019-01-18 10:21:37 -08:00
75 changed files with 99 additions and 239 deletions

View File

@ -22,18 +22,12 @@ test:debug --test_arg=--node_options=--inspect-brk --test_output=streamed --test
# Filesystem interactions # # Filesystem interactions #
############################### ###############################
# Create symlinks in the project: # Don't create symlinks like bazel-out in the project.
# - dist/bin for outputs # These cause VSCode to traverse a massive tree, opening file handles and
# - dist/testlogs, dist/genfiles
# - bazel-out
# NB: bazel-out should be excluded from the editor configuration.
# The checked-in /.vscode/settings.json does this for VSCode.
# Other editors may require manual config to ignore this directory.
# In the past, we say a problem where VSCode traversed a massive tree, opening file handles and
# eventually a surprising failure with auto-discovery of the C++ toolchain in # eventually a surprising failure with auto-discovery of the C++ toolchain in
# MacOS High Sierra. # MacOS High Sierra.
# See https://github.com/bazelbuild/bazel/issues/4603 # See https://github.com/bazelbuild/bazel/issues/4603
build --symlink_prefix=dist/ build --symlink_prefix=/
# Performance: avoid stat'ing input files # Performance: avoid stat'ing input files
build --watchfs build --watchfs

4
.gitignore vendored
View File

@ -1,7 +1,7 @@
.DS_STORE .DS_STORE
/dist/ /dist/
/bazel-out/ /bazel-*
/integration/bazel/bazel-* /integration/bazel/bazel-*
e2e_test.* e2e_test.*
node_modules node_modules
@ -13,9 +13,9 @@ pubspec.lock
.c9 .c9
.idea/ .idea/
.settings/ .settings/
.vscode/launch.json
*.swo *.swo
modules/.settings modules/.settings
.vscode
modules/.vscode modules/.vscode
# Don't check in secret files # Don't check in secret files

15
.vscode/settings.json vendored
View File

@ -1,15 +0,0 @@
{
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/node_modules/**": true,
"**/bazel-out/**": true,
"**/dist/**": true,
},
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/bazel-out": true,
"**/dist": true,
},
}

View File

@ -1,20 +1,3 @@
<a name="7.2.2"></a>
## [7.2.2](https://github.com/angular/angular/compare/7.2.1...7.2.2) (2019-01-22)
### Bug Fixes
* **bazel:** Fix integration test after v8 bump ([#28194](https://github.com/angular/angular/issues/28194)) ([7b772e9](https://github.com/angular/angular/commit/7b772e9)), closes [#28142](https://github.com/angular/angular/issues/28142)
* **router:** `skipLocationChange` with named outlets ([#28301](https://github.com/angular/angular/issues/28301)) ([32737a6](https://github.com/angular/angular/commit/32737a6)), closes [#27680](https://github.com/angular/angular/issues/27680) [#28200](https://github.com/angular/angular/issues/28200)
### Features
* **bazel:** Add support for SASS ([#28167](https://github.com/angular/angular/issues/28167)) ([a4d9192](https://github.com/angular/angular/commit/a4d9192))
* **compiler-cli:** resolve generated Sass/Less files to .css inputs ([#28166](https://github.com/angular/angular/issues/28166)) ([4c00059](https://github.com/angular/angular/commit/4c00059))
<a name="7.2.1"></a> <a name="7.2.1"></a>
## [7.2.1](https://github.com/angular/angular/compare/7.2.0...7.2.1) (2019-01-16) ## [7.2.1](https://github.com/angular/angular/compare/7.2.0...7.2.1) (2019-01-16)

View File

@ -3796,7 +3796,7 @@ The relevant *Crisis Center* code for this milestone follows.
</code-pane> </code-pane>
<code-pane header="crisis-detail.component.ts" path="router/src/app/crisis-center/crisis-detail/crisis-detail.component.ts"> <code-pane header="crisis-detail.component.html" path="router/src/app/crisis-center/crisis-detail/crisis-detail.component.html">
</code-pane> </code-pane>

View File

@ -52,7 +52,7 @@ describe('AppComponent', () => {
await newDocPromise; // Wait for the new document to be fetched. await newDocPromise; // Wait for the new document to be fetched.
fixture.detectChanges(); // Propagate document change to the view (i.e to `DocViewer`). fixture.detectChanges(); // Propagate document change to the view (i.e to `DocViewer`).
await docRenderedPromise; // Wait for the `docRendered` event. await docRenderedPromise; // Wait for the `docRendered` event.
} };
function initializeTest(waitForDoc = true) { function initializeTest(waitForDoc = true) {
fixture = TestBed.createComponent(AppComponent); fixture = TestBed.createComponent(AppComponent);
@ -73,7 +73,7 @@ describe('AppComponent', () => {
tocService = de.injector.get<TocService>(TocService); tocService = de.injector.get<TocService>(TocService);
return waitForDoc && awaitDocRendered(); return waitForDoc && awaitDocRendered();
} };
describe('with proper DocViewer', () => { describe('with proper DocViewer', () => {

View File

@ -125,7 +125,7 @@ export class ApiListComponent implements OnInit {
return status === 'all' || return status === 'all' ||
status === item.stability || status === item.stability ||
(status === 'security-risk' && item.securityRisk); (status === 'security-risk' && item.securityRisk);
} };
function matchesType() { function matchesType() {
return type === 'all' || type === item.docType; return type === 'all' || type === item.docType;

View File

@ -54,7 +54,7 @@ export class ApiService implements OnDestroy {
section.items.every(item => item.stability === 'deprecated'); section.items.every(item => item.stability === 'deprecated');
}); });
})); }));
} };
constructor(private http: HttpClient, private logger: Logger) { } constructor(private http: HttpClient, private logger: Logger) { }

View File

@ -79,7 +79,7 @@ describe('ContributorListComponent', () => {
return comp; return comp;
} }
interface SearchResult { [index: string]: string; } interface SearchResult { [index: string]: string; };
class TestLocationService { class TestLocationService {
searchResult: SearchResult = {}; searchResult: SearchResult = {};

View File

@ -245,7 +245,7 @@ class FakeComponentFactory extends ComponentFactory<any> {
rootSelectorOrNode?: string | any, rootSelectorOrNode?: string | any,
ngModule?: NgModuleRef<any>): ComponentRef<any> { ngModule?: NgModuleRef<any>): ComponentRef<any> {
return jasmine.createSpy('ComponentRef') as any; return jasmine.createSpy('ComponentRef') as any;
} };
} }
class FakeComponentFactoryResolver extends ComponentFactoryResolver { class FakeComponentFactoryResolver extends ComponentFactoryResolver {

View File

@ -37,6 +37,6 @@ describe('Getting Started NgFor Component', () => {
component.parseError$.subscribe(error => { component.parseError$.subscribe(error => {
expect(error).toBeTruthy(); expect(error).toBeTruthy();
}); })
}); });
}); });

View File

@ -46,6 +46,6 @@ describe('Getting Started NgIf Component', () => {
component.parseError$.subscribe(error => { component.parseError$.subscribe(error => {
expect(error).toBeTruthy(); expect(error).toBeTruthy();
}); })
}); });
}); });

View File

@ -26,7 +26,7 @@ export class ResourceService {
(categories as ConnectableObservable<Category[]>).connect(); (categories as ConnectableObservable<Category[]>).connect();
return categories; return categories;
} };
} }
// Extract sorted Category[] from resource JSON data // Extract sorted Category[] from resource JSON data

View File

@ -100,10 +100,9 @@ export class DocViewerComponent implements OnDestroy {
if (needsToc && !embeddedToc) { if (needsToc && !embeddedToc) {
// Add an embedded ToC if it's needed and there isn't one in the content already. // Add an embedded ToC if it's needed and there isn't one in the content already.
titleEl!.insertAdjacentHTML('afterend', '<aio-toc class="embedded"></aio-toc>'); titleEl!.insertAdjacentHTML('afterend', '<aio-toc class="embedded"></aio-toc>');
} else if (!needsToc && embeddedToc && embeddedToc.parentNode !== null) { } else if (!needsToc && embeddedToc) {
// Remove the embedded Toc if it's there and not needed. // Remove the embedded Toc if it's there and not needed.
// We cannot use ChildNode.remove() because of IE11 embeddedToc.remove();
embeddedToc.parentNode.removeChild(embeddedToc);
} }
return () => { return () => {

View File

@ -14,4 +14,4 @@ export class Deployment {
mode: string = this.location.search()['mode'] || environment.mode; mode: string = this.location.search()['mode'] || environment.mode;
constructor(private location: LocationService) {} constructor(private location: LocationService) {}
} };

View File

@ -68,10 +68,7 @@ export class TocService {
} }
} }
// now remove the anchor // now remove the anchor
if (anchorLink.parentNode !== null) { anchorLink.remove();
// We cannot use ChildNode.remove() because of IE11
anchorLink.parentNode.removeChild(anchorLink);
}
} }
// security: the document element which provides this heading content // security: the document element which provides this heading content
// is always authored by the documentation team and is considered to be safe // is always authored by the documentation team and is considered to be safe

View File

@ -75,7 +75,6 @@
], ],
"radix": true, "radix": true,
"semicolon": [ "semicolon": [
true,
"always" "always"
], ],
"triple-equals": [ "triple-equals": [

View File

@ -13,6 +13,3 @@ build --local_resources=14336,8.0,1.0
# Use the Angular 6 compiler # Use the Angular 6 compiler
build --define=compile=legacy build --define=compile=legacy
# Don't create symlinks
build --symlink_prefix=/

View File

@ -37,9 +37,14 @@ ts_devserver(
load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary", "rollup_bundle") load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary", "rollup_bundle")
filegroup(
name = "empty_node_modules",
)
rollup_bundle( rollup_bundle(
name = "bundle", name = "bundle",
entry_point = "src/main", entry_point = "src/main",
node_modules = ":empty_node_modules",
deps = ["//src"], deps = ["//src"],
) )

View File

@ -2,24 +2,24 @@
# yarn lockfile v1 # yarn lockfile v1
"@bazel/bazel-darwin_x64@0.18.0": "@bazel/bazel-darwin_x64@0.20.0":
version "0.18.0" version "0.20.0"
resolved "https://registry.yarnpkg.com/@bazel/bazel-darwin_x64/-/bazel-darwin_x64-0.18.0.tgz#bab437605a702279d42f59caa4741bb327eb7dbc" resolved "https://registry.yarnpkg.com/@bazel/bazel-darwin_x64/-/bazel-darwin_x64-0.20.0.tgz#648d61c32a3c5fccb7bf70b753071b6e54b11f21"
integrity sha512-um2OzgLL2Gd/W6joOpvrSTcqpnupliPNpwe/uE7sB0huBSJ/4Im0w2IlCTI6C7OfgMcbpUj4YxgUa9T6u6WY6w== integrity sha512-zeoeVK504341GfnaxdaB4pFzQV0YOK1HLiYj3/ocamPFxAJRh9abvKB8iOpqD5Oal0j7VsINxnXCjovp9a4urA==
"@bazel/bazel-linux_x64@0.18.0": "@bazel/bazel-linux_x64@0.20.0":
version "0.18.0" version "0.20.0"
resolved "https://registry.yarnpkg.com/@bazel/bazel-linux_x64/-/bazel-linux_x64-0.18.0.tgz#0c02b2404ec95c180e17615cc7079ee07df48a69" resolved "https://registry.yarnpkg.com/@bazel/bazel-linux_x64/-/bazel-linux_x64-0.20.0.tgz#2568628a0d0b85dcc69d0ab701b1d6e10551357d"
integrity sha512-Rq8X8bL6SgQvbOHnfPhSgF6hp+f6Fbt2w6pRmBlFvV1J+CeUyrSrrRXfnnO1bjIuq05Ur3mV8ULA0qK6rtA5lQ== integrity sha512-PpHzoEqfXty8dc1/p1tVFXtbPyrE1n0N79QmYePjJ5mJMyW7uBF/zV4IajYY8+IpJEcDVq5v4BavSexOmVJRmA==
"@bazel/bazel-win32_x64@0.18.0": "@bazel/bazel-win32_x64@0.20.0":
version "0.18.0" version "0.20.0"
resolved "https://registry.yarnpkg.com/@bazel/bazel-win32_x64/-/bazel-win32_x64-0.18.0.tgz#aa4575fb00066dcf59a6d464971774dea6a0bafd" resolved "https://registry.yarnpkg.com/@bazel/bazel-win32_x64/-/bazel-win32_x64-0.20.0.tgz#af7d041dae4c066e7aa8618949e2de1aad07495e"
integrity sha512-U2TbfK8B7dc3JqXSFwj2oXCQrxEaSzCCUkAHjAOIGOKzx/HLKIKs+NJj9IQkLLr7BsMU+Qqzo8aqo11E+Vs+aA== integrity sha512-3bqHXFBvLnbvNzr1KCQ1zryTYvHMoQffaWVekbckgPyT2VPEj3abuB91+DrRYmZdPjcgPYnjnyanxZHDkKuF2g==
"@bazel/bazel@file:../../node_modules/@bazel/bazel": "@bazel/bazel@file:../../node_modules/@bazel/bazel":
version "0.18.0" version "0.20.0"
optionalDependencies: optionalDependencies:
"@bazel/bazel-darwin_x64" "0.18.0" "@bazel/bazel-darwin_x64" "0.20.0"
"@bazel/bazel-linux_x64" "0.18.0" "@bazel/bazel-linux_x64" "0.20.0"
"@bazel/bazel-win32_x64" "0.18.0" "@bazel/bazel-win32_x64" "0.20.0"

View File

@ -1,6 +1,6 @@
{ {
"name": "angular-srcs", "name": "angular-srcs",
"version": "7.2.2", "version": "7.2.1",
"private": true, "private": true,
"branchPattern": "2.0.*", "branchPattern": "2.0.*",
"description": "Angular - a web framework for modern web apps", "description": "Angular - a web framework for modern web apps",
@ -146,9 +146,5 @@
"vlq": "0.2.2", "vlq": "0.2.2",
"vrsource-tslint-rules": "5.1.1", "vrsource-tslint-rules": "5.1.1",
"webpack": "1.12.9" "webpack": "1.12.9"
},
"// 4": "natives is needed for gulp to work with node >= 10.13, see #28213",
"resolutions": {
"natives": "1.1.6"
} }
} }

View File

@ -10,7 +10,6 @@ ng_module(
"src/**/*.ts", "src/**/*.ts",
], ],
), ),
module_name = "@angular/animations",
deps = [ deps = [
"//packages/core", "//packages/core",
], ],

View File

@ -12,7 +12,6 @@ ng_module(
"src/**/*.ts", "src/**/*.ts",
], ],
), ),
module_name = "@angular/animations/browser",
deps = [ deps = [
"//packages/animations", "//packages/animations",
"//packages/core", "//packages/core",

View File

@ -7,7 +7,6 @@ load("//tools:defaults.bzl", "ng_module")
ng_module( ng_module(
name = "testing", name = "testing",
srcs = glob(["**/*.ts"]), srcs = glob(["**/*.ts"]),
module_name = "@angular/animations/browser/testing",
deps = [ deps = [
"//packages/animations", "//packages/animations",
"//packages/animations/browser", "//packages/animations/browser",

View File

@ -10,7 +10,6 @@ ts_library(
"src/**/*.ts", "src/**/*.ts",
], ],
), ),
module_name = "@angular/benchpress",
deps = [ deps = [
"//packages:types", "//packages:types",
"//packages/core", "//packages/core",

View File

@ -10,7 +10,6 @@ ng_module(
"src/**/*.ts", "src/**/*.ts",
], ],
), ),
module_name = "@angular/common",
deps = [ deps = [
"//packages/core", "//packages/core",
"@rxjs", "@rxjs",

View File

@ -12,7 +12,6 @@ ng_module(
"src/**/*.ts", "src/**/*.ts",
], ],
), ),
module_name = "@angular/common/http",
deps = [ deps = [
"//packages/common", "//packages/common",
"//packages/core", "//packages/core",

View File

@ -12,7 +12,6 @@ ng_module(
"src/**/*.ts", "src/**/*.ts",
], ],
), ),
module_name = "@angular/common/http/testing",
deps = [ deps = [
"//packages/common/http", "//packages/common/http",
"//packages/core", "//packages/core",

View File

@ -8,7 +8,6 @@ ts_library(
["**/*.ts"], ["**/*.ts"],
exclude = ["closure-locale.ts"], exclude = ["closure-locale.ts"],
), ),
module_name = "@angular/common/locales",
) )
npm_package( npm_package(

View File

@ -12,35 +12,21 @@ import {Directive, DoCheck, ElementRef, Input, KeyValueChanges, KeyValueDiffer,
* @ngModule CommonModule * @ngModule CommonModule
* *
* @usageNotes * @usageNotes
*
* Set the font of the containing element to the result of an expression.
*
* ``` * ```
* <some-element [ngStyle]="{'font-style': styleExp}">...</some-element> * <some-element [ngStyle]="{'font-style': styleExp}">...</some-element>
* ```
* *
* Set the width of the containing element to a pixel value returned by an expression.
*
* ```
* <some-element [ngStyle]="{'max-width.px': widthExp}">...</some-element> * <some-element [ngStyle]="{'max-width.px': widthExp}">...</some-element>
* ```
* *
* Set a collection of style values using an expression that returns key-value pairs.
*
* ```
* <some-element [ngStyle]="objExp">...</some-element> * <some-element [ngStyle]="objExp">...</some-element>
* ``` * ```
* *
* @description * @description
* *
* An attribute directive that updates styles for the containing HTML element. * Update an HTML element styles.
* Sets one or more style properties, specified as colon-separated key-value pairs. *
* The key is a style name, with an optional `.<unit>` suffix * The styles are updated according to the value of the expression evaluation:
* (such as 'top.px', 'font-style.em'). * - keys are style names with an optional `.<unit>` suffix (ie 'top.px', 'font-style.em'),
* The value is an expression to be evaluated. * - values are the values assigned to those properties (expressed in the given unit).
* The resulting non-null value, expressed in the given unit,
* is assigned to the given style property.
* If the result of evaluation is null, the corresponding style is removed.
* *
* @publicApi * @publicApi
*/ */
@ -55,24 +41,13 @@ export class NgStyle implements DoCheck {
private _differs: KeyValueDiffers, private _ngEl: ElementRef, private _renderer: Renderer2) {} private _differs: KeyValueDiffers, private _ngEl: ElementRef, private _renderer: Renderer2) {}
@Input() @Input()
set ngStyle( set ngStyle(values: {[key: string]: string}) {
/**
* A map of style properties, specified as colon-separated
* key-value pairs.
* * The key is a style name, with an optional `.<unit>` suffix
* (such as 'top.px', 'font-style.em').
* * The value is an expression to be evaluated.
*/
values: {[key: string]: string}) {
this._ngStyle = values; this._ngStyle = values;
if (!this._differ && values) { if (!this._differ && values) {
this._differ = this._differs.find(values).create(); this._differ = this._differs.find(values).create();
} }
} }
/**
* Applies the new styles if needed.
*/
ngDoCheck() { ngDoCheck() {
if (this._differ) { if (this._differ) {
const changes = this._differ.diff(this._ngStyle); const changes = this._differ.diff(this._ngStyle);

View File

@ -7,7 +7,6 @@ load("//tools:defaults.bzl", "ng_module")
ng_module( ng_module(
name = "testing", name = "testing",
srcs = glob(["**/*.ts"]), srcs = glob(["**/*.ts"]),
module_name = "@angular/common/testing",
deps = [ deps = [
"//packages/common", "//packages/common",
"//packages/core", "//packages/core",

View File

@ -20,7 +20,6 @@ ts_library(
"src/integrationtest/**/*.ts", "src/integrationtest/**/*.ts",
], ],
), ),
module_name = "@angular/compiler-cli",
tsconfig = ":tsconfig", tsconfig = ":tsconfig",
deps = [ deps = [
"//packages/compiler", "//packages/compiler",

View File

@ -8,7 +8,6 @@ ts_library(
"*.ts", "*.ts",
"**/*.ts", "**/*.ts",
]), ]),
module_name = "@angular/compiler-cli/src/ngcc",
deps = [ deps = [
"//packages:types", "//packages:types",
"//packages/compiler", "//packages/compiler",

View File

@ -8,7 +8,6 @@ ts_library(
"index.ts", "index.ts",
"src/**/*.ts", "src/**/*.ts",
]), ]),
module_name = "@angular/compiler-cli/src/ngtsc/annotations",
deps = [ deps = [
"//packages/compiler", "//packages/compiler",
"//packages/compiler-cli/src/ngtsc/diagnostics", "//packages/compiler-cli/src/ngtsc/diagnostics",

View File

@ -8,7 +8,6 @@ ts_library(
"index.ts", "index.ts",
"src/**/*.ts", "src/**/*.ts",
]), ]),
module_name = "@angular/compiler-cli/src/ngtsc/diagnostics",
deps = [ deps = [
"//packages/compiler", "//packages/compiler",
"@ngdeps//typescript", "@ngdeps//typescript",

View File

@ -8,6 +8,5 @@ ts_library(
"index.ts", "index.ts",
"src/**/*.ts", "src/**/*.ts",
]), ]),
module_name = "@angular/compiler-cli/src/ngtsc/host",
deps = ["@ngdeps//typescript"], deps = ["@ngdeps//typescript"],
) )

View File

@ -8,7 +8,6 @@ ts_library(
"index.ts", "index.ts",
"src/*.ts", "src/*.ts",
]), ]),
module_name = "@angular/compiler-cli/src/ngtsc/metadata",
deps = [ deps = [
"//packages:types", "//packages:types",
"//packages/compiler", "//packages/compiler",

View File

@ -8,7 +8,6 @@ ts_library(
"index.ts", "index.ts",
"src/**/*.ts", "src/**/*.ts",
]), ]),
module_name = "@angular/compiler-cli/src/ngtsc/shims",
deps = [ deps = [
"//packages/compiler", "//packages/compiler",
"//packages/compiler-cli/src/ngtsc/host", "//packages/compiler-cli/src/ngtsc/host",

View File

@ -8,7 +8,6 @@ ts_library(
"index.ts", "index.ts",
"src/**/*.ts", "src/**/*.ts",
]), ]),
module_name = "@angular/compiler-cli/src/ngtsc/switch",
deps = [ deps = [
"//packages/compiler", "//packages/compiler",
"//packages/compiler-cli/src/ngtsc/host", "//packages/compiler-cli/src/ngtsc/host",

View File

@ -8,7 +8,6 @@ ts_library(
"index.ts", "index.ts",
"src/**/*.ts", "src/**/*.ts",
]), ]),
module_name = "@angular/compiler-cli/src/ngtsc/transform",
deps = [ deps = [
"//packages/compiler", "//packages/compiler",
"//packages/compiler-cli/src/ngtsc/diagnostics", "//packages/compiler-cli/src/ngtsc/diagnostics",

View File

@ -5,7 +5,6 @@ load("//tools:defaults.bzl", "ts_library")
ts_library( ts_library(
name = "translator", name = "translator",
srcs = glob(["**/*.ts"]), srcs = glob(["**/*.ts"]),
module_name = "@angular/compiler-cli/src/ngtsc/translator",
deps = [ deps = [
"//packages:types", "//packages:types",
"//packages/compiler", "//packages/compiler",

View File

@ -5,7 +5,6 @@ load("//tools:defaults.bzl", "ts_library")
ts_library( ts_library(
name = "typecheck", name = "typecheck",
srcs = glob(["**/*.ts"]), srcs = glob(["**/*.ts"]),
module_name = "@angular/compiler-cli/src/ngtsc/typecheck",
deps = [ deps = [
"//packages:types", "//packages:types",
"//packages/compiler", "//packages/compiler",

View File

@ -8,7 +8,6 @@ ts_library(
"index.ts", "index.ts",
"src/**/*.ts", "src/**/*.ts",
]), ]),
module_name = "@angular/compiler-cli/src/ngtsc/util",
deps = [ deps = [
"//packages:types", "//packages:types",
"@ngdeps//@types/node", "@ngdeps//@types/node",

View File

@ -10,7 +10,6 @@ ts_library(
"src/**/*.ts", "src/**/*.ts",
], ],
), ),
module_name = "@angular/compiler",
) )
ng_package( ng_package(

View File

@ -10,7 +10,6 @@ ng_module(
["**/*.ts"], ["**/*.ts"],
exclude = ["testing.ts"], exclude = ["testing.ts"],
), ),
module_name = "@angular/compiler/testing",
deps = [ deps = [
"//packages:types", "//packages:types",
"//packages/compiler", "//packages/compiler",

View File

@ -10,7 +10,6 @@ ng_module(
"src/**/*.ts", "src/**/*.ts",
], ],
), ),
module_name = "@angular/core",
deps = [ deps = [
"//packages:types", "//packages:types",
"@ngdeps//zone.js", "@ngdeps//zone.js",

View File

@ -9,7 +9,6 @@ ng_module(
srcs = glob( srcs = glob(
["**/*.ts"], ["**/*.ts"],
), ),
module_name = "@angular/core/testing",
deps = [ deps = [
"//packages:types", "//packages:types",
"//packages/core", "//packages/core",

View File

@ -10,7 +10,6 @@ ng_module(
"src/**/*.ts", "src/**/*.ts",
], ],
), ),
module_name = "@angular/elements",
deps = [ deps = [
"//packages/core", "//packages/core",
"//packages/platform-browser", "//packages/platform-browser",

View File

@ -10,7 +10,6 @@ ng_module(
"src/**/*.ts", "src/**/*.ts",
], ],
), ),
module_name = "@angular/forms",
deps = [ deps = [
"//packages/core", "//packages/core",
"//packages/platform-browser", "//packages/platform-browser",

View File

@ -10,7 +10,6 @@ ng_module(
"src/**/*.ts", "src/**/*.ts",
], ],
), ),
module_name = "@angular/http",
deps = [ deps = [
"//packages/core", "//packages/core",
"//packages/platform-browser", "//packages/platform-browser",

View File

@ -7,7 +7,6 @@ load("//tools:defaults.bzl", "ng_module")
ng_module( ng_module(
name = "testing", name = "testing",
srcs = glob(["**/*.ts"]), srcs = glob(["**/*.ts"]),
module_name = "@angular/http/testing",
deps = [ deps = [
"//packages/core", "//packages/core",
"//packages/http", "//packages/http",

View File

@ -10,7 +10,6 @@ ts_library(
"src/**/*.ts", "src/**/*.ts",
], ],
), ),
module_name = "@angular/language-service",
deps = [ deps = [
"//packages:types", "//packages:types",
"//packages/compiler", "//packages/compiler",

View File

@ -10,7 +10,6 @@ ng_module(
"src/**/*.ts", "src/**/*.ts",
], ],
), ),
module_name = "@angular/platform-browser-dynamic",
deps = [ deps = [
"//packages:types", "//packages:types",
"//packages/common", "//packages/common",

View File

@ -7,7 +7,6 @@ load("//tools:defaults.bzl", "ng_module")
ng_module( ng_module(
name = "testing", name = "testing",
srcs = glob(["**/*.ts"]), srcs = glob(["**/*.ts"]),
module_name = "@angular/platform-browser-dynamic/testing",
deps = [ deps = [
"//packages/compiler", "//packages/compiler",
"//packages/compiler/testing", "//packages/compiler/testing",

View File

@ -10,7 +10,6 @@ ng_module(
"src/**/*.ts", "src/**/*.ts",
], ],
), ),
module_name = "@angular/platform-browser",
deps = [ deps = [
"//packages:types", "//packages:types",
"//packages/common", "//packages/common",

View File

@ -12,7 +12,6 @@ ng_module(
"src/**/*.ts", "src/**/*.ts",
], ],
), ),
module_name = "@angular/platform-browser/animations",
deps = [ deps = [
"//packages/animations", "//packages/animations",
"//packages/animations/browser", "//packages/animations/browser",

View File

@ -7,7 +7,6 @@ load("//tools:defaults.bzl", "ng_module")
ng_module( ng_module(
name = "testing", name = "testing",
srcs = glob(["**/*.ts"]), srcs = glob(["**/*.ts"]),
module_name = "@angular/platform-browser/testing",
deps = [ deps = [
"//packages/core", "//packages/core",
"//packages/core/testing", "//packages/core/testing",

View File

@ -10,7 +10,6 @@ ng_module(
"src/**/*.ts", "src/**/*.ts",
], ],
), ),
module_name = "@angular/platform-server",
deps = [ deps = [
"//packages/animations/browser", "//packages/animations/browser",
"//packages/common", "//packages/common",

View File

@ -43,6 +43,8 @@ export class ServerRendererFactory2 implements RendererFactory2 {
(<EmulatedEncapsulationServerRenderer2>renderer).applyToHost(element); (<EmulatedEncapsulationServerRenderer2>renderer).applyToHost(element);
return renderer; return renderer;
} }
case ViewEncapsulation.Native:
throw new Error('Native encapsulation is not supported on the server!');
default: { default: {
if (!this.rendererByCompId.has(type.id)) { if (!this.rendererByCompId.has(type.id)) {
const styles = flattenStyles(type.id, type.styles, []); const styles = flattenStyles(type.id, type.styles, []);

View File

@ -7,7 +7,6 @@ load("//tools:defaults.bzl", "ng_module")
ng_module( ng_module(
name = "testing", name = "testing",
srcs = glob(["**/*.ts"]), srcs = glob(["**/*.ts"]),
module_name = "@angular/platform-server/testing",
deps = [ deps = [
"//packages/core", "//packages/core",
"//packages/platform-browser-dynamic/testing", "//packages/platform-browser-dynamic/testing",

View File

@ -10,7 +10,6 @@ ng_module(
"src/**/*.ts", "src/**/*.ts",
], ],
), ),
module_name = "@angular/platform-webworker-dynamic",
deps = [ deps = [
"//packages:types", "//packages:types",
"//packages/common", "//packages/common",

View File

@ -10,7 +10,6 @@ ng_module(
"src/**/*.ts", "src/**/*.ts",
], ],
), ),
module_name = "@angular/platform-webworker",
deps = [ deps = [
"//packages:types", "//packages:types",
"//packages/common", "//packages/common",

View File

@ -10,7 +10,6 @@ ng_module(
"src/**/*.ts", "src/**/*.ts",
], ],
), ),
module_name = "@angular/router",
deps = [ deps = [
"//packages/common", "//packages/common",
"//packages/core", "//packages/core",

View File

@ -505,10 +505,8 @@ export class Router {
// Update URL if in `eager` update mode // Update URL if in `eager` update mode
tap(t => { tap(t => {
if (this.urlUpdateStrategy === 'eager') { if (this.urlUpdateStrategy === 'eager' && !t.extras.skipLocationChange) {
if (!t.extras.skipLocationChange) { this.setBrowserUrl(t.urlAfterRedirects, !!t.extras.replaceUrl, t.id);
this.setBrowserUrl(t.urlAfterRedirects, !!t.extras.replaceUrl, t.id);
}
this.browserUrlTree = t.urlAfterRedirects; this.browserUrlTree = t.urlAfterRedirects;
} }
}), }),
@ -671,11 +669,8 @@ export class Router {
(this as{routerState: RouterState}).routerState = t.targetRouterState !; (this as{routerState: RouterState}).routerState = t.targetRouterState !;
if (this.urlUpdateStrategy === 'deferred') { if (this.urlUpdateStrategy === 'deferred' && !t.extras.skipLocationChange) {
if (!t.extras.skipLocationChange) { this.setBrowserUrl(this.rawUrlTree, !!t.extras.replaceUrl, t.id, t.extras.state);
this.setBrowserUrl(
this.rawUrlTree, !!t.extras.replaceUrl, t.id, t.extras.state);
}
this.browserUrlTree = t.urlAfterRedirects; this.browserUrlTree = t.urlAfterRedirects;
} }
}), }),

View File

@ -575,27 +575,6 @@ describe('Integration', () => {
expect(fixture.nativeElement).toHaveText('team 33 [ , right: ]'); expect(fixture.nativeElement).toHaveText('team 33 [ , right: ]');
}))); })));
it('should navigate after navigation with skipLocationChange',
fakeAsync(inject([Router, Location], (router: Router, location: Location) => {
const fixture = TestBed.createComponent(RootCmpWithNamedOutlet);
advance(fixture);
router.resetConfig([{path: 'show', outlet: 'main', component: SimpleCmp}]);
router.navigate([{outlets: {main: 'show'}}], {skipLocationChange: true});
advance(fixture);
expect(location.path()).toEqual('');
expect(fixture.nativeElement).toHaveText('main [simple]');
router.navigate([{outlets: {main: null}}], {skipLocationChange: true});
advance(fixture);
expect(location.path()).toEqual('');
expect(fixture.nativeElement).toHaveText('main []');
})));
describe('"eager" urlUpdateStrategy', () => { describe('"eager" urlUpdateStrategy', () => {
beforeEach(() => { beforeEach(() => {
const serializer = new DefaultUrlSerializer(); const serializer = new DefaultUrlSerializer();
@ -4911,10 +4890,6 @@ class RootCmpWithOnInit {
class RootCmpWithTwoOutlets { class RootCmpWithTwoOutlets {
} }
@Component({selector: 'root-cmp', template: `main [<router-outlet name="main"></router-outlet>]`})
class RootCmpWithNamedOutlet {
}
@Component({selector: 'throwing-cmp', template: ''}) @Component({selector: 'throwing-cmp', template: ''})
class ThrowingCmp { class ThrowingCmp {
constructor() { throw new Error('Throwing Cmp'); } constructor() { throw new Error('Throwing Cmp'); }
@ -4966,7 +4941,6 @@ class LazyComponent {
RootCmp, RootCmp,
RelativeLinkInIfCmp, RelativeLinkInIfCmp,
RootCmpWithTwoOutlets, RootCmpWithTwoOutlets,
RootCmpWithNamedOutlet,
EmptyQueryParamsCmp, EmptyQueryParamsCmp,
ThrowingCmp ThrowingCmp
], ],
@ -4997,7 +4971,6 @@ class LazyComponent {
RootCmpWithOnInit, RootCmpWithOnInit,
RelativeLinkInIfCmp, RelativeLinkInIfCmp,
RootCmpWithTwoOutlets, RootCmpWithTwoOutlets,
RootCmpWithNamedOutlet,
EmptyQueryParamsCmp, EmptyQueryParamsCmp,
ThrowingCmp ThrowingCmp
], ],
@ -5029,7 +5002,6 @@ class LazyComponent {
RootCmpWithOnInit, RootCmpWithOnInit,
RelativeLinkInIfCmp, RelativeLinkInIfCmp,
RootCmpWithTwoOutlets, RootCmpWithTwoOutlets,
RootCmpWithNamedOutlet,
EmptyQueryParamsCmp, EmptyQueryParamsCmp,
ThrowingCmp ThrowingCmp
] ]

View File

@ -7,7 +7,6 @@ load("//tools:defaults.bzl", "ng_module")
ng_module( ng_module(
name = "testing", name = "testing",
srcs = glob(["**/*.ts"]), srcs = glob(["**/*.ts"]),
module_name = "@angular/router/testing",
deps = [ deps = [
"//packages/common", "//packages/common",
"//packages/common/testing", "//packages/common/testing",

View File

@ -12,7 +12,6 @@ ng_module(
"src/**/*.ts", "src/**/*.ts",
], ],
), ),
module_name = "@angular/router/upgrade",
deps = [ deps = [
"//packages/common", "//packages/common",
"//packages/core", "//packages/core",

View File

@ -10,7 +10,6 @@ ng_module(
"src/**/*.ts", "src/**/*.ts",
], ],
), ),
module_name = "@angular/service-worker",
deps = [ deps = [
"//packages/common", "//packages/common",
"//packages/core", "//packages/core",

View File

@ -10,6 +10,5 @@ ng_module(
"*.ts", "*.ts",
"src/**/*.ts", "src/**/*.ts",
]), ]),
module_name = "@angular/service-worker/config",
deps = ["//packages/core"], deps = ["//packages/core"],
) )

View File

@ -6,7 +6,6 @@ ng_module(
name = "testing", name = "testing",
testonly = True, testonly = True,
srcs = glob(["**/*.ts"]), srcs = glob(["**/*.ts"]),
module_name = "@angular/service-worker/testing",
deps = [ deps = [
"//packages/core", "//packages/core",
"@rxjs", "@rxjs",

View File

@ -11,7 +11,6 @@ ng_module(
"src/dynamic/**/*.ts", "src/dynamic/**/*.ts",
], ],
), ),
module_name = "@angular/upgrade",
deps = [ deps = [
"//packages/core", "//packages/core",
"//packages/platform-browser", "//packages/platform-browser",

View File

@ -15,7 +15,6 @@ ng_module(
"src/static/**/*.ts", "src/static/**/*.ts",
], ],
), ),
module_name = "@angular/upgrade/static",
deps = [ deps = [
"//packages/core", "//packages/core",
"//packages/platform-browser", "//packages/platform-browser",

View File

@ -1,9 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# https://www.tldp.org/LDP/abs/html/options.html#AEN19601 set -u -e -o pipefail
# https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html
set -u -e -E -o pipefail
BASEDIR=$(dirname "$0") BASEDIR=$(dirname "$0")
BASEDIR=`(cd $BASEDIR; pwd)` BASEDIR=`(cd $BASEDIR; pwd)`
@ -110,26 +107,11 @@ REWRITE_MESSAGE="git filter-branch -f --msg-filter \"$BASEDIR/utils/github_close
PUSH_BRANCHES="git push git@github.com:angular/angular.git merge_pr_master:$MASTER_BRANCH merge_pr_patch:$PATCH_BRANCH" PUSH_BRANCHES="git push git@github.com:angular/angular.git merge_pr_master:$MASTER_BRANCH merge_pr_patch:$PATCH_BRANCH"
CHERRY_PICK_PR="git cherry-pick merge_pr_base..merge_pr" CHERRY_PICK_PR="git cherry-pick merge_pr_base..merge_pr"
# Checks that each PR branch to be merged upstream contains SHAs of commits that significantly changed our CI infrastructure.
#
# This check is used to enforce that we don't merge PRs that have not been rebased recently and could result in merging
# of non-approved or otherwise bad changes.
REQUIRED_BASE_SHA_MASTER="3fba6eff79a9b50909199eaa4ebf754c1c4adba6" # pullapprove => CODEOWNERS migration
REQUIRED_BASE_SHA_PATCH="e3853e842ea5c10fafbc310a76a4a7f47ed8c65e" # pullapprove => CODEOWNERS migration
if [[ $MERGE_MASTER == 1 ]]; then
REQUIRED_BASE_SHA="$REQUIRED_BASE_SHA_MASTER"
# check patch only if patch-only PR
elif [[ $MERGE_PATCH == 1 ]]; then
REQUIRED_BASE_SHA="$REQUIRED_BASE_SHA_PATCH"
fi
CHECK_IF_PR_REBASED="git branch --quiet merge_pr --contains $REQUIRED_BASE_SHA"
echo "======================" echo "======================"
echo "GitHub Merge PR Steps" echo "GitHub Merge PR Steps"
echo "======================" echo "======================"
echo " $FETCH_PR" echo " $FETCH_PR"
echo " $BASE_PR" echo " $BASE_PR"
echo " $CHECK_IF_PR_REBASED"
echo " $SQUASH_PR" echo " $SQUASH_PR"
echo " $REWRITE_MESSAGE" echo " $REWRITE_MESSAGE"
if [[ $MERGE_MASTER == 1 ]]; then if [[ $MERGE_MASTER == 1 ]]; then
@ -145,19 +127,6 @@ echo ">>> Fetch PR: $FETCH_PR"
$FETCH_PR $FETCH_PR
echo ">>> Mark base: $BASE_PR" echo ">>> Mark base: $BASE_PR"
$BASE_PR $BASE_PR
echo ">>> Check if PR rebased: $CHECK_IF_PR_REBASED"
if [[ $($CHECK_IF_PR_REBASED) != "" ]]; then
echo "The PR is sufficiently rebased!"
else
echo ""
echo ""
echo "Failed to merge pull request #${PR_NUMBER} because it hasn't been rebased recently and could be bypassing new or updated CI checks!"
echo ""
echo "Please rebase the PR and try again."
echo ""
$RESTORE_BRANCH
exit 1
fi
echo ">>> Autosquash: $SQUASH_PR" echo ">>> Autosquash: $SQUASH_PR"
GIT_EDITOR=echo $SQUASH_PR GIT_EDITOR=echo $SQUASH_PR
echo ">>> Rewrite message: $REWRITE_MESSAGE" echo ">>> Rewrite message: $REWRITE_MESSAGE"
@ -184,3 +153,4 @@ if [[ $PUSH_UPSTREAM == 1 ]]; then
fi fi
echo echo
echo ">>>>>> SUCCESS <<<<<< PR#$PR_NUMBER merged." echo ">>>>>> SUCCESS <<<<<< PR#$PR_NUMBER merged."

View File

@ -44,7 +44,38 @@ PKG_GROUP_REPLACEMENTS = {
]""" % ",\n ".join(["\"%s\"" % s for s in ANGULAR_SCOPED_PACKAGES]), ]""" % ",\n ".join(["\"%s\"" % s for s in ANGULAR_SCOPED_PACKAGES]),
} }
def ts_library(tsconfig = None, testonly = False, deps = [], **kwargs): def _default_module_name(testonly):
""" Provide better defaults for package names.
e.g. rather than angular/packages/core/testing we want @angular/core/testing
TODO(alexeagle): we ought to supply a default module name for every library in the repo.
But we short-circuit below in cases that are currently not working.
"""
pkg = native.package_name()
if testonly:
# Some tests currently rely on the long-form package names
return None
if pkg.startswith("packages/bazel"):
# Avoid infinite recursion in the ViewEngine compiler. Error looks like:
# Compiling Angular templates (ngc) //packages/bazel/test/ngc-wrapped/empty:empty failed (Exit 1)
# : RangeError: Maximum call stack size exceeded
# at normalizeString (path.js:57:25)
# at Object.normalize (path.js:1132:12)
# at Object.join (path.js:1167:18)
# at resolveModule (execroot/angular/bazel-out/host/bin/packages/bazel/src/ngc-wrapped/ngc-wrapped.runfiles/angular/packages/compiler-cli/src/metadata/bundler.js:582:50)
# at MetadataBundler.exportAll (execroot/angular/bazel-out/host/bin/packages/bazel/src/ngc-wrapped/ngc-wrapped.runfiles/angular/packages/compiler-cli/src/metadata/bundler.js:119:42)
# at MetadataBundler.exportAll (execroot/angular/bazel-out/host/bin/packages/bazel/src/ngc-wrapped/ngc-wrapped.runfiles/angular/packages/compiler-cli/src/metadata/bundler.js:121:52)
return None
if pkg.startswith("packages/"):
return "@angular/" + pkg[len("packages/"):]
return None
def ts_library(tsconfig = None, testonly = False, deps = [], module_name = None, **kwargs):
"""Default values for ts_library""" """Default values for ts_library"""
deps = deps + ["@ngdeps//tslib"] deps = deps + ["@ngdeps//tslib"]
if testonly: if testonly:
@ -57,15 +88,19 @@ def ts_library(tsconfig = None, testonly = False, deps = [], **kwargs):
else: else:
tsconfig = _DEFAULT_TSCONFIG_BUILD tsconfig = _DEFAULT_TSCONFIG_BUILD
if not module_name:
module_name = _default_module_name(testonly)
_ts_library( _ts_library(
tsconfig = tsconfig, tsconfig = tsconfig,
testonly = testonly, testonly = testonly,
deps = deps, deps = deps,
node_modules = _DEFAULT_TS_TYPINGS, node_modules = _DEFAULT_TS_TYPINGS,
module_name = module_name,
**kwargs **kwargs
) )
def ng_module(name, tsconfig = None, entry_point = None, testonly = False, deps = [], **kwargs): def ng_module(name, tsconfig = None, entry_point = None, testonly = False, deps = [], module_name = None, **kwargs):
"""Default values for ng_module""" """Default values for ng_module"""
deps = deps + ["@ngdeps//tslib"] deps = deps + ["@ngdeps//tslib"]
if testonly: if testonly:
@ -77,6 +112,8 @@ def ng_module(name, tsconfig = None, entry_point = None, testonly = False, deps
tsconfig = _DEFAULT_TSCONFIG_TEST tsconfig = _DEFAULT_TSCONFIG_TEST
else: else:
tsconfig = _DEFAULT_TSCONFIG_BUILD tsconfig = _DEFAULT_TSCONFIG_BUILD
if not module_name:
module_name = _default_module_name(testonly)
if not entry_point: if not entry_point:
entry_point = "public_api.ts" entry_point = "public_api.ts"
_ng_module( _ng_module(
@ -89,6 +126,7 @@ def ng_module(name, tsconfig = None, entry_point = None, testonly = False, deps
compiler = _INTERNAL_NG_MODULE_COMPILER, compiler = _INTERNAL_NG_MODULE_COMPILER,
ng_xi18n = _INTERNAL_NG_MODULE_XI18N, ng_xi18n = _INTERNAL_NG_MODULE_XI18N,
node_modules = _DEFAULT_TS_TYPINGS, node_modules = _DEFAULT_TS_TYPINGS,
module_name = module_name,
**kwargs **kwargs
) )

View File

@ -6122,10 +6122,10 @@ nanomatch@^1.2.9:
snapdragon "^0.8.1" snapdragon "^0.8.1"
to-regex "^3.0.1" to-regex "^3.0.1"
natives@1.1.6, natives@^1.1.0: natives@^1.1.0:
version "1.1.6" version "1.1.4"
resolved "https://registry.yarnpkg.com/natives/-/natives-1.1.6.tgz#a603b4a498ab77173612b9ea1acdec4d980f00bb" resolved "https://registry.yarnpkg.com/natives/-/natives-1.1.4.tgz#2f0f224fc9a7dd53407c7667c84cf8dbe773de58"
integrity sha512-6+TDFewD4yxY14ptjKaS63GVdtKiES1pTPyxn9Jb0rBqPMZ7VcCiooEhPNsr+mqHtMGxa/5c/HhcC4uPEUw/nA== integrity sha512-Q29yeg9aFKwhLVdkTAejM/HvYG0Y1Am1+HUkFQGn5k2j8GS+v60TVmZh6nujpEAj/qql+wGUrlryO8bF+b1jEg==
needle@^2.2.1: needle@^2.2.1:
version "2.2.4" version "2.2.4"