Skip to content

Commit 7705079

Browse files
Merge pull request #515 from angular/master
Compare changes across branches, commits, tags, and more below.
2 parents 5238aac + 3d15616 commit 7705079

Some content is hidden

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

44 files changed

+2427
-1744
lines changed

.pullapprove.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,8 +509,8 @@ groups:
509509
- >
510510
contains_any_globs(files, [
511511
'packages/core/src/i18n/**',
512-
'packages/core/src/render3/i18n.ts',
513-
'packages/core/src/render3/i18n.md',
512+
'packages/core/src/render3/i18n/**',
513+
'packages/core/src/render3/instructions/i18n.ts',
514514
'packages/core/src/render3/interfaces/i18n.ts',
515515
'packages/common/locales/**',
516516
'packages/common/src/i18n/**',

aio/content/guide/router.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22

33
In a single-page app, you change what the user sees by showing or hiding portions of the display that correspond to particular components, rather than going out to the server to get a new page.
44
As users perform application tasks, they need to move between the different [views](guide/glossary#view "Definition of view") that you have defined.
5-
To implement this kind of navigation within the single page of your app, you use the Angular **`Router`**.
65

7-
To handle the navigation from one [view](guide/glossary#view) to the next, you use the Angular _router_.
8-
The router enables navigation by interpreting a browser URL as an instruction to change the view.
6+
To handle the navigation from one [view](guide/glossary#view) to the next, you use the Angular **`Router`**.
7+
The **`Router`** enables navigation by interpreting a browser URL as an instruction to change the view.
98

109
To explore a sample app featuring the router's primary features, see the <live-example></live-example>.
1110

aio/content/marketing/contributors.json

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -86,24 +86,6 @@
8686
"groups": ["Angular"],
8787
"lead": "kara"
8888
},
89-
"matsko": {
90-
"name": "Matias Niemela",
91-
"picture": "matias.jpg",
92-
"twitter": "yearofmoo",
93-
"website": "http://yearofmoo.com",
94-
"bio": "Matias Niemela is a fullstack web developer who has been programming & building websites for over 10 years, and a core team member of AngularJS for two years. In the spring of 2015 Matias joined Angular full time at Google. In his free time Matias loves to build complex things and is always up for public speaking, travelling and tweaking his current Vim setup.",
95-
"groups": ["Angular"],
96-
"lead": "kara"
97-
},
98-
"kara": {
99-
"name": "Kara Erickson",
100-
"picture": "kara-erickson.jpg",
101-
"twitter": "karaforthewin",
102-
"website": "https://github.com/kara",
103-
"bio": "Kara is a software engineer on the Angular team at Google and a co-organizer of the Angular-SF Meetup. Prior to Google, she helped build UI components in Angular for guest management systems at OpenTable. She enjoys snacking indiscriminately and probably other things too.",
104-
"groups": ["Angular"],
105-
"lead": "igorminar"
106-
},
10789
"pkozlowski-opensource": {
10890
"name": "Pawel Kozlowski",
10991
"picture": "pawel.jpg",
@@ -618,26 +600,6 @@
618600
"bio": "Justin (aka Schwarty) is a Google Developer Expert in Web Technologies and Angular, the host and maintainer of the weekly AngularAir live video broadcast, educator, writer and content creator. He has Angular courses available on LinkedIn Learning and Pluralsight and loves passing on years of full stack development knowledge to help empower others to find their inner awesomeness!",
619601
"groups": ["GDE"]
620602
},
621-
"dennispbrown": {
622-
"name": "Denny Brown",
623-
"picture": "denny.jpg",
624-
"bio": "Denny is founder of Expert Support, a professional services firm specializing in technical communication, and leads the Angular technical writing team. His lifelong passion has been to reduce the time and effort required to understand complex technical information. Early on, he was Associate Chairman of the Computer Science Department at Stanford, where he taught introductory courses in programming. He also plays old-timers baseball in local leagues and national tournaments.",
625-
"groups": ["Angular"],
626-
"lead": "aikidave"
627-
},
628-
"jbogarthyde": {
629-
"name": "Judy Bogart",
630-
"picture": "judy.png",
631-
"groups": ["Angular"],
632-
"lead": "dennispbrown"
633-
},
634-
"rockument69": {
635-
"name": "Tony Bove",
636-
"picture": "rockument69.jpg",
637-
"bio": "Tony is a technical writer with Expert Support. His lifelong passions are helping people use technology, writing fiction, and playing music. When he's not working or playing the harmonica with friends in a bluegrass band, he's swimming and snorkeling on a Kauai beach and playing ball with his Irish Wolfhound. He's worked at home for decades before it became a thing.",
638-
"groups": ["Angular"],
639-
"lead": "aikidave"
640-
},
641603
"kapunahelewong": {
642604
"name": "Kapunahele Wong",
643605
"picture": "kapunahele.jpg",

goldens/circular-deps/packages.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1758,9 +1758,10 @@
17581758
"packages/core/src/render3/index.ts"
17591759
],
17601760
[
1761-
"packages/core/src/render3/i18n.ts",
1761+
"packages/core/src/render3/i18n/i18n_apply.ts",
17621762
"packages/core/src/render3/interfaces/type_checks.ts",
1763-
"packages/core/src/render3/index.ts"
1763+
"packages/core/src/render3/index.ts",
1764+
"packages/core/src/render3/instructions/i18n.ts"
17641765
],
17651766
[
17661767
"packages/core/src/render3/interfaces/container.ts",

goldens/size-tracking/integration-payloads.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"bundle": "TODO(i): we should define ngDevMode to false in Closure, but --define only works in the global scope.",
6363
"bundle": "TODO(i): (FW-2164) TS 3.9 new class shape seems to have broken Closure in big ways. The size went from 169991 to 252338",
6464
"bundle": "TODO(i): after removal of tsickle from ngc-wrapped / ng_package, we had to switch to SIMPLE optimizations which increased the size from 252338 to 1198917, see PR#37221 and PR#37317 for more info",
65-
"bundle": 1213130
65+
"bundle": 1214317
6666
}
6767
}
6868
}

packages/compiler-cli/src/ngtsc/annotations/src/metadata.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ export function generateSetClassMetadataCall(
7070
`Duplicate decorated properties found on class '${clazz.name.text}': ` +
7171
duplicateDecoratedMemberNames.join(', '));
7272
}
73-
const decoratedMembers =
74-
classMembers.map(member => classMemberToMetadata(member.name, member.decorators!, isCore));
73+
const decoratedMembers = classMembers.map(
74+
member => classMemberToMetadata(member.nameNode ?? member.name, member.decorators!, isCore));
7575
if (decoratedMembers.length > 0) {
7676
metaPropDecorators = ts.createObjectLiteral(decoratedMembers);
7777
}
@@ -127,7 +127,7 @@ function ctorParameterToMetadata(
127127
* Convert a reflected class member to metadata.
128128
*/
129129
function classMemberToMetadata(
130-
name: string, decorators: Decorator[], isCore: boolean): ts.PropertyAssignment {
130+
name: ts.PropertyName|string, decorators: Decorator[], isCore: boolean): ts.PropertyAssignment {
131131
const ngDecorators = decorators.filter(dec => isAngularDecorator(dec, isCore))
132132
.map((decorator: Decorator) => decoratorToMetadata(decorator));
133133
const decoratorMeta = ts.createArrayLiteral(ngDecorators);

packages/compiler-cli/src/ngtsc/annotations/test/metadata_spec.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,19 @@ runInEachFileSystem(() => {
9090
`);
9191
expect(res).toBe('');
9292
});
93+
94+
it('should preserve quotes around class member names', () => {
95+
const res = compileAndPrint(`
96+
import {Component, Input} from '@angular/core';
97+
98+
@Component('metadata') class Target {
99+
@Input() 'has-dashes-in-name' = 123;
100+
@Input() noDashesInName = 456;
101+
}
102+
`);
103+
expect(res).toContain(
104+
`{ 'has-dashes-in-name': [{ type: Input }], noDashesInName: [{ type: Input }] })`);
105+
});
93106
});
94107

95108
function compileAndPrint(contents: string): string {

packages/core/src/application_module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {ComponentFactoryResolver} from './linker';
2121
import {Compiler} from './linker/compiler';
2222
import {NgModule} from './metadata';
2323
import {SCHEDULER} from './render3/component_ref';
24-
import {setLocaleId} from './render3/i18n';
24+
import {setLocaleId} from './render3/i18n/i18n_locale_id';
2525
import {NgZone} from './zone';
2626

2727
declare const $localize: {locale?: string};

packages/core/src/application_ref.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import {InternalViewRef, ViewRef} from './linker/view_ref';
3030
import {isComponentResourceResolutionQueueEmpty, resolveComponentResources} from './metadata/resource_loading';
3131
import {assertNgModuleType} from './render3/assert';
3232
import {ComponentFactory as R3ComponentFactory} from './render3/component_ref';
33-
import {setLocaleId} from './render3/i18n';
33+
import {setLocaleId} from './render3/i18n/i18n_locale_id';
3434
import {setJitOptions} from './render3/jit/jit_options';
3535
import {NgModuleFactory as R3NgModuleFactory} from './render3/ng_module_ref';
3636
import {publishDefaultGlobalUtils as _publishDefaultGlobalUtils} from './render3/util/global_utils';

packages/core/src/render3/bindings.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88

99
import {devModeEqual} from '../change_detection/change_detection_util';
10-
import {assertDataInRange, assertLessThan, assertNotSame} from '../util/assert';
10+
import {assertIndexInRange, assertLessThan, assertNotSame} from '../util/assert';
1111

1212
import {getExpressionChangedErrorDetails, throwErrorIfNoChangesMode} from './errors';
1313
import {LView} from './interfaces/view';
@@ -24,7 +24,7 @@ export function updateBinding(lView: LView, bindingIndex: number, value: any): a
2424

2525
/** Gets the current binding value. */
2626
export function getBinding(lView: LView, bindingIndex: number): any {
27-
ngDevMode && assertDataInRange(lView, bindingIndex);
27+
ngDevMode && assertIndexInRange(lView, bindingIndex);
2828
ngDevMode &&
2929
assertNotSame(lView[bindingIndex], NO_CHANGE, 'Stored value should never be NO_CHANGE.');
3030
return lView[bindingIndex];

packages/core/src/render3/component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import {Type} from '../core';
1212
import {Injector} from '../di/injector';
1313
import {Sanitizer} from '../sanitization/sanitizer';
14-
import {assertDataInRange} from '../util/assert';
14+
import {assertIndexInRange} from '../util/assert';
1515

1616
import {assertComponentType} from './assert';
1717
import {getComponentDef} from './definition';
@@ -172,7 +172,7 @@ export function createRootComponentView(
172172
rNode: RElement|null, def: ComponentDef<any>, rootView: LView,
173173
rendererFactory: RendererFactory3, hostRenderer: Renderer3, sanitizer?: Sanitizer|null): LView {
174174
const tView = rootView[TVIEW];
175-
ngDevMode && assertDataInRange(rootView, 0 + HEADER_OFFSET);
175+
ngDevMode && assertIndexInRange(rootView, 0 + HEADER_OFFSET);
176176
rootView[0 + HEADER_OFFSET] = rNode;
177177
const tNode: TElementNode = getOrCreateTNode(tView, null, 0, TNodeType.Element, null, null);
178178
const mergedAttrs = tNode.mergedAttrs = def.hostAttrs;

packages/core/src/render3/di.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -495,8 +495,8 @@ function searchTokensOnInjector<T>(
495495
* @returns Index of a found directive or provider, or null when none found.
496496
*/
497497
export function locateDirectiveOrProvider<T>(
498-
tNode: TNode, tView: TView, token: Type<T>|InjectionToken<T>, canAccessViewProviders: boolean,
499-
isHostSpecialCase: boolean|number): number|null {
498+
tNode: TNode, tView: TView, token: Type<T>|InjectionToken<T>|string,
499+
canAccessViewProviders: boolean, isHostSpecialCase: boolean|number): number|null {
500500
const nodeProviderIndexes = tNode.providerIndexes;
501501
const tInjectables = tView.data;
502502

@@ -510,7 +510,8 @@ export function locateDirectiveOrProvider<T>(
510510
// When the host special case applies, only the viewProviders and the component are visible
511511
const endIndex = isHostSpecialCase ? injectablesStart + cptViewProvidersCount : directiveEnd;
512512
for (let i = startingIndex; i < endIndex; i++) {
513-
const providerTokenOrDef = tInjectables[i] as InjectionToken<any>| Type<any>| DirectiveDef<any>;
513+
const providerTokenOrDef =
514+
tInjectables[i] as InjectionToken<any>| Type<any>| DirectiveDef<any>| string;
514515
if (i < directivesStart && token === providerTokenOrDef ||
515516
i >= directivesStart && (providerTokenOrDef as DirectiveDef<any>).type === token) {
516517
return i;

0 commit comments

Comments
 (0)