Skip to content

Commit 340e945

Browse files
Merge pull request #517 from angular/master
Create a new pull request by comparing changes across two branches
2 parents b6a80b6 + ca79880 commit 340e945

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+981
-341
lines changed

.ng-dev/commit-message.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,6 @@ export const commitMessage: CommitMessageConfig = {
77
maxLineLength: 120,
88
minBodyLength: 20,
99
minBodyLengthTypeExcludes: ['docs'],
10-
types: [
11-
'build',
12-
'ci',
13-
'docs',
14-
'feat',
15-
'fix',
16-
'perf',
17-
'refactor',
18-
'release',
19-
'style',
20-
'test',
21-
],
2210
scopes: [
2311
'animations',
2412
'bazel',

CHANGELOG.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,44 @@
1+
<a name="10.1.0-next.5"></a>
2+
# 10.1.0-next.5 (2020-08-12)
3+
4+
5+
### Bug Fixes
6+
7+
* **compiler-cli:** avoid creating value expressions for symbols from type-only imports ([#37912](https://github.com/angular/angular/issues/37912)) ([18098d3](https://github.com/angular/angular/commit/18098d3)), closes [#37900](https://github.com/angular/angular/issues/37900)
8+
* **compiler-cli:** type-check inputs that include undefined when there's coercion members ([#38273](https://github.com/angular/angular/issues/38273)) ([7525f3a](https://github.com/angular/angular/commit/7525f3a))
9+
* **router:** defer loading of wildcard module until needed ([#38348](https://github.com/angular/angular/issues/38348)) ([8f708b5](https://github.com/angular/angular/commit/8f708b5)), closes [#25494](https://github.com/angular/angular/issues/25494)
10+
* **router:** restore 'history.state' object for navigations coming from Angular router ([#28108](https://github.com/angular/angular/issues/28108)) ([#28176](https://github.com/angular/angular/issues/28176)) ([df76a20](https://github.com/angular/angular/commit/df76a20))
11+
12+
13+
### Features
14+
15+
* **compiler-cli:** Add compiler option to report errors when assigning to restricted input fields ([#38249](https://github.com/angular/angular/issues/38249)) ([71138f6](https://github.com/angular/angular/commit/71138f6))
16+
* **router:** better warning message when a router outlet has not been instantiated ([#30246](https://github.com/angular/angular/issues/30246)) ([1609815](https://github.com/angular/angular/commit/1609815))
17+
18+
19+
20+
<a name="10.0.9"></a>
21+
## 10.0.9 (2020-08-12)
22+
23+
24+
### Bug Fixes
25+
26+
* **common:** ensure scrollRestoration is writable ([#30630](https://github.com/angular/angular/issues/30630)) ([#38357](https://github.com/angular/angular/issues/38357)) ([58f4b3a](https://github.com/angular/angular/commit/58f4b3a)), closes [#30629](https://github.com/angular/angular/issues/30629)
27+
* **compiler:** evaluate safe navigation expressions in correct binding order ([#37911](https://github.com/angular/angular/issues/37911)) ([f5b9d87](https://github.com/angular/angular/commit/f5b9d87)), closes [#37194](https://github.com/angular/angular/issues/37194)
28+
* **compiler-cli:** avoid creating value expressions for symbols from type-only imports ([#38415](https://github.com/angular/angular/issues/38415)) ([ca2b4bc](https://github.com/angular/angular/commit/ca2b4bc)), closes [#37912](https://github.com/angular/angular/issues/37912)
29+
* **compiler-cli:** infer quote expressions as any type in type checker ([#37917](https://github.com/angular/angular/issues/37917)) ([5b87c67](https://github.com/angular/angular/commit/5b87c67)), closes [#36568](https://github.com/angular/angular/issues/36568)
30+
* **compiler-cli:** mark eager `NgModuleFactory` construction as not side effectful ([#38320](https://github.com/angular/angular/issues/38320)) ([016a41b](https://github.com/angular/angular/commit/016a41b)), closes [#38147](https://github.com/angular/angular/issues/38147)
31+
* **compiler-cli:** match wrapHost parameter types within plugin interface ([#38004](https://github.com/angular/angular/issues/38004)) ([df01a82](https://github.com/angular/angular/commit/df01a82))
32+
* **compiler-cli:** preserve quotes in class member names ([#38387](https://github.com/angular/angular/issues/38387)) ([c9acb7b](https://github.com/angular/angular/commit/c9acb7b)), closes [#38311](https://github.com/angular/angular/issues/38311)
33+
* **core:** prevent NgModule scope being overwritten in JIT compiler ([#37795](https://github.com/angular/angular/issues/37795)) ([3acebdc](https://github.com/angular/angular/commit/3acebdc)), closes [#37105](https://github.com/angular/angular/issues/37105)
34+
* **core:** queries not matching string injection tokens ([#38321](https://github.com/angular/angular/issues/38321)) ([32109dc](https://github.com/angular/angular/commit/32109dc)), closes [#38313](https://github.com/angular/angular/issues/38313) [#38315](https://github.com/angular/angular/issues/38315)
35+
* **core:** Store the currently selected ICU in `LView` ([#38345](https://github.com/angular/angular/issues/38345)) ([ee5123f](https://github.com/angular/angular/commit/ee5123f))
36+
* **platform-server:** remove styles added by ServerStylesHost on destruction ([#38367](https://github.com/angular/angular/issues/38367)) ([7f11149](https://github.com/angular/angular/commit/7f11149))
37+
* **router:** prevent calling unsubscribe on undefined subscription in RouterPreloader ([#38344](https://github.com/angular/angular/issues/38344)) ([4151314](https://github.com/angular/angular/commit/4151314))
38+
* **service-worker:** fix the chrome debugger syntax highlighter ([#38332](https://github.com/angular/angular/issues/38332)) ([f5d5bac](https://github.com/angular/angular/commit/f5d5bac))
39+
40+
41+
142
<a name="10.1.0-next.4"></a>
243
# 10.1.0-next.4 (2020-08-04)
344

aio/content/examples/toh-pt6/src/app/hero-detail/hero-detail.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, OnInit, Input } from '@angular/core';
1+
import { Component, OnInit } from '@angular/core';
22
import { ActivatedRoute } from '@angular/router';
33
import { Location } from '@angular/common';
44

@@ -11,7 +11,7 @@ import { HeroService } from '../hero.service';
1111
styleUrls: [ './hero-detail.component.css' ]
1212
})
1313
export class HeroDetailComponent implements OnInit {
14-
@Input() hero: Hero;
14+
hero: Hero;
1515

1616
constructor(
1717
private route: ActivatedRoute,

aio/content/guide/web-worker.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,16 @@ The CLI does not support running Angular itself in a web worker.
1414

1515
To add a web worker to an existing project, use the Angular CLI `ng generate` command.
1616

17-
`ng generate web-worker` *location*
17+
```bash
18+
ng generate web-worker <location>
19+
```
1820

1921
You can add a web worker anywhere in your application.
2022
For example, to add a web worker to the root component, `src/app/app.component.ts`, run the following command.
2123

22-
`ng generate web-worker app`
24+
```bash
25+
ng generate web-worker app
26+
```
2327

2428
The command performs the following actions.
2529

aio/content/tutorial/toh-pt4.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,6 @@ next section on [Routing](tutorial/toh-pt5).
385385
path="toh-pt4/src/app/heroes/heroes.component.ts">
386386
</code-example>
387387

388-
The browser refreshes and the page displays the list of heroes.
389388
Refresh the browser to see the list of heroes, and scroll to the bottom to see the
390389
messages from the HeroService. Each time you click a hero, a new message appears to record
391390
the selection. Use the "clear" button to clear the message history.

aio/src/app/custom-elements/contributor/contributor-list.component.spec.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ReflectiveInjector } from '@angular/core';
1+
import { Injector } from '@angular/core';
22

33
import { of } from 'rxjs';
44

@@ -12,20 +12,22 @@ import { LocationService } from 'app/shared/location.service';
1212
describe('ContributorListComponent', () => {
1313

1414
let component: ContributorListComponent;
15-
let injector: ReflectiveInjector;
15+
let injector: Injector;
1616
let contributorService: TestContributorService;
1717
let locationService: TestLocationService;
1818
let contributorGroups: ContributorGroup[];
1919

2020
beforeEach(() => {
21-
injector = ReflectiveInjector.resolveAndCreate([
22-
ContributorListComponent,
23-
{provide: ContributorService, useClass: TestContributorService },
24-
{provide: LocationService, useClass: TestLocationService }
25-
]);
26-
27-
locationService = injector.get(LocationService);
28-
contributorService = injector.get(ContributorService);
21+
injector = Injector.create({
22+
providers: [
23+
{provide: ContributorListComponent, deps: [ContributorService, LocationService] },
24+
{provide: ContributorService, useClass: TestContributorService, deps: [] },
25+
{provide: LocationService, useClass: TestLocationService, deps: [] }
26+
]
27+
});
28+
29+
locationService = injector.get(LocationService) as unknown as TestLocationService;
30+
contributorService = injector.get(ContributorService) as unknown as TestContributorService;
2931
contributorGroups = contributorService.testContributors;
3032
});
3133

aio/src/app/custom-elements/resource/resource-list.component.spec.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ReflectiveInjector } from '@angular/core';
1+
import { Injector } from '@angular/core';
22

33
import { of } from 'rxjs';
44

@@ -12,20 +12,22 @@ import { Category } from './resource.model';
1212
describe('ResourceListComponent', () => {
1313

1414
let component: ResourceListComponent;
15-
let injector: ReflectiveInjector;
15+
let injector: Injector;
1616
let resourceService: TestResourceService;
1717
let locationService: TestLocationService;
1818
let categories: Category[];
1919

2020
beforeEach(() => {
21-
injector = ReflectiveInjector.resolveAndCreate([
22-
ResourceListComponent,
23-
{provide: ResourceService, useClass: TestResourceService },
24-
{provide: LocationService, useClass: TestLocationService }
25-
]);
26-
27-
locationService = injector.get(LocationService);
28-
resourceService = injector.get(ResourceService);
21+
injector = Injector.create({
22+
providers: [
23+
{provide: ResourceListComponent, deps: [ResourceService, LocationService] },
24+
{provide: ResourceService, useClass: TestResourceService, deps: [] },
25+
{provide: LocationService, useClass: TestLocationService, deps: [] }
26+
]
27+
});
28+
29+
locationService = injector.get(LocationService) as unknown as TestLocationService;
30+
resourceService = injector.get(ResourceService) as unknown as TestResourceService;
2931
categories = resourceService.testCategories;
3032
});
3133

aio/src/app/search/search.service.spec.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { ReflectiveInjector, NgZone } from '@angular/core';
1+
import { Injector, NgZone } from '@angular/core';
22
import { fakeAsync, tick } from '@angular/core/testing';
33
import { of } from 'rxjs';
44
import { SearchService } from './search.service';
55
import { WebWorkerClient } from 'app/shared/web-worker';
66

77
describe('SearchService', () => {
88

9-
let injector: ReflectiveInjector;
9+
let injector: Injector;
1010
let service: SearchService;
1111
let sendMessageSpy: jasmine.Spy;
1212
let mockWorker: WebWorkerClient;
@@ -16,10 +16,13 @@ describe('SearchService', () => {
1616
mockWorker = { sendMessage: sendMessageSpy } as any;
1717
spyOn(WebWorkerClient, 'create').and.returnValue(mockWorker);
1818

19-
injector = ReflectiveInjector.resolveAndCreate([
20-
SearchService,
21-
{ provide: NgZone, useFactory: () => new NgZone({ enableLongStackTrace: false }) }
22-
]);
19+
injector = Injector.create({
20+
providers: [
21+
{ provide: SearchService, deps: [NgZone]},
22+
{ provide: NgZone, useFactory: () => new NgZone({ enableLongStackTrace: false }), deps: [] }
23+
]
24+
});
25+
2326
service = injector.get(SearchService);
2427
});
2528

aio/src/app/shared/deployment.service.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ReflectiveInjector } from '@angular/core';
1+
import { Injector } from '@angular/core';
22
import { environment } from 'environments/environment';
33
import { LocationService } from 'app/shared/location.service';
44
import { MockLocationService } from 'testing/location.service';
@@ -15,7 +15,7 @@ describe('Deployment service', () => {
1515
it('should get the mode from the `mode` query parameter if available', () => {
1616
const injector = getInjector();
1717

18-
const locationService: MockLocationService = injector.get(LocationService);
18+
const locationService = injector.get(LocationService) as unknown as MockLocationService;
1919
locationService.search.and.returnValue({ mode: 'bar' });
2020

2121
const deployment = injector.get(Deployment);
@@ -25,8 +25,8 @@ describe('Deployment service', () => {
2525
});
2626

2727
function getInjector() {
28-
return ReflectiveInjector.resolveAndCreate([
29-
Deployment,
30-
{ provide: LocationService, useFactory: () => new MockLocationService('') }
31-
]);
28+
return Injector.create({providers: [
29+
{ provide: Deployment, deps: [LocationService] },
30+
{ provide: LocationService, useFactory: () => new MockLocationService(''), deps: [] }
31+
]});
3232
}

aio/src/app/shared/ga.service.spec.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
1-
import { ReflectiveInjector } from '@angular/core';
1+
import { Injector } from '@angular/core';
22

33
import { GaService } from 'app/shared/ga.service';
44
import { WindowToken } from 'app/shared/window';
55

66
describe('GaService', () => {
77
let gaService: GaService;
8-
let injector: ReflectiveInjector;
8+
let injector: Injector;
99
let gaSpy: jasmine.Spy;
1010
let mockWindow: any;
1111

1212
beforeEach(() => {
1313
gaSpy = jasmine.createSpy('ga');
1414
mockWindow = { ga: gaSpy };
15-
injector = ReflectiveInjector.resolveAndCreate([GaService, { provide: WindowToken, useFactory: () => mockWindow }]);
15+
injector = Injector.create({
16+
providers: [
17+
{ provide: GaService, deps: [WindowToken] },
18+
{ provide: WindowToken, useFactory: () => mockWindow, deps: [] }
19+
]});
20+
1621
gaService = injector.get(GaService);
1722
});
1823

aio/src/app/shared/location.service.spec.ts

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ReflectiveInjector } from '@angular/core';
1+
import { Injector } from '@angular/core';
22
import { Location, LocationStrategy, PlatformLocation } from '@angular/common';
33
import { MockLocationStrategy } from '@angular/common/testing';
44
import { Subject } from 'rxjs';
@@ -9,26 +9,28 @@ import { LocationService } from './location.service';
99
import { ScrollService } from './scroll.service';
1010

1111
describe('LocationService', () => {
12-
let injector: ReflectiveInjector;
12+
let injector: Injector;
1313
let location: MockLocationStrategy;
1414
let service: LocationService;
1515
let swUpdates: MockSwUpdatesService;
1616
let scrollService: MockScrollService;
1717

1818
beforeEach(() => {
19-
injector = ReflectiveInjector.resolveAndCreate([
20-
LocationService,
21-
Location,
22-
{ provide: GaService, useClass: TestGaService },
23-
{ provide: LocationStrategy, useClass: MockLocationStrategy },
24-
{ provide: PlatformLocation, useClass: MockPlatformLocation },
25-
{ provide: SwUpdatesService, useClass: MockSwUpdatesService },
26-
{ provide: ScrollService, useClass: MockScrollService }
27-
]);
28-
29-
location = injector.get(LocationStrategy);
30-
service = injector.get(LocationService);
31-
swUpdates = injector.get(SwUpdatesService);
19+
injector = Injector.create({
20+
providers: [
21+
{ provide: LocationService, deps: [GaService, Location, ScrollService, PlatformLocation, SwUpdatesService] },
22+
{ provide: Location, deps: [LocationStrategy, PlatformLocation] },
23+
{ provide: GaService, useClass: TestGaService, deps: [] },
24+
{ provide: LocationStrategy, useClass: MockLocationStrategy, deps: [] },
25+
{ provide: PlatformLocation, useClass: MockPlatformLocation, deps: [] },
26+
{ provide: SwUpdatesService, useClass: MockSwUpdatesService, deps: [] },
27+
{ provide: ScrollService, useClass: MockScrollService, deps: [] }
28+
]
29+
});
30+
31+
location = injector.get(LocationStrategy) as unknown as MockLocationStrategy;
32+
service = injector.get(LocationService);
33+
swUpdates = injector.get(SwUpdatesService) as unknown as MockSwUpdatesService;
3234
scrollService = injector.get(ScrollService);
3335
});
3436

@@ -380,7 +382,7 @@ describe('LocationService', () => {
380382
let platformLocation: MockPlatformLocation;
381383

382384
beforeEach(() => {
383-
platformLocation = injector.get(PlatformLocation);
385+
platformLocation = injector.get(PlatformLocation) as unknown as MockPlatformLocation;
384386
});
385387

386388
it('should call replaceState on PlatformLocation', () => {
@@ -577,7 +579,7 @@ describe('LocationService', () => {
577579
let gaLocationChanged: jasmine.Spy;
578580

579581
beforeEach(() => {
580-
const gaService = injector.get(GaService);
582+
const gaService = injector.get(GaService) as unknown as TestGaService;
581583
gaLocationChanged = gaService.locationChanged;
582584
// execute currentPath observable so that gaLocationChanged is called
583585
service.currentPath.subscribe();

aio/src/app/shared/logger.service.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ErrorHandler, ReflectiveInjector } from '@angular/core';
1+
import { ErrorHandler, Injector } from '@angular/core';
22
import { Logger } from './logger.service';
33

44
describe('logger service', () => {
@@ -10,10 +10,10 @@ describe('logger service', () => {
1010
beforeEach(() => {
1111
logSpy = spyOn(console, 'log');
1212
warnSpy = spyOn(console, 'warn');
13-
const injector = ReflectiveInjector.resolveAndCreate([
14-
Logger,
15-
{ provide: ErrorHandler, useClass: MockErrorHandler }
16-
]);
13+
const injector = Injector.create({providers: [
14+
{ provide: Logger, deps: [ErrorHandler] },
15+
{ provide: ErrorHandler, useClass: MockErrorHandler, deps: [] }
16+
]});
1717
logger = injector.get(Logger);
1818
errorHandler = injector.get(ErrorHandler);
1919
});

aio/src/app/shared/reporting-error-handler.spec.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ErrorHandler, ReflectiveInjector } from '@angular/core';
1+
import { ErrorHandler, Injector } from '@angular/core';
22
import { TestBed } from '@angular/core/testing';
33
import { WindowToken } from 'app/shared/window';
44
import { AppModule } from 'app/app.module';
@@ -14,11 +14,12 @@ describe('ReportingErrorHandler service', () => {
1414
onerrorSpy = jasmine.createSpy('onerror');
1515
superHandler = spyOn(ErrorHandler.prototype, 'handleError');
1616

17-
const injector = ReflectiveInjector.resolveAndCreate([
18-
{ provide: ErrorHandler, useClass: ReportingErrorHandler },
19-
{ provide: WindowToken, useFactory: () => ({ onerror: onerrorSpy }) }
20-
]);
21-
handler = injector.get(ErrorHandler);
17+
const injector = Injector.create({providers: [
18+
{ provide: ErrorHandler, useClass: ReportingErrorHandler, deps: [WindowToken] },
19+
{ provide: WindowToken, useFactory: () => ({ onerror: onerrorSpy }), deps: [] }
20+
]});
21+
22+
handler = injector.get(ErrorHandler) as unknown as ReportingErrorHandler;
2223
});
2324

2425
it('should be registered on the AppModule', () => {

0 commit comments

Comments
 (0)