Compare commits

...

5015 Commits

Author SHA1 Message Date
7a1f964201 chore(release): cut the 2.1.1 release 2016-10-20 15:36:02 -07:00
3dffbb6cf1 docs(changelog): add 2.1.1 changelog 2016-10-20 15:34:35 -07:00
79f1798b68 chore(release): cut the 2.2.0-beta.0 release and add changelog 2016-10-20 15:31:47 -07:00
dd08d421a1 fix(router): do not update primary route if only secondary outlet is given (#11797) 2016-10-20 15:31:24 -07:00
a2d4299f2c fix(router): module loader should start compiling modules when stubbedModules are set (#11742) 2016-10-20 15:31:11 -07:00
2598b59de7 cleanup(router): add a test verifying than NavigationEnd is not emitted after NavigationCancel 2016-10-20 15:31:04 -07:00
20b4617289 fix(router): fix lazy loading triggered by redirects from wildcard routes
Closes #12183
2016-10-20 15:30:50 -07:00
958bb0da04 refactor(compiler): introduce directive wrappers to generate less code
- for now only wraps the `@Input` properties and calls
  to `ngOnInit`, `ngDoCheck` and `ngOnChanges` of directives.
- also groups eval sources by NgModule.

Part of #11683
2016-10-20 15:30:27 -07:00
4ba8f1989b refactor(compiler): don’t use the OfflineCompiler in extract_i18n 2016-10-20 15:29:43 -07:00
c04b4d795a refactor(compiler): remove private exports
All of `@angular/compiler` is private, so we can export
everything we need directly.
2016-10-20 15:29:25 -07:00
f1b5ba9231 chore(ci): re-enable browserstack tests in ci 2016-10-20 15:27:39 -07:00
50b524ba1e chore(tslint.json): semicolon rule expects an array 2016-10-20 15:27:25 -07:00
680ceb7d65 refactor: remove some facades (#12335) 2016-10-20 15:25:05 -07:00
ea186d5ccd refactor(forms): remove ListWrapper facades
originally cherry-picked from 445e5922ec
2016-10-20 15:15:32 -07:00
10455044f1 chore(ci): make browserstack tests optional until they are fixed 2016-10-20 14:49:01 -07:00
31150fe6e8 feat(benchmark): add large form benchmark
This benchmark tracks the generated file size for large forms
as well as the time to create and destroy many form fields.
2016-10-20 14:48:02 -07:00
9223066123 fix(benchmarks): fix method name in targetable spec 2016-10-20 14:47:42 -07:00
cca4a5c519 fix(compiler): don't redeclare a var in the same scope (#12386)
This is not allowed by Closure Compiler.
2016-10-18 20:28:30 -07:00
6e5f8b59b3 fix(animations): generate aot code for animation trigger output events (#12291)
Closes #11707
Closes #12291
2016-10-18 17:16:51 -07:00
8409b65153 fix(http): make normalizeMethodName optimizer-compatible. (#12370)
`normalizeMethodName` reflectively accessed the RequestMethod enum. With a smart
optimizer, properties from the enum could be removed or renamed, and so user
code just passing in e.g. 'PATCH' might not work. This change fixes the code to
be more explicit and avoids the optimizer issue.
2016-10-18 11:21:54 -07:00
38e2203b24 refactor(core): delete unused reflector code 2016-10-17 23:17:34 -07:00
bd1dcb5f11 fix(core): fix decorator defalut values 2016-10-17 23:17:34 -07:00
3993279527 fix(core): fix property decorators
fixes #12224
2016-10-17 23:17:34 -07:00
bf1e2613b2 refactor(core): cleanup decorators 2016-10-17 23:17:34 -07:00
f7db0668d1 refactor(core): simplify & cleanup reflection 2016-10-17 23:17:34 -07:00
27d76776b8 fix(router): correctly export filter operator in es5 (#12286) 2016-10-17 23:06:19 -07:00
8603d9c269 refactor(http): use Http.request for all http shorthand methods (#12319) 2016-10-17 23:04:25 -07:00
d55f747858 docs(router): attribute notation for string paths (#12205)
Either bind an expression or use the attribute notation.
The mixed way `[routerLink]="/path"` won't work.
Prefer the attribute notation for string-only paths
2016-10-17 22:53:55 -07:00
52de0fa558 docs(CONTRIBUTING.md): fix typo (reproductions --> reproduction) (#12230) 2016-10-17 22:52:44 -07:00
d61ecf0663 docs(NgSwitch): fix mismatched tags in example (#12270) 2016-10-17 22:51:56 -07:00
5a9c5f28b8 docs(CHANGELOG.md): remove incorrect link (#12259) 2016-10-17 22:51:44 -07:00
15fc5dd7ee test(forms): added missing selfOnly tests (#12317) 2016-10-17 22:51:13 -07:00
a5419608e0 docs(ngIf): minor improvements 2016-10-17 22:50:12 -07:00
5f95bf1dd2 refactor(common): remove redundant type 2016-10-17 22:50:12 -07:00
33c8948fd3 refactor(animations): ensure animation data-structures are created only when used
Closes #12250
2016-10-14 15:43:41 -07:00
606e51881a perf(benchmarks): update ng2-switch to match ng2
- use the ~same template layout (text nodes),
- use trackBy

both benchmark now show about the same perfs.
2016-10-12 17:11:46 -07:00
fdf4309b50 perf(common): optimize NgSwitch default case
relates to #11297
2016-10-12 17:11:46 -07:00
af996ef0c4 docs(changelog): fix typo in code name, ouch! 2016-10-12 14:05:48 -07:00
68d2dfdd2a docs(changelog): tweak the change log and group all the 2.1 changes together 2016-10-12 13:54:21 -07:00
07bd4b0630 chore: bump version number and generate CHANGELOG (#12247) 2016-10-12 13:19:31 -07:00
df1718d624 fix(compiler): allow WS as <ng-content> content (#12225) 2016-10-12 07:58:06 -07:00
17e3410d98 Form submit event (#11989)
* feat(forms): ngSubmit event exposes $event from original submit event as local variable

Modify NgForm directive and FormGroup directive to expose the original submit event as $event in the ngSubmit event. Modify docs to reflect changes.

This resolves #10920.

* refactor: code cleanup
2016-10-11 15:49:36 -07:00
5effc330ed feat(upgrade): compilerOptions in bootstrap (#10575) 2016-10-11 15:48:08 -07:00
3df00828d7 docs(router): fix CanActivateChild API docs (#12128)
fixes #12127
2016-10-11 15:47:57 -07:00
8c477b2f45 fix(compiler-cli): don't clone static symbols when simplifying annotation metadata (#12158) 2016-10-11 15:47:44 -07:00
7787771aba refactor(core): cleanup decorators.ts (#12161) 2016-10-11 15:47:20 -07:00
7275e1beb3 refactor(compiler): add optional visit() to TemplateAstVisitor (#12209) 2016-10-11 15:46:11 -07:00
12ba62e5e2 refactor(compiler): expose template parser phases (#12210) 2016-10-11 15:45:27 -07:00
e6e007e2f1 refactor(core): cleanup SpyObject (#12221) 2016-10-11 15:44:48 -07:00
91dd138fa5 docs(animations): document :enter and :leave transition aliases (#12222) 2016-10-11 15:44:38 -07:00
d972d82354 refactor: simplify isPresent(x) ? x : y to x || y (#12166)
Closes #12166
2016-10-10 09:20:58 -07:00
bdcf46f82e refactor(compiler): improve types, misc 2016-10-10 09:20:58 -07:00
79e1c7b807 refactor(upgrade): unify spec code (#12190)
- replace all variable declarations using 'var' by 'const' or 'let'
- replace es5 function declaration by arrow function where applicable
2016-10-10 09:18:33 -07:00
d22eeb70b8 fix(forms): allow optional fields with pattern and minlength validators (#12147) 2016-10-10 09:17:45 -07:00
aa92512ac6 fix(compiler): properly shim :host:before and :host(:before) (#12171)
fixes #12165
2016-10-10 09:15:15 -07:00
f782b08f58 docs: Minor typo fix (#12151) 2016-10-10 09:14:35 -07:00
4202936bbf refactor(compiler): add optional visit() to html AST Visitor (#12135) 2016-10-10 09:13:50 -07:00
e1faca6386 refactor(compiler): template element ast has endSourceSpan (#12138) 2016-10-10 09:12:05 -07:00
f5b0e22d35 docs(public_api): fix missing backtick 2016-10-07 17:23:08 -07:00
00693d70a2 docs: add PUBLIC_API.md 2016-10-07 14:29:16 -07:00
bcef5efffe fix(platform-browser-dynamic): mark platformBrowserDynamic as stable API (#12154)
Everyone building Angular apps need to use this api to bootstrap or AoT compile, so it can't be experimental.
2016-10-07 13:54:06 -07:00
13ecc140e8 fix(compiler): validate @HostBinding name (#12139)
relates to #7500
2016-10-07 13:53:53 -07:00
709a6dea06 refactor(compiler): attribute ast records span of the value (#12132) 2016-10-07 13:53:29 -07:00
16cfb88c00 refactor(compiler): refactor analyzeModules() out of OfflineCompiler (#12137) 2016-10-07 13:52:53 -07:00
efee6f5199 docs(saved-replies): order the replies as shown in github (#12153)
github sorts the replies by reply name.
2016-10-07 13:52:18 -07:00
2aa8aae76d docs(saved-replies): add document with saved replies for our issue tracker 2016-10-07 09:21:20 -07:00
afb4bd9ef6 refactor(NgZone): merge NgZoneImpl and NgZone (#12104) 2016-10-06 15:23:37 -07:00
d641c36a45 fix(compiler): interpolation expressions report the correct offset (#12125) 2016-10-06 15:22:10 -07:00
f4566f8128 fix(http): fix Headers initialization from Headers and Object (#12106) 2016-10-06 15:21:27 -07:00
a67c06708d fix(http): Headers.append should append to the list 2016-10-06 15:21:03 -07:00
d9d57d71dd refactor(http): move one Headers test inside the main describe 2016-10-06 15:21:03 -07:00
e06303a987 fix(router): improve error message (#12102) 2016-10-06 15:19:22 -07:00
40b92ddf21 fix(router): wildcards routes should support lazy loading
Closes #12024
2016-10-06 15:19:09 -07:00
1681e4f57f fix(router): parent resolve should complete before merging resolved data
Closes #12032
2016-10-06 15:19:09 -07:00
71b7654660 fix(compiler-cli): remove peerDependency on @angular/platform-server (#12122)
There is no runtime dependency from the compiler-cli on @angular/platform-server - it was most likely added to package.json by mistake.
2016-10-06 15:16:41 -07:00
eaaec6979c fix(compiler-cli): remove unused parse5 dependency from package.json
This was added in error or is an obsolete dependency. We don't need parse5 for the compiler-cli's runtime.
2016-10-06 15:16:22 -07:00
c587c63591 docs(changelog): fix mentions, backticks and a misplaced line ending (#12109)
* docs(changelog): fix mentions and backticks

`@page` and `@document` were both incorrectly linking to GitHub repositories.
`:enter` and `:leave` in the *Features* section were missing backticks.

* Fix misplaced line ending.
2016-10-06 15:12:41 -07:00
f50c1da4e2 fix(forms): properly validate blank strings with minlength (#12091) 2016-10-06 15:12:09 -07:00
0254ce1f6c refactor(core): simplify Reflector code, add types (#12099) 2016-10-06 15:11:16 -07:00
c9b765f5c0 refactor(compiler): module collector is reusable (#12095) 2016-10-06 15:10:44 -07:00
8c975ed156 refactor(facade): inline StringWrapper (#12051) 2016-10-06 15:10:27 -07:00
bb35fcb562 docs(contributing): remove references to Angular 2
It's just Angular.
2016-10-06 15:07:46 -07:00
57230b70a9 docs(contributing): update the "Submitting an Issue" section 2016-10-06 15:06:37 -07:00
43dc60ce4f docs(contributing): update "got a question or a problem" section
Inspired by: https://github.com/ng-bootstrap/ng-bootstrap#getting-help
2016-10-06 13:58:14 -07:00
230b3b73d8 chore(benchpress): fix the license (#12090)
It's not Apache MIT 2.0, that's a mishmash of Apache 2.0 and MIT
2016-10-06 10:24:01 -07:00
0b7dc2f9ff docs(RouterTestingModule) change modules to imports in example (#12118) 2016-10-06 10:22:39 -07:00
de1f44f51f fix(benchmarks): allow ng2_switch benchmark to be used with AoT. (#12124) 2016-10-06 10:22:08 -07:00
f1cfddf6d6 refactor(benchmarks): add index_aot to support AoT bootstrap. (#12105)
Note: This only make sure it can compile the AoT version, but does not yet use it in e2e tests.
2016-10-06 08:37:37 -07:00
ef621a2f00 docs(changelog): tweak changelog 2016-10-06 06:43:17 -07:00
df9761951b docs(changelog): added changelog for 2.1.0-rc.0 2016-10-05 16:48:22 -07:00
f786c560f1 doc(triage): add info about user pain, frequency and severity labels 2016-10-05 15:58:45 -07:00
c5557de3e7 doc(triage): correct existing incorrect info 2016-10-05 15:58:45 -07:00
ec3a5b54de docs(readme): remove incorrect download count badge
npm doesn't currently support download counts for scoped packages, so there is no replacement right now.
2016-10-05 11:37:28 -07:00
cf269d9ff4 refactor: add license header to JS files & format files (#12081) 2016-10-04 20:39:20 -07:00
5fa5ffb82a refactor(benchmarks): refactor to support AOT bootstrap in G3 (#12075) 2016-10-04 16:27:45 -07:00
4a57dcfd8d fix(forms): properly validate empty strings with patterns (#11450) 2016-10-04 16:14:23 -07:00
43923ffcf5 docs(traige): update triaging doc 2016-10-04 16:13:32 -07:00
50c37d45dc refactor: simplify arrow functions (#12057) 2016-10-04 15:57:37 -07:00
a63359689f fix(ShadowCss): fix attribute selectors in :host and :host-context (#12056)
Fix a regression introduced in #11917 while fixing #6249
2016-10-04 15:40:31 -07:00
43d3a84df3 Revert "refactor: add license header to JS files & format files (#12035)"
This reverts commit 8310c91823.
2016-10-04 14:06:41 -07:00
8310c91823 refactor: add license header to JS files & format files (#12035) 2016-10-04 13:15:49 -07:00
b64b5ece65 refactor(facade): Remove most of StringMapWrapper facade. (#12022)
This change mostly automated by
12012b07a2
with some manual fixes.
2016-10-03 16:46:05 -07:00
ed9c2b6281 fix(Header): preserve case of the first init, set() or append() (#12023)
fixes #11624
2016-10-03 15:27:56 -07:00
1cf5f5fa38 docs(NgModule): Fixed docs for NgModule.entryComponents (#12006)
* docs(NgModule): Corrected the wording of the documentation of `entryComponents`, fixed some minor grammar issues

* docs(NgModule): Remove redundant ComponentFactory mentions

* docs(NgModule): Restore ComponentFactory/ComponentResolver links
2016-10-03 10:19:03 -07:00
a32078f85e docs(DEVELOPER.md): fix typos on "Tests" section (#12029) 2016-10-02 14:19:47 -07:00
decd129a4d refactor(facade): remove DateWrapper (#12027) 2016-10-02 14:12:14 -07:00
c3c9ecb302 text(offline compiler): fix expected output 2016-09-30 17:59:43 -07:00
af520947aa test(AstSerializer): fix serializing void tags 2016-09-30 17:59:43 -07:00
040bf57966 fix(xlif): fix <x> ctype names
fixes #12000
see http://docs.oasis-open.org/xliff/v1.2/os/xliff-core.html#ctype
2016-09-30 17:59:43 -07:00
65a60b7456 style(I18N): Carriage returns in serialized files 2016-09-30 17:59:43 -07:00
756ef09d12 docs(gh): try to improve the issue template (#11891) 2016-09-30 16:40:56 -07:00
9316f95467 fix(ShadowCss): support @page and @document CSS rules (#11878)
fixes #11860
2016-09-30 16:26:24 -07:00
83d94b7504 fix(ShadowCss): support quoted attribute values
fixes #6085
2016-09-30 14:37:41 -07:00
a121136fae refactor(ShadowCss): add missing types 2016-09-30 14:37:41 -07:00
a6bb84e02b fix(ShadowCss): fix :host(tag) and :host-context(tag)
fixes #11972
2016-09-30 14:37:41 -07:00
3898dc488e fix(BrowserAdapter): correctly removes styles on IE
fixes #7916
2016-09-30 11:18:17 -07:00
ca3f9926f9 refactor(BrowserAdapter): cleanup 2016-09-30 11:18:17 -07:00
1c012a035f refactor(CssSelector): misc cleanup 2016-09-30 11:06:24 -07:00
38c5304b7f docs(CssSelector): [name*=value] is not supported
fixes #6042
2016-09-30 11:06:24 -07:00
9a049be67f feat(Parse5): update to the latest version 2.2.1
fixes #6237
2016-09-30 10:46:49 -07:00
2045c9e8ee docs: update docs for ng2_ftl benchmark 2016-09-30 10:42:21 -07:00
6c4ec05a4a fix(ShadowCss): support [attr="value with space"]
fixes #6249
2016-09-30 10:27:35 -07:00
f7bfda31ff refactor(ShadowCss): cleanup 2016-09-30 10:27:35 -07:00
a92b573309 test(DirectiveResolver): test that a prop can have both @Input and @HostBinding 2016-09-30 10:08:52 -07:00
4fd13d71c8 refactor(DirectiveResolver): cleanup 2016-09-30 10:08:52 -07:00
bf7b82b658 fix(UrlSearchParams): change a behavior when a param value is null or undefined (#11990) 2016-09-30 09:57:26 -07:00
c143fee849 refactor(routerLinkActive): optimised routerLinkActive active check code (#11968)
Modify routerLinkActive to optimise performance by removing unnecessary iteration. By replacing Array.reduce with Array.some, the loop will break when it finds an active link. Useful if used on the parent of a large group of routerLinks. Furthermore, if a RouterLink is active it will not check the RouterLinkWithHrefs.
2016-09-30 09:42:54 -07:00
0286956107 refactor(facade): Inline isBlank called with object-type argument (#11992) 2016-09-30 09:26:53 -07:00
e884f4854d feat(animations): provide aliases for :enter and :leave transitions (#11991) 2016-09-30 09:15:56 -07:00
df1822fc2a benchmarks: add ng2_ftl and ng2_switch_ftl benchmarks (#11963)
These benchmarks take the output of AoT
and manually tweaks it to explore possible
future changes to the compiler to produce
this output directly.
2016-09-30 09:09:31 -07:00
42b4b6d21b fix(upgrade): bind optional properties when upgrading from ng1 (#11411)
Previously, optional properties of a directive/component would be wrongly mapped and thus ignored.

Closes #10181
2016-09-29 09:45:28 -07:00
36bc2ff269 docs(forms): Added FormControl initialization information (#11948) 2016-09-28 13:59:08 -07:00
1564042fe8 fix(ngc): allow ReflectorHost passed as argument to CodeGenerator#create (#11951) 2016-09-27 17:12:57 -07:00
41c8c30973 chore(lint): remove unused imports (#11923)
This was done automatically by tslint, which can now fix issues it finds.
The fixer is still pending in PR https://github.com/palantir/tslint/pull/1568
Also I have a local bugfix for https://github.com/palantir/tslint/issues/1569
which causes too many imports to be deleted.
2016-09-27 17:12:25 -07:00
61129fa12d fix(compiler): move detection of unsafe properties for binding to ElementSchemaRegistry (#11378) 2016-09-27 17:10:02 -07:00
3a5b4882bc fix(compiler): Do not embed templateUrl in view factories in non-debug mode. (#11818)
Fixes #11117.
2016-09-27 17:09:44 -07:00
425c1e6042 refactor: remove dead code 2016-09-27 16:13:09 -07:00
58605cf350 refactor(facade): remove useless facades 2016-09-27 16:13:09 -07:00
34b31dea7c docs(upgrade): rename undeclared Ng2 to Ng2Component (#11950) 2016-09-27 16:11:41 -07:00
a241ab7c07 (docs): removing addProvider from UpgradeAdapter (#11934)
The `addProvider` function in the `UpgradeAdapter` was deprecated in this [commit](d21331e902 (diff-77163e956a7842149f583846c1c01651)) and has been removed in final. Given this, the documentation for downgrading ng2 providers for use in ng1 is invalid.
2016-09-27 10:10:45 -07:00
745e10e6d2 docs(router_config): add missing quote (#11925) 2016-09-27 10:10:12 -07:00
33340dbbd1 docs: remove outdated docs (#11875) 2016-09-24 08:23:28 +09:00
52812c08e2 chore(CHANGELOG): fix wrong issue link (#11871) 2016-09-24 07:13:24 +09:00
52f5ae1961 chore(compiler): followup fix for PR#11846 (#11870)
Original PR set [] to any, but any[], is a tighter type and still
works for SNC enabled consumers of the emit.
2016-09-24 07:13:05 +09:00
9be895b6da docs(ExceptionHandler): fix API docs (#11772)
fixes #11769
2016-09-24 07:05:43 +09:00
9f1c82537e ci(travis): increase node's heap size to prevent OOM on travis (#11869) 2016-09-24 06:04:29 +09:00
5ab5cc77bb Fix(http): invalidStateError if response body without content (#11786)
Fix(http): invalidStateError if response body without content
If the responseType has been specified and other than 'text', responseText throw an InvalidStateError exception

See XHR doc => https://xhr.spec.whatwg.org/#the-responsetext-attribute

Unit Test to prevent invalidStateError
2016-09-24 05:44:01 +09:00
f1b6c6efa1 refactor(animations): ensure animation input/outputs are managed within the template parser (#11782)
Closes #11782
Closes #11601
Related #11707
2016-09-24 05:37:04 +09:00
45ad13560b docs(changelog): remove info about an internal change 2016-09-23 12:02:56 -07:00
2045268cec chore(release): v2.1.0-beta.0 2016-09-23 11:41:35 -07:00
fb1076b44a docs(changelog): release notes for 2.1.0-beta.0 2016-09-23 11:37:28 -07:00
6fc46526ae fix(upgrade): allow attribute selectors for components in ng2 which are not part of upgrade (#11808)
fixes #11280
2016-09-24 02:47:16 +09:00
3ef5ede6d6 chore(compiler): emit ([] as any[]) instead of purely []. (#11846)
In SNC mode `[]` has type of never[], so we cast it to any[] to
typecheck correctly see
https://github.com/Microsoft/TypeScript/issues/10479.

This is temporary workaround, until we fully
migrate the framework to TS 2.0 and strictNullChecks.
2016-09-24 02:21:59 +09:00
136621ebc9 docs(Component): API docs for .encapsulation and .interpolation 2016-09-22 11:01:16 -07:00
f23b22a0f4 refactor: misc cleanup 2016-09-22 11:01:16 -07:00
0ca971c5bd refactor(common): cleanup (#11668) 2016-09-22 10:34:00 -07:00
3a6fcee0e6 docs(core): mark TestBed as stable api and add preliminary docs (#11767)
TestBed was accidentaly ommited from the 'stable' api list during the API sweep before final. We do consider it to be stable.
2016-09-22 10:32:17 -07:00
8972137c29 docs(contributing): remove preview references (#11795) 2016-09-22 10:31:56 -07:00
cc6481077f ci(BrowserStack): add Safari 10 (#11796) 2016-09-22 10:31:38 -07:00
c041b93418 refactor(TemplateParser): clearer error message for on* binding (#11802)
fixes #11756
2016-09-22 10:31:18 -07:00
bc33765913 chore(ISSUE_TEMPLATE): update Angular version field (#11821) 2016-09-22 10:29:12 -07:00
31dce72b7b fix(router): update the router not to reset router state when updating root component (#11799) 2016-09-21 11:37:43 -07:00
212f8dbde7 fix(forms): disable all radios with disable() 2016-09-20 15:00:12 -07:00
44da4984f9 fix(forms): support unbound disabled in ngModel (#11736) 2016-09-20 14:55:47 -07:00
d95344430c chore(zone.js): update to 0.6.25 (#11725) 2016-09-20 14:55:07 -07:00
131626fc61 fix(compiler): Safe property access expressions work in event bindings (#11724) 2016-09-20 14:54:53 -07:00
676bb0fa7d feat(router): update dts files 2016-09-20 14:53:52 -07:00
5a849829c4 feat(router): add router preloader to optimistically preload routes 2016-09-20 14:53:52 -07:00
671f73448c refactor: misc cleanup (#11654) 2016-09-19 17:15:57 -07:00
51d73d3e4e fix(forms): make setDisabledState optional for reactive form directives (#11731)
Closes #11719
2016-09-19 16:26:33 -07:00
bf81b06a28 docs(forms): add select control examples (#11728) 2016-09-19 16:25:33 -07:00
0621f07a2c refactor: misc cleanup 2016-09-19 16:24:31 -07:00
1225ecfb14 chore(node): allow current node version
node current is 6.6.0
see https://github.com/nodejs/LTS#lts_schedule
2016-09-19 16:24:31 -07:00
5509453e72 refactor(common): pipe code cleanup 2016-09-19 16:19:28 -07:00
70488ed382 fix(OfflineCompiler): support older TS versions (#11734) 2016-09-19 15:36:25 -07:00
03aedbe54b fix(OfflineCompiler): Do not provide I18N values when they're not specified
fixes #11643
2016-09-19 10:44:33 -07:00
8395aab25d refactor(OfflineCompiler): cleanup 2016-09-19 10:44:33 -07:00
0dc15eb64a fix(ContentChild): query descendants by default
fixes #1645
2016-09-19 10:42:46 -07:00
cba885a1fb refactor: code cleanup 2016-09-19 10:42:46 -07:00
fa4723a208 docs(forms): add radio button examples (#11676) 2016-09-19 10:41:20 -07:00
5bf08b886f build(npm): update fsevents to 1.0.14 (#11686)
fixes #11685
2016-09-18 16:04:46 -07:00
89802316b9 docs(injector): API docs - remove lone code-block backticks (#11653)
The triple backticks in the markdown of the API entry are unbalanced.
2016-09-18 16:04:04 -07:00
2300c23332 fix(docs): Fixed wording for NgModule schemas (#11620) 2016-09-18 16:03:43 -07:00
fa39965a37 build(gulp): fail on ddescribe / iit left in tests
Closes #10524
2016-09-18 16:01:50 -07:00
115f0fa842 refactor(gulpfile): cleanup, add comments 2016-09-18 16:01:50 -07:00
734b8b8c13 fix(compiler): [attribute~=value] selector (#11696)
Change the seperator regular expression to ignore tildes which are followed by an equal sign.

Closes #9644
2016-09-18 15:58:19 -07:00
54b41f57be docs(Host): fix the API example (#11684)
fixes #11681
2016-09-18 15:56:13 -07:00
df4254ae89 refactor(facade): move isPromise to core private (#10573) 2016-09-18 15:55:08 -07:00
14ee75924b fix(common): fix ngOnChanges signature of NgTemplateOutlet directive 2016-09-15 11:00:30 -07:00
bd4045b6e7 fix(MetadataResolver): throw Component.moduleId is not a string
fixes #11590
2016-09-15 10:57:37 -07:00
255099aa61 refactor(MetadataResolver): cleanup 2016-09-15 10:57:37 -07:00
1c24096650 refactor(benchpress): add more types 2016-09-15 10:17:10 -07:00
32aeb1052d refactor(benchpress): normalize phase b into B and e into E
This simplifies the perflog metrics and prevents future errors.
2016-09-15 10:17:10 -07:00
838d4bbf6c fix(benchpress): support measuring scriptTime and other metrics of page reload.
E.g. for benchmarks that measure page start time
2016-09-15 10:17:10 -07:00
c4114c2f66 finished refactoring 2016-09-15 10:17:10 -07:00
37b8691c8c refactor(benchpress): remove chrome < v44 support 2016-09-15 10:17:10 -07:00
93054d4e3d refactor(benchpress): remove facades from chrome_driver_extension 2016-09-15 10:17:10 -07:00
cfc12c6539 docs(api): changes to correct jade errors in API doc gen (#11619) 2016-09-15 09:09:00 -07:00
c0bdd89b5d docs(readme): update the note about RC 2016-09-14 19:37:19 -07:00
d5515473bf docs: update README.md for npm packages 2016-09-14 17:14:02 -07:00
ffe5c49c3e chore(release): v2.0.0 proprioception-reinforcement 2016-09-14 16:49:10 -07:00
ae1dd5bfd0 docs(changelog): add changelog for bug fixes that landed between rc.7 and 2.0.0 2016-09-14 16:45:16 -07:00
cb657c4b55 docs: update descriptions in package.jsons 2016-09-14 16:44:39 -07:00
42f60ca303 docs(core): update dts file 2016-09-14 15:27:33 -07:00
e33037a2f1 docs(core): docs for Directive and Component 2016-09-14 15:27:33 -07:00
9cee8bcc83 docs(common): add directives docs
Closes #11581
2016-09-14 15:24:01 -07:00
003294d5df docs(core): fix examples 2016-09-14 14:53:30 -07:00
785292f44f chore(core): reexport query metadata decorators 2016-09-14 14:53:30 -07:00
15c2912527 chore(core): update public api file 2016-09-14 14:53:30 -07:00
096ae7c404 docs(core): updates query decorator docs 2016-09-14 14:53:30 -07:00
5972fdc817 docs(core): extract how to examples 2016-09-14 14:53:30 -07:00
2c42a50fc3 docs(pipes): updated pipe documentation 2016-09-14 14:32:09 -07:00
caa1cd2470 docs(pipes): move pipe examples to the common folder 2016-09-14 14:26:00 -07:00
5fad37df69 Revert "chore(core): update public api file"
This reverts commit 727c2b38a4.

Revert "docs(core): updates query decorator docs"

This reverts commit b6287ccc51.

Revert "docs(core): extract how to examples"

This reverts commit 69e8ace884.
2016-09-14 13:34:25 -07:00
727c2b38a4 chore(core): update public api file 2016-09-14 13:22:09 -07:00
b6287ccc51 docs(core): updates query decorator docs 2016-09-14 13:22:09 -07:00
69e8ace884 docs(core): extract how to examples 2016-09-14 13:22:09 -07:00
85d9db6bc4 fix(platform-browser): provide Title service as part of the module (#11605)
Fixes #11600
2016-09-14 13:21:23 -07:00
0a2132ef10 docs(di): update docs on di 2016-09-14 11:57:31 -07:00
d299ce4bcf docs(lifecycle): update docs for lifecycle hooks 2016-09-14 11:51:03 -07:00
0b9425bbb4 fix(examples): make them work with noImplicitAny and declarations:true 2016-09-14 11:29:31 -07:00
1a035a0dc7 build(examples): include in main tsconfig.json
Also rename `examples/tsconfig.json` into `examples/tsconfig-build.json`
so that it does not shadow the main `tsconfig.json` in editors

Also adds `noImplicitAny` and `declarations`
`examples/tsconfig.json`.
2016-09-14 11:29:31 -07:00
84b4338ab5 build(example): fix tsconfig (#11593) 2016-09-14 07:40:58 -07:00
b847257b16 refactor(ShadowCss): remove a comment that trigger an issue with webpack (#11587)
fixes #11584
2016-09-13 21:59:11 -07:00
c65d139081 build: remove JS suffix from the license banner 2016-09-13 21:48:58 -07:00
57f0269491 build(examples): fail build.sh if errors are found 2016-09-13 21:48:58 -07:00
4e6c41b3a1 build(examples): work around protractor typings issues and fix existing type errors
This works around the typings issues until we have a build of protractor with typings that don't
polute global types via ambient type definitions
2016-09-13 21:48:58 -07:00
7105021c41 docs(forms): add docs for FormArray 2016-09-13 14:00:52 -07:00
f7313db0be docs(forms): add docs for FormGroup 2016-09-13 14:00:52 -07:00
1d2e70e3a4 docs(forms): add docs for FormControl 2016-09-13 14:00:52 -07:00
21516c32e6 docs(forms): add docs for AbstractControl 2016-09-13 14:00:52 -07:00
00a24b63da build(npm): roll back jasmine 2.5 upgrade due to console reporter issues (#11573)
2.5.1 no longer prints dots in the './test.sh node' mode
2016-09-13 13:32:58 -07:00
e71558ba89 docs(forms): update docs for FormBuilder (#11548) 2016-09-13 13:23:31 -07:00
7ac47acc1c docs(core): updates docs for query metadata 2016-09-13 11:28:12 -07:00
60e49a7e4b docs(core): add an example of using ViewChildren 2016-09-13 11:28:12 -07:00
c71e35cbf5 docs(core): add an example of using ViewChild 2016-09-13 11:28:12 -07:00
1348c65b0c docs(core): add an example of using ContentChildren 2016-09-13 11:28:12 -07:00
ff03d87cdd docs(core): add an example of using ContentChild 2016-09-13 11:28:12 -07:00
a2bf334e6e chore(benchpress): update package.json and add publish script 2016-09-13 10:49:16 -07:00
f8690caa98 chore: refactor build script to allow to build individual packages 2016-09-13 10:49:16 -07:00
aa713d1dd9 docs(readme): fixed visual of browserstack link (#11552)
Instead of using a variable for the link of browserstack it was using the direct https link.
That caused to show the text and the link (incorrect markdown).
Moved the https link to the bottom with the other link assignments. It will now only show the blue text with the link to the browserstack.
2016-09-13 10:06:02 -07:00
a2519c6164 fix(upgrade): correct the main entry path in package.json 2016-09-13 10:03:45 -07:00
fa994810d5 chore(release): v2.0.0-rc.7 2016-09-12 23:25:28 -07:00
c54580a4af docs(changelog): add release notes for 2.0.0-rc.7 2016-09-12 23:25:05 -07:00
730415e048 build: temporarily disable building and testing of documentation examples
This is due to protractor typings issue that breaks the compilation.
2016-09-12 23:06:38 -07:00
42a287fabf fix(core): make name in Pipe non optional 2016-09-12 22:47:54 -07:00
42d442dcd5 refactor(core): add a name to all decorators and other fixes 2016-09-12 22:47:54 -07:00
cc2873a94d chore: update typings
Note that the typings don’t reflect the shape of the metadata
due to a bug in the public-api-guard
2016-09-12 22:47:54 -07:00
63e15ffaec refactor(core): remove …Metadata for all decorators and use the decorator directly.
BREAKING CHANGE:
- all `…Metadata` classes have been removed. Use the corresponding decorator
  as constructor or for `instanceof` checks instead.
- Example:
  * Before: `new ComponentMetadata(…)`
  * After: `new Component(…)`
- Note: `new Component(…)` worked before as well.
2016-09-12 22:47:54 -07:00
1b15170c89 refactor(core): simplify decorators
Every decorator now is made of the following:
- a function that can be used
as a decorator or as a constructor. This function
also can be used for `instanceof` checks.
- a type for this function (callable and newable)
- a type that describes the shape of the data
  that the user needs to pass to the decorator
  as well as the instance of the metadata

The docs for decorators live at the followig places
so that IDEs can discover them correctly:
- General description of the decorator is placed on the
  `...Decorator` interface on the callable function
  definition
- Property descriptions are placed on the interface
  that describes the metadata produces by the decorator
2016-09-12 22:47:54 -07:00
26d1423ae9 docs(forms): update docs for NgForm (#11547) 2016-09-12 17:01:04 -07:00
61aad7925f fix(forms): fix resetting radios (#11546)
Closes #11516
2016-09-12 15:15:58 -07:00
79055f727b fix(forms): support dots in control names in contains (#11542)
Closes #11535
2016-09-12 15:15:50 -07:00
220d8377fe build(npm): update to jasmine@2.5.1
Closes #11390
2016-09-12 12:54:52 -07:00
cc7780adf7 build(npm): update to rxjs@5.0.0-beta.12
Fixes #11300
2016-09-12 12:05:00 -07:00
051a6ebe12 feat(zone): upgrade to zone.js@0.6.21 2016-09-12 11:48:24 -07:00
c9513b713a docs(forms): add example apps for ngModelGroup (#11525) 2016-09-12 11:45:48 -07:00
66e38b6754 docs(forms): add example apps for ngModel (#11524) 2016-09-12 11:27:29 -07:00
7b82877ee5 fix(Localization): BCP47 uses hyphens as separator (#11514)
https://tools.ietf.org/html/bcp47
2016-09-12 11:27:15 -07:00
c9ad5e46d6 docs(forms): add example app for formArrayName (#11512) 2016-09-12 11:26:43 -07:00
2cdd051109 docs(forms): update example for formGroupName (#11510) 2016-09-12 11:26:18 -07:00
57cb82052b docs(forms): add example app for formControlDirective (#11508) 2016-09-12 11:24:09 -07:00
dd8204a655 docs(forms): update example for formGroupDirective 2016-09-12 11:22:51 -07:00
cdda4082de docs(forms): add example app for formControlName 2016-09-12 11:22:51 -07:00
0614c8c99d chore(router): update publicapi 2016-09-12 10:02:48 -07:00
a343a8e1c2 docs(router): fix typos 2016-09-12 09:47:44 -07:00
a41c1bbdf4 docs(router): update docs of the router lifecycle interfaces 2016-09-10 16:55:14 -07:00
f2c6157e74 docs(router): update docs of RouteModule and RouterTestingModule 2016-09-10 16:55:13 -07:00
32564ece27 docs(router): update RouterState docs 2016-09-10 16:55:13 -07:00
3eee62fa71 docs(router): update router configuration docs 2016-09-10 16:55:13 -07:00
617475005f docs(router): update docs of the Router service 2016-09-10 16:55:13 -07:00
0822066175 docs(router): update docs for router directives 2016-09-10 16:55:13 -07:00
82f30e09f0 refactor(common): cleanup directive tests 2016-09-09 14:30:18 -07:00
c649a5c5ab refactor(common): cleanup directives 2016-09-09 14:30:18 -07:00
53f0c2206d fix(forms): rename validator change fn due to conflict (#11492)
Closes #11479
2016-09-09 14:09:11 -07:00
0bce3907b8 fix(tests): add missing import (#11490) 2016-09-09 14:08:47 -07:00
2170379251 refactor(common): cleanup, strip deprecated doc (#11469) 2016-09-09 12:05:06 -07:00
5a4e46db20 refactor(tests): simplify code (#11485) 2016-09-09 12:04:38 -07:00
f5d44a42c9 refactor(NgClass): cleanup, readability (#11467) 2016-09-09 12:03:51 -07:00
673de004d2 fix(forms): clear errors on disable (#11463)
Closes #11287
2016-09-09 12:00:38 -07:00
f386cb4ba9 Fix benchpress for newest protractor and selenium (#11451)
* chore: update protractor and selenium-webdriver packages

As `karma-jasmine` has a peer dependency on `jasmine-core@2.3`, but `jasmine` and `protractor` are using `jasmine-core@2.4` we need to add `jasmine-core@2.3` explicitly. Previously, the peer dependency was
satisfied by accident because npm deduped the dependency
for `jasmine-core@2.3` as top level dependency.

Note that the shrink-wrap files changes quite a bit because
of the deduping mechanism of npm.

* fix(benchpress): make it work with latest protractor and seleniuv-webdriver

* fix(e2e_tests): make them work with latest protractor
2016-09-09 10:37:47 -07:00
71e9cae1d0 chore(github): update issue template to hide comments (#11473)
Wrap additional descriptions in comments so that they are hidden in created issues (only visible during editing)
2016-09-09 09:36:53 -07:00
df6762a170 docs(TestBed): Fix to current packageing (#11472) 2016-09-09 09:36:38 -07:00
d296298282 fix(build): prevent package tsconfigs from shadowing main tsconfig (#11454) 2016-09-08 15:01:22 -07:00
077e0be1e7 fix(CssSelector): fix getMatchingElementTemplate() for void tags
fixes #11407
2016-09-08 13:55:41 -07:00
a52d076912 refactor(CssSelector): misc 2016-09-08 13:55:41 -07:00
dae7cfc454 chore(github): update pull request template fix link (#11449)
Fix the link to the contribution guildelines -  commit message guidlines
2016-09-08 13:54:30 -07:00
436af15d63 refactor: remove parseFloat from facades (#11446) 2016-09-08 13:54:10 -07:00
7b24028437 fix(forms): fix disabled support for empty form containers (#11427)
Closes #11386
2016-09-08 12:21:48 -07:00
6a2bbffe10 fix(animations): allow group() to be used as entry point for an animation trigger (#11419)
Closes #11312
Closes #11419
2016-09-08 12:20:07 -07:00
f78e184822 docs(FactoryProvider): add missing backtick (#11444) 2016-09-08 09:18:37 -07:00
78ad9adc1a fix(ShadowCss): fix perf regression (#11420)
fixes #11371
2016-09-07 16:48:10 -07:00
9e2ec7a1aa fix(ngc): use the compilerHost to detect file existence (#11418) 2016-09-07 16:24:52 -07:00
643afa4b15 docs(cheatsheet): fix typo NgModule definition (#11377)
`.Class` and not `.class` in js approach for NgModule definition.
2016-09-07 16:05:05 -07:00
ed2ebeb52a fix(build): test example directories with unit and e2e tests (#11296) 2016-09-07 16:04:33 -07:00
567900e550 chore(github): update issue template (#11415) 2016-09-07 14:10:47 -07:00
cc958c74ad docs(router): Fix typo of segment name and odd quote (#11409) 2016-09-07 14:10:19 -07:00
62af613741 chore: update triage and labels process (#11403) 2016-09-07 14:10:01 -07:00
3ff816afa6 style(CompileMetadataResolver): better error message (#11401) 2016-09-07 14:09:25 -07:00
dd03bf12e1 docs: misc fixes.
docs(common_module): Fix macro format
docs(number_pipe): Add missing period sign
docs(date_pipe): Fix suffix consistency
docs(date_pipe): Fix missing quote
docs(number_pipe): Fix incorrect article

Looks like the word "Polyfill" does not start with a vowel pronunciation.

docs(location_strategy): Fix code format

Add missing \`\`\` at start.

docs(i18n_plural_pipe): Fix code format
docs(location): Add missing period sign
refactor(ngSwitch): fix typo on parameter
docs(di): Add missing quote
docs(compiler): Fix typo
docs(compiler): Add missing period sign
docs(directives): Fix description for styles parameter
docs(location_strategy): Add code language

Revert for misunderstanding.
2016-09-06 15:45:37 -07:00
645108f25b test: cleanup playground/src/bootstrap.ts file 2016-09-06 15:35:10 -07:00
882efd125e build: remove obsolete presubmit.sh script 2016-09-06 15:35:10 -07:00
d91e92c2f5 build(test.sh): clear dist directory when the script starts
This is to prevent stale files causing the tests to fail when we run them locally after checking out a new revision.
2016-09-06 15:35:10 -07:00
8858ebc4ab ci: update SauceLabs badge when running CI on master (#11352) 2016-09-06 12:07:48 -07:00
df4c0a3d1f refactor(benchmarks): align tree benchmark with largetable benchmark
- add ng2_switch benchmark to track `ngFor` over `ngSwitch`
- measure create only, createDestroy and update
- simplify the created dom
- always add a style binding
2016-09-06 12:07:12 -07:00
b4363bc8af feat(benchmarks): add targetable benchmarks back 2016-09-06 12:07:12 -07:00
d26a827494 fix(lazy-loading): fix an issue with webpack and lazy loader. (#11387)
The issue was introduced in PR#11049.
2016-09-06 12:06:18 -07:00
ea95c391c1 fix(compiler): error when NgModule.bootstrap contains undefined or null 2016-09-06 11:44:56 -07:00
aa9b617c9d fix(compiler): correctly type event handler proxy functions 2016-09-06 11:44:56 -07:00
7192fec841 refactor(EventManager): remove ListWrapper (#11363) 2016-09-06 11:23:00 -07:00
ee88c3c976 fix typo (#11265)
meesage => message
2016-09-06 10:26:51 -07:00
1ff0add29e docs(CHANGELOG): fix provider syntax (#11258)
fixes #11256
2016-09-06 10:26:20 -07:00
5ee0f09b92 build: update the symlinks scripts for Windows to new packaging (#11192) 2016-09-06 10:25:59 -07:00
70b0ab457b style(dom_renderer): use const (#11229) 2016-09-06 10:25:16 -07:00
c25d1f7ecc test: reactivate the remaining disabled tests in Edge (#11188)
Fixes #4756
2016-09-06 10:24:48 -07:00
a45769a0a2 test(offline_compiler_test.sh): lock down npm dependencies 2016-09-02 15:58:46 -07:00
109dc99d32 build(npm): remove obsolete npm dependencies
I also removed an obsolete bundling script which depended on systemjs-builder that I removed.
2016-09-02 15:58:46 -07:00
2371d22d49 chore: remove obsolete dart related files 2016-09-02 15:58:46 -07:00
6f4b6edfea chore(git): cleanup .gitignore
all obsolete paths have been removed
2016-09-02 15:58:46 -07:00
8c09933803 fix(forms): support rebinding nested controls (#11210) 2016-09-02 15:57:35 -07:00
d309f7799c fix(DomSchema): add missing elements
fixes #11219
2016-09-02 15:35:36 -07:00
93deff6c33 refactor(DomSchema): improve readability by making the schema more explicit using interface names 2016-09-02 15:35:36 -07:00
c31535982c fix(ngc): prepend a rootDir when assuming a file exists (#11291)
Otherwise we'll later try to resolve the file under one of the rootDirs and won't find it.
2016-09-02 14:52:14 -07:00
f5101782d9 docs(router): Fixed examples for router.navigate (#11263) 2016-09-02 13:42:51 -07:00
5e5ae3cde6 fix(ngc): propagate errors to main (#11214) 2016-09-01 16:54:37 -07:00
53cf71430f build(publish): shallow fetch to improve perfs (depth=1) 2016-09-01 16:53:51 -07:00
04d02b55d1 build(publish): replace version placeholders in .min.js files 2016-09-01 16:53:51 -07:00
043493cb62 fix(forms): disabled controls should never be invalid (#11257)
Closes #11253
2016-09-01 16:51:42 -07:00
2581c0851a feat(benchmarks): add incremental-dom version of deep tree benchmark 2016-09-01 14:13:33 -07:00
27d72e87c3 feat(benchmarks): add baseline for deep tree that only used createElement 2016-09-01 14:13:33 -07:00
eef4c22e87 feat(benchmarks): add static tree benchmark 2016-09-01 14:13:33 -07:00
4287f1716d chore: add incremental-dom as dev dependency 2016-09-01 14:13:33 -07:00
ebc8e808a9 feat(router): register NgModuleFactory objects. (#11211)
When lazily loading code, users need to be able to get hold of the
NgModuleFactory. For SystemJS environments, the SystemJS registry serves
this purpose. However other environments, such as modules compiled with
Closure compiler, do not expose exports object or a path based registry.

For these environments, `@NgModule` objects can include an identifier, and
the loading code can then pass `loadModule(id).then(() =>
getNgModule(id))` to the router.
2016-09-01 13:46:08 -07:00
c9e5b599e4 fix(animations): ensure parent animations are triggered before children (#11201) 2016-09-01 13:24:26 -07:00
e42a057048 docs(cheatsheet): complete the copy edit (#11215)
…and general cleanup of the cheatsheet.
2016-09-01 12:06:42 -07:00
0bb94df1da docs(core): docs fixes (#11212) 2016-09-01 11:45:59 -07:00
50e171c09b docs(CHANGELOG): add missing animation feature for RC6 (#11216) 2016-09-01 11:40:36 -07:00
96697029c9 docs(changelog): small fixes 2016-08-31 22:26:31 -07:00
7c3b1367bc docs(changelog): add notes about required SystemJS and Karma config changes 2016-08-31 22:23:54 -07:00
18be339ee9 chore: upgrade chrome to v53 (#11213) 2016-08-31 16:59:17 -07:00
ddda62b1f2 docs(router): add changelog for 3.0.0-rc.2 2016-08-31 16:55:18 -07:00
0ddae9b727 chore(release): bump Angular version to 2.0.0-rc.6 in package.json 2016-08-31 16:49:14 -07:00
625b105d3a docs(changelog): add changelog for 2.0.0-rc.6 2016-08-31 16:49:14 -07:00
f9eb1f33f4 fix(platform-webworker): remove trailing comma in package.json 2016-08-31 16:49:14 -07:00
046c1a8a25 fix(compiler-cli): update package.json to tsc-wrapped@0.3.0 2016-08-31 16:49:14 -07:00
08e48c8f73 fix(router): correct peerDependencies info in package.json 2016-08-31 16:49:14 -07:00
1b5e2b5129 test: add Intl polyfill and run Intl tests in all browsers (#10471) 2016-08-31 15:55:13 -07:00
562c8263dc fix(animations): ensure animation callbacks are fired for embedded views 2016-08-31 15:46:23 -07:00
99c0a7fae2 fix(tsc-wrapped): correct the tsickle dependency in package.json 2016-08-31 15:10:09 -07:00
f4f6f4b4d8 fix(core): don't require reflect-metadata shim when in AOT mode 2016-08-31 15:10:09 -07:00
cc89ef6c8c fix(core): report errors for missing di tokens correctly (#11209) 2016-08-31 14:47:56 -07:00
6ea5b05e7c refactor(benchmarks): make setup nicer
- simplify and correct systemjs config
- remove deep imports into Ng2 packages to work with bundles
- have separate Ng2 and Polymer bootstrap files
2016-08-31 11:24:22 -07:00
f7b5478e9f feat(benchmarks): add polymer_leaves benchmark 2016-08-31 08:24:11 -07:00
873233e825 feat(benchpress): also report the statistics in the generated file 2016-08-31 08:24:11 -07:00
942104d9ac fix(benchpress): support chrome 52
Without this fix, the `scriptTime` was always 0.
2016-08-31 08:24:10 -07:00
6dceaf209d fix(benchmarks): recreate setup for running benchmarks 2016-08-31 08:24:10 -07:00
2ab07d9418 chore: cleanup stale protractor files 2016-08-31 08:24:10 -07:00
1ef122988e fix(benchpress): make code compile and unit tests green again 2016-08-31 08:24:10 -07:00
db280fc67e chore: move benchpress to @angular/benchpress 2016-08-31 08:24:09 -07:00
ef0f29c372 fix: merge artifact 2016-08-30 21:37:28 -07:00
1818056912 fix(TemplateParser): disallow event-property binding even with the NO_ERRORS_SCHEMA
closes #11026
2016-08-30 21:32:24 -07:00
1df69cb4d2 fix(DomSchemaRegistry): detect invalid elements 2016-08-30 21:32:03 -07:00
2b20db6c5a chore: update to typescript@2.0.2 - the currect 2.0 rc 2016-08-30 21:07:45 -07:00
174c016104 fix(bundles): correct RxJS mapping in rollup config for umd/es5 bundles 2016-08-30 21:07:45 -07:00
71ae2c4525 refactor(webworkers): move webworkers to separate @angular/platform-webworker and @angular/platform-webworker-dynamic packages
BREAKING CHANGE: web worker platform is now exported via separate packages.

Please use @angular/platform-webworker and @angular/platform-webworker-dynamic
2016-08-30 21:07:45 -07:00
0f68351979 fix(Router): fix type (#11181) 2016-08-30 21:06:38 -07:00
c74a438f0c docs(router): fix up the exampesd 2016-08-30 20:37:35 -07:00
c350ba29f6 fix(router): do not use rx/add/operator 2016-08-30 20:37:35 -07:00
6e40ef0f6d refactor: remove requestAnimationFrame from polyfills and platforms (#10528) 2016-08-30 19:58:22 -07:00
24e046fd6a ci(publish): fix multiples umd files (#11179) 2016-08-30 19:58:07 -07:00
979657989b fix(packages): use ES modules for primary build (#11120) 2016-08-30 18:07:40 -07:00
8cb1046ce9 docs(cheatsheet): copy edit bootstrapping.md (#11149)
Also remove Dart-specific code, since the Dart cheatsheet is produced
from dart-lang/angular2.
2016-08-30 08:32:51 -07:00
d53a898f46 edit dependency-injection.md (#11156)
No copy edits to this one, but I removed Dart-specific code, since the
Dart cheatsheet is produced from dart-lang/angular2.

Part of a group of cheatsheet PRs (see #11149).

cc @Foxandxss & @IgorMinar
2016-08-29 18:13:35 -07:00
f9f80003c8 docs(cheatsheet): copy edit class-decorators.md (#11154)
No copy edits to this one, but I removed Dart-specific code, since the
Dart cheatsheet is produced
from dart-lang/angular2.
2016-08-29 18:13:10 -07:00
d59ee3caaa docs(cheatsheet): copy edit component-configuration.md (#11155)
Also remove Dart-specific code, since the Dart cheatsheet is produced
from dart-lang/angular2.

Part of a group of cheatsheet PRs (see #11149).

cc @Foxandxss & @IgorMinar
2016-08-29 18:12:51 -07:00
b8ea71afb6 docs(cheatsheet): copy edit built-in-directives.md (#11153)
Also remove Dart-specific code, since the Dart cheatsheet is produced
from dart-lang/angular2.
2016-08-29 18:12:42 -07:00
e2241a2f92 fix(router): support guards navigating synchronously (#11150) 2016-08-29 17:51:38 -07:00
e8a1566065 fix(forms): support radio buttons with same name but diff parent (#11152)
Closes #10065
2016-08-29 17:49:42 -07:00
d2ad871279 fix(forms): update validity when validator dir changes
closes #11116
2016-08-29 13:12:46 -07:00
0b665c0ece feat(validations): add support to bind validation attributes
This change enables to bind the validations attributes `required`,
`minlength`, `maxlength` and `pattern`.

Closes: #10505, #7393
2016-08-29 13:12:20 -07:00
875e66409c fix(closure): prevent closure renaming of testability interface (#11146) 2016-08-29 13:08:28 -07:00
d7de5c4f8e refactor(compiler): replace CompileIdentifierMap with regular Map
closes #11145

Also rename `CompileIdentifierMetadata.runtime` into `CompileIdentifierMetadata.reference`.

Also remove `CompileIdentifierMetadata.equalsTo` as
now it is enough to just check the `reference` fields for equality.
2016-08-29 12:45:27 -07:00
51877ef4ed fix(compiler): no longer uses assetCacheKey for token identity.
Fixes #10545, Fixes #10538
2016-08-29 12:45:02 -07:00
c377e80670 chore: format benchmarks
closes #11112
2016-08-29 12:43:25 -07:00
61002733bc refactor(benchmarks): make tree benchmark work again 2016-08-29 12:42:57 -07:00
5ff14de1f3 chore: force lf EOL for ts files (#11143) 2016-08-29 12:41:58 -07:00
38069aba35 fix(compiler): make ShadowCSS shim work on Android browser (#11139)
Fixes #11123
2016-08-29 08:18:55 -07:00
7dee1ee4cf test(core): update ErrorHandler tests to handle browsers without stack (#11141)
Fixes #11114
2016-08-29 08:17:45 -07:00
af63378fa0 fix(ShadowCss): properly shim selectors after :host and :host-context (#10997)
fixes #5390

Before the change:

    // original CSS
    :host .foo .bar {...}
    .foo .bar {...}

    // translated to 
    [_nghost-shh-2] .foo .bar {...}
    .foo[_ngcontent-shh-2] .bar[_ngcontent-shh-2] {...}

Note that `.foo` and `.bar` where not scoped and would then apply to nested components.

With this change those selectors are scoped (as they are without  `:host`).

You can explicitly apply the style to inner component by using `>>>` or `/deep/`: `:host >>> .foo`
2016-08-26 16:11:57 -07:00
abad6673e6 fix(ngc): don't quote properties in literal maps (#11110)
Closure compiler treats quoted properties specially, and doesn't rename them.

Fixes #11050
2016-08-26 15:54:34 -07:00
75553200c0 fix(http): encode correct value for %3D (#9790) 2016-08-26 15:47:29 -07:00
6c77d7182a fix(compiler-cli): make ngc to work on Windows (#10919)
Fixes #10792
2016-08-26 15:41:50 -07:00
4a44832114 fix(UrlParser) stop setting default value 'true' (matrix params) (#10946)
This was already fixed recently for query params in #10399.
2016-08-26 15:41:32 -07:00
27539c8b80 refactor(example): refactor forward_ref example into a spec and unignore example specs (#11088) 2016-08-26 15:40:46 -07:00
e220a80093 feat(codegen): Add an error message when the locale is not provided (#11104) 2016-08-26 15:38:48 -07:00
3dd85cb7f1 test(tools): make the test suite to pass on Windows (#10926) 2016-08-26 15:36:04 -07:00
511fe3d9f8 chore(contributing): remove documentation note (#11108) 2016-08-26 15:35:33 -07:00
9ce8ef76bf fix(ErrorHandler): make rethrowError internal so that the interface can be implemented (#11109) 2016-08-26 14:43:42 -07:00
7c07bfff97 fix(errors): [2/2] Rename Exception to Error; remove from public API
BREAKING CHANGE:

Exceptions are no longer part of the public API. We don't expect that anyone should be referring to the Exception types.

ExceptionHandler.call(exception: any, stackTrace?: any, reason?: string): void;
change to:
ErrorHandler.handleError(error: any): void;
2016-08-26 10:37:17 -07:00
86ba072758 fix(errors): [1/2] Rename Exception to Error; remove from public API 2016-08-26 10:37:17 -07:00
fc1e45db92 fix(Router): merge artifacts
closes #11063
closes #11102
2016-08-26 10:32:35 -07:00
a2deafc50f fix(router): add an option to disable initial navigation 2016-08-26 10:32:35 -07:00
2fc5c57b31 feat(router): add support for custom error handlers 2016-08-26 10:32:35 -07:00
93f323cfa2 refactor(router): make RouterLink and RouterLinkWithHref create url in a similar way 2016-08-26 10:32:35 -07:00
bb9dfbc578 fix(router): use encodeUri/decodeUri to encode fragment 2016-08-26 10:32:35 -07:00
0bb516fae2 fix(router): fix the order of guards, so canActivateChild runs before canActivate 2016-08-26 10:32:35 -07:00
2ffecc0e14 fix(router): update the location before activating components 2016-08-26 10:32:35 -07:00
b9647b7347 fix(i18n): change default locale from en_US to en-US (#11103) 2016-08-26 10:30:10 -07:00
f25c97671a fix(compiler): handle invalid host bindings and events (#11101) 2016-08-26 10:29:53 -07:00
0a053a4cd5 fix(i18n): Currency/Date/Number pipe use injected locale (#11093) 2016-08-26 09:16:01 -07:00
4d7d2a2daa refactor: remove various leftover unused or deprecated code (#11091) 2016-08-26 09:12:27 -07:00
0cf5ece7f8 build: workaround to run presubmit.sh on Windows (#11096) 2016-08-26 09:12:10 -07:00
66df335998 chore(dependencies): switch from es6-shim to core-js (#10884) 2016-08-25 17:28:36 -07:00
fc2fe00d16 fix(compiler): allow tsc-wrapped to be compile with TypeScript 2.0 (#11086) 2016-08-25 17:28:20 -07:00
811962b2bb refactor: rename SanitizationService to Sanitizer and DomSanitizationService to DomSanitizer (#11085)
BREAKING CHANGE: Previously inconsistently named APIs SanitizationService and DomSanitizationService were renamed to Sanitizer and DomSanitizer
2016-08-25 15:41:19 -07:00
b867764b0d refactor(template): remove supporter deprecated var / # (#11084)
BREAKING CHANGES:

- `#` and `var` are not supported any more in expressions, use `let`,
- `var-<name>` could not be used any more on templates, use `let-<name>`,
- `var-<name>` could not be used any more to create a reference, use `ref-<name>`.
2016-08-25 15:21:33 -07:00
ce08982f78 fix(forms): fix conflicting getter name (#11081) 2016-08-25 14:56:31 -07:00
cbe0976426 test: improve perfs by removing unneeded TestBed.compileComponents() calls (#11083) 2016-08-25 14:56:14 -07:00
515ff61fcb fix(forms): fully support rebinding form group directive (#11051) 2016-08-25 14:37:57 -07:00
d7c82f5c0f test: fix memory leak when running test campaign (#11072) 2016-08-25 14:37:46 -07:00
566d4361e2 refactor: remove obsolete analyzeAppProvidersForDeprecatedConfiguration
closes #11028
2016-08-25 13:29:43 -07:00
ea2e5521e8 refactor: replace any[] with Provider[] where possible 2016-08-25 13:29:03 -07:00
eb7d8c702c fix(core): FactoryProvider's deps property should be optional 2016-08-25 13:29:03 -07:00
5d294624fa docs(core): update stability markers for core apis 2016-08-25 13:29:03 -07:00
3aaf064d11 refactor(router): remove ROUTER_DIRECTIVES which were replaced by RouterModule 2016-08-25 13:29:03 -07:00
f38a700e35 docs(upgrade): mark upgrade apis as stable 2016-08-25 13:29:03 -07:00
501b83441d refactor(forms): remove FORM_PROVIDERS, FORM_DIRECTIVES, REACTIVE_FORM_PROVIDERS, REACTIVE_DIRECTIVES
All of these have been replaced by FormsModule and ReactiveFormsModule.
2016-08-25 13:29:03 -07:00
c03e25a7b7 docs(common): mark platform-browser and platform-browser-dynamic apis stable 2016-08-25 13:29:03 -07:00
1f5a5895e5 refactor(common): rename UrlChangeEvent and UrlChangeListener to LocationChangeEvent and LocationChangeListener
These apis are not expected to be used anyone, hence I'm not documenting this change as a breaking.
2016-08-25 13:29:03 -07:00
8a2324f86a docs(common): mark all common apis except for i18n as stable 2016-08-25 13:29:03 -07:00
6335b31702 refactor(common): remove COMMON_DIRECTIVES, COMMON_PIPES, CORE_DIRECTIVES that were replace with CommonModule 2016-08-25 13:29:03 -07:00
6ef7a76e39 doc(form): updating example to avoid "TypeError: Converting circular structure to JSON" (#10184) 2016-08-25 11:14:40 -07:00
cc79dcac7f docs(cheatsheet): update javascript sections (#11070) 2016-08-25 11:12:23 -07:00
dc6f72e963 fix(closure): replace property accesses (#11078)
Accessing a property on the window object must be done with square brackets.
Otherwise closure compiler may collide the symbol's alias between the property
and variable mappings.
Also, accessing the 'provide' property must be done with dot syntax, so that
it can be renamed along with the code that declares such a property.
2016-08-25 11:12:06 -07:00
2b313e4979 feat(forms): add support for disabled controls (#10994) 2016-08-24 16:58:43 -07:00
4f8f8cfc66 feat(animations): make sure animation callback reports the totalTime (#11022)
Closes #11022
2016-08-24 16:55:00 -07:00
8b782818f5 feat(linker): Allow configurable module prefixes and suffixes. (#11049) 2016-08-24 16:54:42 -07:00
bd510ccdbb fix(core): assigns an overriden name to constructor named constructor (#11043)
Fixes #10545
2016-08-24 10:21:13 -07:00
f1ce7607a6 fix(router): canLoad should cancel a navigation instead of failing it (#11001) 2016-08-24 10:20:44 -07:00
7dfcaac730 fix(http): restructure exports so that we don't leak private factory functions (#11016)
Ref #10615
2016-08-23 16:34:57 -07:00
c7a874dd2f feature(ngc): allow codegen to skip over .d.ts inputs (#11021) 2016-08-23 16:26:35 -07:00
aa5c8ca61f fix(compiler): throw descriptive error meesage for invalid NgModule providers (#10947)
Fixes #10714
2016-08-23 16:18:41 -07:00
5c93a8800a fix(core): Share private types through an exported interface. (#11009)
Instead of using declare namespace to share the types. This allows the generated code to be compiled with closure with full optimizations.
2016-08-23 16:18:11 -07:00
05bbb8efcf fix(platform-browser): remove export for private symbol _WORKER_UI_PLATFORM_PROVIDERS. (#11018) 2016-08-23 16:16:40 -07:00
14a30f3ca0 fix(compiler): Correctly handles references to static methods (#11013)
Fixes: #10975
2016-08-23 11:58:12 -07:00
5ddecb18a7 feat(router): throw a helpful error when misusing forRoot() from a lazy module. (#10996) 2016-08-23 11:57:58 -07:00
c02325dd06 docs(DatePipe): add AM/PM designator in description #10998 2016-08-23 11:57:41 -07:00
4a740f23a4 refactor(core): remove deprecated @Component.directives and @Component.pipes
BREAKING CHANGE: previously deprecated @Component.directives and @Component.pipes support was removed.

All the components and pipes now must be declarated via an NgModule. NgModule is the basic
compilation block passed into the Angular compiler via Compiler#compileModuleSync or #compileModuleAsync.

Because of this change, the Compiler#compileComponentAsync and #compileComponentSync were removed as well -
any code doing compilation should compile module instead using the apis mentioned above.

Lastly, since modules are the basic compilation unit, the ngUpgrade module was modified to always require
an NgModule to be passed into the UpgradeAdapter's constructor - previously this was optional.
2016-08-23 09:59:00 -07:00
a782232ca3 refactor(core): fix typo in private property name 2016-08-23 09:59:00 -07:00
a29f9f3ab8 refactor(core/testing): remove deprecated TestComponentBuilder
BREAKING CHANGE: deprecated TestComponentBuilder was removed, please use TestBed instead
2016-08-23 09:59:00 -07:00
3c2b2ff332 test: fix existing tests by removing usage of obsolete stuff like component level directives, AsyncCompleter and TestComponentBuilder 2016-08-23 09:59:00 -07:00
939d318242 refactor(platform-browser-dynamic): Removed TestComponentBuilder from ResourceLoaderCache specs (#10890) 2016-08-23 09:22:33 -07:00
39a2c39cef feat(compiler): Added "strictMetadataEmit" option to ngc (#10951)
ngc can now validate metadata before emitting to verify it doesn't
contain an error symbol that will result in a runtime error if
it is used by the StaticReflector.

To enable this add the section,

  "angularCompilerOptions": {
    "strictMetadataEmit": true
  }

to the top level of the tsconfig.json file passed to ngc.

Enabled metadata validation for packages that are intended to be
used statically.
2016-08-22 17:37:48 -07:00
45e8e73670 refactor(animations): deport TCB away from animation-land forever (#10892)
* feat(animations): support animation trigger template callbacks

* refactor(animations): deport TCB away from animation-land forever
2016-08-22 17:18:25 -07:00
ca41b4f5ff feature(core): update RxJS to 5.0.0-beta.11 (#10648) 2016-08-22 17:17:23 -07:00
3c561475c8 refactor(animations): add an onStart handler for AnimationPlayer (#10360) 2016-08-22 16:39:52 -07:00
23a27776e2 chore: upgrade zone.js to v0.6.17 (#10989) 2016-08-22 16:24:21 -07:00
01111b04ff fix(ngc): codegen allows --strictNullChecks (#10991) 2016-08-22 15:30:18 -07:00
8560e1e4bf fix(ngc): comment out a private keyword in codegen. (#10949)
Workaround for b/30775898
2016-08-22 14:28:09 -07:00
e0fbca9fb0 feat(ngc): support pathmapping using a separate reflector (#10985)
Until we have comprehensive E2E tests, it's too risky to change the
reflector_host Misko wrote before final. But google3 uses path mapping
and needs all imports to be  and all paths to be canonicalized to
the longest rootDir.

This change introduces a subclass of ReflectorHost with overrides for methods
that differ. After final (or when we have good tests), we'll refactor
them back into one class.
2016-08-22 11:48:33 -07:00
a7b76826a0 fix(compiler): Only emit metadata for exported enums (#10957)
Closes: #10955
2016-08-22 10:26:22 -07:00
ece7985b8a chore(formatting): fix formatting for component fixture spec (#10986) 2016-08-22 10:20:21 -07:00
9883e19e2e fix(tests): remove fit in component_fixture_spec (#10961) 2016-08-19 17:12:58 -07:00
c631cfc2fd feat(core): add NO_ERRORS_SCHEMA that allows any properties to be set on any element (#10956)
Often it is useful to test a component without rendering certain directives/components
in its template because these directives require some complicated setup.

You can do that by using NO_ERRORS_SCHEMA.

TestBed.configureTestingModule({
  schemas: [NO_ERRORS_SCHEMA]
});

This would disable all schema checks in your tests.
2016-08-19 16:05:34 -07:00
53c99cfc95 feat(router): add syntax sugar for confuguring RouterTestingModule (#10906) 2016-08-19 16:01:59 -07:00
c56f3f2246 fix(compiler): do not autoinclude components declared as entry points (#10898) 2016-08-19 15:59:50 -07:00
cc0e3d2296 docs(router): Added additional router documentation including cheatsheet updates (#10802) 2016-08-19 15:48:09 -07:00
917d43e108 refactor(tests): add ComponentFixture tests (#10910)
Remove old TestComponentBuilder tests, and keep relevant
ComponentFixture tests as component_fixture_spec.
2016-08-19 15:46:40 -07:00
bb7d55244d fix(zones): bump zone version to 0.6.15 (#10953)
This fixes issues with microtasks being called too early
in certain tests.
2016-08-19 14:35:26 -07:00
8a5eb08672 fix(fakeAsync): have fakeAsync use Proxy zone. (#10797)
Closes #10503

It is possible for code in `beforeEach` to capture and fork a zone
(for example creating `NgZone` in `beforeEach`). Subsequently the code
in `it` may chose to do `fakeAsync`. The issue is that because the
code in `it` can use `NgZone` from the `beforeEach`. it effectively can
escape the `fakeAsync` zone. A solution is to run all of the test in
`ProxyZone` which allows a test to dynamically replace the rules at any
time. This allows the `beforeEach` to fork a zone, and then `it` to
retroactively became `fakeAsync` zone.
2016-08-19 12:10:53 -07:00
477e425f57 fix(http): inline HTTP_PROVIDERS and JSONP_PROVIDERS until the metadata collector can do it automatically. (#10928) 2016-08-18 15:01:07 -07:00
654ff6115a fix(http): deep copy for constructor using existing Headers (#10679)
When creating a new Headers object using an existing Headers object
the existing Headers map is copied by reference. Therefore adding a
new Header value to the new Headers object also added this value to
the existing Headers object which is not in accordance with the
spec.
This commit alters the constructor to create a deep copy of existing
Headers maps and therefore unlink existing Headers from new Headers.

Closes #6845

BREAKING CHANGE: 

any code which relies on the fact that a newly
created Headers object is referencing an existing Headers map is
now broken, but that should normally not be the case since this
behavior is not documented and not in accordance with the spec.
2016-08-18 15:00:44 -07:00
628d06c17c feat(core): Throw a descriptive error when BrowserModule is installed a second time (via lazy loading). (#10899)
Such a configuration is unsupported and causes all kinds of problems.
2016-08-18 13:34:28 -07:00
91980382e8 fix(pipes): remove bidi control chars (#10870)
Fix inconsistent results in Edge vs. other browsers.

Closes #10080.
2016-08-18 13:31:33 -07:00
2f41b5c8a0 refactor(core): Removed test deprecated references from runtime_compiler (#10927)
Removed reference to TestComponentBuilder from runtime_compiler_spec.ts
2016-08-18 11:20:02 -07:00
cd8cbd3762 fix(ngc): don't codegen foo.d.ngfactory.ts from foo.d.ts (#10833) 2016-08-18 10:11:06 -07:00
292ccf882a test(forms): update reactive form integration tests to use TestBed (#10908) 2016-08-17 17:10:56 -07:00
a0e13b9797 refactor(core): remove deprecated functions ReflectiveInjector.fromResolvedBindings and ResolvedReflectiveBinding (#10819) 2016-08-17 16:53:09 -07:00
a5c0349d88 refactor(core): Removed linker test references to TestComponentBuilder (#10903)
Removed references to TestComponentBuilder from:
  query_integration_spec.ts
  regression_integration_spec.ts
  security_integration_spec.ts
  view_injector_integration_spec.ts
2016-08-17 16:52:39 -07:00
c48021ab97 refactor(compiler): move test/test_bindings to testing/test_bindings (#10081)
`test_bindings` is used in core test cases too, but `test` should be
private to the package, so it should live in `testing`.
2016-08-17 16:37:31 -07:00
beb79e75bf refactor(various): remove a few lingering but unused deprecated apis (#10896)
Removes deprecated APPLICATION_COMMON_PROVIDERS, as well as some
internal apis that were deprecated.
2016-08-17 16:36:10 -07:00
0b62b6f783 refactor(debug): switch tests from TCB to use TestBed (#10756) 2016-08-17 16:27:54 -07:00
895c542a20 refactor(directiveLifecycle): switch test from TCB to use TestBed (#10768) 2016-08-17 16:17:07 -07:00
c4fd862e15 fix(metadata): throw better errors when components are passed to imports or modules are passed to declarations. (#10888)
Closes #10823
2016-08-17 15:57:02 -07:00
6f18bd18bb refactor(core): Removed linker test reference to TestComponentBuilder (#10867)
Removed TestComponentBuilder references from ng_container_integration_spect.ts
2016-08-17 15:45:29 -07:00
00e157dc3b refactor(router): update stability labels (#10902) 2016-08-17 15:35:30 -07:00
4be863c223 Remove TCB (#10900)
* refactor(webworker): change tests not to use TestComponentBuilder

* refactor(core): change tests not to use TestComponentBuilder
2016-08-17 15:05:22 -07:00
3009be8d6e docs(security): mark the various DomAdapters as unsafe. (#10868)
Part of #8511.
2016-08-17 13:42:18 -07:00
4829fbb95c refactor(core): Remove linker test references to TestComponentBuilder (#10869)
Removed TestComponentBuilder references from projection_integration_spec.ts
2016-08-17 11:19:38 -07:00
40e160c22c fix(platform-browser-dynamic): Rename CACHED_TEMPLATE_PROVIDER to RESOURCE_CACHE_PROVIDER (#10866)
* fix(platform-browser-dynamic): Rename CACHED_TEMPLATE_PROVIDER to RESOURCE_CACHE_PROVIDER

Closes #9741

BREAKING CHANGE:

`CACHED_TEMPLATE_PROVIDER` is now renamed to `RESOURCE_CACHE_PROVIDER`

Before:

```js
import {CACHED_TEMPLATE_PROVIDER} from '@angular/platform-browser-dynamic';
```

After:

```js
import {RESOURCE_CACHE_PROVIDER} from '@angular/platform-browser-dynamic';
```

* Rename XHR -> ResourceLoader
2016-08-17 09:24:44 -07:00
951ecb4d90 feat(core): update public api 2016-08-17 08:06:32 -07:00
9318033294 refactor(router): update router spec not to use TestComponentBuilder 2016-08-17 08:06:32 -07:00
4648b3e5de feat(testing): add TestBed.get 2016-08-17 08:06:32 -07:00
740e80492d refactor(core): update entry_components_integration_spec not to use TestComponentBuilder 2016-08-17 08:06:32 -07:00
cc22b051e3 refactor(core): update change_detection_integration_spec not to use TestComponentBuilder 2016-08-17 08:06:32 -07:00
75405ae0f5 refactor(core): update forward_ref_integration_spec not to use TestComponentBuilder 2016-08-17 08:06:32 -07:00
f12d51992d fix(animations): report errors for missing host-level referenced animations (#10650)
Closes #10650
2016-08-17 08:00:49 -07:00
6fd5bc075d chore(forms): update forms labels (#10873) 2016-08-17 07:44:39 -07:00
675e582ffd refactor(http): Removed deprecated HTTP_PROVIDERS and JSONP_PROVIDERS (#10864)
BREAKING CHANGE: previously deprecated HTTP_PROVIDERS and JSONP_PROVIDERS were removed; see deprecation notice for migration instructions.
2016-08-17 07:43:31 -07:00
0a22e8eefd refactor(core): Removing linker test references to TestComponentBuilder (#10865)
Removed references to TestComponentBuilder from integration_spec.ts
2016-08-17 07:15:35 -07:00
44a4814766 Update package.json (#10609)
Update compiler-cli dependencies to increment tsc-wrapped to 0.2.2. It appears this was missed in the rc5 release.
2016-08-16 19:40:25 -07:00
3c23238129 docs(ngFor): add documentation for ngForTrackBy (#10780)
* docs(ngFor): add documentation for ngForTrackBy

* wo/ prefix
2016-08-16 19:39:22 -07:00
916ed55d82 chore(docs): remove sentences for dart (#10781) 2016-08-16 19:38:49 -07:00
2451eb9ded docs(router): Explanation in code should be comment (#10790) 2016-08-16 19:38:23 -07:00
ed639784d4 docs(router): Fix mismatching of code and comment (#10791) 2016-08-16 19:37:53 -07:00
b77a3794b8 docs(changelog): added missing closing parenthesis (#10783) 2016-08-16 19:37:24 -07:00
73a9ee4a05 Remove component resolver (#10858)
* refactor(core): remove deprecated ComponentResolver

BREAKING CHANGE: deprecated ComponentResolver was removed

Please follow deprecation instruction and migrate your code to use ComponentFactoryResolver.

* refactor(common): remove deprecated NgSwitchWhen directive

BREAKING CHANGE: previously deprecated NgSwitchWhen directive was removed, use NgSwitchCase instead
2016-08-16 16:48:32 -07:00
9adf80385b fix(animations): remove deprecated trigger APIs (#10825)
BREAKING CHANGE: Animations defined using an at-symbol prefix that are
not property bound are now invalid.

```html
<!-- this is now invalid -->
<div @flip="flipState"></div>

<!-- change that to -->
<div [@flip]="flipState"></div>
```

BREAKING CHANGE: Animations that are not bound using the at-symbol
prefix using `animate-` must now be preixed using `bind-animate-`.

```html
<!-- this is now invalid -->
<div animate-flip="flipState"></div>

<!-- is valid now -->
<div bind-animate-flip="flipState"></div>
```

Closes #10825
2016-08-16 14:09:21 -07:00
a86c554a8e refactor(core/testing): remove deprecated ViewMetadata (#10837)
Note that this doesn't actually remove all uses, but makes them
private.
2016-08-16 13:59:06 -07:00
62078eee45 chore(tsconfig): emit decorator metadata so that tsc watch works with demos (#10863) 2016-08-16 13:53:04 -07:00
24e280a21a refactor(router): remove deprecated apis (#10658) 2016-08-16 13:40:28 -07:00
f7ff6c5a12 refactor(core): remove deprecated 'bootstrap' (#10831) 2016-08-16 11:15:01 -07:00
f6a7d6504c feat(i18n): xliff integration 2016-08-15 22:28:38 -07:00
96bf42261b fix(XmlHelper): declaration 2016-08-15 22:21:40 -07:00
72bb38f83b feat(i18n): xliff 2016-08-15 22:21:40 -07:00
4c9900dc3a refactor(testing): remove deprecated testing functions (#10832)
Remove TestComponentBuilder, addProviders, and withProviders. These
were deprecated in rc5 - see the changelog for update information.

Note - this does not actually remove the functions, but makes them
internal only. They will be removed from the codebase entirely
at a later time.
2016-08-15 21:40:37 -07:00
6b26102931 feat(router): extend support for lazy loading children (#10705) 2016-08-15 21:11:09 -07:00
bec5c5fdad refactor(Provider): remove deprecated provider/bind API (#10652)
Closes #9751

BREAKING CHANGE:

These forms of providers are no longer accepted:
  bind(MyClass).toFactory(...)
  new Provider(MyClass, toFactory: ...)

We now only accept:
  {provider: MyClass, toFactory: ...}
2016-08-15 19:37:42 -07:00
04c11bb749 test(forms): update template-driven form tests to use testbed (#10830) 2016-08-15 16:37:59 -07:00
3f5331be9d refactor(chore): remove deprecated NgZoneError (#10822)
BREAKING CHANGE: previously deprecated NgZoneError has been removed
2016-08-15 16:10:30 -07:00
48751cceae refactor(core): Removed deprecated Query and ViewQuery (#10820)
BREAKING CHANGE: previously deprecated Query and ViewQuery  were removed; see deprecation notice for migration instructions.
2016-08-15 16:07:55 -07:00
4a9745ef78 refactor(core): Remove deprecated DynamicComponentLoader (#10759)
BREAKING CHANGE: previously deprecated DynamicComponentLoader was removed; see deprecation notice for migration instructions.
2016-08-15 16:07:19 -07:00
acc0fe6cf9 refactor(TestBed): remove deprecated TestBed.reset 2016-08-15 14:07:54 -07:00
b238414984 refactor(core): remove previously deprecated SystemJsComponentResolver and SystemJsCmpFactoryResolver
BREAKING CHANGE: previously deprecated SystemJsComponentResolver and SystemJsCmpFactoryResolver have been removed.

Please follow deprecation instructions to migrate your code.
2016-08-15 14:07:54 -07:00
231ed69507 refactor(common): Remove uses of deprecated TestComponentBuilder. (#10754)
* ng_class_spec

* Working through ng_for_spec.

* Finishing up ng_for_spec.

* Finish the rest of the specs.

* Convert pipes tests.
2016-08-15 13:52:57 -07:00
60b10134df cleanup(platform): removed webworker and server deprecated apis (#10745) 2016-08-15 13:44:01 -07:00
73c0a9daaf fix(router): make routerLinkActiveOptions public (#10758) 2016-08-15 00:39:59 -07:00
398bbb6aa9 refactor(core): replace some for statements with map/reduce 2016-08-14 10:10:07 -07:00
05d1312306 refactor(core): Replace all var with const and let 2016-08-14 10:10:07 -07:00
bc6d1c87a6 fix(core): don't strip sourceMappingURL (#9664)
fix #9664
2016-08-14 10:10:07 -07:00
712c7d5c3b fix(datePipe): allow float for date pipe input (#10687) 2016-08-14 10:05:21 -07:00
e9479b30e8 refactor(OutputAst): BuiltinMethod.bind renamed to Bind (#10739) 2016-08-14 10:04:37 -07:00
7f6685e451 test(forms): refactor form model tests to three files (#10774) 2016-08-13 17:26:08 -07:00
ce4eae65a7 feat(i18n): provide LOCALE_ID and NgLocalization 2016-08-13 06:18:25 -07:00
4df48b202c fix(i18n): update NgLocalLocalization (#10771)
ref https://github.com/papandreou/node-cldr/issues/31
2016-08-13 05:43:36 -07:00
33ced7088f refactor(common): remove deprecated ReplacePipe (#10772)
BREAKING CHANGE: previously deprecated ReplacePipe was removed
2016-08-12 21:50:57 -07:00
3329977ec9 refactor(core): remove deprecated coreBootstrap and coreLoadAndBootstrap
BREAKING CHANGE: previously deprecated coreBootstrap and coreLoadAndBootstrap have been removed.

Please follow deprecation instructions to migrate your code.
2016-08-12 18:07:58 -07:00
f84c3fdc5f refactor(ApplicationRef): remove all previously deprecated ApplicationRef apis
BREAKING CHANGE: All previously deprecated ApplicationRef apis have been removed.

Please follow the deprecation instructions to migrate your code.
2016-08-12 17:59:30 -07:00
44e1b23813 refactor(PlatformRef): remove deprecated PlatformRef#registerDisposeListener, #disposed, #dispose()
BREAKING CHANGE: previously deprecated PlatformRef#registerDisposeListener, #disposed, #dispose() - follow deprecation instructions to upgrade
2016-08-12 17:59:30 -07:00
12b0a3d0e5 refactor(NgUpgrade): remove deprecated addProvider
BREAKING CHANGE: previously deprecated UpgradeAdapter#addProvider was removed, see deprecation notice for migration instructions.
2016-08-12 17:59:30 -07:00
d2825077b1 fix(core): Removed depricated disposePlatform
BREAKING CHANGE: previously deprecated disposePlatform was removed; see deprecation notice for migration instructions.
2016-08-12 17:52:13 -07:00
156a52e390 refactor(core): Removed deprecated properties and events from metadata (#10753)
BREAKING CHANGE: previously deprecated DirectiveMetadataType#properties and DirectiveMetadataType#events were removed; see deprecation notice for migration instructions.
2016-08-12 17:44:44 -07:00
bb7221f922 refactor(facade): Removed unnecessary override and deprecation. (#10761) 2016-08-12 17:41:12 -07:00
2eb4ee8393 refactor(core): Removed depricated lockRunMode (#10763)
BREAKING CHANGE: previously deprecated lockRunMode was removed; see deprecation notice for migration instructions.
2016-08-12 17:40:22 -07:00
87fe47737a fix(testing): override metadata subclasses properly (#10767)
This fixes an issue where `TestBed.overrideComponent(MyComp, {})`
would remove some properties including `providers` from the component.

This was due to the override not properly dealing with getter fields
on subclasses.
2016-08-12 17:39:33 -07:00
9317056138 fix(ngc): Revert "fix(ngc): add an option to produce TS1.9-pathMapping imports (#10602)" (#10765)
This reverts commit beadf6167a.
2016-08-12 17:38:29 -07:00
a235ae16ed refactor(core): Removed deprecated DebugNode.inject() (#10751)
BREAKING CHANGE: previously deprecated DebugNode#inject was removed, see deprecation notice for migration instructions.
2016-08-12 15:57:23 -07:00
79afcf0766 fix(forms): remove deprecated form provider functions (#10741)
BREAKING CHANGE:

The deprecated `provideForms()` and `disableDeprecatedForms()` functions have been removed. Please import the `FormsModule` or the `ReactiveFormsModule` from @angular/forms instead.
2016-08-12 15:32:47 -07:00
161a4dd15f feat(i18n): Add NgLocaleLocalization which returns plural cases given a locale (#10744) 2016-08-12 14:46:06 -07:00
6580d67875 feat(i18n): pass translation config directly into ngc (#10622) 2016-08-12 14:45:36 -07:00
04c6b2fe85 fix(router): location changes and redirects break the back button (#10742) 2016-08-12 14:30:51 -07:00
203b2ba637 fix(http): expose jsonpFactory for AoT compilation (#10730) 2016-08-12 11:30:12 -07:00
5b99b8c18a test: add Blob and FormData polyfills for testing in IE9 (#10563) 2016-08-12 10:35:19 -07:00
6a011f4e8e test(security): work around an escaping bug in IE9 (#10493) 2016-08-12 10:34:55 -07:00
f0c1f9ef39 docs(GH): you never know... (#10740) 2016-08-12 10:33:39 -07:00
97f35714f7 feat(forms): add NgForm method that resets submit state (#10715) 2016-08-11 23:27:33 -07:00
00e5b7d30a refactor(SharedStylesHost): remove SetWrapper facade (#10598) 2016-08-11 23:26:57 -07:00
39c0f9ebb3 fix(ExtractorMerger): returns errors together with nodes (as a ParseTreeResult) 2016-08-11 23:24:22 -07:00
e60c765280 refactor: remove unused imports 2016-08-11 23:24:22 -07:00
91dd672aa4 style(xmb): add a space after ICU message cases 2016-08-11 23:24:22 -07:00
a5d2aadecb ci(travis): enable fast finish mode for optional modes. (#10588)
* Travis CI runs the optional tasks in "waiting" mode, which means that the whole build is only ready once the optional tasks are also ready.
   e.g https://travis-ci.org/angular/angular/builds/150844963 - This build lost about 48 minutes just from an optional mode.

* The Travis Fast Finish mode will mark the build as finished, once all "required" tasks have finished.
   https://blog.travis-ci.com/2013-11-27-fast-finishing-builds/
2016-08-11 23:03:28 -07:00
cc6749c158 fix(router): lazy loading keeps refetching modules (#10707) 2016-08-11 22:59:53 -07:00
f48142e679 feat(core): make ngprobe tokens pluggable 2016-08-11 22:56:10 -07:00
947f9c3f56 feat(router): make router.config public 2016-08-11 22:56:10 -07:00
7cd4741fcb fix(http): return empty string if no body is present (#10668) 2016-08-11 21:40:18 -07:00
2d520ae7e7 fix(compiler): Generate temporary variables for guarded expressions (#10657)
Fixes: #10639
2016-08-11 21:20:54 -07:00
5d59c6e80f docs(forms): fix reactive forms api examples (#10701) 2016-08-11 21:20:39 -07:00
50345b8c36 feat(i18n): add an HtmlParser decorator (#10645)
* fix(i18n): merge retains attributes w/o value

* feat(i18n): allow attributes on ng-container (i.e. i18n)

* feat(i18n): add an HtmlParser decorator

* style: clang format
2016-08-11 21:00:35 -07:00
7606c96c80 fix(forms): remove deprecated forms APIs (#10624)
BREAKING CHANGE:

The deprecated forms APIs in @angular/common have been removed. Please update to the new forms API in @angular/forms. See angular.io for more information.
2016-08-11 20:40:46 -07:00
3466232f8b fix(build): Remove duplicate System declarations (#10713)
Add it to a common .d.ts. Prevents closure from complaining of duplicate declarations when compiled using tsickle to generate externs.
2016-08-11 19:37:01 -07:00
6e842fc5bf feat(ngc): allow ngc implementations to provide XHR (#10708) 2016-08-11 15:04:00 -07:00
50c795280f fix: use a global System.import() instead of using a property of the global facade (#10696) 2016-08-11 14:17:44 -07:00
51b22cf14f chore: Fix typos in changelog for rc5 (#10688) 2016-08-11 09:02:12 -07:00
2291929a15 feat(forms): add control status classes to form groups (#10667) 2016-08-11 09:01:09 -07:00
7fac4efede chore(facades): missed a couple places in #10620 (#10661)
This lets us skip src/facade/exception* when compiling modules other than core
2016-08-11 08:39:13 -07:00
b96869afd2 refactor(Type): merge Type and ConcreType<?> into Type<?> (#10616)
Closes #9729

BREAKING CHANGE:

`Type` is now `Type<T>` which means that in most cases you have to
use `Type<any>` in place of `Type`.

We don't expect that any user applications use the `Type` type.
2016-08-10 18:21:28 -07:00
6f4ee6101c chore(imports): don't import ExceptionHandler from facade (#10620)
This lets us skip src/facade/exception* when compiling modules other than core.
It prevents having many conflicting declarations
2016-08-10 15:55:18 -07:00
6db27153ef Router Fixes (#10579)
* fix(router): copy over data during data resolution
* fix(router): components instantiated in lazy-loaded modules should use location's injector
2016-08-10 15:53:57 -07:00
9a11ec2624 fix(metadata): treat empty array of metadata like absent file (#10610) 2016-08-10 11:52:56 -07:00
aff1bc9f2d refactor(tests): move public test APIs to TestBed (#10621)
Completely remove deprecated TestComponentBuilder and friends.
2016-08-10 11:51:40 -07:00
43512aa5eb fix(i18n): ICU placeholders are replaced by their translations (#10586)
They were replaced by the original message.
2016-08-09 21:05:04 -07:00
c7f3aa71fb fix(router): support relative param-only navigation (#10613) 2016-08-09 17:03:17 -07:00
f9da3c98d6 chore: remove deprecated router 2/2 2016-08-09 15:24:14 -07:00
a20a420be6 chore: remove deprecated router 1/2 2016-08-09 15:24:14 -07:00
beadf6167a fix(ngc): add an option to produce TS1.9-pathMapping imports (#10602)
This fixes a regression in #10486
2016-08-09 14:58:19 -07:00
c8da7e995f test(router): Android browser does not support element.click() 2016-08-09 13:25:20 -07:00
8be6b12c2b test(router): use Object.isFrozen instead of relying on an exception 2016-08-09 13:25:20 -07:00
4728f29f67 test(router): increase Karma timers and add polyfills for old browsers 2016-08-09 13:25:20 -07:00
2a942e49ac chore(changelog): update convetional-changelog (#10594)
conventional-changelog-angular@1.3.0 makes breaking changes message detection more forgiving
2016-08-09 11:53:23 -07:00
e3aa19049f chore(router): update changelog 2016-08-09 11:02:04 -07:00
ef1eadadcd chore(router): bump up version number 2016-08-09 11:01:17 -07:00
f444c11d21 docs(changelog): add the ngModel is now fully async note 2016-08-09 10:54:54 -07:00
d75502eeee refactor(testing): remove deprecated test setup functions (#10600)
Remove test setup functions which were deprecated in rc5. See the
changelog for rc5 for how to update. In brief, instead of
`setBaseTestProviders`, use `TestBed.initTestEnvironment`.
2016-08-09 10:46:28 -07:00
ebcd14f8e9 docs(changelog): update change log to rc.5
Closes #10599
2016-08-09 10:34:07 -07:00
b65f66feff feat(i18n): switch to sha1 for message fingerprinting 2016-08-09 09:52:11 -07:00
dd68ae3ef1 feat(ExtractorMerger): ignore implicit tags in translatable sections 2016-08-09 09:52:11 -07:00
1b04d70626 feat(ExtractorMerger): allow nested implicit tags 2016-08-09 09:52:11 -07:00
01bca41168 fix: allow users to pass in absolute paths to ngc (#10572) 2016-08-09 09:36:37 -07:00
94e1ab33ce chore(release): update package.jsons 2016-08-09 09:33:17 -07:00
0b08dd8674 chore(animations): make sure host-prop animation deprecation is correctly emitted
Closes #10581
2016-08-08 23:39:22 -07:00
b2b47177cd add brandon suggestions 2016-08-09 03:30:25 +02:00
f08257ff4a docs(cheatsheet): update for rc5 2016-08-09 03:06:01 +02:00
d1f4222c83 docs(cheatsheet): add NgModules docs to the cheatsheet 2016-08-08 17:18:50 -07:00
d21331e902 fix(ngUpgrade): to work with @NgModule
We changed the bootstrap order:
1. create NgZone
2. bootstrap ng1 inside NgZone and upgrade ng1 components to ng2 components.
3. bootstrap ng2 with NgZone

Note: Previous footgun behavior was: bootstrap ng2 first to extract NgZone, so that ng1 bootstrap can happen in NgZone. This meant that if ng2 bootstrap eagerly compiled a component which contained ng1 components, then we did not have complete metadata.
2016-08-08 12:50:08 -07:00
37f138e83d test(ngUpgrade): convert the upgrade example to use NgModules
The example worked even before this change - verifying that the fallback/legacy mode works as well.
2016-08-08 12:20:22 -07:00
5dab0bad3c test(NgUpgrade): add support for loading plaground/upgrade example without bundles 2016-08-08 12:20:22 -07:00
85e70a4cde style(ngUpgrade): small cleanup 2016-08-08 12:20:21 -07:00
6b564ecda5 feat(ngUpgrade): add support for NgModules
BREAKING CHANGE: UpgradeAdapter.addProvider are now deprecated in favor of passing in an NgModule into the adapter's constructor

Before:

```
let upgradeAdapter = new UpgradeAdapter();
upgradeAdapter.addProviders([myProvidersArray);
```

After:

```
@NgModule({
  providers: myProvidersArray
})
class MyModule {}

let upgradeAdapter = new UpgradeAdapter(MyModule);
```
2016-08-08 12:17:35 -07:00
d4cceff0ef chore: remove module aware bootstrap API (#10543)
This API was introduced post RC4, but needs to be removed
before RC5 as we have decided against it.
2016-08-08 09:36:09 -07:00
a415613457 fix(router): update dts files 2016-08-08 09:15:59 -07:00
1a41bd1ca4 feature(router): add route.root returning the root of router state 2016-08-08 09:15:59 -07:00
5a99393355 fix(router): route.parent should work for secondary children 2016-08-08 09:15:59 -07:00
afcb3c0035 fix(router): support outlets in non-absolute positions 2016-08-08 09:15:59 -07:00
d2d36c61f3 fix(router): fix matrix params check to handle 'special' objects 2016-08-08 09:15:59 -07:00
0bd97ecda2 feat(http): add options method to Http (#10540)
Add options method to the Http object, which could be useful when using self-describing RESTful APIs.

This closes #10500, closes #7918
2016-08-08 09:15:13 -07:00
46bbcefb36 fix(linker): prevent pollution of empty embeddedView context (#10548)
Fixes #10045
2016-08-08 09:11:35 -07:00
74b57dfa7d refactor(i18n): remove circular dep 2016-08-05 13:39:54 -07:00
8c9c0986e9 refatcor(digestMessage): takes a i18n.Message 2016-08-05 13:39:54 -07:00
4028fcaa51 refactor(i18n): Drop html.Message and create i18n.Message right away 2016-08-05 13:39:54 -07:00
7a8ef1eae5 feat(i18n): merge translations 2016-08-05 13:39:54 -07:00
e811a5d97f refactor(i18n): misc updates 2016-08-05 13:39:54 -07:00
df44e3e425 fix(i18n extractor): array manipulation 2016-08-05 13:39:54 -07:00
cdb1a237e5 refactor(compiler): html_parser -> ml_parser 2016-08-05 13:39:54 -07:00
fcafdff10b feat(forms): allow both patching and strict setting of values (#10537) 2016-08-05 13:35:17 -07:00
c586656d43 fix(router): fix type definition 2016-08-05 13:12:21 -07:00
3a307c2794 fix(router): absolute redirects should work with lazy loading 2016-08-05 13:12:21 -07:00
4f17dbc721 fix(router): add segmentPath to the link DSL 2016-08-05 13:12:21 -07:00
99989f5d3f chore(facade): remove most facade/async functions 2016-08-05 12:26:28 -07:00
6baf3baedd chore(playground): clang-format 2016-08-05 12:26:28 -07:00
0d1f3c3b07 fix: support trailing slash in basePath (#10533) 2016-08-05 11:11:24 -07:00
83e2d3d1cb refactor(RegExpWrapper): remove the facade (#10512) 2016-08-05 09:50:49 -07:00
b4613ab2d2 fix(ExpressionParser): undefined is undefined (was null) 2016-08-05 09:45:13 -07:00
0ca05eee45 feat(ExpressionParser): add support for this 2016-08-05 09:45:13 -07:00
26c9e1dc70 refactor(NgFor spec): code cleanup 2016-08-05 09:45:13 -07:00
797cb5ae7b refactor(NgStyleSpec): simplify NgStyle tests (#10519) 2016-08-05 09:28:08 -07:00
63b82cd730 feat(router): Allow navigation without updating the URL (#9608) 2016-08-04 11:46:09 -07:00
2b704f0586 fix(linker/compiler): rename const to avoid duplicate declaration (#10457)
Currently in the `linker/compiler.ts` file, the **same identifier** is used in **two declarations**:
```typescript
export type CompilerOptions = { … }
…
export const CompilerOptions = new OpaqueToken('compilerOptions');
```
This breaks the API doc generation. I’m surprised that this was not flagged by the tsc.

The duplicate declaration was introduced in 46b212706b.
2016-08-04 11:31:58 -07:00
ce5ba80792 refactor(NgTemplateOutlet): simplify implementation (#10492) 2016-08-04 11:28:36 -07:00
8b18ef4ba2 feat(NgStyle): add support for the style.unit notation (#10496)
Closes #10326
2016-08-04 11:00:43 -07:00
cd18de7a21 refactor(compiler): use Object.keys instead of Object.getOwnPropertyNames (#10498) 2016-08-04 10:35:41 -07:00
fd19671c07 chore(benchpress): clang-format and lint 2016-08-04 10:08:37 -07:00
3fcd6fd93f chore(benchpress): make benchpress compile
Also adds compiling benchpress to the build scripts to verify that.
2016-08-04 10:08:37 -07:00
c8d53d71a3 fix(ngc): gather metadata for OpaqueToken
Fixes #10482
2016-08-04 10:05:25 -07:00
790362e243 fix: put all ngc files into a single directory (#10486)
Prior to this change `ngc` would place generated files which refer
to components in the node_modules into the node_module. This is an
issue. Now all of the files are forced into a single directory
as specified in `tsconfig.json` by the `genDir` option.

see: https://docs.google.com/document/d/1OgP1RIpZ-lWUc4113J3w13HTDcW-1-0o7TuGz0tGx0g
2016-08-03 21:34:03 -07:00
2eda7a5293 fix(router): provideRouter should use provideRoutes (#10488) 2016-08-03 19:35:12 -07:00
9925aa89dc fix(compiler): Report references to non-exported symbols.
Includes fixes to places now reported as errors.

Part of #8310
2016-08-03 15:42:38 -07:00
6195a45ae2 fix(forms): export AbstractFormGroupDirective
Because
- `Form` is **exported** -- see line 30/31 of
`modules/@angular/forms/src/forms.ts`: i.e., <br>`export {Form} from
'./directives/form_interface'`; and
- Methods of `Form`, which are public, have an
`AbstractFormGroupDirective` parameter;
e.g.,<br>`Form.getFormGroup(dir: AbstractFormGroupDirective):
FormGroup`.

Then it makes sense for `AbstractFormGroupDirective` to be
public/exported too. In any case, if it isn't exported then the **API
docs for `Form` don't get generated properly.**
2016-08-03 15:33:29 -07:00
422d380b3e feat(router): add queryParams and fragment to every activated route 2016-08-03 15:30:03 -07:00
550ab31bd0 feat(router): add parent, children, firstChild to ActivatedRoute 2016-08-03 15:30:03 -07:00
5fceb21549 refactor(router): remove dead code 2016-08-03 15:30:03 -07:00
29caa37943 feat(router): support sibling modules providing routes 2016-08-02 13:31:15 -07:00
8efbcc996a fix(compiler): allow to use pipes inside of *ngIf (#10452)
Fixes #9746
2016-08-02 12:19:34 -07:00
91c64d2b8d fix: missing export for validators 2016-08-02 12:12:15 -07:00
82e7ecd611 fix(compiler): StaticReflect now resolves re-exported symbols (#10453)
Fixes: #10451
2016-08-02 11:45:14 -07:00
3d53b33391 chore: update public api and integrate minor review comments 2016-08-02 11:23:26 -07:00
34624b2db2 refactor(core): deprecate old methods on ApplicationRef
BREAKING CHANGE:
- `ApplicationRef.run` is deprecated. Use `NgZone.run` directly
- `ApplicationRef.injector` is deprecated. Inject an `Injector` or
  use `NgModuleRef.injector` instead
- `ApplicationRef.zone` is deprecated. Inject `NgZone` instead.
2016-08-02 11:23:26 -07:00
1ab5eb0844 refactor(core): don’t use zone.run in ApplicationRef.bootstrap.
`ApplicationRef.bootstrap` is supposed to be run inside of `ngDoBootstrap` method
of the module that is bootstrapped, and that method already runs inside of the
zone.
2016-08-02 11:23:26 -07:00
630028350a refactor(core): Introduce AppInitStatus
This class allows any provider to know and wait for the initialization of the
application. This functionality previously was tied to `ApplicationRef`.

BREAKING CHANGE:
- `ApplicationRef.waitForAsyncInitializers` is deprecated. Use 
  `AppInitStatus.donePromise` / `AppInitStatus.done` instead.
2016-08-02 11:23:26 -07:00
7e4fd7d7da refactor(core): introduce @NgModule.bootstrap and ngDoBootstrap method
If a `@NgModule` has a `bootstrap` property, `PlatformRef.bootstrapModule` /
`PlatformRef.bootstrapModuleFactory` will automatically bootstrap the components
listed in there.
If such a property does not exist, `PlatformRef.bootstrapModule` /
`PlatformRef.bootstrapModuleFactory` will try to call the method `ngDoBootstrap(appRef: ApplicationRef)` on the module class.
Otherwise an error is reported.
2016-08-02 11:23:26 -07:00
af2e80e068 refactor(core): introduce APP_BOOTSTRAP_LISTENER multi provider
Using the `registerBootstrapListener` easily lead to race condition
and needed dependencies on `ApplicationRef`.

BREAKING CHANGE:
- `ApplicationRef.registerBootstrapListener` is deprecated. Provide a multi
  provider for the new token `APP_BOOTSTRAP_LISTENER` instead.
2016-08-02 11:23:26 -07:00
8e6091de6c refactor(core): use ngOnDestroy in providers
Note about the addition of `beforeEach(fakeAsync(inject(…))))` in some tests:
`ApplicationRef` is now using `ngOnDestroy` and there is eager,
including all of its dependencies which contain `NgZone`.
The additional `fakeAsync` in `beforeEach` ensures that `NgZone`
uses the fake async zone as parent, and not the root zone.

BREAKING CHANGE (via deprecations):
- `ApplicationRef.dispose` is deprecated. Destroy the module that was
   created during bootstrap instead by calling `NgModuleRef.destroy`.
- `AplicationRef.registerDisposeListener` is deprecated.
   Use the `ngOnDestroy` lifecycle hook for providers or
   `NgModuleRef.onDestroy` instead.
- `disposePlatform` is deprecated. Use `destroyPlatform` instead.
- `PlatformRef.dipose()` is deprecated. Use `PlatformRef.destroy()`
   instead.
- `PlatformRef.registerDisposeListener` is deprecated. Use
  `PlatformRef.onDestroy` instead.
- `PlaformRef.diposed` is deprecated. Use `PlatformRef.destroyed`
  instead.
2016-08-02 11:23:26 -07:00
ecdaded25f feat(core): introduce NgModuleRef.destroy and call ngOnDestroy on all providers 2016-08-02 11:23:26 -07:00
c161ed415d feat(core): support ngOnDestroy on providers of a directive.
Such providers also become eager as they will be instantiated
anyways on destruction.
2016-08-02 11:23:26 -07:00
ff3b71f7b3 refactor(core): collect lifecycle hooks for all injectable classes 2016-08-02 11:23:26 -07:00
16cc9b46aa fix(fake_async): share zone between beforeEach and it
This is needed for the case if a `beforeEach` instantiates
`NgZone`and the `it` uses
`TestComponentBuilder.createFakeAsync`.

Otherwise the `NgZone` will use the root zone as parent,
and `TestComponentBuilder.createFakeAsync` will always return
undefined as `tick` does not forward promises created
under the zone of `NgZone`.
2016-08-02 11:23:26 -07:00
3ce11ed58c docs(pipes): update I18nSelectPipe API documentation (#10449) 2016-08-02 10:59:07 -07:00
7db75fa361 test: reactivate some of the disabled tests in Edge (#10450) 2016-08-02 10:58:03 -07:00
d6d4568830 fix(forms): allow arrays as parents (#10440)
Closes #10432
2016-08-02 09:40:42 -07:00
a55d796c4b fix: Better error message in case of unknown property binding 2016-08-02 09:28:04 -07:00
73f02c7861 fix: throw useful error on missing platform module. 2016-08-02 09:28:04 -07:00
8c8754e573 chore: add browserNoRouter test running mode 2016-08-02 09:28:04 -07:00
c977a906b3 docs(cheatsheet): add moduleId (#10095) 2016-08-02 07:34:04 -07:00
e0eea6c2f4 feat(forms): add invalid prop to abstract controls (#10439) 2016-08-01 18:41:25 -07:00
3e377f520e fix(router): make an outlet to unregister itself when it is removed from the dom 2016-08-01 16:56:38 -07:00
8dc82a0080 fix(router): fix offline compilation by exporting provideLocationStrategy 2016-08-01 16:23:28 -07:00
4624a35845 docs(router): fixes api docs 2016-08-01 16:23:28 -07:00
8d4499959a feat(forms): add get method for easy access to child controls (#10428) 2016-08-01 14:22:50 -07:00
2dfc9c653b refactor: dart 2016-08-01 11:34:51 -07:00
106db0aba8 refactor: IS_DART === false 2016-08-01 11:34:51 -07:00
28c4852cd6 refactor: remove ts2dart annotations 2016-08-01 11:34:51 -07:00
13c8211065 fix: String.split(str, n) stops after n separator (#10408) 2016-08-01 11:33:35 -07:00
e73d0511cf fix(TemplateParser): report empty expression (#10391)
fixes #3754
2016-08-01 11:24:49 -07:00
e18626b7a2 fix(core): ensure ngFor only inserts/moves/removes elements when necessary (#10287)
Closes #9960
Closes #7239
Closes #9672
Closes #9454
Closes #10287
2016-08-01 11:09:52 -07:00
4df7b1cfbc chore: fixes some issues that happen with closure compiler. (#10392) 2016-08-01 09:47:49 -07:00
f9573ece41 ci(browser providers): update browsers in SL and BS (#10425) 2016-08-01 08:00:12 -07:00
93ade740e2 fix(router): configure DI correctly when using the old provideRouter function 2016-08-01 02:35:41 -07:00
a46437c57d refactor(core): fix bootstrapModule regarding zones and initializers (#10383)
This makes `bootstrapModuleFactory` wait for promises
returned by `APP_INITIALIZER`s, also making `bootstrapModuleFactory` async.
I.e. now `bootstrapModule` and `bootstrapModuleFactory` behave in the
same way.

This ensures that all code from module instantiation, to creating
`ApplicationRef`s as well as calling `APP_INITIALIZERS` is run
in the Angular zone.

This also moves the invocation of the initializers from the `ApplicationRef`
constructor into the `bootstrapModuleFactory` call, allowing initializers
to get a hold of `ApplicationRef` (see #9101).

Fixes #9101
Fixes #10363
Fixes #10205
2016-08-01 02:12:59 -07:00
633c7d1ebe refactor(core): cleanup unused NgZone factory
This factory was only used when using `coreBootstrap` / `coreLoadAndBoostrap`
which is not supported any more.
2016-08-01 02:12:59 -07:00
251953218c fix(http): URLSearchParams.clone propagate the QueryEncoder (#9900) 2016-07-30 19:01:20 -07:00
0d6cc17252 fix(UrlParser): stop setting default value 'true' (#10399) 2016-07-30 14:34:03 -07:00
c8989c900f chore(github): remove reference to Dart in the issue template (#10388) 2016-07-30 00:22:04 -07:00
6134320f16 refactor(http): rewrite for readable & efficient. 2016-07-29 21:30:28 -07:00
7f647822bd fix(http): headers should be case-insensitive.
fixes #9452

spec at https://tools.ietf.org/html/rfc2616
2016-07-29 21:30:15 -07:00
e34a04d2ad feat(xmb/xtb): support dtd 2016-07-29 14:18:34 -07:00
44093905e2 refactor(test): refine types 2016-07-29 13:53:13 -07:00
3e2900f74b refactor(i18n): move code around 2016-07-29 13:40:58 -07:00
11fd2eccec refactor: fix merge glitches 2016-07-29 13:40:58 -07:00
0eee1d5de3 feat(i18n): xtb serializer 2016-07-29 13:40:58 -07:00
1b77604ee2 refactor(compiler): re-arrange files 2016-07-29 13:40:58 -07:00
cc5cfe87c3 feat(i18n): xmb serializer 2016-07-29 13:40:58 -07:00
48f230a951 feat(I18nAst): introduce an intermediate AST 2016-07-29 13:40:58 -07:00
2be50bdbb0 refactor(i18n): message extractor
fixes #8802
2016-07-29 13:40:58 -07:00
f7258ea52a test(HtmlAst): add a serializer 2016-07-29 13:40:58 -07:00
28e8b2faab feat(ICU): extract ICU messages 2016-07-29 13:40:58 -07:00
3c3e9ddb10 feat(router): add a validation to make sure pathMatch is set correctly 2016-07-29 12:27:43 -07:00
5162fb6d52 feat(router): add isActive to router 2016-07-29 12:27:43 -07:00
2fdb39e60a feat(router): activateroute should expose its route config 2016-07-29 12:27:43 -07:00
43c71ae103 fix(platform-browser): IEMobile is badly detected when testing (#10382) 2016-07-29 10:05:12 -07:00
f0bd528d77 test(http): fix Blob creation for Android <= 4.3
Closes #10377
2016-07-29 18:20:09 +02:00
50a024b42f test(http): add Typed Array polyfill for IE9 2016-07-29 18:19:54 +02:00
b48f7bcb8d fix(forms): normalize written value in NumberValueAccessor
Closes #10379
2016-07-29 18:18:30 +02:00
763ca60f5b feat(compiler): Support default parameters in static reflector (#10370)
Closes: #10369
2016-07-29 09:10:45 -07:00
0eca7abdd8 chore: update public api
Closes #10355
2016-07-29 04:47:50 -07:00
d0a95e35af refactor(testing): introduce new testing api to support ng modules
BREAKING CHANGE:
- deprecations:
  * `withProviders`, use `TestBed.withModule` instead
  * `addProviders`, use `TestBed.configureTestingModule` instead
  * `TestComponentBuilder`, use `TestBed.configureTestModule` / `TestBed.override...` / `TestBed.createComponent` instead.

Closes #10354
2016-07-29 04:47:18 -07:00
acc6c8d0b7 feat(compiler): introduce MockDirectiveResolver.setDirective 2016-07-29 04:47:18 -07:00
3dbc66c1ac refactor(core): introduce interfaces for constructor arguments of decorators
For @Directive, @Component, @Pipe, @NgModule
2016-07-29 04:47:18 -07:00
4ad6bcce54 feat(compiler): add MockPipeResolver 2016-07-29 04:47:17 -07:00
0988cc82b0 refactor(core): remove ViewResolver and ViewResolverMock
The methods on `ViewResolverMock` have been merged into `DirectiveResolver`.

BREAKING CHANGE:
- ES5 users can no longer use the `View(…)` function to provide `ViewMetadata`.
  This mirrors the removal of the `@View` decorator a while ago.
2016-07-29 04:47:17 -07:00
20b03bad11 feat(compiler): Added support for conditional expressions. (#10366)
Expression evaluated by the static reflector can now supports
conditional expressions.

Closes: #10365
2016-07-28 17:32:29 -07:00
81d27daf0d fix(router): update dts files 2016-07-28 15:03:19 -07:00
bb8b82b3f5 fix(router): relax type defintion of Route to improve dev ergonomics 2016-07-28 15:03:19 -07:00
915a6666f8 fix(core): fix offline detection in ng_module_factory_loader 2016-07-28 15:03:19 -07:00
72da547d6a fix(router): updates router module to be offline-compilation friendly 2016-07-28 15:03:19 -07:00
7c76a75452 fix(forms): update dirty before emitting value change (#10362)
Closes #5328
2016-07-28 14:25:33 -07:00
a32c4ad2f0 fix(compiler): auto declare entryComponents recursively
Closes #10348
2016-07-28 12:03:34 -07:00
fb3608aa5d fix(compiler): report better error messages for host bindings
Closes #10346
2016-07-28 11:21:50 -07:00
0a46f37444 fix(metadata): fix typechecking with typescript@next 2016-07-28 11:17:53 -07:00
9b39e499ac fix(core): support components without a selector (#10331)
Components without a selector now get the selector `ng-component`.
Directives without a selector will throw an error message.

Closes #3464
Closes #10216
2016-07-28 10:39:10 -07:00
a67cc8229d chore: move injector to being non-internal but private (#10339)
* chore: move injector to being non-internal but private

* Add the new non-internal method to the public API.
2016-07-28 10:38:29 -07:00
b58e9ea775 feat(compiler): Added support for references to static fields. (#10334)
Closes: #10332
2016-07-27 19:26:59 -07:00
422effdd18 refactor(http): use ngModules for http (#10329) 2016-07-27 13:09:05 -07:00
3b690b68a6 fix(testing): Fix error message in test bed
The API name in the error message was wrong
2016-07-27 12:03:27 -07:00
43349dd373 fix(forms): improve ngModel error messages (#10314) 2016-07-27 10:59:40 -07:00
e44e8668ea fix(core): only warn and auto declare undeclared entryComponents.
This is needed to support existing applications.
After final these warnings will become errors.

Closes #10316
2016-07-27 10:56:12 -07:00
69e72c0786 chore: remove browserDynamicTestingPlatform as it is deprecated and was not part of rc.4
Closes #10319
2016-07-27 10:52:47 -07:00
553344739c fix(core): allow module providers to overwrite providers from ModuleWithProviders
Fixes #10313
Closes #10317
2016-07-27 10:51:58 -07:00
367f0fd142 fix(static_reflector): report methods with decorators in propMetadata as well
This was the behavior of our regular reflector as well, although the
method name does not imply this.

Fixes #10308
Closes #10318
2016-07-27 10:50:58 -07:00
58d9e7fc5a feat(facade): add support for all thenables (#10278)
All objects that have a then function will be considered Promises
2016-07-27 10:37:48 -07:00
9d9e9c6ff1 refactor(router): take advantage of the new way of configuring modules 2016-07-27 10:24:29 -07:00
ba88db5141 fix(ngClass): do not deconstruct classes on element removal (#10303)
Prior to this fix [ngClass] would remove all dynamic classes
when destroyed. It's essential that classes are persisted such
that remove-based animations will still be stylistically correct.
This patch fixes this issue.

Closes #10008
Closes #10303
2016-07-26 15:20:27 -07:00
62e7c0f464 feat(router): implement canLoad 2016-07-26 14:39:02 -07:00
fc83bbbe98 fix(compiler): treat custom elements as unknown elements by default
Closes #10300
2016-07-26 12:31:22 -07:00
482c019199 feat(security): only warn when actually sanitizing HTML. (#10272)
Previously, Angular would warn users when simply re-encoding text
outside of the ASCII range. While harmless, the log spam was annoying.

With this change, Angular specifically tracks whether anything was
stripped during sanitization, and only reports a warning if so.

Fixes #10206.
2016-07-26 11:39:09 -07:00
b449467940 feat(compiler): Allow calls to simple static methods (#10289)
Closes: #10266
2016-07-26 10:18:35 -07:00
0aba42ae5b fix(forms): throw error if wrong control container for reactive forms (#10286) 2016-07-26 10:08:46 -07:00
0d1bf8148b fix(animations): ensure animation detection doesn't rely on the body node
Closes #10230
Closes #10191
Closes #10273
2016-07-26 09:33:50 -07:00
b42411ba1f chore: update public api
- `precompile` -> `entryComponents`
- introduce `ModuleWithProviders`
- introduce `@NgModule.schema`
- update to bootstrap

Closes #10268
2016-07-26 07:45:40 -07:00
5a21f168d6 refactor(core): change bootstrap of modules and names of platforms
BREAKING CHANGES:
- `browserPlatform`/`browserDynamicPlatform`/... have been deprecated and renamed into `platformBrowser`/`platformBrowserDynamic`/....
- `bootstrapModule` and `bootstrapModuleFactory` have been moved to be members of `PlaformRef`.
  E.g. `platformBrowserDynamic().bootstrapModule(MyModule)`.
2016-07-26 07:28:55 -07:00
00b726f695 refactor(core): introduce NgModule.schemas
This allows Angular to error on unknown properties,
allowing applications that don’t use custom elements
to get better error reporting.

Part of #10043

BREAKING CHANGE:
- By default, Angular will error during parsing
  on unknown properties,
  even if they are on elements with a `-` in their name
  (aka custom elements). If you application is using
  custom elements, fill the new parameter `@NgModule.schemas`
  with the value `[CUSTOM_ELEMENTS_SCHEMA]`.

  E.g. for bootstrap:
  ```
  bootstrap(MyComponent, {schemas: [CUSTOM_ELEMENTS_SCHEMA]});
  ```
2016-07-26 07:04:36 -07:00
f02da4e91a feat(core): introduce ModuleWithProviders.
Modules can now provider helper functions that allow
to import a module together with an array of providers.

Part of #10043
2016-07-26 07:04:36 -07:00
d6b65db9a7 fix(static_reflector): resolve values of functions in the function context 2016-07-26 07:04:36 -07:00
6f4e49ed53 refactor(core): rename precompile into entryComponents.
Part of #10043

BREAKING CHANGE:
- `@Component.precompile` was renamed to `@Component.entryComponents`
  (old property still works but is deprecated)
- `ANALYZE_FOR_PRECOMPILE` was renamed to `ANALYZE_FOR_ENTRY_COMPONENTS` (no deprecations)
2016-07-26 07:04:36 -07:00
46b212706b refactor(core): change module semantics
This contains major changes to the compiler, bootstrap of the platforms
and test environment initialization.

Main part of #10043
Closes #10164

BREAKING CHANGE:
- Semantics and name of `@AppModule` (now `@NgModule`) changed quite a bit.
  This is actually not breaking as `@AppModules` were not part of rc.4.
  We will have detailed docs on `@NgModule` separately.
- `coreLoadAndBootstrap` and `coreBootstrap` can't be used any more (without migration support).
  Use `bootstrapModule` / `bootstrapModuleFactory` instead.
- All Components listed in routes have to be part of the `declarations` of an NgModule.
  Either directly on the bootstrap module / lazy loaded module, or in an NgModule imported by them.
2016-07-26 07:04:10 -07:00
ca16fc29a6 build: fix and document the symlinks scripts for Windows
Closes #10213
2016-07-26 09:52:11 +02:00
9edea0b139 fix(ng upgrade): do not compile ng2 components until after ng1 bootstrap (#10084)
Closes #9407 and angular/protractor#2944
2016-07-25 21:14:35 -07:00
d15a1d64e1 fix(router): make router provides work with cli and offline compilation 2016-07-25 18:04:22 -07:00
c87847974a chore(forms): separate out tests for reactive forms (#10283) 2016-07-25 15:57:51 -07:00
6f68330fa5 feat(router): rename UrlPathWithParams into UrlSegment
BREAKING CHANGE:

UrlPathWithParams => UrlSegment
UrlSegment => UrlSegmentGroup
2016-07-25 12:15:07 -07:00
2b63330a36 fix(router): handle when both primary and secondary are empty-path and primary has a child 2016-07-22 18:51:35 -07:00
06e4ca4bb3 fix(router): advance query params and fragment after advanced routes 2016-07-22 18:51:35 -07:00
43437c175a fix(router): handle url fragments when no url segments present 2016-07-22 18:51:35 -07:00
8d90a5a4cf fix(router): router link active should take all descendants into account 2016-07-22 18:51:35 -07:00
93a4ca652a refactor(router): renames PRIMARY_OUTLET into primary 2016-07-22 18:51:35 -07:00
41178367d1 feat(HtmlLexer): better hint on unclosed ICU message errors
fixes #10227
2016-07-22 17:27:15 -07:00
54f2edbb90 refactor(Lexer): code cleanup 2016-07-22 16:50:54 -07:00
b652a7fc9f chore: remove obsolete files (#10240) 2016-07-22 16:18:31 -07:00
e34eb4520f fix(testing): ComponentFixture - Avoid extra scheduleMicrotask (#10223)
Don't schedule microtask to check for pending macrotasks when no one is waiting for a whenStable().
2016-07-22 16:07:11 -07:00
190bcc89c1 refactor(EventEmitter): optional emits (#10058)
the Subject#next is optional
2016-07-22 10:19:57 -07:00
64fc4648b7 fix(testing): correctly import NgMatchers (#10077)
Some test cases incorrectly rely on the side effect of other test cases
importing `NgMatchers`. This commit fixes this by making `expect` in
`core/testing_internal` properly typed.
2016-07-22 09:20:51 -07:00
bdb59129d0 feat(http): add content-type override support for http request (#10211) 2016-07-22 08:37:32 -07:00
d455942389 fix(CurrencyPipe): use default Intl formatting options when none provided
fixes #10189
2016-07-22 08:21:31 -07:00
cdb3678fe3 chore(tools): remove unused files 2016-07-22 08:20:46 -07:00
e73ac1e992 chore(Dart): remove obsolete files, update the docs 2016-07-22 08:20:46 -07:00
51f3d22e4f feat(security): trust resource URLs as URLs. (#10220)
Resource URLs are strictly "more" trustworthy than plain URLs, so trusting them maintains the same level of security while avoiding to break people when we downgrade a resource URL context to a plain URL context.
2016-07-21 17:44:59 -07:00
00aa7a76b6 chore(tests): enable lint, make it green. (#10224) 2016-07-21 17:12:00 -07:00
27b87ef535 fix(router): throw when cannot parse a url 2016-07-21 16:14:55 -07:00
44709e0dca fix(router): handle urls with only secondary top-level segments 2016-07-21 16:14:44 -07:00
31a7709ece test: execute router tests on ./test.sh browser (#10053) 2016-07-21 16:12:40 -07:00
a441b5b8fe feat(security): categorize <track src> as a regular URL.
After security review, it turns out we were too paranoid about <track src>. Its content is not actually active or dangerous.

Fixes #10089.
2016-07-21 13:53:35 -07:00
76b8a49bfb feat(http): add support for blob as a response type (#10190) 2016-07-21 13:44:38 -07:00
db54a84d14 fix(router): routerLinkActive should only set classes after the router has successfully navigated 2016-07-20 17:51:21 -07:00
eb6ff65af7 refactor(router): makes an error message clearer 2016-07-20 14:47:51 -07:00
23ee29b6a2 fix(router): navigation should not preserve query params and fragment by default
BREAKING CHANGE

Previously both imperative (router.navigate) and declarative (routerLink) navigations
would preserve the current query params and fragment. This behavior turned out to
be confusing. This commit changes it.

Now, neither is preserved by default. To preserve them, you need to do the following:

router.naviage("newUrl", {preserveQueryParams: true, preserveFragment: true})

<a routerLink="newUrl" preserveQueryParams preserveFragment></a>
2016-07-20 14:30:04 -07:00
73a69895d8 cleanup(router): removes unnecessary files from tsconfig 2016-07-20 11:44:07 -07:00
2799e7a3ca refactor(router): rename RouterTestModule into RouterTestingModule 2016-07-20 11:39:31 -07:00
b43f95435b fix(testing): add an explicit doAsyncPrecompilation step (#10015)
This removes the magic from the `inject` test helper that would inspect
the current zone and would only work with our `async` test helper.
Now, `inject` is always synchronous, and if you are using a module
that requires async precompilation, you're required to call
`doAsyncPrecompilation` in your tests.

This is part of the breaking changes introduced with the swap
to each test having an AppModule.

Closes #9975
Closes #9593

BREAKING CHANGE:

`TestInjector` is now renamed to `TestBed`

Before:

```js
import {TestInjector, getTestInjector} from '@angular/core/testing';
```

After:

```js
import {TestBed, getTestBed} from '@angular/core/testing';
```
2016-07-20 10:51:21 -07:00
450f61d384 docs(router): fix provider token (#10177) 2016-07-20 07:27:09 -07:00
f3dd91e1d7 feat(NumberPipe): add string support (#10163)
fixes #10159
2016-07-19 11:27:06 -07:00
979946c062 fix(testing): Add platform directives to the shim that keeps setBaseTestProviders running (#10154)
Due to daa9da4047,
tests using the setBaseTestProviders stopped working with ambient directives such as
`ngIf`. Add them back in to keep the shim working.
2016-07-19 08:59:14 -07:00
51e661eb74 fix(router): export navigation extras 2016-07-18 17:42:04 -07:00
921a17960c fix(router): lazy loaded components should use loaded injector 2016-07-18 17:42:04 -07:00
7a4f6621ed fix(router): handle lastPathIndex of empty-path routes 2016-07-18 17:42:04 -07:00
83bc5c97ef fix(http): convert objects passed to requests into a string (#10124)
This remove a breaking change introduced with commit #e7a8e2757b06d572f614f53b648d2fd75df370d2 where json objects passed to  requests were not converted into string.

BREAKING CHANGE:

The behavior in this commit is the same as before PR 7260 : the objects sent with the request are converted to a string, therefore there is no need for the user to take care of the serialization.

Fixes #10073
2016-07-18 14:20:03 -07:00
3f08efa35d fix(KeyValueDiffer): check for changes
fixes #9115
2016-07-18 11:30:07 -07:00
0914dc35e8 refactor(Differ): cleanup 2016-07-18 11:30:07 -07:00
b6746cce9c refactor(decorators): cleanup 2016-07-18 10:38:59 -07:00
8cd97c2054 refactor(NgFor): cleanup 2016-07-18 10:38:59 -07:00
32d8cde9c6 docs(NgSwitch): fix typo ngSwitch to NgSwitch (#10143) 2016-07-18 10:24:55 -07:00
1803ed2512 fix(router): fix rollup config to properly set up rxjs 2016-07-15 16:27:54 -07:00
f08060b0b0 fix(router): back button does not work in IE11 and Safari 2016-07-15 14:59:59 -07:00
b77a4a40a4 fix(router): expose initalNavigation and dispose so they can be used with webworkers 2016-07-14 17:29:01 -07:00
e1109d52e1 docs(router): update the docs of LocationPathStrategy 2016-07-14 15:00:50 -07:00
0668ba50e8 fix(router): freeze params and queryParams to prevent common source of bugs 2016-07-14 13:33:05 -07:00
44ff005ce3 doc(developer): updates (#10075) 2016-07-14 08:51:05 -07:00
aa88438b54 feat(Router): add extra validation for when route was passed as Array (#9942) 2016-07-14 08:28:31 -07:00
85be729c70 fix(router): lazily-loaded modules should use loaded injectors instead of the root one 2016-07-13 18:25:30 -07:00
a5dc5705a3 feat(router): guards and data resolvers can now return promises 2016-07-13 18:25:30 -07:00
9e3d13f61f feat(router): add support for canActivateChild 2016-07-13 18:25:30 -07:00
961c9d48ae fix(compiler): Query expression lambdas should have dynamic type
Fixes: #9875
2016-07-13 15:41:30 -07:00
9229bbbc80 Revert "fix(compiler): Generates function expressions as returning any (#9980)"
This reverts commit eb5763c23f.
2016-07-13 15:41:30 -07:00
34feecf60e fix(forms): improve no value accessor error message (#10051) 2016-07-13 14:13:02 -07:00
4c762a6be3 chore(lint): enable lint check for duplicate vars 2016-07-13 12:33:39 -07:00
0426325ef7 fix(router): merge SystemJsAppModuleFactoryLoader and SystemJsAllModuleLoader 2016-07-13 11:16:46 -07:00
0b54e3cf0a fix(router): do not fire events on 'duplicate' location events 2016-07-13 11:16:46 -07:00
5cf58971f1 fix(router): update current state and url before activating components 2016-07-13 11:16:46 -07:00
6518ff88b2 fix(compiler): No longer writes 0 length files outside of genDir (#10023)
Fixes: #9984
2016-07-13 11:15:23 -07:00
42b0c1d8a2 refactor: misc cleanup (#10046) 2016-07-13 11:01:32 -07:00
4a965052f9 fix(platform-browser): remove testing_e2e target (#10029)
The testing_e2e util does not belong in platform-browser and was never
intended to be a public API. Move it out of that whole tree.

BREAKING CHANGE:

The following API was never intended to be public and is removed:

```js
import {verifyNoBrowserErrors} from '@angular/platform-browser/testing_e2e';
```

Consider using Protractor's console plugin: https://github.com/angular/protractor-console-plugin
2016-07-13 10:10:02 -07:00
5725c5925c docs(ExceptionHandler): Update code example in comment block to correct syntax error. (#10032) 2016-07-13 07:28:08 -07:00
a46291b67c docs(router) Added @Injectable decorators to Router API examples (#10033) 2016-07-13 07:27:32 -07:00
4ac76ca281 docs(router): fix syntax in code example of comment block (#10026) 2016-07-13 07:26:26 -07:00
e7a8e2757b refactor(http): share 'body' logic between Request and Response 2016-07-12 18:01:06 -07:00
1266460386 feat(http): add support for ArrayBuffer
Add the buffer option to store response in ArrayBuffer
Improve the interface to get back response independently of the buffer type
2016-07-12 18:01:06 -07:00
0ccb6e0dfc refactor: code cleanup 2016-07-12 16:57:39 -07:00
3050ae155c feat(ICU): enable ICU extraction even when when in is not used
BREAKING CHANGES:

"{" is used a a delimiter for ICU messages then it could not be used in text nodes.
"{" should be escaped as "{{ '{' }}"

Before:

    <span>some { valid } text</span>

After:

    <span>some { invalid } text<span> <!-- throw parse error -->
    <span>some {{ '{' }} valid } text</span>
2016-07-12 16:57:39 -07:00
402fd934d0 refactor: code cleanup 2016-07-12 15:26:03 -07:00
6c86e8d80a test(HtmlLexer): Add test for "{" and "{{" escaping 2016-07-12 15:26:03 -07:00
60e6f91a53 refactor(HmtlLexer): cleanup 2016-07-12 15:26:03 -07:00
e676fded21 refactor(Lexer): add types
relates to #9100
2016-07-12 15:26:03 -07:00
25e070dd65 fix(HtmlParser): correctly propagate the interpolation config across layers 2016-07-12 15:26:03 -07:00
da8eb9f8b8 feat(forms): add ability to reset forms (#9974)
Closes #4914
Closes #4933
2016-07-12 15:02:25 -07:00
806a25413c feat(animations): allow animation integration support into host params
Closes #9044
Closes #9933
2016-07-12 14:55:36 -07:00
5af1e891cd fix(animations): throw errors when duplicate component trigger names are registered 2016-07-12 14:55:31 -07:00
79eda30f0f refactor(animations): collect parser / lookup errors in the same place 2016-07-12 14:55:27 -07:00
6d02d2f107 fix(SyncAsyncResult): fix default async value (#10013) 2016-07-12 13:55:06 -07:00
ded518d47f feat(router): update routerLink DSL to handle aux routes 2016-07-12 11:44:55 -07:00
27436270fd fix(Compiler): Catch exceptions in the logging of binding update
fixes #9994
2016-07-12 11:21:32 -07:00
b4ea0b1601 test(datePipe): remove hardcoded timezone (#10007)
Closes #9964
2016-07-12 11:13:26 -07:00
7b31178546 fix(platform-browser-dynamic): Add @Injectable() annotation to XHRImpl.
Otherwise Closure compiled code will complain that the class is missing the annootation.
2016-07-11 23:27:35 -07:00
2ff83324af fix(core): Don't use ES6 spread operator when undefined is allowed.
Workaround a closure bug where it doesn't produce the right code ES6 operator when the array value can be undefined.
2016-07-11 23:14:25 -07:00
4ef86891a3 fix(compiler): Ignore references to declared modules and unneeded types (#9776)
Fixes: #9670
2016-07-11 17:26:35 -07:00
eb5763c23f fix(compiler): Generates function expressions as returning any (#9980)
Function expressions are used in an expression context so untyped
function expressions should have any as the result type.

Fixes: #9877
2016-07-11 17:19:38 -07:00
d1a3e3aff1 fix(DirectiveResolver): throw on duplicate Input & Output names 2016-07-11 16:38:06 -07:00
93d0a01d3d refactor: code cleanup 2016-07-11 16:22:23 -07:00
9af2d8b810 fix(testing): remove deprecated testing APIs (#9923)
See https://github.com/angular/angular/blob/master/CHANGELOG.md for
prior deprecation and how to update.
2016-07-11 16:04:32 -07:00
94dc632a6d fix(NgStyle): remove duplicate input declaration (#9978)
fixes #9977
2016-07-11 15:09:04 -07:00
29231877e6 fix(testing): reintroduce and deprecate setBaseTestProviders (#9905)
This change reverts the removal of setBaseTestProviders that was
introduced in 8d746e3f67.

Instead, setBaseTestProviders and the providers provided from
`@angular/platform-browser-dynamic/testing` and `@angular/server/testing`
will still work for the next release, but are deprecated.

See 8d746e3f67 for how to upgrade.
2016-07-11 14:01:11 -07:00
e68252a79b fix(forms): re-enable form provider functions for easier migration (#9972) 2016-07-11 13:23:38 -07:00
4ec2a30942 fix(compiler): Fixed ?. operator to short-circut execution (#9965)
Fixes: #9850
2016-07-11 12:58:56 -07:00
e6b24437a9 fix(compiler): Collector collects enum values. (#9967)
Fixes: #9928
2016-07-11 11:50:33 -07:00
a05f7b2d76 refactor(animations): move MockAnimationPlayer back into core (#9966)
Closes #9966
2016-07-11 10:55:47 -07:00
61e18434d3 refactor(router): not use reserved words as variable (#9941) 2016-07-11 10:53:29 -07:00
57473e72ec refactor: code cleanup (#9931) 2016-07-09 10:12:39 -07:00
c3bdd504d0 fix(animations): ensure all child elements are rendered before running animations
Closes #9402
Closes #9775
Closes #9887
2016-07-08 18:18:46 -07:00
daa9da4047 refactor(core): deprecate coreBootstrap, PLATFORM_PIPES/DIRECTIVES providers and ComponentResolver
BREAKING CHANGE (deprecations)

- Instead of `coreBootstrap`, create an `@AppModule` and use `bootstrapModule`.
- Instead of `coreLoadAndBootstarp`, create an `@AppModule` and use `bootstrapModuleFactory`.
- Instead of `bootstrapWorkerApp`, create an `@AppModule` that includes the `WorkerAppModule` and use `bootstrapModule` with the `workerAppPlatform()`.
- Instead of `bootstrapWorkerUi`, create an @AppModule that includes the `WorkerUiModule` and use `bootstrapModule` with the `workerUiPlatform()` instead.
- Instead of `serverBootstrap`, create an @AppModule and use `bootstrapModule` with the `serverDynamicPlatform()` instead.
- Instead of `PLATFORM_PIPES` and `PLATFORM_DIRECTIVES`, provide platform directives/pipes via an `@AppModule`.
- Instead of `ComponentResolver`:
  - use `ComponentFactoryResolver` together with `@AppModule.precompile`/`@Component.precompile` or `ANALYZE_FOR_PRECOMPILE` provider for dynamic component creation.
  - use `AppModuleFactoryLoader` for lazy loading.
- Instead of `SystemJsComponentResolver`, create an `@AppModule` and use `SystemJsAppModuleLoader`.
- Instead of `SystemJsCmpFactoryResolver`, create an `@AppModule` and use `SystemJsAppModuleFactoryLoader`

Closes #9726
2016-07-08 15:31:50 -07:00
245b0910ed feat(router): add activate and deactivate events to RouterOutlet 2016-07-08 15:01:52 -07:00
a77db44129 feat(router): empty-path routes should inherit matrix params 2016-07-08 14:48:59 -07:00
34b3c534e7 fix(router): disallow root segments with matrix params 2016-07-08 14:47:55 -07:00
fa47890032 refactor(core): clean up platform bootstrap and initTestEnvironment
- Introduces `CompilerFactory` which can be part of a `PlatformRef`.
- Introduces `WorkerAppModule`, `WorkerUiModule`, `ServerModule`
- Introduces `serverDynamicPlatform` for applications using runtime compilation
  on the server.
- Changes browser bootstrap for runtime and offline compilation (see below for an example).
  * introduces `bootstrapModule` and `bootstrapModuleFactory` in `@angular/core`
  * introduces new `browserDynamicPlatform` in `@angular/platform-browser-dynamic
- Changes `initTestEnvironment` (which used to be `setBaseTestProviders`) to not take a compiler factory any more (see below for an example).

BREAKING CHANGE:

## Migration from `setBaseTestProviders` to `initTestEnvironment`:

- For the browser platform:
  BEFORE:
  ```
  import {setBaseTestProviders} from ‘@angular/core/testing’;
  import {TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
      TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS} from ‘@angular/platform-browser-dynamic/testing’;

  setBaseTestProviders(TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
      TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS);
  ```

  AFTER:
  ```
  import {initTestEnvironment} from ‘@angular/core/testing’;
  import {browserDynamicTestPlatform,
      BrowserDynamicTestModule} from ‘@angular/platform-browser-dynamic/testing’;

  initTestEnvironment(
      BrowserDynamicTestModule,
      browserDynamicTestPlatform());

  ```
- For the server platform:
  BEFORE:
  ```
  import {setBaseTestProviders} from ‘@angular/core/testing’;
  import {TEST_SERVER_PLATFORM_PROVIDERS,
      TEST_SERVER_APPLICATION_PROVIDERS} from ‘@angular/platform-server/testing/server’;

  setBaseTestProviders(TEST_SERVER_PLATFORM_PROVIDERS,
      TEST_SERVER_APPLICATION_PROVIDERS);
  ```

  AFTER:
  ```
  import {initTestEnvironment} from ‘@angular/core/testing’;
  import {serverTestPlatform,
      ServerTestModule} from ‘@angular/platform-browser-dynamic/testing’;

  initTestEnvironment(
      ServerTestModule,
      serverTestPlatform());

  ```

## Bootstrap changes
```
@AppModule({
  modules: [BrowserModule],
  precompile: [MainComponent],
  providers: […], // additional providers
  directives: […], // additional platform directives
  pipes: […] // additional platform pipes
})
class MyModule {
  constructor(appRef: ApplicationRef) {
    appRef.bootstrap(MainComponent);
  }
}

// offline compile
import {browserPlatform} from ‘@angular/platform-browser’;
import {bootstrapModuleFactory} from ‘@angular/core’;

bootstrapModuleFactory(MyModuleNgFactory, browserPlatform());

// runtime compile long form
import {browserDynamicPlatform} from ‘@angular/platform-browser-dynamic’;
import {bootstrapModule} from ‘@angular/core’;

bootstrapModule(MyModule, browserDynamicPlatform());
```

Closes #9922
Part of #9726
2016-07-08 13:41:38 -07:00
d84a43c828 fix(TemplateParser): add support for data-template attribute
fixes #9904
2016-07-08 13:07:01 -07:00
9a1babb30c refactor(TemplateParser): cleanup 2016-07-08 13:07:01 -07:00
30a332ee36 feat(forms): updateValue() for form groups and form arrays (#9901)
Closes #9553
2016-07-08 13:04:25 -07:00
426b002897 docs(developer): update building and testing instructions (#9903)
fixes #9683
2016-07-08 12:00:27 -07:00
2de8364de2 feat(ExpressionChangedAfterItHasBeenCheckedException): more meaningful error message
fixes #9882
2016-07-08 10:34:22 -07:00
eacc9e6541 refactor: misc cleanup 2016-07-08 10:34:22 -07:00
749dec7dfb doc(api): fix invalid doc links (#9873)
Errors were reported during API doc generation.
2016-07-07 23:02:35 -07:00
96a9e66616 feat(router): add the ANALYZE_FOR_PRECOMPILE provider to make dev ergonomics better 2016-07-07 18:07:10 -07:00
46e105f3ab fix(router): encode/decode params and path segments 2016-07-07 17:33:42 -07:00
f7a0e9ecb6 fix(router): fix RouterLinKActive to work with RouterLink 2016-07-07 17:33:42 -07:00
93025d1bc6 fix(forms): export form directive arrays for offline compile (#9893) 2016-07-07 17:29:20 -07:00
98d49d4ce3 refactor(core): make lockRunMode a noop and deprecate it.
BREAKING CHANGE:
- `lockRunMode` is deprecated and no more needed.

Closes #9878
2016-07-07 16:16:55 -07:00
1426f680f5 refactor(core): add a deprecation message for using PLATFORM_DIRECTIVES / PLATFORM_PIPES / CompilerConfig / XHR as regular providers in bootstrap.
We still support this via a hack, but should remove this soon.

This also fixes tests for module directives / pipes
as they used directives / pipes that were
already present in the underlying platform.
2016-07-07 16:16:55 -07:00
c7fc51a185 chore(public api): run build.sh before generating the api doc (#9889) 2016-07-07 15:39:53 -07:00
b7e69bc1a1 fix(NgPlural): expression inside cases (#9883)
fixes #9868
2016-07-07 14:47:06 -07:00
72544ba551 feat(router): add RouterTestModule 2016-07-07 14:28:01 -07:00
c43dd5a655 refactor(router): renamed RouterAppModule into RouterModule 2016-07-07 14:28:01 -07:00
7f4954bed6 fix(animations): change trigger binding syntax to function as a property binding []
Animation triggers can now be set via template bindings `[]`

BREAKING CHANGE:

animation trigger expressions within the template that are assigned as
an element attribute (e.g. `@prop`) are deprecated. Please use the
Angular2 property binding syntax (e.g. `[@prop]`) when assigning
properties.

```ts
// this is now deprecated
<div @trigger="expression"></div>

// do this instead
<div [@trigger]="expression"></div>
```
2016-07-07 14:13:06 -07:00
f1fc1dc669 revert: fix(animations): ensure all child elements are rendered before running animations
This reverts commit cbe85a0893.
2016-07-07 14:12:17 -07:00
cbe85a0893 fix(animations): ensure all child elements are rendered before running animations
Closes #9402
Closes #9775
2016-07-07 14:10:04 -07:00
7073cf74fe feat(core): allow to add precompiled tokens via a provider
Introduces the new `ANALYZE_FOR_PRECOMPILE` token. This token can be used to
create a virtual provider that will populate the `precompile` fields of
components and app modules based on its
`useValue`. All components that are referenced in the `useValue`
value (either directly or in a nested array or map) will be added
to the `precompile` property.

closes #9874
related to #9726
2016-07-07 12:16:48 -07:00
9d265b6f61 feat(forms): add modules for forms and deprecatedForms (#9859)
Closes #9732

BREAKING CHANGE:

We have removed the deprecated form directives from the built-in platform directive list, so apps are not required to package forms with their app. This also makes forms friendly to offline compilation.

Instead, we have exposed three modules:

OLD API:
- `DeprecatedFormsModule`

NEW API:
- `FormsModule`
- `ReactiveFormsModule`

If you provide one of these modules, the default forms directives and providers from that module will be available to you app-wide.  Note: You can provide both the `FormsModule` and the `ReactiveFormsModule` together if you like, but they are fully-functional separately.

**Before:**
```ts
import {disableDeprecatedForms, provideForms} from @angular/forms;

bootstrap(App, [
   disableDeprecatedForms(),
   provideForms()
]);
```

**After:**

```ts
import {DeprecatedFormsModule} from @angular/common;

bootstrap(App, {modules: [DeprecatedFormsModule] });
```

-OR-

```ts
import {FormsModule} from @angular/forms;

bootstrap(App, {modules: [FormsModule] });
```

-OR-

```ts
import {ReactiveFormsModule} from @angular/forms;

bootstrap(App, {modules: [ReactiveFormsModule] });
```

You can also choose not to provide any forms module and run your app without forms.

Or you can choose not to provide any forms module *and* provide form directives at will.  This will allow you to use the deprecatedForms API for some components and not others.

```
import {FORM_DIRECTIVES, FORM_PROVIDERS} from @angular/forms;

@Component({
   selector: some-comp,
   directives: [FORM_DIRECTIVES],
   providers: [FORM_PROVIDERS]
})
class SomeComp
```
2016-07-07 11:32:51 -07:00
776a83f9da doc(i18nPluralPipe): update API doc example (#9862) 2016-07-07 08:48:37 -07:00
f29457f3f0 fix(datePipe): short timezone not displayed, closes #9812 (#9816) 2016-07-07 08:47:30 -07:00
a005d1595e chore(compiler-cli): correct homepage URL in package.json (#9869) 2016-07-07 08:43:53 -07:00
8d746e3f67 feat(testing): add implicit test module
Every test now has an implicit module. It can be configured via `configureModule` (from @angular/core/testing)
to add providers, directives, pipes, ...

The compiler now has to be configured separately via `configureCompiler` (from @angular/core/testing)
to add providers or define whether to use jit.

BREAKING CHANGE:
- Application providers can no longer inject compiler internals (i.e. everything
  from `@angular/compiler). Inject `Compiler` instead. This reflects the
  changes to `bootstrap` for module support (3f55aa609f).
- Compiler providers can no longer be added via `addProviders` / `withProviders`.
  Use the new method `configureCompiler` instead.
- Platform directives / pipes need to be provided via
  `configureModule` and can no longer be provided via the
  `PLATFORM_PIPES` / `PLATFORM_DIRECTIVES` tokens.
- `setBaseTestProviders()` was renamed into `initTestEnvironment` and 
  now takes a `PlatformRef` and a factory for a
  `Compiler`.
- E.g. for the browser platform:
  
  BEFORE:
  ```
  import {setBaseTestProviders} from ‘@angular/core/testing’;
  import {TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
      TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS} from ‘@angular/platform-browser-dynamic/testing’;
  
  setBaseTestProviders(TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
      TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS);   
  ```

  AFTER:
  ```
  import {setBaseTestProviders} from ‘@angular/core/testing’;
  import {browserTestCompiler, browserDynamicTestPlatform,
      BrowserDynamicTestModule} from ‘@angular/platform-browser-dynamic/testing’;
  
  initTestEnvironment(
      browserTestCompiler,
      browserDynamicTestPlatform(),
      BrowserDynamicTestModule);

  ```
- E.g. for the server platform:
  
  BEFORE:
  ```
  import {setBaseTestProviders} from ‘@angular/core/testing’;
  import {TEST_SERVER_PLATFORM_PROVIDERS,
      TEST_SERVER_APPLICATION_PROVIDERS} from ‘@angular/platform-server/testing/server’;
  
  setBaseTestProviders(TEST_SERVER_PLATFORM_PROVIDERS,
      TEST_SERVER_APPLICATION_PROVIDERS);   
  ```

  AFTER:
  ```
  import {setBaseTestProviders} from ‘@angular/core/testing’;
  import {serverTestCompiler, serverTestPlatform,
      ServerTestModule} from ‘@angular/platform-browser-dynamic/testing’;
  
  initTestEnvironment(
      serverTestCompiler,
      serverTestPlatform(),
      ServerTestModule);

  ```

Related to #9726
Closes #9846
2016-07-06 18:04:19 -07:00
37e6da6dfb refactor(router): clean up naming 2016-07-06 16:19:52 -07:00
8aa2a0c1b2 feat(router): add RouterAppModule 2016-07-06 16:00:40 -07:00
6bfd514caf fix(router): remove a circular dep 2016-07-06 14:38:05 -07:00
ad3f18c0dd chore(build): update build script to increase node's heap size 2016-07-06 14:38:05 -07:00
39d04b4a15 chore(public_api): update public api 2016-07-06 14:38:05 -07:00
6fbe56dbf2 feat(router): update the example app to use lazily-loaded modules 2016-07-06 14:38:05 -07:00
8ebb8e44c8 feat(router): add support for lazily loaded modules 2016-07-06 14:38:05 -07:00
6fcf962fb5 feat(core): add AddModuleFactoryLoader 2016-07-06 14:38:05 -07:00
2708ce6a17 docs(api): fix links (#9852) 2016-07-06 14:34:27 -07:00
30bec78da3 fix(compiler): Missing metadata files should result in undefined (#9704)
RelectorHost threw an exception when metadata was requested for a
.d.ts file that didn't have a .metadata.json file.  Changed it to
return undefined.

Fixes #9678
2016-07-06 14:26:31 -07:00
9a04fcd061 feat(compiler): Expression span information and error correction (#9772)
Added error correction so the parser always returns an AST
Added span information to the expression parser
Refactored the test to account for the difference in error reporting
Added tests for error corretion
Modified tests to validate the span information
2016-07-06 14:06:47 -07:00
ae62f082fd docs(api): fix broken example urls (#9828) 2016-07-06 13:57:38 -07:00
9cc3b2ca9e fix(animations): ensure a null easing value is never used with web-animations
Closes #9780
Closes #9752
2016-07-06 11:25:54 -07:00
3fe1cb0253 refactor(core): ensure CSS parser uses ParseSourceSpan to track ast locations
This commit also fixes up any remaining TODO comments.

Closes #9778
2016-07-06 11:22:45 -07:00
0ed7773223 build(gulp): Fix paths for public-api tasks on Windows (#9794) 2016-07-05 20:52:35 -07:00
3f55aa609f feat(browser): use AppModules for bootstrap in the browser
This introduces the `BrowserModule` to be used for long form
bootstrap and offline compile bootstrap:

```
@AppModule({
  modules: [BrowserModule],
  precompile: [MainComponent],
  providers: […], // additional providers
  directives: […], // additional platform directives
  pipes: […] // additional platform pipes
})
class MyModule {
  constructor(appRef: ApplicationRef) {
    appRef.bootstrap(MainComponent);
  }
}

// offline compile
import {bootstrapModuleFactory} from ‘@angular/platform-browser’;
bootstrapModuleFactory(MyModuleNgFactory);

// runtime compile long form
import {bootstrapModule} from ‘@angular/platform-browser-dynamic’;
bootstrapModule(MyModule);
```

The short form, `bootstrap(...)`, can now creates a module on the fly,
given `directives`, `pipes, `providers`, `precompile` and `modules`
properties.

Related changes:
- make `SanitizationService`, `SecurityContext` public in `@angular/core` so that the offline compiler can resolve the token
- move `AnimationDriver` to `platform-browser` and make it
  public so that the offline compiler can resolve the token

BREAKING CHANGES:
- short form bootstrap does no longer allow
  to inject compiler internals (i.e. everything 
  from `@angular/compiler). Inject `Compiler` instead.
  To provide custom providers for the compiler,
  create a custom compiler via `browserCompiler({providers: [...]})`
  and pass that into the `bootstrap` method.
2016-07-02 20:35:09 -07:00
74b45dfbf8 Revert "refactor(core): ensure CSS parser uses ParseSourceSpan to track ast locations"
This reverts commit 5c9f871b21.
2016-07-01 21:21:56 -07:00
5c9f871b21 refactor(core): ensure CSS parser uses ParseSourceSpan to track ast locations
This commit also fixes up any remaining TODO comments.

Closes #9285
2016-07-01 17:18:14 -07:00
77dc6ef411 fix(forms): mark control containers as touched when child controls are touched (#9735) 2016-07-01 15:36:04 -07:00
5eca6e4e40 bug(datePipe): passing "hh" to the datepipe (#9774)
closes #9759
2016-07-01 15:34:57 -07:00
0c65d5cf2b fix(router): handle router outlets in ngIf 2016-06-30 22:14:42 -07:00
f65ebec3ed fix(router): update links when query params change 2016-06-30 22:14:42 -07:00
81bf3f66ca docs(router): rename global redirects into absolute redirects 2016-06-30 22:14:42 -07:00
3cbded6694 fix(forms): use change event for select multiple (#9713) 2016-06-30 20:24:39 -07:00
137fff9632 fix(router): remove private and internal annotations (#9753) 2016-06-30 19:39:13 -07:00
695c08b9dd test(forms): add test for multi-select and custom accessors (#9624) 2016-06-30 18:04:00 -07:00
119794249b doc(changelog): cleans up markdown for breaking changes (#9739) 2016-06-30 17:31:39 -07:00
afb72164e4 fix(docs): typo in comments (#9743)
correct a typo in comments
2016-06-30 15:18:41 -07:00
9fee5630fd chore: fix package on changelog (#9736) 2016-06-30 15:17:00 -07:00
01de58d650 chore(router): bump up version number 2016-06-30 14:58:59 -07:00
dabf214f17 fix(router): remove private and internal annotations (#9745) 2016-06-30 14:47:55 -07:00
fb2539e1d5 fix(router): remove the precompile warning 2016-06-30 14:33:04 -07:00
ad9f02a73e chore: enable cyclic dependency check
Closes #9742
2016-06-30 14:28:22 -07:00
2d73583253 chore(compiler): fix cyclic dependency 2016-06-30 14:28:22 -07:00
73f017bad9 fix(typescript): make router compile with typescript@next
fixes #9731
2016-06-30 11:51:52 -07:00
055282f156 chore(router): bump up version number 2016-06-30 11:45:31 -07:00
fe7de53b89 chore(router): update router change log 2016-06-30 11:45:31 -07:00
17e4cfc748 feat(core): introduce @AppModule
Main part for #9726
Closes #9730
2016-06-30 11:34:40 -07:00
1608d91728 docs(changelog): change log and package.json to rc4
Closes #9727
2016-06-30 10:16:32 -07:00
a3b90411aa fix(router): fix RouterLinkActive to handle the case when the link has extra paths 2016-06-30 09:26:57 -07:00
5781b96490 fix(router): redirect should not add unnecessary brackets 2016-06-30 09:26:57 -07:00
f208ee0d57 fix(router): reexport router directives 2016-06-30 09:26:57 -07:00
8aa388de6c doc(directive): fixes incorrect example code (#9635) 2016-06-29 22:16:43 -07:00
51d4c9dcbd fix(compiler): make code easier to type check
These changes are needed for the G3 sync as we use a different version/settings of Typescript than on Github.

closes #9701
2016-06-29 10:43:58 -07:00
e81dea695c fix(compiler): report not existing files as errors
Closes #9690
2016-06-29 07:35:34 -07:00
3fec27961e fix: support *directive on <template> (#9691)
fixes #7315
2016-06-28 21:53:41 -07:00
3784696b9e fix(router): make the contstructor of the router service public 2016-06-28 18:39:37 -07:00
8c45aebc18 fix(router): make router links work on non-a tags 2016-06-28 18:39:37 -07:00
810c722413 docs(security): point users to docs when sanitization fails. (#9680) 2016-06-28 18:13:46 -07:00
e2116c53f3 fix(upgrade): add peerDependency on platform-browser-dynamic (#9674)
Closes #9623
2016-06-28 17:27:28 -07:00
296a447e3c docs(router): add api docs 2016-06-28 14:49:29 -07:00
0961bd1eff feat(forms): use formControlName on radio buttons when name is absent (#9681) 2016-06-28 15:21:53 -06:00
9340e1b065 docs(security): security api doc update and fix stability marker for Type 2016-06-28 14:01:48 -07:00
ae4fa56ee9 fix(public API): update golden files
broken by #9606
2016-06-28 12:21:50 -07:00
2d9d7f1310 fix(security): allow empty CSS values. (#9675) 2016-06-28 11:45:02 -07:00
5ee84fe0f6 refactor: add types (#9606)
relates to #9100
2016-06-28 11:35:59 -07:00
1620426393 fix(http): don't encode values that are allowed in query (#9651)
This implements a new class, QueryEncoder, that provides
methods for encoding keys and values of query parameter.
The encoder encodes with encodeURIComponent, and then
decodes a whitelist of allowed characters back to their
unencoded form.

BREAKING CHANGE:

The changes to Http's URLSearchParams serialization now 
prevent encoding of these characters inside query parameters
which were previously converted to percent-encoded values:

@ : $ , ; + ; ? /

The default encoding behavior can be overridden by extending
QueryEncoder, as documented in the URLSearchParams service.

Fixes #9348
2016-06-28 11:31:35 -07:00
bf598d6b8b feat(compiler): support sync runtime compile
Adds new abstraction `Compiler` with methods
`compileComponentAsync` and `compileComponentSync`.
This is in preparation of deprecating `ComponentResolver`.

`compileComponentSync` is able to compile components
synchronously given all components either have an inline
template or they have been compiled before.

Also changes `TestComponentBuilder.createSync` to
take a `Type` and use the new `compileComponentSync` method.

Also supports overriding the component metadata even if
the component has already been compiled.

Also fixes #7084 in a better way.

BREAKING CHANGE:
`TestComponentBuilder.createSync` now takes a component type
and throws if not all templates are either inlined
are compiled before via `createAsync`.

Closes #9594
2016-06-28 10:26:16 -07:00
24eb8389d2 fix: public api surface fixes + stability markers
- ts-api-guardian will now error if a new public symbol is added with a stability marker (`@stable`, `@experimental`, `@deprecated`)
- DomEventsPlugin and KeyEventsPlugin were removed from public api surface - these classes is an implementation detail
- deprecated BROWSER_PROVIDERS was removed completely
- `@angular/compiler` was removed from the ts-api-guardian check since this package shouldn't contain anything that users need to directly import
- the rest of the api surface was conservatively marked as stable or experimental

BREAKING CHANGES: DomEventsPlugin and KeyEventsPlugin previously exported from core are no longer public - these classes are implementation detail.

Previously deprecated BROWSER_PROVIDERS was completely removed from platform-browser.

Closes #9236
Closes #9235
Ref #9234
2016-06-28 07:39:40 -07:00
fcfddbf79c feat(router): add pathMatch property to replace terminal 2016-06-27 20:21:30 -07:00
dc64e90ab9 feat(router): use componentFactoryResolver 2016-06-27 20:21:30 -07:00
e12b1277df feat(core): split ChangeDetectorStrategy into ChangeDetectionStrategy and ChangeDetectorStatus 2016-06-27 20:19:20 -07:00
797914e948 fix(forms): emit statusChange when child controls have async validator (#9652) 2016-06-27 21:01:24 -06:00
e0b0a594bb fix(animations): ensure void => * animations are triggered when an expression is omitted
Closes #9327
Closes #9381
2016-06-27 18:55:10 -07:00
ed0ade6f34 fix(forms): make radio button selection logic more flexible (#9646)
Closes #9558
2016-06-27 15:29:33 -06:00
5cc7b41f39 Revert "fix(Compiler): relax childIsRecursive check (#8705)"
This fix prevented waiting for child components even if the cycle was only introduced via the `directives` array, i.e. without actually having a cycle. This easily causes issues for applications that have one shared list of directives for all components.

This reverts commit 3d5bb23184.

Closes #9647
2016-06-27 14:27:03 -07:00
f2f1ec0117 feat(router): implement data and resolve 2016-06-27 14:25:56 -07:00
e913d9954d chore(typings): restrict Angular to es5+collections+promise 2016-06-27 13:58:59 -07:00
d20488752b fix(router): top-levels do not work in ngIf 2016-06-27 13:34:54 -07:00
855f3afb28 fix(router): canceled navigations should return a promise that is resolved with false 2016-06-27 13:34:54 -07:00
3f44377f2f fix(router): handle empty path with query params 2016-06-27 13:34:54 -07:00
90295e3252 fix(router): preserve fragment on initial load 2016-06-27 13:34:54 -07:00
a620f95891 build(npm): upgrade ts-api-guardian to v0.1.4
Closes #9642
2016-06-27 12:27:59 -07:00
db66509e66 test(security): tests for HTML5 elements, srcset.
Part of #9572.
2016-06-27 12:19:03 -07:00
6605eb30e9 feat(security): allow more HTML5 elements and attributes in sanitizers
Allow more elements and attributes from the HTML5 spec which were stripped by the htmlSanitizer.

fixes #9438

feat(security): allow audio data URLs in urlSanitizer

test(security) : add test for valid audio data URL

feat(security): allow and sanitize srcset attributes

test(security): test for srcset sanitization
2016-06-27 12:19:03 -07:00
3644eef860 feat(DomRenderer): Adding support for document fragments in SVG foreign objects (#9458) 2016-06-27 08:26:45 -07:00
fb2509675d doc(changelog): add backticks around html elements so they actually render (#9637) 2016-06-27 08:21:34 -07:00
eef9512ce6 fix(forms): async validator-directives process Observables correctly (#8186)
Closes #/8022
2016-06-26 16:52:50 -06:00
9f00a1b902 fix(forms): add select multiple accessor as built-in accessor 2016-06-26 16:24:27 -06:00
c369bc747d docs: update cheatsheet import lines (#9614) 2016-06-26 07:31:35 -07:00
c03e1f2f59 feat(forms): add support for formArrayName
Closes #9251
2016-06-25 13:30:53 -07:00
17dcbf66b9 feat(forms): expose ValidatorFn and AsyncValidatorFn
Closes #8834
2016-06-24 18:24:11 -07:00
40b907a657 refactor(testing): remove wrapping of Jasmine functions (#9564)
Instead, the async function now determines whether it should return a promise
or instead call a done function parameter. Importing Jasmine functions
from `@angular/core/testing` is no longer necessary and is now deprecated.

Additionally, beforeEachProviders is also deprecated, as it is specific
to the testing framework. Instead, use the new addProviders method directly.

Before:
```js
import {beforeEachProviders, it, describe, inject} from 'angular2/testing/core';

describe('my code', () => {
  beforeEachProviders(() => [MyService]);

  it('does stuff', inject([MyService], (service) => {
    // actual test
  });
});
```

After:
```js
import {addProviders, inject} from 'angular2/testing/core';

describe('my code', () => {
  beforeEach(() => {
    addProviders([MyService]);
  });

  it('does stuff', inject([MyService], (service) => {
    // actual test
  });
});
```
2016-06-24 17:48:35 -07:00
a33195dcf3 fix(core/testing compiler/testing): move TestComponentBuilder to core/testing (#9590)
TestComponentBuilder now lives in core/testing. compiler/testing contains a private
OverridingTestComponentBuilder implementation which handles the private behavior
we need to override templates. This is part of the effort to simplify the testing
imports and hide compiler APIs.

Closes #9585

BREAKING CHANGE:

`TestComponentBuilder` is now imported from `@angular/core/testing`. Imports
from `@angular/compiler/testing` are deprecated.

Before:

```
import {TestComponentBuilder, TestComponentRenderer, ComponentFixtureAutoDetect} from '@angular/compiler/testing';
```

After:
```
import {TestComponentBuilder, TestComponentRenderer, ComponentFixtureAutoDetect} from '@angular/core/testing';
```
2016-06-24 17:35:01 -07:00
c693c03f1d test(node): enable source maps in test.sh node (#9589) 2016-06-24 16:52:41 -07:00
de127109f9 feat(forms): make valueChanges and statusChanges available on abstract control directives 2016-06-24 14:37:19 -07:00
83208983b3 chore(router): bump up version number 2016-06-24 13:07:42 -07:00
327d04c9c6 chore(router): clang-format 2016-06-24 12:44:32 -07:00
54edce2bab fix(router): wildcard don't get notified on url changes 2016-06-24 12:44:32 -07:00
1a145ac500 fix(router): default exact to false in routerLinkActiveOptions 2016-06-24 12:44:32 -07:00
9f978cf49d test(router): add a test checking that you can use a slash in query params 2016-06-24 12:44:32 -07:00
41b781107b fix(router): doen't throw on canDeactive when route hasn't advanced 2016-06-24 12:44:32 -07:00
dcf75126bf fix(common/testing): remove internal MockLocationStrategy from common/testing (#9562)
BREAKING CHANGE:

MockLocationStrategy was intended to be internal only and is now removed
from the `@angular/common/testing` public api.

Use `SpyLocation` from `@angular/common/testing` for location testing.
2016-06-24 12:41:57 -07:00
1143b0389a fix(core/testing): move ComponentFixture to core (#9386)
BREAKING CHANGE:

`ComponentFixture` will be moving out of `@angular/compiler/testing` to `@angular/core/testing` in
this release. For now, it is deprecated from `@angular/compiler/testing`.
2016-06-24 12:41:49 -07:00
97a2119596 fix(forms): ngModel should emit valueChanges and statusChanges asynchronously 2016-06-24 12:37:46 -07:00
fbd2dd9ca2 fix(router): handle path:'' redirects and matches 2016-06-24 11:39:41 -07:00
f463e09b9f fix(ngc): work with typescript@next
This is required due to breaking change in TS, see
https://github.com/Microsoft/TypeScript/pull/8841#issuecomment-227300348
2016-06-24 10:27:31 -07:00
42a5b6cbda chore(testing): upgrade ts-api-guardian to 0.1.3 2016-06-23 18:19:32 -07:00
0ad1215a92 build(changelog): remove old changelog script and add gulp task 2016-06-23 17:35:57 -07:00
7733c97df3 build(npm): update conventional-changelog dependency
Fixes #5672
2016-06-23 17:35:57 -07:00
8a9e9c7bd3 fix(core/testing): clean up the core testing public API (#9466)
Previously, we were exporting internal mocks and helpers. Move these
to core/testing/testing_internal or remove them if they were
never used.

Remove deprecated items - injectAsync, clearPendingTimers.

BREAKING CHANGE:

Remove the following APIs from `@angular/core/testing`, which have been deprecated or were
never intended to be publicly exported:

```
injectAsync
clearPendingTimers
Log
MockAppliacationHref
MockNgZone
clearPendingTimers
getTypeOf
instantiateType
```

Instead of `injectAsync`, use `async(inject())`.

`clearPendingTimers` is no longer required.
2016-06-23 17:10:22 -07:00
3d8eb8cbca fix(platform-browser/testing): clean up public api for platform-browser/testing (#9519)
Mostly, removing things that were never intended to be exported publicy.

BREAKING CHANGE:

The following are no longer publicly exported APIs. They were intended as internal
utilities and you should use your own util:

```
browserDetection,
dispatchEvent,
el,
normalizeCSS,
stringifyElement,
expect (and custom matchers for Jasmine)
```
2016-06-23 16:42:25 -07:00
894747c34c fix(platform-browser/testing-e2e): clean up unused exports from e2e testing helpers (#9387) 2016-06-23 16:14:31 -07:00
8d5a312585 chore(api): clean up compiler/testing api (#9520)
Do not export MockXHR, which is a private helper.
2016-06-23 15:52:18 -07:00
8eb81b3741 ci: add updated ts-api-guardian check 2016-06-23 14:26:40 -07:00
22d8f73bc9 test: add public api golden files
Includes a few style fixes on "* as foo" imports.
2016-06-23 14:26:40 -07:00
249a6bdd98 test: upgrade ts-api-guardian to v0.1.2 2016-06-23 14:26:40 -07:00
3ad81b1beb test(security): simplify integration test. 2016-06-23 13:57:51 -07:00
5ab0534164 test(security): Ensure xlink:href is not bindable.
The DOM schema does not allow binding any properties to dangerous SVG
attributes/properties. This change adds a smoke test to verify that
behaviour, by testing that `xlink:href` (a sample dangerous property)
is not bindable.

Fixes #9510.
2016-06-23 13:57:51 -07:00
5150344213 fix(common): add license header to localization.ts 2016-06-23 13:27:43 -07:00
98cef76931 fix(security): no warning when sanitizing escaped html (#9392) (#9413) 2016-06-23 13:06:19 -07:00
6c5b653593 feat(core): add @Component.precompile and ComponentFactoryResolver
Part to #9467
Closes #9543
2016-06-23 12:10:04 -07:00
9ed8f2d26e fix(compiler): don't inject viewProviders into content child elements
E.g. in the following scenario,
`some-directive` should not be able to inject
any view provider that `my-comp-with-view-providers`
declares.

```
<my-comp-with-view-providers>
  <div some-directive></div>
</my-comp-with-view-providers>
```
2016-06-23 12:10:04 -07:00
33a2f86b28 chore: remove stale tsconfig.json
This tsconfig.json prevents fast round trip cycles in VsCode
as it relies on the package-dist folders to be filled.
2016-06-23 12:10:04 -07:00
fed1672a43 refactor(i18n): I18nPipe uses NgLocalization (#9313)
and some refactoring
2016-06-23 11:44:05 -07:00
54dbed4f48 fix(typings): don't test compiler-cli typings on TS 1.8 2016-06-23 10:57:03 -07:00
df759b8d4b fix(core): improve error message for broken bindings
Fixes #6820

Closes #9536
2016-06-23 19:28:56 +02:00
6edf0474cc feat(forms): add support for standalone ngModel dirs inside forms
Closes #9230
2016-06-23 10:16:47 -07:00
826f89f862 fix(ngc): correct dependencies for compiler-cli
Update compiler-cli dependencies to include minimist and also increment tsc-wrapped to 0.2.0.  There is signature mismatch between tsc-wrapped (v0.1.0) collector.js#getMetadata and compiler-cli reflector_host.js#getMetadataFor that caused an error anytime ngc was executed. The error received was as follows.

`TypeError: Cannot read property 'getSymbolsInScope' of undefined`

After forcing NPM to install @angular/tsc-wrapped@latest the error was resolved.

Fixes #9540
2016-06-23 10:16:04 -07:00
c43aec2182 fix(animations): make sure the easing value is passed into the web-animations player
Closes #9517
Closes #9523
2016-06-23 10:14:18 -07:00
ae75e3640a chore(lint): Added license headers to most TypeScript files
Relates to #9380
2016-06-23 09:47:54 -07:00
a5f2cc73f6 chore(lint): Add lint check for license headers
Added a tslint check to make sure all source files begin with a license
header (at the very beginning or after a `#!`).

Relates to #9380
2016-06-23 09:46:32 -07:00
e1e5c40ef7 fix(testing): remove the toThrowErrorWith matcher (jasmine has toThrowError)
BREAKING CHANGE:

Before:

    expect(...).toThrowErrorWith(msg);

After:

    expect(...).toThrowError(msg);
2016-06-23 08:58:52 -07:00
6420f75320 fix(testing): remove the toMatchPattern matcher (jasmine has toMatch)
BREAKING CHANGE:

Before:

    expect(...).toMatchPattern(pattern);

After:

    expect(...).toMatch(pattern);
2016-06-23 08:58:28 -07:00
5face35ae5 refactor: misc cleanup 2016-06-23 08:56:10 -07:00
398060d5ff fix(NgSwitch): display deprecation message only once 2016-06-23 08:56:10 -07:00
638fd744aa feat(forms): support updating of validators on exiting controls (#9516)
lint

fix

async

d

test

test
2016-06-23 08:18:07 -07:00
098b461b69 fix(core): report duplicate template bindings in templates
Fixes #7315

BREAKING CHANGES:

Previously multiple template bindings on one element
(ex. `<div *ngIf='..' *ngFor='...'>`) were allowed but most of the time
were leading to undesired result. It is possible that a small number
of applications will see template parse errors that shuld be fixed by
nesting elements or using `<template>` tags explicitly.

Closes #9462
2016-06-23 15:59:07 +02:00
9decc3d823 build: fix some issues on Windows platforms
Closes #9450
2016-06-23 10:46:01 +02:00
a5f2e205ef fix(http): add search param escaping for keys (#9166) 2016-06-22 18:23:15 -07:00
8899b83927 chore(typescript): Enabled noFallthroughCasesInSwitch
Turned on the noFallthroughCasesInSwitch flag in tsconfig and fixed
a few cases where there were fallthroughs.
2016-06-22 16:08:55 -07:00
f6a410a4a8 feat(QueryList): implement some() (#9464)
closes #9443
2016-06-22 13:13:31 -07:00
3d5bb23184 fix(Compiler): relax childIsRecursive check (#8705)
Fix how the compiler checks for recursive components by also considering
component descendants. Previously, it only checked if the current
component was evaluated previously. This failed in certain cases of
mutually recursive components, causing `createAsync` in tests to not
resolve.

closes [7084](https://github.com/angular/angular/issues/7084)
2016-06-22 07:02:11 -07:00
ef37d2ae0b example(router): add an example app for the new router 2016-06-21 23:19:26 -07:00
2eb234bc63 chore(router): enable bundling 2016-06-21 23:19:26 -07:00
758ee95880 fix(router): fix tsconfig to use es2015 modules 2016-06-21 23:19:26 -07:00
40e1112a8e chore(router): test karma config to rerun tests on change 2016-06-21 23:19:26 -07:00
397f5e2390 refactor(HtmlLexer): simplify the code 2016-06-21 18:03:22 -07:00
1a212259af refactor: cleanup lexers & parsers 2016-06-21 18:03:22 -07:00
f114dd300b fix(core): properly report missing providers and viewProviders (#9411)
Fixes #8237
2016-06-21 17:27:27 -07:00
5954a26bce docs: add latest changelog updates (#9415) 2016-06-21 17:16:22 -07:00
bdbbe5aa20 chore(release): 2.0.0-rc.3 2016-06-21 16:34:48 -07:00
15911367a2 refactor(router): removes a circualr dep 2016-06-21 12:17:30 -07:00
8dd3f59c81 chore(router): changes the router setup to align with other modules 2016-06-21 12:17:30 -07:00
c9d28492b7 chore(router): remove lint and format tasks from router 2016-06-21 12:17:30 -07:00
d1f93072a8 chore(router): clang-format 2016-06-21 12:17:30 -07:00
92d8bf9619 feat(router): add support for componentless routes 2016-06-21 12:17:30 -07:00
bd2281e32d fix(resolve): change resolve not to resolve root activate route 2016-06-21 12:17:30 -07:00
0c50bc6449 fix(router): url serializer should handle segments without primary children 2016-06-21 12:17:30 -07:00
f164715678 chore(README): fix a typo 2016-06-21 12:17:30 -07:00
2aa615b4ae chore(router): bump up version 2016-06-21 12:17:30 -07:00
42c89b1b9b docs(router): add a README to include a link to the guide 2016-06-21 12:17:30 -07:00
f6b75f56ad fix(router): typo in starts with slash validation error 2016-06-21 12:17:30 -07:00
280540e4a2 fix(router): change serialize not to require parenthesis in query string to be encoded 2016-06-21 12:17:30 -07:00
fea216db12 fix(router): fixes a type issue in a test 2016-06-21 12:17:30 -07:00
b260eb06f6 fix(router): change postinstall hook to devsetup to not require having 'typings' installed 2016-06-21 12:17:30 -07:00
1c937a10f9 chore(router): add changelog 2016-06-21 12:17:30 -07:00
ca23b4c55f feat(router): add route config validation 2016-06-21 12:17:30 -07:00
7e12208ca6 feat(router): do not support paths starting with / 2016-06-21 12:17:30 -07:00
2773281338 feat(router): drop index property
Use path: '/' instead of 'index: true'
2016-06-21 12:17:30 -07:00
f8e8d22e4e fix(router): stringify positional parameters when using routerLink 2016-06-21 12:17:30 -07:00
cf4a9236b9 chore(router): bump up version number 2016-06-21 12:17:30 -07:00
4450e7b246 cleanup(router): enable noImplicitAny and noImplicntReturns 2016-06-21 12:17:30 -07:00
cdbf67ee05 test(router): add a test checking that guards work for child routes 2016-06-21 12:17:30 -07:00
9a67f38728 fix(router): port fixes done on angular current router to the new one
The bugs were fixed on current angular router in the following commits:
angular/angular@b2a7fd05cb
angular/angular@fa2ce8100b
angular/angular@595bcdd1ac

Closes #12
2016-06-21 12:17:30 -07:00
25560ed048 feat(router): implement RouterLinkActive 2016-06-21 12:17:30 -07:00
2aa19fd078 feat(router): support navigating by url tree 2016-06-21 12:17:30 -07:00
cca9a58ded chore(router): bump up version number 2016-06-21 12:17:30 -07:00
d6a25325c7 chore(package): unpin version 2016-06-21 12:17:30 -07:00
a717da2d3e chore(router): bump up version number 2016-06-21 12:17:30 -07:00
b3e801ed9e feat(router): make it work with TypeScript 1.8 2016-06-21 12:17:30 -07:00
3683fb6886 refactor(router): minor refactoring 2016-06-21 12:17:30 -07:00
3bd0ce291e feat(router): mark the index property as deprecated
Use {path: '', component: A} instead of {index: true, component: A}

}#
2016-06-21 12:17:30 -07:00
523fc5536c fix(router): fix Params type to allow passing any value types when calling router.navigate 2016-06-21 12:17:30 -07:00
f5efccfb44 test(router): test update location when route does not change 2016-06-21 12:17:30 -07:00
b6ec22de6b test(router): test empty url with global redirect 2016-06-21 12:17:30 -07:00
15f27b5455 fix(providers): make providers static analysis friendly 2016-06-21 12:17:30 -07:00
127401598b feat(router): implement terminal 2016-06-21 12:17:30 -07:00
503b07f698 docs(router): add a README 2016-06-21 12:17:30 -07:00
f0a6329005 fix(router): fixes a typo 2016-06-21 12:17:30 -07:00
2982892acc cleanup(router): clang-format 2016-06-21 12:17:30 -07:00
9de56481f1 feat(router): add enableTracing option 2016-06-21 12:17:30 -07:00
777eb2f159 feat(router): emit an event when routes are recognized 2016-06-21 12:17:30 -07:00
05eebe0fed feat(router): provide meaningful toString impls 2016-06-21 12:17:30 -07:00
fdfbbd5bac chore(router): bump up version number 2016-06-21 12:17:30 -07:00
1f3f8ef6c8 fix(router): fix nested deactivation 2016-06-21 12:17:30 -07:00
820eeb49d1 chore(router): bump up version number 2016-06-21 12:17:30 -07:00
2d4be1c9eb fix(router): init is not triggered in certain scenarios 2016-06-21 12:17:30 -07:00
2fef30f619 fix(router): make stringify handle nulls 2016-06-21 12:17:30 -07:00
10113b63b5 chore(router): bump up version number 2016-06-21 12:17:30 -07:00
545caab433 fix(router): use bootstrap listener to trigger initial navigation 2016-06-21 12:17:30 -07:00
3f90659cc1 fix(router): supports index routes with path 2016-06-21 12:17:30 -07:00
131914ac94 fix(router): fix lazy loading issues 2016-06-21 12:17:30 -07:00
29a7c4538c Revert "fix(provider): fix a circular dependency & remove common providers"
This reverts commit 6375fdd4f2928d5ddeccaf11a8589a7668bc9049.
2016-06-21 12:17:30 -07:00
f195bb608c chore(router): update config before publishing to npm 2016-06-21 12:17:30 -07:00
66caabca0c feat(router): implement redirectTo 2016-06-21 12:17:30 -07:00
25c6a3715d fix(provider): fix a circular dependency & remove common providers 2016-06-21 12:17:30 -07:00
97cf0e40d5 fix(guards): Cancel in-flight guards if one returns false 2016-06-21 12:17:30 -07:00
6988a550ea cleanup(router): fix tslint errors 2016-06-21 12:17:30 -07:00
8a1cdc2dd5 chore: install typings with npm i 2016-06-21 12:17:30 -07:00
dadd5ddded chore: add lint and clang-format 2016-06-21 12:17:30 -07:00
56f8c95ee9 tests(router): add tests verifying that updating secondary segments using router link works 2016-06-21 12:17:30 -07:00
ed50e17e5b refactor(router): rename queryParameters into queryParams 2016-06-21 12:17:30 -07:00
33b518ad21 feat(router): update RouterLink to support query params and fragment 2016-06-21 12:17:30 -07:00
b0e7c14545 fix(router): add an app initializer to trigger initial navigation
Closes #10
2016-06-21 12:17:30 -07:00
5742d4720a fix(router): fix router to handle guards that return observable
Closes #19
2016-06-21 12:17:30 -07:00
9b356d9b86 fix(router): traverse route config in depth-first order
Closes #17
2016-06-21 12:17:30 -07:00
793ac3f6b4 Configure router with provided routes
Closes #9
2016-06-21 12:17:30 -07:00
9b094e42a3 chore(router): update the npm dist 2016-06-21 12:17:30 -07:00
6ce7a5a1ea docs(router): add docs 2016-06-21 12:17:30 -07:00
88920bfee1 feat(router): add support for basic events 2016-06-21 12:17:30 -07:00
2717bcc3af feat(router): implement cancelation 2016-06-21 12:17:30 -07:00
5d386dc426 chore(router): update build dir 2016-06-21 12:17:30 -07:00
f34af4f249 feat(router): add support for using classes as guard 2016-06-21 12:17:30 -07:00
f04b6978fb cleanup(router): add @internal to constructors where needed 2016-06-21 12:17:30 -07:00
ab958598d7 feat(router): implement CandDeactivate 2016-06-21 12:17:30 -07:00
1914847e72 cleanup(router): make strictNullChecks happy 2016-06-21 12:17:30 -07:00
d95f0fd83d fix(router): fix index routes 2016-06-21 12:17:30 -07:00
243612e36d refactor(router): rename candidate into snapshot 2016-06-21 12:17:30 -07:00
c5cca8e098 feat(router): add support for CanActivate guard 2016-06-21 12:17:30 -07:00
99f7404d8b refactor(router): remove rootNode function 2016-06-21 12:17:30 -07:00
9ff6b0828f feat(router): make activation sync 2016-06-21 12:17:30 -07:00
6f052d1daf feat(router): add a function to resolve components 2016-06-21 12:17:30 -07:00
63c194b71f feat(router): change recognize to return a router state candidate 2016-06-21 12:17:30 -07:00
46911117f1 feat(router): implement a function create router state out of a candidate 2016-06-21 12:17:30 -07:00
2de1030413 feat(router): add RouterStateCandidate 2016-06-21 12:17:30 -07:00
1f6ade894e cleanup(router): fix a typo 2016-06-21 12:17:30 -07:00
8407cfeac7 fix(router): fix router to take root component type instead of instance 2016-06-21 12:17:30 -07:00
91d64a2855 feat(router): export provideRouter via index 2016-06-21 12:17:30 -07:00
40a06af79b feat(router): add provideRouter to configure the router when bootstrapping an app 2016-06-21 12:17:30 -07:00
8aef86f4a0 feat(router): export all public api tokens via index 2016-06-21 12:17:30 -07:00
5bdc6ecec8 chore: adds the build dir to use with 'npm install' 2016-06-21 12:17:30 -07:00
c179b5033b feat(router): implement relative navigation 2016-06-21 12:17:30 -07:00
86f47273bc feat(router): changes router config not to use names 2016-06-21 12:17:30 -07:00
2e1bd46bb1 feat(router): add createUrlTree 2016-06-21 12:17:30 -07:00
a9e773b47b feat(router): serialize outlet names into the url 2016-06-21 12:17:30 -07:00
10d38cbb72 chore(router): change karma reporter 2016-06-21 12:17:30 -07:00
a5371bfb8a cleanup: cleanup tsconfig files 2016-06-21 12:17:30 -07:00
4b2740f270 refactor: move index.ts into src 2016-06-21 12:17:30 -07:00
5b371736b2 feat: add RouterLink 2016-06-21 12:17:30 -07:00
c9b4bcf689 refactor: move all utility functions into the utils dir 2016-06-21 12:17:30 -07:00
013f9a2bbc feat: add tree.siblings 2016-06-21 12:17:30 -07:00
5bf1c93ead docs: adds missing api docs 2016-06-21 12:17:30 -07:00
4f6ec01932 feat: implement a simple version of the router service 2016-06-21 12:17:30 -07:00
0f79e504c9 test: set up karma to support fakeAsync 2016-06-21 12:17:30 -07:00
1a4e911b8b cleanup: fix type errors when compiling with strictNullChecks enabled 2016-06-21 12:17:30 -07:00
1f98519380 feat: implement RouterOutletMap 2016-06-21 12:17:30 -07:00
aad7010952 feat: add RouterOutlet 2016-06-21 12:17:30 -07:00
1be9ea681b fix: fix source maps 2016-06-21 12:17:30 -07:00
f259a2204b feat: implement recognizer 2016-06-21 12:17:30 -07:00
4b1db0e61c feat: implement default url serializer 2016-06-21 12:17:30 -07:00
aee764d14d chore: update TS to enable non-nullable types 2016-06-21 12:17:30 -07:00
47585498af chore: updates typings to head 2016-06-21 12:17:30 -07:00
37c5320e33 feat: implement Tree 2016-06-21 12:17:30 -07:00
01111a1122 cleanup: removes a fake test 2016-06-21 12:17:30 -07:00
0b2bb1b6f5 chore(typings): use typings instead of tsd 2016-06-21 12:17:30 -07:00
f57df3cf8a chore: set up test and build infrastructure 2016-06-21 12:17:30 -07:00
c9c81e1fbc fix(XmbSerializer): add meaning attribute, escape attribute values 2016-06-21 11:52:11 -07:00
e38e04c1c2 refactor(MessageExtractor): pass the interpolationConfig around 2016-06-21 11:52:11 -07:00
99587ea4ed refactor(i18n): misc 2016-06-21 11:52:11 -07:00
58b18d7fe7 fix(partition): fix partition when <!-- i18n --> is the only child 2016-06-21 11:52:11 -07:00
04a50f5832 feat(MessageExtractor): do not expand ICU messages before extraction 2016-06-21 11:52:11 -07:00
e157a065b0 fix(compiler): codegen view query generic types 2016-06-21 11:51:54 -07:00
41ef4b3d4a chore(npm): add repository metadata 2016-06-21 11:21:04 -07:00
262650ab39 docs(test_injector): Fix documentation typo (#9403)
- Change 'teh' for 'the'
2016-06-21 11:19:08 -07:00
8c076d5a73 fix(upgrade): fix bundling issue and fix e2e test
the previous demo app was broken and is missing an e2e test.

I fixed the app, but was not able to get protractor to properly test
this app. Julie and I are looking into that. For now I manually verified
that the app works and that the original issue was fixed.

Closes #9244
2016-06-21 11:12:42 -07:00
c5c456120c refactor: delete containsRegexp() (there is escapeRegExp() in the lang facade)
BREAKING CHANGES:

`containsRegexp` is no more exported from `@angular/core/testing`. It should not have been part of the public API in the first place.
2016-06-21 09:15:21 -07:00
fdf6bc18dd fix(compiler): properly report unresolved dependencies
Fixes #9332

Closes #9341
2016-06-21 16:36:57 +02:00
297f0fd2c3 fix(core/testing): show full error
test(platform-browser): update fail capture

test(platform-browser-dynamic): update fail capture
2016-06-20 19:36:37 -07:00
86405345b7 doc: fix enableDebugTools import path (#9377) 2016-06-20 16:45:35 -07:00
12c49042ab fix(HTTP/XhrBackend): correctly set the status code on errors (#9355)
fixes #9329
fixes angular/http#54
2016-06-20 15:02:14 -07:00
ba46ca683b fix(animations): ensure starting styles are applied when a delay is present
Closes #9326
Closes #9328
2016-06-20 11:16:39 -07:00
ca42b49fa2 refactor: misc cleanup (#9369) 2016-06-20 10:55:29 -07:00
1b28cf71f5 feat(compiler): make interpolation symbols configurable (@Component config) (#9367)
closes #9158
2016-06-20 09:52:41 -07:00
6fd52dfb38 build(npm): update ts-api-guardian to v0.0.4 (#9366) 2016-06-20 09:32:27 -07:00
af2f5c3d7d cleanup(router): removes router 2016-06-20 08:47:54 -07:00
65be81baf8 doc(CheatSheet): update ngSwitch syntax in the cheatsheet (#9361) 2016-06-20 08:05:50 -07:00
7a3689f175 chore: formating 2016-06-19 22:27:29 +02:00
8675b8dc48 fix: cleanup public api of platform-server
BREAKING CHANGE: Parse5Adapter is no longer exported as public API, use serverBootstrap()

Parse5Adapter is an implementation detail not a public API

Closes #9237

Closes #9205
2016-06-19 09:03:01 -07:00
279e816ea7 chore: Remove unnecessary calls to Parse5DomAdapter
This reverts commit 80deac5cde.
2016-06-19 08:42:00 -07:00
2d60ff14ae bug(datePipe): date format pipe's 2-digit interpretation of minutes and seconds (#9338)
Closes #9333
2016-06-18 09:03:58 -07:00
dee1b774f2 docs(changelog): add note about forthcoming deprecation of Parse5DomAdapter (#9314) 2016-06-17 17:34:14 -07:00
c0f2a22a08 fix(perf): support prod mode again
After splitting the facades into multiple modules,
enabling prod mode for code had no effect for the compiler.

Also in a change between RC1 and RC2 we created the `CompilerConfig`
via a provider with `useValue` and not via a `useFactory`, which reads
the prod mode too early.

Closes #9318
Closes #8508
Closes #9318
2016-06-17 15:59:27 -07:00
5c8d3154d7 feat(datePipe): numeric string support 2016-06-17 15:58:06 -07:00
40f8a45b95 test(DatePipe): fixes 2016-06-17 15:48:26 -07:00
76a418760e fix(BrowserUtil): fix supportsIntlApi() 2016-06-17 15:34:12 -07:00
49bf3f5b3a fix(NumberPipe): fix broken RegExp
introduced in 7498050421 (#9308)
2016-06-17 15:33:25 -07:00
773c34900f fix(change_detection): ChangeDetectorRef reattach should restore original mode
After using ChangeDetectorRef detach, it should keep the ChangeDetector mode so that it is restored after calling reattach.

closes #7078
closes #7080
2016-06-17 15:00:41 -07:00
791153c93c fix(compiler): StaticReflector ignores unregistered decorators. (#9266)
Also modified static reflector to allow writing tests in using
the .ts and using the MetadataCollector.

Also made MetadataCollector be able to use SourceFiles that have
not been bound (that is, don't have the parent property set).

Fixes #9182
Fixes #9265
2016-06-17 13:11:00 -07:00
721f53f0d6 feat(I18N Expander): do not add extra <ul> & <li> around ICU messages (#9283)
fixes #9072
2016-06-17 11:38:24 -07:00
7498050421 refactor: misc (#9308) 2016-06-17 10:57:50 -07:00
5e3ccbcea9 refactor: add types (#9288) 2016-06-17 10:57:32 -07:00
8879aa1df4 feat(security): fail more detectably when using a safe value in an interpolation.
If a user ends up with a safe value in an interpolation context, that's probably
a bug. Returning `"SafeValue must use [property]= binding"` will make it easier
to detect and correct the situation. Detecting the situation and throwing an
error for it could cause performance issues, so we're not doing this at this
point (but might revisit later).

Part of #8511 and #9253.
2016-06-17 10:00:30 -07:00
44e0ad4987 refactor(forms): remove the facade local copy (#9276) 2016-06-17 08:53:17 -07:00
c449f325ba docs: remove and identify reverts in changelog 2016-06-17 08:45:40 -07:00
5fe60759f9 feat(QueryList): support index in callbacks
Closes #9278
2016-06-17 08:09:42 -07:00
6c389ed32f ci(local dev): fix test.sh 2016-06-16 15:46:08 -07:00
45549cda61 refactor(core): get rid of the bitwise operator facade helpers 2016-06-16 14:31:55 -07:00
a13052fc73 refactor(core): rename css_parser and css_lexer files
Closes #9273
2016-06-16 14:31:48 -07:00
4e7bb03e81 refactor(core): rename AST to Ast for all CSS parser code 2016-06-16 14:31:41 -07:00
935c39a7e2 feat(core): ensure CSS parser tracks start/end values and understands complex pseudo selectors 2016-06-16 14:31:34 -07:00
e0c1c13004 chore(.github): improve github issue and PR templates
the current templates accidentaly introduce tasks list which is confusing to both people
submitting the issue as well as triaging it.
2016-06-16 14:29:05 -07:00
c08ca22dba refactor(HtmlParser): clang format 2016-06-16 13:54:00 -07:00
a3f6e19881 docs: add missing breaking changes (#9267) 2016-06-16 13:49:29 -07:00
37b617dccf chore(tsickle): add @Annotation annotations
This lets users continue using runtime-sideeffect Decorators if they choose,
only down-leveling the marked ones to Annotations.

Also remove the "skipTemplateCodegen" option, which is no longer needed
since Angular compiles with tsc-wrapped rather than ngc. The former doesn't
include any codegen.
2016-06-16 12:29:46 -07:00
c60ef45bc8 fix(HtmlParser): add missing ; 2016-06-16 10:23:02 -07:00
2b1ac63e3a npm: bump the version number in package.json
this version string is currently not authoritative source see #9264 and #9233
2016-06-16 09:57:44 -07:00
6686bc62f6 feat(benchpress): add custom user metric to benchpress
This is a continuation of #7440 (@jeffbcross).

Closes #9229
2016-06-16 07:30:53 -07:00
1eaa193c51 feat(compiler-cli): add a debug option to control the output
fixes #9208
2016-06-15 18:13:57 -07:00
b620f4f456 feat(DomElementSchemaRegistry): add support for <ng-content> and <ng-container> 2016-06-15 18:13:57 -07:00
e484c62a8d fix(HtmlParser): do not add required parents to template root elements
fixes #5967
2016-06-15 18:13:57 -07:00
9ba400d7d5 fix(HtmlParser): consider <ng-container> when adding required parents 2016-06-15 18:13:57 -07:00
9cbd8f7afc test(ng-container): test nesting ng-containers 2016-06-15 18:13:57 -07:00
8e6e90e703 fix(forms): ngModel should export as ngModel 2016-06-15 17:46:45 -07:00
26676c4833 docs(webworker): add/correct experimental markers to web worker apis 2016-06-15 17:12:40 -07:00
39e0b4903c feat(radio): support radio button sharing a control 2016-06-15 15:27:34 -07:00
54c577cfe0 chore: update cheatsheet for new provider syntax (#9227) 2016-06-15 15:11:39 -07:00
27024915e4 docs: removed iframe from changelog (#9223) 2016-06-15 13:17:45 -07:00
80f3e7591e chore(docs): Update changelog for release (#9217) 2016-06-15 12:49:39 -07:00
933f45ef31 docs(webworkers): add experimental markers for all web worker public apis 2016-06-15 09:38:03 -07:00
4fc37aeabd fix(webworkers): rename all web worker apis with "render" to "ui"
"render" is gramatically incorrect and confusing to developers who used this api.

Since webworker apis were exposed only in master, renaming these before the rc2 release
is not a breaking change
2016-06-15 09:38:03 -07:00
2fd1e88199 fix(forms): suppress forms deprecation warning after first 2016-06-15 08:52:56 -07:00
17f317d31e fix: correct failing to push into builds repo on rerun 2016-06-14 21:28:37 -07:00
5941c92a31 fix: make ci fail when compiler integration test fails 2016-06-14 19:40:43 -07:00
d44d0852e5 Revert "fix: cleanup public api of platform-server"
This reverts commit ac84468f1c.
2016-06-14 19:40:43 -07:00
80deac5cde Revert "chore: Remove unnecessary calls to Parse5DomAdapter"
This reverts commit 387a90e546.
2016-06-14 19:40:43 -07:00
8a54c1a115 refactor(ViewBuilder): cleanup 2016-06-14 19:11:30 -07:00
0dbff55bc6 feat(Compiler): add support for <ng-container>
`<ng-container>` is a logical container that can be used to group nodes but is not rendered in the DOM tree as a node.

`<ng-container>` is rendered as an HTML comment.
2016-06-14 19:11:30 -07:00
22916bb5d1 feat(forms): add easy way to switch between forms modules (#9202) 2016-06-14 18:23:40 -07:00
fe01e2efb7 feat(I18nExtractor): Add file paths to error messages (#9177)
* feat(I18nExtractor): Add file paths to error messages

relates to #9071

* feat(i18n): allow i18n start comments without meaning

* refactor(i18n): cleanup

* test(HtmlParser): Add depth to expansion forms
2016-06-14 17:50:23 -07:00
7afee97d1b fix(platform-server): correctly import private DOMTestComponentRenderer 2016-06-14 17:26:55 -07:00
6fc267f22c fix: split dynamic bits in platform-browser into platform-browser-dynamic
Previously these symbols were exposed via platform-browser-dynamic, then we merged then into platform-browser
thinking that tools would know how to shake off the compiler and other dynamic bits not used with the offline
compilation flow. This turned out to be wrong as both webpack and rollup don't have good enough tree-shaking
capabilities to do this today. We think that in the future we'll be able to merge these two entry points into
one, but we need to give tooling some time before we can do it. In the meantime the reintroduction of the -dynamic
package point allows us to separate the compiler dependencies from the rest of the framework.

This change undoes the previous breaking change that removed the platform-browser-dynamic package.
2016-06-14 15:31:24 -07:00
ac84468f1c fix: cleanup public api of platform-server
BREAKING CHANGE: Parse5Adapter is no longer exported as public API, use serverBootstrap()

Parse5Adapter is an implementation detail not a public API
2016-06-14 13:21:28 -07:00
387a90e546 chore: Remove unnecessary calls to Parse5DomAdapter 2016-06-14 13:07:11 -07:00
6eeb9495d8 chore: have test.sh take platform argument 2016-06-14 13:07:11 -07:00
566b4ef481 ci(snapshots): publish tsc-wrapped snapshots 2016-06-13 18:30:38 -07:00
a191e9697c feat(forms): support setting control name in ngModelOptions 2016-06-13 16:57:10 -07:00
5504ca1e38 feat(compiler): Added support for limited function calls in metadata. (#9125)
The collector now collects the body of functions that return an
expression as a symbolic 'function'. The static reflector supports
expanding these functions statically to allow provider macros.

Also added support for the array spread operator in both the
collector and the static reflector.
2016-06-13 15:56:51 -07:00
5c0cfdee48 fix(forms): separate ngModelGroup from formGroupName 2016-06-13 13:41:39 -07:00
bc888bf3a1 refactor(compiler): Change arguments of CompilerConfig to named arguments
BREAKIKNG CHANGE:
`CompilerConfig` used to take positional arguments and now takes named arguments.

Closes #9172
2016-06-13 13:14:07 -07:00
1745366530 refactor(compiler): make PLATFORM_PIPES / PLATFORM_DIRECTIVES an option on CompilerConfig
This aligns the configuration of platform pipes / directives with offline compilation.

BREAKING CHANGE:
- `PLATFORM_PIPES` and `PLATFORM_DIRECTIVES` now are fields on `CompilerConfig`. 
  Instead of providing a binding to these tokens, provide a binding for `CompilerConfig` instead.
2016-06-13 13:13:45 -07:00
1fb0db4aeb chore(docs): Fixed pre-commit command for clang-format 2016-06-13 12:12:44 -07:00
61960c51a3 feat(forms): compose validator fns automatically if arrays 2016-06-13 11:41:32 -07:00
14a3ade662 chore(typescript): Changed double asterisks in #9100 to single asterisks
As in #9151, these comments are being read as JSDoc comments. This commit is smaller and only touches a few files that are causing errors.
2016-06-13 10:53:31 -07:00
de97687422 docs(i18n): fix typo (#9165) 2016-06-13 10:00:57 -07:00
a0251305ea doc(CompilerCli): Add a bootstrap example for a compiled application 2016-06-13 08:59:16 -07:00
2b8d12ddf0 chore(forms): rename ngControl to formControlName 2016-06-12 13:17:36 -07:00
1f6fd3c8fc refactor: add types (#9148) 2016-06-11 21:23:37 -07:00
55860e1621 fix(animations): ensure AUTO styles are cleared at the end of the state-change animation
Closes #9014
Closes #9015
2016-06-11 00:08:41 -07:00
4d51158b1a fix(animations): ensure the web-animations driver converts style props to camel-case
The web animations API now requires that all styles are converted to
camel case. Chrome has already made this breaking change and hyphenated
styles are not functional anymore.

Closes #9111
Closes #9112
2016-06-10 22:54:10 -07:00
7d9c1e1225 chore(forms): rename ngFormModel to formGroup 2016-06-10 19:10:17 -07:00
d53edfec47 chore(forms): rename ngFormControl to formControl 2016-06-10 17:28:19 -07:00
a6e5ddc5af feat(ComponentResolver): Add a SystemJS resolver for compiled apps (#9145) 2016-06-10 16:31:34 -07:00
b866f32832 chore(forms): rename Control, ControlGroup, and ControlArray classes 2016-06-10 12:00:18 -07:00
97833d48c1 chore(templateOutlet): fix linting 2016-06-10 11:32:09 -07:00
9c0031f7a5 fix: broken build due to bad noImplicitAny merge 2016-06-10 10:35:36 -07:00
164a091c71 feat(NgTemplateOutlet): add context to NgTemplateOutlet
Closes #9042
2016-06-10 10:25:44 -07:00
4ed6cf7519 feat(forms): allow ngModel to register with parent form 2016-06-10 10:24:01 -07:00
5267115481 feat(I18N): generate error on unknown cases
fixes #9094
2016-06-10 08:45:59 -07:00
43148d8233 feat(HtmlLexer): add support for alphabetic cases 2016-06-10 08:45:59 -07:00
537e99b4ea fix(http): respect custom Content-Type header in XHRConnection (#9131)
Fix a bug due to which setting a custom Content-Type header in the
Request led to multiple Content-Types being set on the sent
XMLHttpRequest: first the detected content type based on the request
body, followed by the custom set content type.

Fix #9130.
2016-06-10 08:18:49 -07:00
e1fcab777c fix(ngSwitch): use switchCase instead of switchWhen (#9076) 2016-06-09 22:52:30 -07:00
f39c9c9e75 style(lint): re-format modules/@angular 2016-06-09 17:00:15 -07:00
bbed364e7b chore(tsc-wrapped): update to newest tsickle 2016-06-09 16:45:16 -07:00
3aca5ff9e2 fix(compiler): properly report missing DI tokens (#9065)
Fixes #8245
2016-06-09 16:07:06 -07:00
9146bb0816 docs(DatePipe): Update date doc reference in date_pipe.ts (#9081) 2016-06-09 16:05:13 -07:00
0c9e8dbf60 docs(linker): document the injector argument as mandatory (#9098)
Fixes #8600
2016-06-09 16:03:42 -07:00
b34a04d53a chore(build): activate optional jobs in SL and BS (#8605) 2016-06-09 15:21:17 -07:00
0658eb4429 fix(compiler): Added unit test to ReflectorHost and fixed issues (#9052)
Refactored ReflectorHost to allow it to be tested.
Fixed an issue where the .d.ts was findable but it wasn't used by the project
  (This happens when the .metadata.json file references a module that was not
   needed, such as it doesn't declare any types, and the reference to it was
   elided by TypeScript when writing the .d.ts file).
Added tests for ReflectorHost
2016-06-09 14:51:53 -07:00
e178ee4ba0 fix(compiler): Added support for '* as m' style imports. (#9077)
Also includes fixes for broken test.
2016-06-09 13:23:29 -07:00
9f506cd330 chore(lint): remove unused lint checks
Now that we have --noImplicitAny we don't need these checks for explicit types in specific locations.

Also re-enable the check to disallow keywords as variable names.
2016-06-09 11:34:53 -07:00
729dc3b764 fix(security): support XSSI prefixes with and without commas.
Some implementations use an XSSI prefix with a trailing comma, some without.
This changes Angular to support both.
2016-06-09 11:32:07 -07:00
7ce0fc7d47 refactor: add types (#9116) 2016-06-09 11:04:15 -07:00
b60eecfc47 fix(build): update API spec to include the return value. 2016-06-09 10:11:02 -07:00
346304762e feat(security): document <iframe src> to be TRUSTED_URL.
Docs on the DomSanitizationService didn't match actual usage before.

Also fixes some minor docs and implementation issues.
2016-06-08 20:49:15 -07:00
e213939f28 chore(forms): fix implicit any 2016-06-08 17:08:59 -07:00
4c39eace52 feat(forms): add new forms folder 2016-06-08 16:41:08 -07:00
86fbd50c3d refactor(TypeScript): Add noImplicitAny
We automatically insert explicit 'any's where needed. These need to be
addressed as in #9100.

Fixes #4924
2016-06-08 16:20:50 -07:00
87d824e1b4 fix: add typescript test for our typings (#9096)
* Revert "fix(d.ts): enable angular2 compilation with TS flag --strictNullChecks (#8902)"

This reverts commit 7e352a27f7.

* test: add typescript test for our typings
2016-06-08 16:06:23 -07:00
50acb96130 fix(forms): update value and validity when controls are added
Closes #8826
2016-06-08 14:06:20 -07:00
29c2dcff61 fix(http): remove peerDep on @angular/common
it is not needed there because it will get transitively installed by @angular/platform-browser

we only need to declare this dependency in tsconfig.json because tsconfig.json's
do not support transitive dependencies in this way.
2016-06-08 12:20:42 -07:00
cea103a7ff test: add tree-shaking test
currently this doesn't throw or break the build, first we need to resolve all
of the existing issues.

to run execute: ./tools/tree-shaking-test/test.sh

then inspect dist/tree-shaking/test/**/*.bundle.js
2016-06-08 12:20:42 -07:00
d18694a1c3 Revert "WIP: test: add tree-shaking test (#8979)"
This reverts commit b746c64229.

Reason: bad merge via github ui
2016-06-08 12:20:17 -07:00
b746c64229 WIP: test: add tree-shaking test (#8979)
* test: add tree-shaking test

currently this doesn't throw or break the build, first we need to resolve all
of the existing issues.

to run execute: ./tools/tree-shaking-test/test.sh

then inspect dist/tree-shaking/test/**/*.bundle.js

* fix(http): remove peerDep on @angular/common

it is not needed there because it will get transitively installed by @angular/platform-browser

we only need to declare this dependency in tsconfig.json because tsconfig.json's
do not support transitive dependencies in this way.
2016-06-08 12:15:09 -07:00
d38aa5e25f chore(lint): sort imports in tools/ 2016-06-08 11:29:37 -07:00
efdc2d5118 chore(lint): upgrade clang-format 2016-06-08 11:29:37 -07:00
515a8e0765 fix(forms): rename old forms folder to forms-deprecated 2016-06-08 11:21:58 -07:00
45de65bd45 fix(router): don't mark the RouterOutletMap as internal
it's currently being reexported as public api which breaks anyone tryin to import
the router because the RouterOutletMap definition is missing
2016-06-08 11:18:35 -07:00
9d6b98794e chore: fix build break by using tsickle@0.1.2 2016-06-08 09:34:53 -07:00
7aa1790874 fix(travis): pin the version of tsickle for offline_compiler_test 2016-06-07 17:16:26 -07:00
5cd490eba2 test(public api): sort symbols case insensitive 2016-06-07 15:17:02 -07:00
ac1156739d feat(i18n): extract messages 2016-06-07 15:17:02 -07:00
7cefec77ef fix(ngUpgrade): prevent digest already in progress (#9054)
fix(ngUpgrade): prevent digest already in progress
2016-06-07 15:10:13 -07:00
36d25f2a07 feat(animations): support styling of the default animation state
It is now possible to set a fallback state that will apply its
styling when the destination state is not detected.

```ts
state("*", style({ ... }))
```

Closes #9013
2016-06-07 12:59:33 -07:00
c3d2459a4e fix(query): set fixed @ViewChild / @ContentChild right after the view is created
This is needed to have a true replacement of the previous
`DynamicComponentLoader.loadNextToLocation`, so that components
can be loaded into the view before change detection runs.

Closes #9040
2016-06-07 12:40:35 -07:00
8847580fd7 Revert "fix(compiler): add ability to parse : in * directives"
This reverts commit 53628e19ac.
as it breaks pipe arguments in `*ngFor`, ...

See #9062
Closes #9063
2016-06-07 12:39:17 -07:00
cf3548a02f fix(compiler): Improved error reporting of the static reflector.
StaticReflector provides more context on errors reported by the
collector.

The metadata collector now records the line and character of the node that
caused it to report the error.

Includes other minor fixes to error reporting and a wording change.

Fixes #8978
Closes #9011
2016-06-07 08:38:32 -07:00
c197e2bb42 Revert "fix(ngUpgrade): prevent digest already in progress (#9046)"
This reverts commit d1c989b8a5.

Breaks a Karma test.
2016-06-06 16:30:11 -07:00
d1c989b8a5 fix(ngUpgrade): prevent digest already in progress (#9046) 2016-06-06 13:34:27 -07:00
57c9a07fff chore: fix public api spec for beforeEachProviders
Closes #9043
2016-06-06 09:25:52 -07:00
a19c4e8f9a fix(upgrade): allow functions for template and templateUrl (#9022) 2016-06-04 19:53:51 -07:00
53083c0b52 refactor(testing): type beforeEachProviders (#9023)
these are valid otherwise
```typescript
beforeEachProviders(1)
beforeEachProviders('wat')
beforeEachProviders([
  Http
])
```
2016-06-04 19:52:51 -07:00
994d9212c1 docs(NgControlName): correct exports name (#9021) 2016-06-04 19:48:50 -07:00
52ddc96c9f refactor(compiler): remove obsolete @View-related code (#9019) 2016-06-04 19:46:55 -07:00
057abefe50 fix(compiler): report errors for queries without selectors (#9018)
Fixes #4489
2016-06-04 19:46:03 -07:00
f0e24b1a1e chore(karma): remove ref to legacy files (#9008) 2016-06-04 14:44:59 -07:00
a1e3004e62 docs(animations): provide API docs for the animation DSL
Closes #8970
2016-06-03 18:57:17 -07:00
e504d4eb05 fix(renderer): remove unecessary setElementStyles method
There is no need to expose this additional method inside of the Renderer
API. The functionality can be restored by looping and calling
`setElementStyle` instead.

Note that this change is changing code that was was introduced after
the last release therefore this fix is not a breaking change.

Closes #9000
Closes #9009
2016-06-03 15:20:34 -07:00
a6ad61d83e refactor: change provide(...) for {provide: ...}
- provide() is deprecated,
- {} syntax is required by the offline compiler
2016-06-03 15:03:49 -07:00
27a47e7841 refactor(imports): simplify paths 2016-06-03 14:46:04 -07:00
b00b9fe564 chore(README): update missing step in compiler-cli docs README 2016-06-03 14:36:16 -07:00
fa0718ba9a feat(animations): provide support for offline compilation 2016-06-03 14:36:11 -07:00
155b88213c feat(debug): collect styles and classes for the DebugElement 2016-06-03 14:36:06 -07:00
35ea02fb81 fix(compiler): Reflector generates imports for '..' relative modules.
Fixes #9003
Closes #9004
2016-06-03 12:54:30 -07:00
ddd2ac4f55 fix(core): fix type of DebugNode.properties (#8964)
Properties can have any value, not just strings.
2016-06-03 10:51:13 -07:00
6f281ab3c4 fix(HTMLParser): properly report errors for not properly closed tags (#8999)
Fixes #7849
2016-06-03 10:49:17 -07:00
fe8a7b0e82 fix(test-runner): make karma internal reporter compatible with 0.13.20 (#8977)
causes internal reporter to produce output messages again after upgrade to 0.13.20
2016-06-03 10:48:55 -07:00
76e6214b9b chore: remove angular_entry point (#8975)
this is obsolete and no longer needed. it wasn't part of the public api so it's ok to remove.
2016-06-03 10:47:55 -07:00
2d8f776e38 feat(build): Added a version stamp in .metadata.json files.
Also modified StaticReflector to handle multiple versions in a
single .metadata.json file.

Fixes #8974
Closes #8981
2016-06-03 10:40:49 -07:00
cf2d3cf920 style(pipes): cleanup unused imports
Remove unused imports from the pipes package. No impact on the code.
2016-06-03 09:58:57 -07:00
b160ada5d1 fix: QueryList documentation (#8976) 2016-06-02 16:24:26 -07:00
1090601e8b refactor(compiler): rename /compiler_cli to /compiler-cli 2016-06-02 13:50:32 -07:00
01dd7dde24 chore(tools): Remove use of TypeChecker from metadata collector.
The metadata collector was modified to look up references in the
import list instead of resolving the symbol using the TypeChecker
making the use of the TypeChecker vestigial. This change removes
all uses of the TypeChecker.

Modified the schema to be able to record global and local (non-module
specific references).

Added error messages to the schema and errors are recorded in
the metadata file allowing the static reflector to throw errors
if an unsupported construct is referenced by metadata.

Closes #8966
Fixes #8893
Fixes #8894
2016-06-02 13:39:15 -07:00
13c39a52c6 chore(compiler): Expose types needed by the language service
The language service needs access to the parser error ranges and
the static reflector.

Closes #8838
2016-06-02 13:36:22 -07:00
3b80ab51ba feat(SchemaRegistry): add Node.textContent
fixes #8413
2016-06-02 13:33:57 -07:00
1a386a58c8 Revert "feat(change_detection): make INTERPOLATE_REGEXP customizable (#7417)"
This reverts commit c3fafa0651.

The symbols should be configured at the component level and not be global to the compiler.
2016-06-01 17:53:45 -07:00
04220be8fd chore: remove old tests (#8954)
These tests are already captured in template_parser_spec.ts
2016-06-01 16:30:51 -07:00
48bf349c3c fix(upgrade): allow deeper nesting of ng2 components/directives (#8949)
* fix(upgrade): add test for upgrade adapter bug

* fix(upgrade): allow deeper nesting of ng2 components/directives

allow a nesting sequence of ng2 > ng1 > ng2 directives
2016-06-01 15:58:40 -07:00
21fc1bb655 fix(core): Keep core exports seperate from core/testing exports. (#8930) 2016-06-01 15:37:23 -07:00
d38d375fa6 test: enforce sorting of the public_api_spec
Closes #8950
2016-06-01 15:06:52 -07:00
602836800b feat(ChangeDetectorRef): make detectChanges() correct
Closes #8599
2016-06-01 12:50:47 -07:00
2953ea10a7 chore: fix public_api_spec after rebase 2016-06-01 10:57:45 -07:00
a738d0d54d chore: remove old public api tests
the tests under tools/public_api_guard have better coverage - we no longer need
to maintain two copies.
2016-06-01 10:43:57 -07:00
d781e69948 style(public_api_spec): reformat 2016-06-01 10:43:22 -07:00
c9b71fb5e2 test: add lots of missing stuff to the public_api_spec
- many entry points were previously missing (e.g. all testing entry points, http, etc)
- upgrade ts-api-guardian to 0.0.3 that adds support for more api surface
- add all info to the spec that was surfaced by ts-api-guardian@0.0.3
2016-06-01 10:43:22 -07:00
dd6cb233b5 build: add missing testing.ts entry points to tsconfigs 2016-06-01 10:43:22 -07:00
a3cf58b67a docs: add info about __moduleName into to DirectiveMetadata docs 2016-06-01 10:43:22 -07:00
70d944a59c refactor: correct api modifier flags 2016-06-01 10:43:22 -07:00
a5a422f8e7 refactor(NumberPipe): remove NumberPipe and replace it with private helper function
NumberPipe was just an implementation detail that we were accidentaly exposing as a public api.
2016-06-01 10:43:22 -07:00
e93b3d2360 fix(Location): make Location#platformStrategy:LocationStrategy property private
BREAKING CHANGE: Location#platformStrategy property was previously accidentaly exported as public

If any application requires access to the current location strategy, it should be accessed via DI instead
by injecting the LocationStrategy token.

The likelyhood of anyone actually depending on this property is very low.
2016-06-01 10:43:22 -07:00
7bc2d9a93a docs: add api stability indicators for @angular/common 2016-06-01 10:43:22 -07:00
1c929031a2 feat(router): export RouterLink and RouterOutlet (#8912)
Makes it possible to individually import RouterLink and RouterOutlet from the router module
2016-06-01 09:48:55 -07:00
f2809d1ed8 fix(PostMessageBus):Add the worker scope to please Closure 2016-06-01 09:24:05 -07:00
f4f6b8721a fix(core): Keep core exports seperate from core/testing exports. 2016-05-31 20:09:43 -07:00
7e352a27f7 fix(d.ts): enable angular2 compilation with TS flag --strictNullChecks (#8902)
Eliminate the following compiler error when using TS 1.9+ with strict null checking enabled:

node_modules/@angular/core/src/util/decorators.d.ts(9,5): error TS2411: Property 'extends' of type 'Type | undefined' is not assignable to string index type 'Type | Function | any[]'.

https://github.com/angular/angular/issues/8720
2016-05-31 18:25:48 -07:00
Tom
0c6b16c208 docs(async-pipe): include observable example (#8900)
Adds the missing example, usage case and a bit more description to the async-pipe.
2016-05-31 18:23:29 -07:00
10475b859d chore: remove deep imports to fix build. 2016-05-31 17:13:41 -07:00
4d793c4eb8 feat(security): Automatic XSRF handling.
Automatically recognize XSRF protection cookies, and set a corresponding XSRF
header. Allows applications to configure the cookie names, or if needed,
completely override the XSRF request configuration by binding their own
XSRFHandler implementation.

Part of #8511.
2016-05-31 16:12:33 -07:00
3ae29c08ac chore(build.sh): make tsc-wrapped installable 2016-05-31 10:43:21 -07:00
3331321f64 build(ngc): run integration test hermetically
This ensures we run in a clean directory, using our real distribution. It finds bugs like @internal
APIs needed to type-check in the offline compiler, as well as problems in package.json.

Also move tsc-wrapped under tools/@angular
2016-05-27 17:21:35 -07:00
c6064a30a1 chore(package.json): make the packages installable 2016-05-27 17:21:34 -07:00
040b101842 feat(security): complete DOM security schema.
This addresses several oversights in assigning security contexts to DOM schema
elements found by our security reviewers (thanks!).

This also adds some more precise unit tests for the interaction between
(Dom)ElementSchemaRegistry and the TemplateParser, and extracts the security
specific parts into dom_security_schema.ts.

Comparison of (potentially) dangerous property names is done case insensitive,
to avoid issues like formAction vs formaction.

Part of issue #8511.
2016-05-27 11:47:33 -07:00
a78a43c816 chore(readme): add CircleCI status badge 2016-05-27 11:40:30 -07:00
ec198b0dc6 docs(MockConnection) add mockError usage example (#8888) 2016-05-27 10:10:53 -07:00
b5d14c26d2 chore(lint): enable requireInternalWithUnderscore tslint check 2016-05-27 09:31:18 -07:00
2019050db2 chore(lint): enable duplicateModuleImport tslint check 2016-05-27 09:17:08 -07:00
5f999225ba chore(lint): upgrade tslint and its gulp plugin 2016-05-27 09:17:08 -07:00
307d105d2c fix(DomRegistry): fix svg support 2016-05-26 16:46:00 -07:00
0b6967fd74 chore(lint): fix missing semicolon to make Circle green (#8877) 2016-05-26 16:43:15 -07:00
ef0c32512c chore(lint): enable semicolon and variable-name tslint checks 2016-05-26 15:46:03 -07:00
9096481744 chore(lint): format tools dir 2016-05-26 15:46:03 -07:00
5936624d11 chore(lint): re-enable clang-format on tools/ 2016-05-26 15:46:03 -07:00
83723671af chore(lint): upgrade clang-format and gulp plugin 2016-05-26 15:46:03 -07:00
4d825dd9fd refactor(intl facade): remove outdated code 2016-05-26 14:19:26 -07:00
8e38291156 chore: enable the compiler_cli tests again.
Closes #8864
2016-05-26 13:33:26 -07:00
f93512bf27 feat(ViewEncapsulation): default ViewEncapsulation to configurable
BREAKING CHANGES:

DirectiveNormalizer takes new constructor arguments, `config:CompilerConfig`.

Closes #7883
2016-05-26 13:23:37 -07:00
c3fafa0651 feat(change_detection): make INTERPOLATE_REGEXP customizable (#7417)
BREAKING CHANGES:

`Parser` constructor required new parameter `config: CompilerConfig` as second argument.
2016-05-26 13:08:39 -07:00
9036f78b74 fix(compiler): throw an error if variable with the same name is already defined. (#7209)
* fix(compiler): throw an error if variable with the same name is already defined. Closes #6492

* fix(compiler): Clean up formatting for issue #6492

* fix(compiler): throw an error if reference with the same name is already defined.

Closes #6492
2016-05-26 13:04:17 -07:00
263122ea5f upgrade karma to v0.13.20 due to 'invalid characters in the headers on Node 5.6.0'(#1884) issue
Closes #7885
2016-05-26 12:12:35 -07:00
324f0147f6 feat(common/datePipe): change date formatter to use correct pattern closes #7008 (#8154)
- add regular expression to parse date parts
- add date part creator function
- replace tokens in pattern to parsed parts
2016-05-26 12:06:29 -07:00
Jon
be48ba1b06 fix(ngRouteShim): update anchors to function similar to angular 1.x (#8478)
* fix(ngRouteShim): update anchors to function similar to angular 1.x when setting the target

* fix(ngRouteShim): update anchor target check to use indexOf instead of contains on array
2016-05-26 12:03:23 -07:00
b2a7fd05cb fix(router): replace state when path is equal to current path (#8766)
Same as 2bf21e1747 but for new router.

This also fixes an issue where when application loads it clears forward history
because Router constructor calls navigateByUrl which was causing a push state to happen.
2016-05-26 12:02:24 -07:00
84f859d7b2 fix(Control): Support <select multiple> with Control class (#8069) 2016-05-26 12:01:49 -07:00
cbc8d0adf8 fix(upgrade): Ensure upgrade adapter works on angular.js 1.2 (#8647) 2016-05-26 11:58:47 -07:00
420e83a396 feat(forms): add the submitted flag to NgForm and NgFormModel directives
Closes #2960

Closes #7449
2016-05-26 10:48:13 -07:00
89f61087c7 feat(http): implement Response.prototype.toString() to make for a nicer error message
Added a toString method to the Response class displaying status / status and
the URL of the request.

Closes: https://github.com/angular/http/issues/89

Closes #7511
2016-05-26 10:38:29 -07:00
1dcb663917 readme: update badges
Closes #8853
2016-05-26 10:35:22 -07:00
b7b56785d1 fix(Renderer): update signatures to make RenderDebugInfo optional
The code does not force the user to provider `RenderDebugInfo`. The
current implementation lists this as a mandatory parameter. Update
the parameter to be optional.

Fixes #8466

Closes #8859
2016-05-26 10:32:03 -07:00
3a62023260 docs(LifecycleHooks): correct ngDoCheck description (#8807)
The current behavior is for ngDoCheck to supplement, not override, the default change detector. OnChanges will still be called when DoCheck is implemented (fixes #7307).
2016-05-26 10:27:42 -07:00
fa2ce8100b fix(router): openning links in new tab
Clicks on router-link should not prevent browser default action when
any mouse button other than left mouse button or ctrl/meta key is pressed.

router-link href should use location strategy external url.

Closes #5908
Closes #6806
Closes #7749
Closes #8806

Closes #8821
2016-05-26 10:26:57 -07:00
172a5663ef feat(platform-browser-dynamic): re-add a deprecated platform-browser-dynamic 2016-05-26 10:22:39 -07:00
f4b972815b fix(platform-browser): fix rollup config 2016-05-26 10:21:24 -07:00
0cb93a436d fix(testing): add discardPeriodicTasks to be used with fakeAsync (#8629)
Closes #8616
2016-05-26 10:19:30 -07:00
b2e804c961 fix(metadata): Allow spacing in multiple selectors (#7418) 2016-05-26 10:18:31 -07:00
85ce184197 refactor(compiler): remove obsolete code (#8837) 2016-05-26 10:15:47 -07:00
29c77df4be fix(playground): fix WebWorker single_thread example 2016-05-26 09:58:40 -07:00
c39e0463a3 removes tailing slashes from url in lines 229 231
Closes #8718
2016-05-26 09:58:14 -07:00
c27bc1956b docs(API): correct formatting of EmbeddedViewRef API doc example (#8584)
remove ... from EmbeddedViewRef API example doc comments
2016-05-26 09:53:18 -07:00
72707d80ab refactor(api): Correct public api variable names (#8552)
Correct public api variable names (ROUTER_DEPRETACED_TESTING -> ROUTER_DEPRECATED_TESTING)
2016-05-26 09:52:56 -07:00
f18356307b chore: consistent badge shape (#7053) 2016-05-26 09:52:06 -07:00
00475f25c8 fix(doc): Add missing comma in example (#8769) 2016-05-26 09:50:59 -07:00
bab6023eee fix(router): Added pushState fallback for IE 9 browser.
Closes #6506

Closes #7929
2016-05-26 09:49:07 -07:00
5e12a95789 test(security): test case for quoted URL values.
Test case that fixes #8701. This is already supported with the latest sanitizer
changes, but it's good to have an explicit test case.
2016-05-26 09:39:23 -07:00
e5904f4089 fix(facade): change EventEmitter to be sync by default (#8761) 2016-05-26 09:34:04 -07:00
cf1122cf9e chore(contributing): fix link to styleguide (#8781)
- Change to new link to Google's JavaScript style guide
2016-05-26 09:30:31 -07:00
6da79673c2 test(e2e): workaround flaky e2e tests 2016-05-25 17:52:30 -07:00
352ee53202 Revert "feat(AsyncPipe): allow onError argument"
This reverts commit 390046d7b3.
CI fails for IE on win8.
PR #7990
2016-05-25 17:23:20 -07:00
a20639558b npm: invoke webdriver-manager update after install 2016-05-25 16:51:30 -07:00
b9347eb01c build: remove dependency on tsd and use @types/* instead 2016-05-25 16:42:28 -07:00
4dbd8ed6b8 refactor: remove unnecessary annotations 2016-05-25 16:42:28 -07:00
cb980d3e43 fix(ci): incorrect import 2016-05-25 16:22:55 -07:00
f154e2c6cf fix(ci): extra API in public_api_spec 2016-05-25 16:14:03 -07:00
d0a64f9c86 fix: broken build 2016-05-25 16:03:11 -07:00
16ef21d086 fix(ngc): depend on correct tsc-wrapped package 2016-05-25 15:34:43 -07:00
39ecd01b86 chore: audit @angular/core API classification (#8808) 2016-05-25 15:00:05 -07:00
5e0f8cf3f0 feat(core): introduce support for animations
Closes #8734
2016-05-25 13:56:50 -07:00
6c6b316bd9 chore(ngc): fix release instructions 2016-05-25 13:25:26 -07:00
b49dac7be5 chore(git): update .gitignore 2016-05-25 10:03:42 -07:00
4c26397937 chore(ngc): refactor out tsc-wrapped
This allows angular's build to depend on some extensions, but not on code generation, and breaks a cycle in the angular build
We now merge ts-metadata-collector into tsc-wrapped and stop publishing the former.
2016-05-25 09:45:55 -07:00
e26e4f922e build(npm): trigger tsd install from npm postinstall 2016-05-25 08:24:59 -07:00
2ab1085dfb fix(core): remove @internal annotation from PLATFORM_CORE_PROVIDERS
This symbol is no longer reexported at the top level, so it's safe to not mark it as internal.

This fixes the offline compilation which got broken by this symbol not being present in the d.ts
files when the compiler tries to do a deep import.

Closes #8819
2016-05-25 08:22:07 -07:00
acc3a2de83 build: add comment for the tools watch option 2016-05-25 08:22:07 -07:00
12abdd8782 ci: disable the lint job since it's currently not doing anything
the tslint rules have not been executed on the right files when this the lint was reenabled
after package splitup making the linting useless. When reenabled lots of errors show up.
I'm disabling this for now until we come back and fix up the code issues.
2016-05-25 08:22:07 -07:00
2bcdec5aaf build: use connect web server instead of SimpleHTTPServer
Several flakes on CI have been tied to long running SimpleHTTPServer that was
put in place temporarily after the package splitup.
2016-05-25 08:22:07 -07:00
16dfe3c63f build: consolidate tsc to ease migration to @types/ based typings delivery
I actually tried to use @types/* directly but came across several issues which prevented me
from switching over:
- https://github.com/Microsoft/TypeScript/issues/8715
- https://github.com/Microsoft/TypeScript/issues/8723
2016-05-25 08:22:07 -07:00
b4a467e387 ci: disable debug output from env.sh 2016-05-25 08:22:07 -07:00
53628e19ac fix(compiler): add ability to parse : in * directives
- Add ability to parse bindings properly when `:` is present when using a directive with the `*` prefix

Closes #6038
2016-05-24 21:43:10 -07:00
62dd3ceb64 Revert "Don't update the location during initial router navigation"
This reverts commit d5066a9a0f.
2016-05-24 21:43:10 -07:00
d5066a9a0f Don't update the location during initial router navigation
Closes #6069
2016-05-24 21:34:59 -07:00
32b37432b0 docs: Remove text about Dart Editor bundle; clean up text
* Remove text about Dart Editor bundle.
* Fix links.
* Fix some grammar and Markdown formatting.

Closes #5928
2016-05-24 21:34:18 -07:00
5f3d02bc7c fix(Animation): Problem decimals using commas as decimal separation
Tests where failing due to `.` character being used as decimal separator in some regional settings (like spanish for example)

Closes #6335

Closes #6338
2016-05-24 21:23:46 -07:00
97e94dd6e0 docs(DEVELOPER): JDK is needed for protractor to run selenium
Closes #6343
2016-05-24 21:23:18 -07:00
846c031ec9 changelog: Update name of a lifecycle hook
Closes #6418
2016-05-24 21:22:57 -07:00
92340350d2 fix(http): Set response.ok
The ok property was not being set on response objects.
It's now set based on the status code.

Closes #6390
Closes #6503
2016-05-24 21:20:27 -07:00
d4827caa08 refactor(DomRootRenderer): allow registeredComponents access
Closes #6584
2016-05-24 21:17:11 -07:00
6ce13b68fa Typo in web_workers.md
Closes #6694
2016-05-24 21:16:11 -07:00
e82b700ad0 docs(directives): add a deprecation comment for properties, events
Closes #7059
2016-05-24 21:13:56 -07:00
60a2ba87d4 fix(#7099): support for comment finishing with multiple dashes
<!-- xxxx ------->

The issue came from a lack of support for backtracking on string
matching.
The way it is done, if the "end pattern" for consumeRawText starts with
twice the same character, you end up having problem when your string
being parsed has 3 times this char

Example
End string: xxyz
string to parse: aaaaaaxxxyz

calling consumeRawText(false, 'x', attemptParseStr('xyz')) would fail

Closes #7119
2016-05-24 21:01:41 -07:00
83c19a1fbc fix(pipes): handle undefined value in slice
Closes #7152
2016-05-24 20:58:14 -07:00
1513e201bb docs(ContentChild): add example with refs
Add missing example on how ContentChild works with refs
Closes #7160
Closes #7162
2016-05-24 20:57:25 -07:00
a38c9a1ef7 fix(Router) Fix detect active route in depth. 2016-05-24 20:51:51 -07:00
d5f5ce82ca Revert "fix(compiler): support string tokens with . inside."
This reverts commit 67c80fbb5e.
2016-05-24 20:51:51 -07:00
6dc88f5b61 fix(forms): radio buttons with different names should not share state
Closes #7051
2016-05-24 20:07:57 -07:00
7a2ce7ff21 fix(forms): update accessor value when native select value changes
Closes #8710
2016-05-24 20:03:49 -07:00
1ac38bd69a feat(renderer): add a setElementStyles method 2016-05-24 18:42:05 -07:00
982fad0c45 test(public API): Update the public API to the new world 2016-05-24 14:00:00 -07:00
390cefac72 refactor(testing/server): optimize imports 2016-05-24 14:00:00 -07:00
798bface7f fix(typings): remove rxjs workaround
Closes #7198
2016-05-24 12:45:46 -07:00
276fec6e50 build(serve): added cors support for the js.server task
Added and used the cors middleware:
- add the module as a dev depedency in the package.json file
- require the module in the jsserve.js file
- add the module in the middleware list

Closes #7273

Closes #7274
2016-05-24 12:00:40 -07:00
95af14b97c feat(http): added withCredentials support
Taken into account the withCredentials property within the request options:
- added corresponding property in the RequestOptions class
- added corresponding property in the Request class
- handle this property when merging options
- set the withCredentials property on the XHR object when specified

Added a test in the xhr_backend_spec.ts to check that the property is actually
set on the XHR object

Closes https://github.com/angular/http/issues/65

Closes #7281

Closes #7281
2016-05-24 11:53:43 -07:00
0f0a8ade7c feat(http): automatically set request Content-Type header based on body type
Implement the ability to provide objects as request body. The following use cases
are supported:
* raw objects: a JSON payload is created and the content type set to `application/json`
* text: the text is used as it is and no content type header is automatically added
* URLSearchParams: a form payload is created and the content type set to `application/x-www-form-urlencoded`
* FormData: the object is used as it is and no content type header is automatically added
* Blob: the object is used as it is and the content type set with the value of its `type` property if any
* ArrayBuffer: the object is used as it is and no content type header is automatically added

Closes https://github.com/angular/http/issues/69

Closes #7310
2016-05-24 11:42:37 -07:00
e0c83f669e fix(build): force a compatible baseURL for systemjs-builder
Closes #7167

Closes #7360
2016-05-24 11:16:33 -07:00
016f0d8e9e fix: Typo in async.ts
Closes #7382
2016-05-24 11:15:51 -07:00
3e5716ec16 feat(i18n): support implicit tags/attributes 2016-05-24 10:12:19 -07:00
75e6dfb9ab fix(browser): platform code cleanup 2016-05-23 17:57:28 -07:00
9634e8d14a fix(tests): Execute the security specs only once 2016-05-23 17:57:28 -07:00
f95a604b59 fix(bootstrap): swap coreBootstrap() and coreLoadAndBootstrap() arguments 2016-05-23 17:57:28 -07:00
3ff20cd7e3 fix(core): fix build 2016-05-23 17:56:48 -07:00
17f73cb7bc docs(http): fix MockBackend example
imports & syntax error fix

Closes #7383
2016-05-23 17:22:36 -07:00
fba0e2ff12 docs(browser.ts): update bootstrap injector override argument name
Closes #7387
2016-05-23 17:21:07 -07:00
b62415c962 refactor(chore): remove unused mapToObject and objectToMap methods from serializer
resolves #7402

Closes #7416
2016-05-23 17:20:25 -07:00
adc135e6c8 refactor(async_pipe): use subscription strategy interface
The strategies for Promise and Observable based subscriptions
have (nearly) the same method signatures. They should implement
a common interface.

Closes #7573
2016-05-23 17:02:56 -07:00
ceac045a7f fix(compiler): have CSS parser support nested parentheses inside functions
Closes #7580
2016-05-23 16:58:15 -07:00
4d6da7b1a7 chore: Update ISSUE_TEMPLATE.md
Closes #7591
2016-05-23 16:56:38 -07:00
01b9de7a15 Bump reflect-metadata to 0.1.3
Closes #7663
2016-05-23 16:40:24 -07:00
0a872ffd38 feat(core/linker): add SimpleChanges type to lifecycle_hooks to simplify OnChanges signature
Closes #8557
2016-05-23 16:11:52 -07:00
6f3a6a55a0 Update url_search_params.ts
Values need to be encoded on `toString()`
Closes #7686
2016-05-23 14:43:26 -07:00
0795dd307b refactor(chore): Replace all 'bindings' with 'providers'
BREAKING CHANGE

Deprecated `bindings:` and `viewBindings:` are replaced with
`providers:` and `viewProviders:`

Closes #7687
2016-05-23 13:31:08 -07:00
49fb7ef421 refactor(router): Remove deprecated 'as' from ‘RouteConfig’
BREAKING CHANGE
Remove deprecated 'as' from ‘RouteConfig’ in favour of ‘name’
2016-05-23 13:24:36 -07:00
cbeeff2bd6 fix(Router): do not kill event-emitter on navigation failure
Closes #7692
Closes #7532

Closes #7692
2016-05-23 13:21:09 -07:00
ce013a3dd9 feat(regex_url_paths): add regex_group_names to handle consistency with serializers
By adding `regex_named_groups` to regex route configurations we can consistently map
regex matching groups to component parameters.

This should fix #7554.

Closes #7694
2016-05-23 13:18:21 -07:00
1f7449ccf4 fix(changelog): add View decorator breaking change
Closes #7707
2016-05-23 13:14:25 -07:00
c43636f2bb fix(di): type error in InvalidProviderError
- when trying to instantiate an injector with an unknown provider
Closes #7729
2016-05-23 13:08:10 -07:00
9c2fe660a3 (docs) Fix pony greeting equivalence
Cheatsheet claims equivalence between two statements which are not equivalent
Closes #7761
2016-05-23 13:07:20 -07:00
abc266fa35 feat(common): DatePipe supports ISO string
Closes #7794
2016-05-23 12:30:02 -07:00
7d853dd9ad fix(router): ensuring MatchedUrl pass query params 2016-05-23 12:24:08 -07:00
3ac2821a1b Update CHANGELOG.md
remove duplicated content
Closes #7852
2016-05-23 10:27:38 -07:00
666dc75c15 chore(lint): disallow duplicate imports from a module
Closes #7859
2016-05-20 15:59:33 -07:00
e9332c66d2 chore(lint): re-enable linter and fix violations
fixes #7798
2016-05-20 15:49:18 -07:00
830aecd1a7 fix(router/parsing): change route rule error to say PascalCase instead of CamelCase
Closes #7874
2016-05-20 15:39:30 -07:00
ac6959c819 docs(DEVELOPER.md): add a clearer explanation about Windows symlinks issue. (#7886)
add a clearer explanation about Windows symlinks issue.
2016-05-20 15:34:59 -07:00
2bf21e1747 fix(Router): replace state when normalized path is equal to current normalized path
Make sure the same path is not added multiple times to the history.
It is replacing the state, instead of skipping it completely,
because the current path in the browser might not be normalized,
while the given one is normalized.

Closes #7829

Closes #7897
2016-05-20 15:30:15 -07:00
9105ab9596 docs(ng_control_group): update API docs syntax
Closes #7357
2016-05-20 13:19:08 -07:00
165357bfa3 refactor(forms): remove useless imports
Remove useless imports and change `bindings` to `providers` inside
`@Component` and `@Directive`.

Closes #7904
2016-05-20 13:13:27 -07:00
33c7f74cb9 style(platform/browser): fix type spacing
Closes #7980
2016-05-20 13:05:40 -07:00
cb84cbf545 feat(shadow_css): add encapsulation support for CSS @supports at-rule
Closes #7944
2016-05-20 13:02:24 -07:00
b2e0946696 fix(Request): Change Request.text's return type to string
Change the return typing for the .text method to `string` so typescript treats it
like a normal string.

Closes #8138
2016-05-20 12:57:31 -07:00
67c80fbb5e fix(compiler): support string tokens with . inside.
Closes #8178
2016-05-20 12:56:02 -07:00
c574e6808f build: update to rollup@0.26.3 and remove a hack from the build 2016-05-20 11:00:49 -07:00
9175a049d3 feat: add minified bundles
BREAKING CHANGE: bundles are now in the bundles/ subdirectory within each package
2016-05-20 11:00:49 -07:00
0035575c82 build: turn on tsc's stripInternal when producint public d.ts file
I also made some changes to fix imports and remove some stuff that caused
breakage once stripInternals was turned on.
2016-05-20 10:59:57 -07:00
7bfe8aa553 build: fix the build.sh script to work out of the box 2016-05-20 10:59:32 -07:00
1bff47f97d docs: fix syntax errors in HostBinding metadata example
add missing parentheses to getters, remove erroneous brackets in HostBindings

Closes #8269
2016-05-20 10:56:11 -07:00
e8e61de28d refactor(WebWorker): move XHR worker side 2016-05-20 10:48:55 -07:00
54f8308999 refactor(browser): merge static & dynamic platforms 2016-05-20 10:48:55 -07:00
6c99746f0b Update tools.ts
Closes #8296
2016-05-20 10:12:54 -07:00
4086b49046 feat(enableDebugTools): return ComponentRef
allows for 
```
bootstrap(App, [
  ...HTTP_PROVIDERS,
  ...ROUTER_PROVIDERS
])
.then(enableDebugTools)
```
without breaking the rule of always returning a value in a promise
2016-05-20 10:12:54 -07:00
0fad9c2786 docs(changelog): fix ViewQuery read usage example in beta.16 (#8330) 2016-05-20 10:06:46 -07:00
d75f928fca fix(docs): Fix a missing opening bracket (#8331) 2016-05-20 10:06:15 -07:00
68f9aaf214 chore: Update CHANGELOG.md (#8342) 2016-05-20 10:05:52 -07:00
efe4633b15 refactor(empty.ts): typo (#8398)
emppty -> empty
2016-05-20 10:02:47 -07:00
19e65382f7 fix(core): accurate dev mode message for dart (#8403) 2016-05-20 10:01:39 -07:00
5a9eda73b4 docs(changelog): line numbers to master can go out of sync (#8404) 2016-05-20 10:00:47 -07:00
c6f2b3e96b docs(router): fix import and replace RouteConfig (#8433) 2016-05-20 10:00:04 -07:00
55921be1af fix(router-deprecated): export RootRoute
Fix #8449

Closes #8450
2016-05-20 09:59:21 -07:00
9b1b5b393d fix(angular1_router): ngLink should not throw an error if routeParams are undefined (#8460)
If routeParams are undefined, no href attribute should be rendered. This matches the behaviour of ngHref.
2016-05-20 09:48:03 -07:00
3857c8226e docs(MockConnection) update mockRespond usage example (#8487)
Closes: #8486
2016-05-20 09:19:59 -07:00
595bcdd1ac fix(router): browser back and forward buttons not working correctly.
Closes #8524

Closes #8532
2016-05-19 22:42:08 -07:00
27c25bd0e8 chore(readme): update README: no longer beta (#8405) 2016-05-19 22:23:33 -07:00
aec95015f8 docs(http): update http docs to mention .map operator
Closes #5947
2016-05-19 22:15:26 -07:00
b2db6401cc chore(build): remove use of q.denodeify
This change also makes webpack properly reject
promise on build errors

Closes #6546
2016-05-19 22:01:52 -07:00
ebe14720eb chore(typing): enforce --noImplicitAny for tools directory.
Exposed a couple of bugs.

Closes #6645
2016-05-19 21:38:01 -07:00
7112d008d0 fix(IE): make shim work with instrumented code
Closes #6944
2016-05-19 20:50:01 -07:00
90af4763d8 fix(angular1_router): delay view update until activate promise gets fullfilled
If the $routerOnActivate hook returns a promise, the navigation
is commited, once the promise gets fullfilled but the view
is updated immediately.

This commit delays the view update so that both (view and url) are
updated at the same time.

Closes #7777
2016-05-19 20:42:06 -07:00
390046d7b3 feat(AsyncPipe): allow onError argument
Closes #7990
2016-05-19 16:49:28 -07:00
587c119c75 feat(NgZone): isStable
Closes #8108
2016-05-19 16:10:08 -07:00
3019140e7e feat(http): set the statusText property from the XMLHttpRequest instance
Closes #4162
2016-05-19 15:58:59 -07:00
7a80f0d1e1 change property and event to use camel case
Closes #6580
2016-05-19 15:21:54 -07:00
0894318f50 change property and event to use camel case:
* some-property -> someProperty
* some-event -> someEvent

Closes #6609
2016-05-19 15:20:34 -07:00
f9fc524a74 chore(contributing): added commit message samples (#7375)
Each time I am pointing someone to this contribution doc
to read and apply commit message style guide
each time type part of message formatting is missed
2016-05-19 15:19:01 -07:00
9019c6f937 Condition using component as well.
Closes #7755
2016-05-19 15:15:25 -07:00
166b73f4f3 Condition using urlPath, component is null on UnresolvedException of child AsyncRoute. 2016-05-19 15:15:25 -07:00
cb94111f18 style(Forms): remove unused imports
remove unused imports from the forms package
2016-05-19 14:50:33 -07:00
a88b887a05 docs(cheatsheet): Document SVG idiosyncrasies (#6055) 2016-05-19 10:20:08 -07:00
6e62217b78 fix(WebWorker): remove the platform-browser dependency on compiler 2016-05-18 16:23:09 -07:00
a01a54c180 adds 'repository' metadata to npm modules (#8649) 2016-05-17 23:17:15 -07:00
db8290632f fix(upgrade): fallback to root ng2 injector when element is compiled outside the document (#8684)
Currently downgraded ng2 elements fail inside a ui-router view because they are unable
to require an ng2 Injector via the require attribute of the DDO, because ui-router compiles
its templates before they are inserted in a ui-view. This adds a "fallback" behavior if
a parent injector cannot be found to go to the root ng2 Injector.
2016-05-17 15:55:53 -07:00
7bb5167239 chore(security): fix CHANGELOG formatting. (#8687)
Turns out the fenced code block needs to be in its own paragraph.
2016-05-17 15:00:28 -07:00
6cdc53c497 fix(UpgradeNg1ComponentAdapter): make bindings available on $scope in controller & link function (#8645)
Delays NG1 Directive controller instatiation where possible and pre-link function always
to the ngOnInit() lifecycle hook. This way bindings are always available on $scope in both
the controller and the link function.
2016-05-17 14:53:59 -07:00
15ae710d22 feat(security): allow url(...) style values.
Allows sanitized URLs for CSS properties. These can be abused for information
leakage, but only if the CSS rules are already set up to allow for it. That is,
an attacker cannot cause information leakage without controlling the style rules
present, or a very particular setup.

Fixes #8514.
2016-05-17 11:23:31 +02:00
dd50124254 feat(security): allow data: URLs for images and videos.
Allows known-to-be-safe media types in data URIs.

Part of #8511.
2016-05-17 10:57:14 +02:00
ff36b0384a fix(compiler_cli): normalize used directives
- e.g. needed for content projection.

Closes #8677
2016-05-16 13:07:13 -07:00
50c9bed630 feat(security): expose the safe value types.
This allows users to properly type their `SafeHtml`, `SafeStyle`, etc values.

Fixes #8568.
2016-05-15 11:47:06 +02:00
8b1b427195 feat(security): support transform CSS functions for sanitization.
Fixes part of #8514.
2016-05-14 13:25:45 +02:00
9a05ca95f6 fix(build): Release compiler_cli packages along with rest of @angular packages and use ANGULAR_VERSION for package version and peer dependencies. 2016-05-13 13:35:10 -07:00
05266241af build(npm): short-circuit npm install if node_modules are healthy
Closes #8627
2016-05-13 22:07:41 +02:00
4ddf5536b4 docs(DEVELOPER.md): state that git-clang-format must be in PATH
To use ```git clang-format``` your have to make sure that
```git-clang-format``` is in your path.

Closes #7778
2016-05-13 12:25:09 -07:00
f389b5a961 docs(changelog): add missing breaking changes for testing providers
Closes #8440
2016-05-13 12:21:33 -07:00
bac1a6eab3 fix(build): Fix an error in package publishing step where the script errors when a UMD bundle is not found for compiler-cli package. 2016-05-12 16:49:03 -07:00
ff400726ca fix(build): Declare the secure GITHUB_TOKEN_ANGULAR for package publishing from Travis 2016-05-12 15:08:28 -07:00
267d864976 fix(build): Fix broken e2e test Travis task by running the right variation of sed on Travis 2016-05-12 13:58:42 -07:00
97a1084c99 fix(build): Hook up publish-build-artifacts to Travis 2016-05-12 12:01:53 -07:00
61b339678d test(compiler): test schema generation only in Chrome
Closes #8581
2016-05-11 17:01:26 -07:00
d537a26297 chore(build): reenable optional jobs in SL and BS
Closes #8558
2016-05-11 17:00:43 -07:00
d414734aac fix(build): Change publish-build-artifacts.sh to work with new packaging system 2016-05-11 16:58:18 -07:00
817ddfa847 fix(compiler): allow --noImplicitAny 2016-05-11 16:56:12 -07:00
c1154b30c7 fix(compiler): allow decorators defined in the same file 2016-05-11 16:56:12 -07:00
0d71345b93 fix(codegen): codegen all files in the program, not just roots
fixes #8475
2016-05-11 16:56:12 -07:00
f235454dd6 ci: temporarily disable Edge because of SauceLabs issues
https://github.com/angular/angular/issues/8604

On Sauce we've been getting the following error:

11 05 2016 00:58:35.765:ERROR [launcher.sauce]: Heartbeat to microsoftedge 20.10240 (Windows 10) failed
  [title()] Error response status: 13, , UnknownError - An unknown server-side error occurred while processing the command. Selenium error: Unknown error (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 285 milliseconds
Build info: version: '2.52.0', revision: '4c2593c', time: '2016-02-11 19:06:42'
System info: host: 'WIN-SB3ER6JQ6ME', ip: '172.20.60.246', os.name: 'Windows 10', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0_73'
Driver info: org.openqa.selenium.edge.EdgeDriver
Capabilities [{acceptSslCerts=true, browserVersion=25.10586.0.0, platformVersion=10, browserName=MicrosoftEdge, takesScreenshot=true, pageLoadStrategy=normal, takesElementScreenshot=true, platformName=windows, platform=ANY}]
Session ID: XXXXXXXX-XXXX-XXXX-XXXX-XXXX478C1C1A
11 05 2016 00:58:35.766:ERROR [launcher]: microsoftedge 20.10240 (Windows 10) on SauceLabs failed 2 times (failure). Giving up.
2016-05-11 11:06:37 -07:00
6a80578d05 build: create the dist directory before building 2016-05-11 10:11:59 -07:00
d33cd43db1 docs(PULL_REQUEST_TEMPLATE.md): reorganize and improve the pull request template
Closes #7921
2016-05-10 10:55:35 -07:00
9e3df8eefe chore(tsickle): remove redundant jsdoc types
tsickle doesn't like them, and anyway they are bound to get out-of-sync with the inline TS types
2016-05-10 17:38:10 +02:00
cf73ad7c8f chore(security): document sanitization breaking change.
Sanitizing style and URL values breaks specific patterns, see #8491 for
an example. This documents and acknowledges the breaking change while we
work on improving CSS sanitization to allow more values through.
2016-05-10 17:36:36 +02:00
3e68b7eb1f feat(security): warn users when sanitizing in dev mode.
This should help developers to figure out what's going on when the sanitizer
strips some input.

Fixes #8522.
2016-05-09 16:46:31 +02:00
9fbafba993 chore(parsing): change internal usage of @ to : for namespaced values
Closes #8346
2016-05-09 16:20:32 +02:00
7a524e3deb feat(security): add tests for URL sanitization. 2016-05-09 16:00:24 +02:00
7b6c4d5acc feat(security): add tests for style sanitisation. 2016-05-09 16:00:24 +02:00
99c0d503d7 chore(build): run security tests in NodeJS, too. 2016-05-09 16:00:24 +02:00
f86edae9f3 feat(security): add an HTML sanitizer.
This is based on Angular 1's implementation, parsing an HTML document
into an inert DOM Document implementation, and then serializing only
specifically whitelisted elements.

It currently does not support SVG sanitization, all SVG elements are
rejected.

If available, the sanitizer uses the `<template>` HTML element as an
inert container.

Sanitization works client and server-side.

Reviewers: rjamet, tbosch , molnarg , koto

Differential Revision: https://reviews.angular.io/D108
2016-05-09 16:00:24 +02:00
df1b1f6957 feat(security): strip XSSI prefix from XHR responses. 2016-05-05 14:25:44 -07:00
9099160038 chore: fix comment indent. 2016-05-05 12:46:07 -07:00
119abe7bb9 chore: fail build if a command from tsc-watch fails.
This bug was introduced with eba6e7946d
to integrate the compiler_cli into the build properly.

Closes #8480
2016-05-04 20:30:10 -07:00
67ed2e2c0a feat(security): fill in missing security contexts.
Reviewers: koto, rjamet, molnarg

Differential Revision: https://reviews.angular.io/D109
2016-05-04 19:28:50 -07:00
6d36a7a45f chore: fix unit tests on node.js
Closes #8476
2016-05-04 18:00:29 -07:00
e2b1e1577d fix(core): don’t detach nested view containers when destroying a view
When a view is destroyed, we destroy all
views in view containers and should not detach them. However, previously, we also detached them which lead to problems during the iteration loop.

Closes #8458
Closes #8471

Introduced by 0c600cf6e3
2016-05-04 16:27:20 -07:00
b30ddfbfc5 chore(router): clang-format 2016-05-04 15:01:27 -07:00
abfb522f83 refactor(router): reuse existing segmentes when constructing new route trees 2016-05-04 14:51:04 -07:00
b8136cc26e fix(router): provide a top-level route segment for injection 2016-05-04 14:51:04 -07:00
d00b26d941 refactor(router): update link to reuse url segments when possible 2016-05-04 14:51:04 -07:00
12637a761c refactor(router): make names consistent 2016-05-04 14:50:00 -07:00
1a0aea67a0 feat(core): add a component resolver that can load components lazily using system.js 2016-05-04 14:50:00 -07:00
0f1465b899 feat(router): update router to support lazy loading 2016-05-04 14:50:00 -07:00
c0cfd3c6ed chore: remove ts-metadata-collector from shrinkwrap
We need to use the locally installed one.

Closes #8467
2016-05-04 12:29:47 -07:00
a81923b793 fix(compiler): emit correct types for literal arrays and maps. 2016-05-04 12:14:44 -07:00
7150ace7c7 fix(compiler): support lifecycle hooks in compiler_cli 2016-05-04 12:14:43 -07:00
bdce154282 chore: add test script for compiler_cli 2016-05-04 12:14:43 -07:00
5a84048f72 chore: adjust build for tools/metadata name change 2016-05-04 12:14:38 -07:00
188bda813e chore: rename tools/metadata into tools/ts-metadata-collector
Needed to that we can use the locally compiled one during
our tests.
2016-05-04 10:53:28 -07:00
29700aa188 feat(metadata): emit all methods
This is needed to detect lifecycle hooks.
2016-05-04 09:11:04 -07:00
3229bf1665 docs(changelog): add changelog for rc.1 2016-05-04 01:12:40 -06:00
52595f52f9 chore: make workaround_empty_observable_list_diff @internal 2016-05-04 01:12:40 -06:00
edec158dd8 fix(compiler_cli): allow to use builtin directives like NgIf, …
Related to #8448
Closes #8454
2016-05-03 20:49:17 -07:00
0297398f5e chore: clang-format master 2016-05-03 18:56:39 -07:00
9485f5a813 fix: platform-server should declare it's dependency on parse5 via package.json 2016-05-03 18:07:52 -06:00
8f8c017882 chore: remove angular2-template-compiler from package.json
Closes #8429
2016-05-03 16:25:55 -07:00
eba6e7946d refactor(compiler_cli): move it into modules/@angular and integrate properly into the build
This also does no more depend on a version
on npm for the compiler_cli.

Also runs the tests for tools/metadata
2016-05-03 15:57:49 -07:00
3cfe281790 fix(tsickle): put the tsickle support code at EOF 2016-05-03 15:15:22 -07:00
6eac4b68bc build: bump to rc.1 in package.json 2016-05-03 15:28:45 -06:00
fcbfacb6d5 build: do not use tsickle to lower router-deprecated
if we do this, we can break existing code that is inheriting from RouterOutlet and expects the metadata
in the old location
2016-05-03 15:09:35 -06:00
b600915953 build: add licensing preamble to umd bundles 2016-05-03 13:59:30 -06:00
905f38acb8 build: fix source map paths for npm packages
the bundles have source mpas disabled for now because when we downlevel
the esm bundle to es5 tsc doesn't consider the original source map so
we end up with a source map pointing to the esm bundle instead which is
not useful.
2016-05-03 13:36:33 -06:00
38f4c5f155 chore(compiler): update README following package move 2016-05-03 13:26:59 -06:00
509f4ec611 fix(testing): Check for pending macrotasks in ComponentFixture.whenStable() and ComponentFixture.isStable()
Closes #8389
2016-05-03 11:50:35 -07:00
27a7b51d99 fix(docs): upgrade deprecated ngFor-Syntax 2016-05-03 11:49:33 -07:00
a033f8335b fix(compiler): use rootDirs compilerOption to affect genDir layout.
Also update package.json to something releasable.
2016-05-03 12:41:28 -06:00
b98c9e74e1 docs(router): add api docs 2016-05-03 11:35:07 -07:00
9f784dcc5a cleanup(router): fix e2e tests 2016-05-03 10:25:44 -07:00
b625f2471a feat(router): make RouterLink accept single values 2016-05-03 10:25:44 -07:00
3aa2606ff1 cleanup(router): make names consistent 2016-05-03 10:25:44 -07:00
89704e0f93 fix(router): add support for ../ 2016-05-03 10:25:44 -07:00
908a102a87 feat: security implementation in Angular 2.
Summary:
This adds basic security hooks to Angular 2.

* `SecurityContext` is a private API between core, compiler, and
  platform-browser. `SecurityContext` communicates what context a value is used
  in across template parser, compiler, and sanitization at runtime.
* `SanitizationService` is the bare bones interface to sanitize values for a
  particular context.
* `SchemaElementRegistry.securityContext(tagName, attributeOrPropertyName)`
  determines the security context for an attribute or property (it turns out
  attributes and properties match for the purposes of sanitization).

Based on these hooks:

* `DomSchemaElementRegistry` decides what sanitization applies in a particular
  context.
* `DomSanitizationService` implements `SanitizationService` and adds *Safe
  Value*s, i.e. the ability to mark a value as safe and not requiring further
  sanitization.
* `url_sanitizer` and `style_sanitizer` sanitize URLs and Styles, respectively
  (surprise!).

`DomSanitizationService` is the default implementation bound for browser
applications, in the three contexts (browser rendering, web worker rendering,
server side rendering).

BREAKING CHANGES:
*** SECURITY WARNING ***
Angular 2 Release Candidates do not implement proper contextual escaping yet.
Make sure to correctly escape all values that go into the DOM.
*** SECURITY WARNING ***

Reviewers: IgorMinar

Differential Revision: https://reviews.angular.io/D103
2016-05-03 09:21:43 -07:00
dd6e0cf1b5 fix(compiler): fix where pipes live
Impure pipes need to live on the view
that used them and need a new instance for
each call site.

Impure pipes need to live on the component view, cached across all child views,
and need a new pure proxy for each for
each call site that lives on the view
of the call site.

Fixes #8408

This bug was introduced not long ago by 152a117d5c
2016-05-03 09:00:23 -07:00
52a6ba7ed9 fix(compiler): use absolute paths for comparing module urls 2016-05-02 22:40:00 -06:00
43e0fa513b fix(compiler): don’t emit metadata for generated files 2016-05-02 22:40:00 -06:00
de978229b2 chore(compiler): Run compiler_cli tests in new CI.
Also update docs/peer deps, display errors from running jasmine, use the right location of cjs-jasmine
2016-05-02 22:39:32 -06:00
ba62fe974b refactor(static_reflector): remove unnecessary check. 2016-05-02 22:36:32 -06:00
3a40cb1a85 fix(compiler): calculate the right moduleUrl 2016-05-02 22:36:32 -06:00
883e0c48b1 docs(CHANGELOG): document 2.0.0-rc.0 2016-05-02 21:34:27 -06:00
18b6a55764 build: update publish scripts and package.json 2016-05-02 20:45:05 -06:00
00d3b6083c fix(compiler): support css stylesheets in offline compiler 2016-05-02 15:06:46 -07:00
c386fc8379 chore: make compiler_cli build again 2016-05-02 15:06:46 -07:00
43527172ed chore: don’t shadow tsconfig.json used for editors by build specific tsconfig.json 2016-05-02 15:06:46 -07:00
b88384eed8 build: add router-deprecated to the publishing scripts 2016-05-02 15:10:58 -06:00
107016ec12 chore: router move import changes 2016-05-02 13:27:03 -07:00
d930ad1816 chore: router move-only 2016-05-02 13:27:03 -07:00
072446aed3 feat(offline compiler): add metadata emit
Also add a configuration switch to disable the codegen, so we can
still use the metadata emit and tsickle pre-processing in the
build pipeline for angular itself.
2016-05-02 11:47:59 -07:00
2e1f3f003d build: adding basic e2e testing infrastructure 2016-05-02 08:15:10 -07:00
fdd8bd1a36 chore: use ng2tc for compiling and running tests on ci 2016-05-01 23:40:59 -07:00
7db911fdd4 chore: update to tsickle 0.1.2 2016-05-01 23:40:59 -07:00
b6fd81169b feat(core): support the decorator data that tsickle produces 2016-05-01 23:40:59 -07:00
3ae856ab8b build(tsc): Use angular2-template-compiler in place of tsc
This lets us down-level Decorators with tsickle and produce .metadata.json
files for users to reference when offline-compiling their app.
2016-05-01 23:40:59 -07:00
ce5b37239e chore: add lint job to travis 2016-05-01 22:59:41 -07:00
3e17c99f4e chore: clang-reformat 2016-05-01 22:59:41 -07:00
bb8976608d fix: karma timouts for saucelabs 2016-05-01 22:27:55 -07:00
cd52318f48 fix: parse browser detection lazily 2016-05-01 22:27:55 -07:00
2570b72158 fix: textSelection on FireFox 2016-05-01 22:27:55 -07:00
6e79de794c fix: function name shim test 2016-05-01 22:27:55 -07:00
c4be30d2e8 Revert "build(tsc): Use angular2-template-compiler in place of tsc"
This reverts commit 3d25294f706e0fd6224b20372be1e961959c0af8.
2016-05-01 20:51:00 -07:00
57240c85a5 build(tsc): Use angular2-template-compiler in place of tsc
This gives us tsickle pre-processing of Decorators, and produces
.metadata.json files for users to consume in their offline compilation.
2016-05-01 20:51:00 -07:00
a66cdb469f repackaging: all the repackaging changes squashed 2016-05-01 20:51:00 -07:00
505da6c0a8 repackaging: all the file moves 2016-05-01 20:51:00 -07:00
4fe0f1fa65 feat(router): set router-link-active when RouterLink is active
Closes #8376
2016-05-02 01:03:22 +00:00
ec4ca0eace feat(router): implements support for router-link-active 2016-05-02 01:03:22 +00:00
db95fd6ca9 build(offline compiler): package the compiler-cli for users
Closes #8341
2016-05-02 00:38:54 +00:00
ca13f1c024 fix(router): create a route tree when creating the router service
Closes #8365
2016-05-01 21:38:25 +00:00
277b1fc473 feat(router): add RouteTree and UrlTree as aliases to Tree<RouteSegment> and Tree<UrlSegment> 2016-05-01 21:38:25 +00:00
8836219b16 feat(router): add support for wildcards 2016-05-01 21:38:25 +00:00
6f5e3f9390 Update evaluator.spec.ts
Fix stray `fit` that skips tools tests
Closes #8373
2016-05-01 18:43:32 +00:00
a84c2d7fee fix(typescript): strip abstract keyword from properties in .d.ts
Fixes angular2/src/alt_router/metadata/metadata.d.ts

Closes #8339
2016-05-01 02:59:15 +00:00
f114d6c560 fix(compiler): fix cross view references and providers with useValue.
Before, we would create all fields in the generated views
with visibility `private`. This does not work if an embedded
view references a directive / element in a parent view.
In Dart, this was no problem so far as it does not have
a `private` modifier.

Before, `useValue` in a provider did not work when doing
offline compile, as so far the `MetadataResolver` was only
used for jit mode. Now, `useValue` supports any kind of value
that the static reflector can return. E.g. primitives,
arrays, string maps, …

Closes #8366
2016-05-01 02:30:33 +00:00
163d80adb7 fix(compiler_cli): make sure the generated code gets compiled via tic 2016-05-01 02:30:33 +00:00
9e05814212 chore: move StaticReflector into compiler_cli, part 2
Adjust tests and build to run the unit tests again
after the move.
Closes #8363
2016-04-30 20:53:54 +00:00
ab56be46e1 chore: move static_reflector into compiler_cli
Most of the bugs discovered so far in the offline compiler were related to the StaticReflector. As it was part of angular2 core, it was hard to update. Moving it into the compiler_cli allows to release more often until the compiler_cli gets more stable.

Note: Moving the unit test next to the sources is the simplest option for now in terms of build setup.

Note: This commit only does the move. The next commit updates the build to run it again.
2016-04-30 20:53:54 +00:00
6a0cbb8a57 refactor(core): type ComponentRef, ComponentFactory and ComponentFixture by the component type
BREAKING CHANGE:
- `ComponetRef`, `ComponentFactory`, `ComponentFixture` now all require a type
  parameter with the component type.
Closes #8361
2016-04-30 19:47:54 +00:00
4e2c68354e chore: update ts2dart to 0.9.10 2016-04-30 19:47:54 +00:00
62a0809e81 feat(router): listen to location changes
Closes #8362
2016-04-30 19:02:14 +00:00
76d6f5fa0d fix(router): canDeactivate should not change the url when returns false
Closes #8360
2016-04-30 17:50:28 +00:00
0f1b370117 feat(tests): add ROUTER_FAKE_PROVIDERS to angular2/alt_router/router_testing_providers
This change adds providers for fake router dependecies.
This allows TestComponentBuilder to create components with RouterLink and RouterOutlet directives
without the test writer needing to override them.
2016-04-30 09:42:15 -07:00
e589f9949b chore: align badges in README.md 2016-04-30 08:47:49 -07:00
0f774df811 fix(compiler): project using the right directive as component.
Closes #8344
2016-04-29 18:30:30 -07:00
351f24e8eb fix(core): return the ChangeDetectorRef of the component also for embedded views. 2016-04-29 18:30:30 -07:00
aecb60a604 refactor(core): use Function.bind for referring to event listeners instead of a closure. 2016-04-29 18:30:30 -07:00
4d691b61ee fix(core): check components if an event handler inside of an embedded view fires.
BREAKING CHANGE:
- ViewRef.changeDetectorRef was removed as using ChangeDetectorRefs
  for EmbeddedViewRefs does not make sense. Use ComponentRef.changeDetectorRef
  or inject ChangeDetectorRef instead.

Fixes #8242
2016-04-29 18:30:29 -07:00
11955f9b13 fix(compiler): support empty array and map literals.
This was broken after 152a117d5c

Fixes #8336
2016-04-29 18:30:29 -07:00
5ff31f0713 build(router): create alt_router bundle 2016-04-29 18:05:36 -07:00
deba804671 feat(router): add CanDeactivate 2016-04-29 18:05:06 -07:00
e5b87e55da feat(router): implement relative navigation 2016-04-29 18:04:55 -07:00
d097784d57 chore: adjust public API spec to API changes. 2016-04-29 17:34:32 -07:00
15f6b27ae0 refactor(compiler): support referenced OpaqueTokens correctly in offline compiler. 2016-04-29 16:53:51 -07:00
176e55927c refactor(compiler): support hash syntax for providers. 2016-04-29 16:53:50 -07:00
365be6a309 chore: clang-format after various changes. 2016-04-29 16:53:50 -07:00
713e6d4aff chore: adjust router to /*@ts2dart...*/ 2016-04-29 16:53:50 -07:00
a8e277b067 chore: remove const Provider() in favor of /* @ts2dart_Provider */ {provide:} 2016-04-29 16:53:50 -07:00
3aa322a9c6 chore: replace @CONST() with /*@ts2dart_const*/ 2016-04-29 16:53:50 -07:00
a02614beaa chore: replace CONST_EXPR with /*@ts2dart_const*/ 2016-04-29 16:53:49 -07:00
d2527b504a chore: upgrade to ts2dart@0.9.9 2016-04-29 16:53:49 -07:00
46cd868827 feat(di): support map literals as providers 2016-04-29 16:53:49 -07:00
b1a9e445b3 fix(perf): don’t use try/catch in production mode
The previous code that had `try/catch` statements in methods could not be optimized by Chrome. 

This change separates `AppView` (no `try/catch`) form `DebugAppView` (always `try/catch`). Our codegen will use `AppView` in production mode and `DebugAppView` in debug mode.

Closes #8338
2016-04-29 10:18:57 -07:00
5297c9d9cc refactor(core): deprecate DynamicComponentLoader and DebugNode.inject
BREAKING CHANGE:
- `DynamicComponentLoader` is deprecated. Use `ComponentResolver` and `ViewContainerRef` directly.
- `DebugNode.inject` is deprecated. use `DebugNode.injector.get` instead.
2016-04-29 01:37:58 -07:00
ee7caceec7 Revert "docs: deprecate DynamicComponentLoader and DebugNode.inject"
This reverts commit a0b5964a63.
2016-04-29 01:36:58 -07:00
a0b5964a63 docs: deprecate DynamicComponentLoader and DebugNode.inject 2016-04-29 01:34:06 -07:00
cacdead96d feat(core): introduce template context
BREAKING CHANGE:
- Before, a `EmbeddedViewRef` used to have methods for 
  setting variables. Now, a user has to pass in a context
  object that represents all variables when an `EmbeddedViewRef`
  should be created.
- `ViewContainerRef.createEmbeddedViewRef` now takes
   a context object as 2nd argument.
- `EmbeddedViewRef.setLocal` and `getLocal` have been removed.
  Use `EmbeddedViewRef.context` to access the context.
- `DebugNode.locals` has been removed. Use the new methods `DebugElement.references`
  to get the references that are present on this element,
  or `DebugElement.context` to get the context of the `EmbeddedViewRef` or the component to which the element belongs.

Closes #8321
2016-04-29 01:22:13 -07:00
96ae348648 chore(build): fix formatting and tests
Closes #8098
2016-04-28 23:59:06 -07:00
78946fe9fa feat(offline compiler): a replacement for tsc that compiles templates
see #7483.
2016-04-28 21:57:16 -07:00
33e53c9a59 chore(compiler): add dependency on tsickle
This tool lets us re-write TypeScript sources before entering the emit pipeline.
For example, we lower Decorators to the tree-shakable Annotation form.
2016-04-28 21:55:18 -07:00
c493d88405 chore(compiler): refactoring for offline compiler cli
- pass a baseUrl for asset resolution from static symbols
- fixes in StaticReflector to work with a path-aware host

see #7483
2016-04-28 21:54:02 -07:00
8bf6ef6544 fix(metadata): expose Providers in metadata
These worked in Dart because they were effectively exported even without the export keyword.
Without exporting these symbols, they are not produced in .metadata.json files, which leaves
dangling references from the Decorators that use them.
2016-04-28 21:31:28 -07:00
ca40ef5ac7 fix(codegen): event handler has boolean return type 2016-04-28 21:31:28 -07:00
7c0d4976b1 fix(8223): Preserve Provider expressions
Preserves constructor calls in addition to function calls.
Introduced a special case for forwardRef() similar to CONST_EXPR.
2016-04-28 21:31:28 -07:00
30de2db349 cleanup(router): make analyzer happy
Closes #8220
2016-04-29 02:45:57 +00:00
602641dffd feat(router): adds an example app using the new router 2016-04-29 02:45:57 +00:00
560cc14d97 feat(router): change location when navigating 2016-04-29 02:45:57 +00:00
de56dd5f30 feat(router): add RouterLink 2016-04-29 02:45:57 +00:00
fa5bfe4b64 feat(router): add link that support only absolute urls 2016-04-29 02:45:57 +00:00
446657bdd5 feat(router): update recognize to handle matrix parameters 2016-04-29 02:45:57 +00:00
79830f1c75 feat(router): add RouterUrlSerializer 2016-04-29 02:45:57 +00:00
6e1fed42b7 feat(router): add Router and RouterOutlet to support aux routes 2016-04-29 02:45:57 +00:00
d35c109cb9 feat(router): update recognize to support aux routes 2016-04-29 02:45:57 +00:00
fad3b6434c feat(router): update url parser to handle aux routes 2016-04-29 02:45:57 +00:00
073ec0a7eb chore(CHANGELOG): Fix breaking changes description
Adds more info and examples about how ngFor is affected by the change.
2016-04-28 19:03:54 -07:00
70b23ae2ca refactor(compiler): make static reflector work
Also adjust `RuntimeMetadataResolver` to
be able to use it. 

Also rename `RuntimeMetadataResolver` into `CompileMetadataResolver`.
Closes #8313
2016-04-28 23:06:17 +00:00
769835e53e feat(testing): Use NgZone in TestComponentBuilder.
Instantiating the test component within an NgZone will let us track async tasks in event handlers and change detection.

We can also do auto change detection when triggering events through dispatchEvent and not have to do fixture.detectChange() manually in the test.

New API:
ComponentFixture.autoDetectChanges() - This puts the fixture in auto detect mode that automatically calls detectChanges when the microtask queue is empty (Similar to how change detection is triggered in an actual application).

ComponentFixture.isStable() - This returns a boolean whether the fixture is currently stable or has some async tasks that need to be completed.

ComponentFixture.whenStable() - This returns a promise that is resolved when the fixture is stable after all async tasks are complete.

Closes #8301
2016-04-28 22:37:37 +00:00
ac55e1e27b fix(build): Resolve Dart analyzer issues with the Dart dev channel
Closes #8316
2016-04-28 20:35:56 +00:00
0700c8a252 docs(changelog): update change log to 2.0.0-beta.17. 2016-04-28 11:47:32 -07:00
c79e657fcd chore(release): bump version to 2.0.0-beta.17. 2016-04-28 11:39:20 -07:00
d9648887b8 fix(metadata): Do not attach module names to metadata.
The filename contains the module name as resolved by users, so the top-level module name is uneeded.
Module names on references are replaced by capturing the import syntax from the module.
This allows readers of the metadata to do the module resolution themselves.

Fixes #8225
Fixes #8082

Closes #8256
2016-04-28 01:58:13 +00:00
35cd0ded22 chore(testing): Refactor test methods to have a uniform interface.
Remove FunctionWithParamTokens.

All test wrappers async, fakeAsync and inject now return just a Function instead of FunctionWithParamTokens. This makes them directly consumable by the test framework. Also the test framework code does not have to handle a union of Function and FunctionWithParamTokens everywhere.

The Function returned by the above methods are considered asynchronous by the test framework if they return a Promise, synchronous otherwise.

Closes #8257
2016-04-28 01:16:25 +00:00
d2efac18ed feat(core): separate refs from vars.
Introduces `ref-` to give a name to an element or a directive (also works for `<template>` elements), and `let-` to introduce an input variable for a `<template>` element.

BREAKING CHANGE:
- `#...` now always means `ref-`.
- `<template #abc>` now defines a reference to the TemplateRef, instead of an input variable used inside of the template.
- `#...` inside of a *ngIf, … directives is deprecated.
  Use `let …` instead.
- `var-...` is deprecated. Replace with `let-...` for `<template>` elements and `ref-` for non `<template>` elements.

Closes #7158

Closes #8264
2016-04-28 01:13:40 +00:00
ff2ae7a2e1 fix(testing): allow test component builder to override directives from lists
When a component uses a list of directives, such as `ROUTER_DIRECTIVES`,
make `TestComponentBuilder#overrideDirective` work properly for members
of the list.

Closes #7397

Closes #8217
2016-04-28 00:56:45 +00:00
e1058a4d8a Revert "feat(compiler): ElementSchema now has explicit DOM schema information"
This reverts commit d327ac4b43.
2016-04-27 17:41:57 -07:00
d327ac4b43 feat(compiler): ElementSchema now has explicit DOM schema information
This makes the schema available for offline compile compiler as well.

Closes #8179
2016-04-27 22:57:28 +00:00
1ad2a02b11 fix(core): properly evaluate expressions with conditional and boolean operators
Fixes #8235
Fixes #8244

Closes #8282
2016-04-27 21:25:50 +00:00
1e8864c4a5 fix(compiler): Allow templates to access variables that are declared afterwards.
Fixes #8261
2016-04-27 11:22:44 -07:00
c209836fd0 fix(changelog): fix changelog script.
One charecter missing from
140a878a3d
2016-04-26 16:12:59 -07:00
7d1b6af073 style(global): group multiple imports from same module
Closes #7802

Closes #8209
2016-04-26 22:40:30 +00:00
140a878a3d chore(changelog): regenerate changelog for beta.16 including refactor
- the script explicitly takes input for the starting tag.
- the script only prepends changes.
2016-04-26 15:33:35 -07:00
b62bccf254 build(npm): update rxjs to 5.0.0-beta.6
Closes #6871
Closes #8047
2016-04-26 21:16:37 +00:00
39eb34739a chore(changelog): fix changelog with messages about testing zone deps
Closes #8253
2016-04-26 19:01:12 +00:00
969b55326c docs(changelog): update change log to beta.16 2016-04-25 22:08:32 -07:00
2c8371654a chore(release): bump version to beta.16 2016-04-25 21:48:58 -07:00
5a897cf299 feat(router): add Router and RouterOutlet
Closes #8173
2016-04-25 22:41:33 +00:00
ef67a0c57f feat(router): add router metadata 2016-04-25 22:41:33 +00:00
ef6163e652 feat(router): implement recognizer 2016-04-25 22:41:33 +00:00
f6985671dd feat(router): implement RouterUrlParser 2016-04-25 22:41:33 +00:00
90a1f7d5c4 feat(router): add UrlSegment, RouteSegment, and Tree 2016-04-25 22:41:33 +00:00
3e114227f8 refactor(core): support importUri in StaticReflector
Closes #8195
2016-04-25 22:14:29 +00:00
6103aa0a46 fix(release): Fix the package.json zone.js requirement to 0.6.12 2016-04-25 15:10:06 -07:00
b7c6feff28 chore(release): release the metadata collector
Closes #8197
2016-04-25 21:48:07 +00:00
b48d907697 docs(template-syntax): rename elvis operator
Closes #8196
2016-04-25 21:26:33 +00:00
676ddfa065 docs(cheatsheet): add Directive to cheatsheet
Closes #8170
2016-04-25 20:41:34 +00:00
c8d00dc191 fix(codegen): add explicit any to class fields
fixes #8204

Closes #8205
2016-04-25 20:21:18 +00:00
0b6865d6c6 chore: Remove AngularEntrypoint from TS
Closes #8158
2016-04-25 17:35:05 +00:00
67d05eb65f fix(compiler): use DI order for change detection order.
Closes #8198
2016-04-25 09:36:46 -07:00
152a117d5c fix(compiler): properly implement pure pipes and change pipe syntax
Pure pipes as well as arrays and maps are
implemented via proxy functions. This is
faster than the previous implementation
and also generates less code.

BREAKING CHANGE:
- pipes now take a variable number of arguments, and not an array that contains all arguments.
2016-04-25 09:04:22 -07:00
d6626309fd Revert "fix(compiler): only call pure pipes if their input changed."
This reverts commit 8db62151d2.
2016-04-25 07:53:49 -07:00
c3daccd83b fix(forms): ensure select model updates in firefox and ie
Closes #6573

Closes #8148
2016-04-22 21:23:20 +00:00
8db62151d2 fix(compiler): only call pure pipes if their input changed. 2016-04-21 16:20:19 -07:00
bab81a9831 feat(test): Implement fakeAsync using the FakeAsyncTestZoneSpec from zone.js.
Update the version of zone.js to @0.6.12 that contains the new FakeAsyncTestZoneSpec.

The new fakeAsync zone handles errors better and clearPendingTimers() is no longer required to be called after handling an error and is deprecated.

The fakeAsync test zone will now throw an error if an XHR is attemtped within the test since that cannot be controlled synchronously in the test(Need to be mocked out with a service implementation that doesn't involve XHRs).

This commit also allows fakeAsync to wrap inject to make it consistent with async test zone.

BREAKING CHANGE:

inject can no longer wrap fakeAsync while fakeAsync can wrap inject. So the order in existing tests with inject and fakeAsync has to be switched as follows:

Before:
```
inject([...], fakeAsync((...) => {...}))
```

After:
```
fakeAsync(inject([...], (...) => {...}))
```

Closes #8142
2016-04-21 22:11:00 +00:00
cc86fee1d1 fix(compiler): support string tokens with . inside. 2016-04-21 11:17:49 -07:00
386cc5dbb6 fix(transformers): support query.read
Closes #8172
2016-04-21 10:12:59 -07:00
2f7045720a fix(core): various minor compiler fixes
Closes #8162
2016-04-21 09:13:02 -07:00
9889c21aaa fix(metadata): emit metadata rooted at 'angular2'
fixes #8144

closes #8147
2016-04-20 17:14:53 -04:00
e69cb40de3 fix(forms): number input should report null when blank
Closes #6932

Closes #8141
2016-04-20 20:33:18 +00:00
12837e1c17 fix(forms): improve error message when ngFormModel is missing a form
Closes #8136

Closes #8143
2016-04-20 20:10:50 +00:00
9092ac79d4 refactor(core): support non reflective bootstrap.
This changes Angular so that it can be used without reflection (assuming a codegen for injectors).

BREAKIKNG CHANGE:
- Drops `APP_COMPONENT` provider. Instead, inject
  `ApplicationRef` and read its `componentTypes` property.
- long form bootstrap has changed into the following:
  ```
  var platform = createPlatform(ReflectiveInjector.resolveAndCreate(BROWSER_PROVIDERS));
  var appInjector =
    ReflectiveInjector.resolveAndCreate([BROWSER_APP_PROVIDERS, appProviders], platform.injector);
  coreLoadAndBootstrap(appInjector, MyApp);
  ```
2016-04-20 11:34:11 -07:00
0a7d10ba55 refactor(core): separate reflective injector from Injector interface
BREAKING CHANGE:
- Injector was renamed into `ReflectiveInjector`,
  as `Injector` is only an abstract class with one method on it
- `Injector.getOptional()` was changed into `Injector.get(token, notFoundValue)`
  to make implementing injectors simpler
- `ViewContainerRef.createComponent` now takes an `Injector`
  instead of `ResolvedProviders`. If a reflective injector
  should be used, create one before calling this method.
  (e.g. via `ReflectiveInjector.resolveAndCreate(…)`.
2016-04-20 11:28:13 -07:00
efbd446d18 refactor(core): add Query.read and remove DynamicComponentLoader.loadIntoLocation.
This adds the feature for `@ViewChild`/`@ViewChildren`/`@ContentChild`/`@ContentChildren` to define what to read from the queried element.

E.g. `@ViewChild(`someVar`, read: ViewContainerRef)` will locate the element with a variable `someVar` on it and return a `ViewContainerRef` for it.

Background: With this change, Angular knows exactly at which elements there will be `ViewConainerRef`s as the user has to ask explicitly of them. This simplifies codegen and will make converting Angular templates into server side templates simpler as well.

BREAKING CHANGE:
- `DynamicComponentLoader.loadIntoLocation` has been removed. Use `@ViewChild(‘myVar’, read: ViewContainerRef)` to get hold of a `ViewContainerRef` at an element with variable `myVar`.
- `DynamicComponentLoader.loadNextToLocation` now takes a `ViewContainerRef` instead of an `ElementRef`.
- `AppViewManager` is renamed into `ViewUtils` and is a mere private utility service.
2016-04-20 11:28:00 -07:00
c06b0a2371 refactor(codegen): produce .ngfactory.dart/ts files instead of .template.dart/ts files.
This is needed as we will soon store other
things into the generated files, not
only the templates.
2016-04-20 11:27:34 -07:00
0c600cf6e3 refactor(core): introduce ComponentFactory.
Each compile template now exposes a `<CompName>NgFactory` variable
with an instance of a `ComponentFactory`.
Calling `ComponentFactory.create` returns a `ComponentRef` that can
be used directly.

BREAKING CHANGE:
- `Compiler` is renamed to `ComponentResolver`,
  `Compiler.compileInHost` has been renamed to `ComponentResolver.resolveComponent`.
- `ComponentRef.dispose` is renamed to `ComponentRef.destroy`
- `ViewContainerRef.createHostView` is renamed to `ViewContainerRef.createComponent`
- `ComponentFixture_` has been removed, the class `ComponentFixture`
  can now be created directly as it is no more using private APIs.
2016-04-20 11:27:26 -07:00
41404057cf fix(build): ignore Dart warnings for external code. 2016-04-20 10:51:58 -07:00
f4e6994634 feat(NgTemplateOutlet): add NgTemplateOutlet directive
This commits adds a new NgTemplateOutlet directive that can be
used to create embeded views from a supplied TemplateRef.

Closes #7615

Closes #8021
2016-04-20 04:28:59 +00:00
b602bd8c83 refactor(Location): out of router and into platform/common
closes https://github.com/angular/angular/issues/4943

BREAKING CHANGE:

`Location` and other related providers have been moved out of `router` and into `platform/common`. `BrowserPlatformLocation` is not meant to be used directly however advanced configurations may use it via the following import change.

Before:

```
import {
  PlatformLocation,
  Location,
  LocationStrategy,
  HashLocationStrategy,
  PathLocationStrategy,
  APP_BASE_HREF}
from 'angular2/router';

import {BrowserPlatformLocation} from 'angular2/src/router/location/browser_platform_location';
```

After:

```
import {
  PlatformLocation,
  Location,
  LocationStrategy,
  HashLocationStrategy,
  PathLocationStrategy,
  APP_BASE_HREF}
from 'angular2/platform/common';

import {BrowserPlatformLocation} from 'angular2/src/platform/browser/location/browser_platform_location';
```

Closes #7962
2016-04-20 04:28:47 +00:00
30c43521d3 fix(http) : set response.ok based on given status code
Closes #8056
2016-04-20 04:28:27 +00:00
45f5df371d docs(markdown): add missing space between markdown ### and text, turn h1 into h3s, remove bold.
Closes #7996
2016-04-20 04:09:31 +00:00
43e31c5abb docs(): fix a typo: patform -> platform
Closes #8081
2016-04-18 19:53:19 -07:00
13c8b13343 Add BREAKING CHANGE to CHANGELOG for b.15
Dart apps that import angular2/bootstrap.dart ran in beta.14, but fail in beta.15.

Closes #8071
2016-04-18 19:53:19 -07:00
0fc9ec248e fix(upgrade): clean up scope when element is destroyed
Closes #8102
2016-04-19 01:06:14 +00:00
d094a85647 fix(angular_1_router): Removed arrow function from module template
Closes #8076
2016-04-19 00:44:17 +00:00
22c05b0834 fix(tests): remove payload size check 2016-04-18 17:08:55 -07:00
8490921fb3 feat(tests): manage asynchronous tests using zones
Instead of using injectAsync and returning a promise, use the `async` function
to wrap tests. This will run the test inside a zone which does not complete
the test until all asynchronous tasks have been completed.

`async` may be used with the `inject` function, or separately.

BREAKING CHANGE:

`injectAsync` is now deprecated. Instead, use the `async` function
to wrap any asynchronous tests.

Before:
```
it('should wait for returned promises', injectAsync([FancyService], (service) => {
  return service.getAsyncValue().then((value) => { expect(value).toEqual('async value'); });
}));

it('should wait for returned promises', injectAsync([], () => {
  return somePromise.then(() => { expect(true).toEqual(true); });
}));
```

After:
```
it('should wait for returned promises', async(inject([FancyService], (service) => {
  service.getAsyncValue().then((value) => { expect(value).toEqual('async value'); });
})));

// Note that if there is no injection, we no longer need `inject` OR `injectAsync`.
it('should wait for returned promises', async(() => {
  somePromise.then() => { expect(true).toEqual(true); });
}));
```

Closes #7735
2016-04-18 15:59:07 -07:00
ecb9bb96f0 docs(): fix broken links
Closes #8028
2016-04-18 20:12:37 +00:00
75463cd8df chore(perf): return perf metrics from AngularProfiler
Closes #8075
2016-04-18 19:48:52 +00:00
c6244d1470 feat(i18n): add support for nested expansion forms
Closes #7977
2016-04-18 19:38:12 +00:00
22ae2d0976 cleanup(html_parser): cleanup to fix analyzer warnings 2016-04-18 19:38:12 +00:00
88b0a239c4 feat(i18n): support plural and gender special forms 2016-04-18 19:38:12 +00:00
7c9717bba8 feat(html_parser): support special forms used by i18n { exp, plural, =0 {} } 2016-04-18 19:38:11 +00:00
7f297666ca feat(html_lexer): support special forms used by i18n { exp, plural, =0 {} } 2016-04-18 19:38:11 +00:00
d99823e2fd docs(core): fix some grammar
Closes #8055
2016-04-18 19:34:17 +00:00
bb9fb21fac feat(i18n): add custom placeholder names
Closes #7799

Closes #8057
2016-04-18 19:14:15 +00:00
b64672b23c fix(dart) reverts protobuf to last working version
Closes #8125
2016-04-18 18:28:43 +00:00
930f58718b Revert "feat(i18n): add support for custom placeholder names"
This reverts commit 2abb414cfb.
2016-04-14 15:36:40 -07:00
2b34c88b69 refactor(view_compiler): codegen DI and Queries
BREAKING CHANGE:
- Renderer:
  * renderComponent method is removed form `Renderer`, only present on `RootRenderer`
  * Renderer.setDebugInfo is removed. Renderer.createElement / createText / createTemplateAnchor
    now take the DebugInfo directly.
- Query semantics:
  * Queries don't work with dynamically loaded components.
  * e.g. for router-outlet: loaded components can't be queries via @ViewQuery,
    but router-outlet emits an event `activate` now that emits the activated component
- Exception classes and the context inside changed (renamed fields)
- DebugElement.attributes is an Object and not a Map in JS any more
- ChangeDetectorGenConfig was renamed into CompilerConfig
- AppViewManager.createEmbeddedViewInContainer / AppViewManager.createHostViewInContainer
  are removed, use the methods in ViewContainerRef instead
- Change detection order changed:
  * 1. dirty check component inputs
  * 2. dirty check content children
  * 3. update render nodes

Closes #6301
Closes #6567
2016-04-13 14:43:48 -07:00
45f09ba686 docs(changelog): update changelog to beta.15 2016-04-13 14:39:17 -07:00
bb62905bef chore(release): bump version to beta.15 2016-04-13 14:39:17 -07:00
7bc9b19418 cleanup(tests): remove unused imports
Closes #6784
2016-04-13 13:24:04 -07:00
e9f7a00910 docs(metadata): Add more docs of ViewChild and ViewChildren
Closes #7174
2016-04-13 13:24:04 -07:00
a5d6b6db8b fix(WebWorker): Fix textarea value not being sent to the worker
Closes #7439
Closes #7828
2016-04-13 13:24:04 -07:00
fc496813e2 fix(7877): StaticReflector returns empty results instead of undefined.
Reflector always returns either an empty object or an empty list if no
metadata is recorded for the class. StaticReflector matches this
behavior.

Closes #7986
2016-04-13 13:23:54 -07:00
2abb414cfb feat(i18n): add support for custom placeholder names
Closes #7799
Closes #8010
2016-04-13 13:23:42 -07:00
0e56aaf189 fix: remove typescript references to d.ts files from benchpress and e2e tests
using "/// <reference" is incorrect because it makes our code non-portable. The correct solution is to provide
these typings as ambient typings as an additional entry point - which we already do.

Closes #8050
2016-04-13 13:23:27 -07:00
3412aba46e feat(typescript): update to 1.9 nightly.
To workaround https://github.com/Microsoft/TypeScript/issues/7573
we must remove the readonly keyword from generated .d.ts files.
This solution will not scale, but will probably buy enough time to require our users move to a 2.0 beta.

Closes #8003
2016-04-13 18:54:58 +00:00
347e71af7d chore(travis): enable the typescript@next build
Fixes #7050
2016-04-13 18:54:58 +00:00
d24df799d3 Revert "feat(iterable_differ): support immutable lists"
In Dart, ImmutableLists are just a projection of an underlying list.
I.e. if the underlying list changes, the ImmutableList also changes.
So we can't make optimizations based on checking whether a collection
is an ImmutableList.

This reverts commit a10c02cb41.

Closes #8023
2016-04-13 17:02:48 +00:00
01e6b8c7ed fix(build): ignore dart warnings The name … is shown, but not used
See https://github.com/angular/angular/issues/8044

Closes #8045
2016-04-13 09:49:33 -07:00
60727c4d2b revert(format): Revert "chore(format): update to latest formatter"
This reverts commit 03627aa84d.
2016-04-12 09:41:01 -07:00
03627aa84d chore(format): update to latest formatter
Closes #7958
2016-04-11 22:15:23 +00:00
83b8f59297 feat(transformers): special case Profiler 2016-04-11 14:32:22 -07:00
c6f454f51d docs: remove duplicate 'directives' from example
Closes #7963
2016-04-11 21:29:21 +00:00
ccff17599a feat(ngFor): Support convenience view local in ngFor
Closes #8013
2016-04-11 21:27:48 +00:00
fb2773b8f3 docs(router): fix wording of hashchange explanation
Closes #7776
2016-04-11 21:11:11 +00:00
5110121f6e docs(ViewQuery): fix typo in documentation
fix typo that confusingly refers to `@Query` rather than `@ViewQuery`.

Closes #7870
2016-04-11 21:04:08 +00:00
27cf897239 chore: upgrade zone.js to v0.6.10
Closes #7818
Closes #7721

Closes #7888
2016-04-11 21:03:59 +00:00
5d33a12af4 chore(gulpfile): turn off mangle for prod
Closes #7988
2016-04-11 20:50:14 +00:00
08b295603c fix(7987): Incremental build works with new trees
Closes #7989
2016-04-11 20:28:34 +00:00
3b60503d2b feat(transformers): changes transformers to collect information about providers and resolve identifiers during linking 2016-04-10 19:36:16 -07:00
3c2473bac6 Fixed typo in documentation
Closes #7943
2016-04-08 23:27:36 +00:00
f9426709ef chore(build): Fix errors reported using 1.9.
Closes #7954
2016-04-08 21:53:50 +00:00
e1e44a910e fix(select): set value individually from ngModel
Closes #7975

Closes #7978
2016-04-08 21:08:05 +00:00
f371c9066d build(broccoli): Clean-up TypeScript build
The TypeScript parser now only references files that are in broccoli trees.

Closes #7941
2016-04-08 19:30:39 +00:00
85c1927993 build(broccoli): AngularBuilder compiles with TypeScript 1.8+.
Beginning with 1.8, if a modules has both a .ts and .d.ts file, the .js
file is not written.

Closes #7947
2016-04-08 19:24:04 +00:00
a596b887ff feat(compiler): Add an implementation for XHR that uses a template cache to load template files.
Useful for avoiding doing an actual XHR during testing.
Part of the solution for #4051 (Other part is a Karma plugin that will create the template cache).

Closes #7940
2016-04-08 19:05:05 +00:00
6cbf99086e feat(gestures): allow override of Hammer default configuration
Closes #7924
2016-04-08 18:53:58 +00:00
26a3390549 refactor(dart/transform): Remove deprecated angular2/bootstrap
BREAKING CHANGE

Remove the deprecated angular2/bootstrap.ts &
angular2/bootstrap_static.ts libraries.

Browser entry points should import angular2/platform/browser which
supplies the `bootstrap` function.

Closes #7650
2016-04-08 18:28:35 +00:00
9a1959f77a build(tslint): re-enable linter and fix violations
fixes #7798

Closes #7800
2016-04-07 23:11:02 +00:00
226e662cf1 feat(parser): TemplateParser.tryParse() returns both the AST and errors
The language service (#7482) always needs the AST even if there are errors
in the template.

Closes #7858
2016-04-07 22:00:46 +00:00
7a1a1b80ed Roll forward to 0.1.24
Closes #7867
2016-04-07 21:58:48 +00:00
529988bc81 Fix DDC errors 2016-04-07 21:58:48 +00:00
c17dc1c057 fix(7837): MetadataCollector takes no parameters for the constructor.
MetadataCollector no longer requires a ts.LanguageService parameter
it didn't use.

Closes #7838
2016-04-07 21:38:07 +00:00
09a95a692e docs(cheatsheet/dart): fix imports
Closes #7872
2016-04-07 21:23:14 +00:00
247964af62 fix(upgrade): make upgradeAdapter upgrade angular 1 components correctly
With this fix, the $onInit function of an upgraded angular 1 component is called and input bindings (<) are created.

Closes #7951
2016-04-07 20:19:46 +00:00
5e2bc5c593 fix(RouterLink): ignore optional parameters when checking for active routes
fixes #6459
Closes #7834
2016-04-07 19:41:14 +00:00
28e657d857 fix(payload): increase payload size limit temporarily 2016-04-07 11:42:13 -07:00
06ad112998 docs(changelog): update change log to beta.14 2016-04-07 10:19:35 -07:00
cfa1d17afe chore(release): bump version to beta.14 2016-04-07 10:09:46 -07:00
3ca6df87b8 fix(select): update name from ng-value to ngValue
Closes #7939
2016-04-06 22:47:21 +00:00
e310bee9e2 feat(dart/transform): Avoid print in transformer code.
Replace direct uses of `print` in the transformer with explicit uses of
stderr.

Add a few @override annotations for clarification of other `print`
implementations.

Clarify error message on incorrect custom_annotations value.

Closes #7855
2016-04-06 22:31:08 +00:00
4902244cce fix(router): allow forward slashes in query parameters
Closes #7824
2016-04-06 22:01:12 +00:00
8db97b0b7a fix(forms): support both value and ng-value 2016-04-06 14:37:57 -07:00
9be04f8d38 fix(upgrade): leak when angular1 destroys element
Fixes #6401

Closes #7935
2016-04-06 19:58:10 +00:00
74e2bd7e3e fix(select): support objects as select values
Closes #4843

Closes #7842
2016-04-06 17:05:38 +00:00
52d3980d02 Revert "feat(transformers): changes transformers to collect information about providers and resolve identifiers during linking"
This reverts commit 4e9809bcb2.
2016-04-06 09:26:03 -07:00
4e9809bcb2 feat(transformers): changes transformers to collect information about providers and resolve identifiers during linking
Closes #7380
2016-04-04 22:59:43 +00:00
bd8a4215dd refactor(core): remove @Injectable as only classes that are instantiated via DI need it 2016-04-04 22:59:43 +00:00
d23b973e7a refactor(forms): extract Validators.required into a variable as transformers cannot resolve statics 2016-04-04 22:59:43 +00:00
0dbf959548 feat(static-reflector): Added StaticReflector
Added a static reflector that uses metadta produced during build
or, additionally, directly from typescript, to produce the metadata
used by Angular code generation compiler.
2016-04-01 14:45:43 -07:00
20812f446f docs(changelog): fix formatting 2016-03-30 18:10:41 -07:00
27a4d0ce11 docs(changelog): update change log to beta.13 2016-03-30 17:23:38 -07:00
9dec4c7485 chore(release): bump version to beta.13 2016-03-30 17:21:51 -07:00
90c87fa6ad fix(codegen): stringify using an opaque ID when toString contains parens.
Using toString results in 'function (_arg1, arg2) {' when using closure compiler for 6-to-5.

Closes #7825
2016-03-30 23:43:35 +00:00
291928feb1 chore(scripts): log out of npm 2016-03-30 16:20:21 -07:00
c9c52fb353 build(pubspec): Clean up pubspec files
Add a direct dependency on package:path.
Remove dependency on package:quiver
2016-03-29 14:30:00 -07:00
0bcfcde63d fix(Router): handling of special chars in dynamic segments
Closes #7804
2016-03-29 20:24:28 +00:00
1c20a62611 feat(dart): Add a dev-mode check for undeclared lifecycle interfaces
Add a check in ReflectionCapabilities#interfaces which determines if
the passed-in type implements a Lifecycle Interface but does not declare
that it does so.

See https://goo.gl/b07Kii for details.

Closes #6849
2016-03-29 10:55:06 -07:00
8430927e6b feat(i18n): update transformers to read a xmb file when provided and use I18nHtmlParser in this case
Closes #7790
2016-03-28 19:54:13 +00:00
d2ca7d81c8 feat(i18n): reexport I18nHtmlParser through the i18n barrel 2016-03-28 19:54:13 +00:00
756121acc1 feat(i18n): update I18nHtmlParser to accept parsed messages 2016-03-28 19:54:13 +00:00
d7e1175df0 feat(i18n): implement xmb deserialization 2016-03-28 19:54:12 +00:00
66cd84e0d5 refactor(i18n): rename serialize into serializeXmb 2016-03-28 19:54:12 +00:00
506f4ce1e5 feat(compiler): Resolvers now use DI to create reflector
Also introduced ReflectorReader when only read-only access to the reflector
is needed.

Closes #7762
2016-03-28 13:52:32 -05:00
a0387d2835 doc(Router): improve the example for routerOnActivate 2016-03-28 10:25:03 -07:00
9bdd5951d9 docs(forms): update the docs to reflect the current behavior
Closes #6504
2016-03-28 10:22:24 -07:00
111afcdff1 fix(build): MetadataCollector correctly collects property metadata
Fixes #7772

Closes #7773
2016-03-25 21:52:06 +00:00
85f3dc2fb5 chore(build): Produce .d.ts files for build tools
Closes #7763
2016-03-25 18:23:00 +00:00
430f367c2f fix(upgrade): make ngUpgrade work with testability API
Closes #7603
2016-03-25 17:27:45 +00:00
d272f96e23 feat(i18n): implement an i18n-aware html parser
Closes #7738
2016-03-24 20:36:19 +00:00
73a84a7098 refactor(i18n): remove utility functions into a separate file 2016-03-24 20:36:19 +00:00
17c8ec8a5d feat(html_parser): change HtmlElementAst to store both the start and the end positions 2016-03-24 20:36:19 +00:00
a1880c3576 feat(facade): add ListWrapper.flatten 2016-03-24 20:36:19 +00:00
91999e016e feat(facade): add RegExpWrapper.replaceAll to replace all matches using the provided function 2016-03-24 20:36:19 +00:00
aa966f5de2 feat(Compiler): Allow overriding the projection selector
fixes #6303

BREAKING CHANGE:

For static content projection, elements with *-directives are now matched against the element itself vs the template before.

    <p *ngIf="condition" foo></p>

Before:

    // Use the implicit template for projection
    <ng-content select="template"></ng-content>

After:

    // Use the actual element for projection
    <ng-content select="p[foo]"></ng-content>
Closes #7742
2016-03-24 20:09:34 +00:00
3e593b8221 chore(test.typings): instrument against examples folder
chore(typing_spec): delete unused typing_spec files

Closes #7743
2016-03-24 19:25:07 +00:00
440aca86a3 chore(examples): fix implied imports in examples for testing built typings 2016-03-24 19:25:07 +00:00
09f4d6f52d chore(refactor): Refactored metadata collector
Renamed MetadataExtractor to MetadataCollector
Reorganized to split src from tests

Closes #7492
2016-03-24 18:52:06 +00:00
3f57fa6e0e chore(build): Added tests for metadata extractor
Adds unit test to metadata extractor classes
Fixes issues found while testing
2016-03-24 18:52:06 +00:00
ae876d1317 feat(build): Persisting decorator metadata
This allows determing what the runtime metadata will be for a
class without having to loading and running the corresponding
.js file.
2016-03-24 18:52:06 +00:00
6de68e2f1f feat(compiler): assert that Component.style is an array
Part of #7481 (effort to improve error messages)

Closes #7559
2016-03-24 15:21:16 +00:00
49527ab495 fix(ngFor): give more instructive error when binding to non-iterable
Before, you'd get an error like:

```
EXCEPTION: Cannot find a differ supporting object ‘[object Object]’ in [users in UsersCmp@2:14]
```

Now, you get:

```
EXCEPTION: Cannot find a differ supporting object ‘[object Object]’ of type 'Object'. Did you mean to bind ngFor to an Array? in [users in UsersCmp@2:14]
```
2016-03-24 15:21:16 +00:00
0898bca939 chore: bump version to beta.12 w/ changelog 2016-03-23 15:56:38 -07:00
d940387beb chore: upgrade zone.js to v0.6.6
Closes #7730
Closes #7737
2016-03-23 20:48:23 +00:00
27c45b05cf Update ISSUE_TEMPLATE.md 2016-03-23 12:53:10 -07:00
90f09d551f Update ISSUE_TEMPLATE.md 2016-03-23 12:50:01 -07:00
3739588e97 chore: build cjs code prior to launching e2e tests
Closes #6783

Closes #7725
2016-03-22 22:09:33 +00:00
0730b753f2 chore(ddc): add e2e test infra + first test 2016-03-22 22:09:33 +00:00
cad693de0f refactor(NgZoneImpl): ensure zone spec is available
trace could be true (in dev mode) while there is no long stack trace spec
Closes #7702
2016-03-22 18:46:12 +00:00
bf911fc992 chore: upgrade zone.js@0.6.5
Closes #7700
2016-03-22 08:21:10 -07:00
fb6d791ce9 test(angular1_router): check that link generation works with baseHref
Closes #7489
2016-03-22 02:19:09 +00:00
0f8efce799 fix(angular1_router): support link generation with custom hashPrefixes 2016-03-22 02:19:09 +00:00
69c1405196 fix(angular_1_router): ng-link is generating wrong hrefs
At the moment ng-link is generating html5mode URLs for `href`s.
Instead it should check whether or not html5mode is enabled and create
the `href`s accordingly. The renaming in the `getLink` function is
aligning it to `RouterLink`'s `_updateLink`.

Closes #7423
2016-03-22 02:19:09 +00:00
980491b08f chore(angular1_router): tighten up the build regex replacement 2016-03-22 02:19:09 +00:00
72e24663ad refactor(dart/transform): Migrates tests to use package:test
Pt 4 of migrating from package:guinness + package:unittest =>
package:test.

This PR migrates DeferredRewriter & DirectiveMetadataLinker unit tests.

Closes #7703
2016-03-22 02:13:16 +00:00
363ed5140e docs(bundles/overview.md): fix typo
Closes #7677
2016-03-22 01:53:35 +00:00
b0f585ab08 build(npm): bump Angular version in our shrinkwrap files 2016-03-22 01:53:35 +00:00
8b67b07580 fix(package.json): remove es6-promise from the peerDependency list
As of zone.js@0.6* we no longer require an es6-promise polyfill. The polyfill is only needed on browsers that don't
have native Promise support.
2016-03-22 01:53:35 +00:00
5c330ea492 chore(publish): run router publish with additional memory
Closes #7408
2016-03-22 00:20:08 +00:00
06eaaf0ac5 chore(angular1_router): bump version to v0.2.0 2016-03-22 00:20:08 +00:00
9820271243 chore(script): publish angular 1 router to latest tag in npm 2016-03-22 00:20:08 +00:00
b6507e37ef feat(dart/transform): Use angular2/platform/browser as bootstrap lib
Update the Angular 2 transformer to recognize
`package:angular2/platform/browser.dart` as the library which exports
the `bootstrap` function.

Update playground, examples, benchmarks, & tests to import bootstrap from
platform/browser.

Closes #7647
2016-03-21 00:58:17 +00:00
c194f6695d chore: bump version to beta.11 w/ changelog 2016-03-18 14:42:31 -07:00
967ae3e1b8 fix(common): remove @internal annotation on SwitchView
Closes #7657
2016-03-18 13:16:50 -07:00
a5e6eaaebc chore: upgrade es6-shim to v0.35.0
Closes #7653
2016-03-18 13:16:15 -07:00
d4e9b55fb6 fix: make sure that Zone does not show up in angular2.d.ts
Closes #7655
2016-03-18 19:41:30 +00:00
048bd280dd chore: re-enable all tests (accidental ddescribe checkin) 2016-03-18 19:41:30 +00:00
8326ab3240 feat(i18n): add a simple dart script extracting all i18n messages from a package
Closes #7620
2016-03-17 16:45:16 -07:00
a7fe983be2 feat(i18n): create i18n barrel 2016-03-17 16:45:15 -07:00
e1f8e54e34 feat(i18n): implement xmb serializer 2016-03-17 16:45:15 -07:00
2b165944ea refactor(i18n): move message and id into a separate file 2016-03-17 16:45:15 -07:00
ea11b3f1f8 docs(changelog): update change log to beta.10 2016-03-17 15:06:28 -07:00
3bd87147ab chore(release): bump version to beta.10 2016-03-17 15:06:27 -07:00
2f581ffc88 fix(router): RouterOutlet loads component twice in a race condition
Closes #7497

Closes #7545
2016-03-16 22:34:54 +00:00
d61aaac400 chore(): remove all angular2_material code. 2016-03-16 13:37:37 -07:00
310620fd12 chore: upgrade to new Zone.js API v0.6.2
BREAKING CHANGE

Removed deprecated API from NgZone
- `NgZone.overrideOnTurnStart`
- `NgZone.overrideOnTurnDone`
- `NgZone.overrideOnEventDone`
- `NgZone.overrideOnErrorHandler`

Rename NgZone API
- `NgZone.onTurnStart` => `NgZone.onUnstable`
- `NgZone.onTurnDone` => `NgZone.onMicrotaskEmpty`
- `NgZone.onEventDone` => `NgZone.onStable`

Closes #7345
2016-03-16 18:05:09 +00:00
f9fb72fb0e chore(core): remove @View annotation
Closes #7495
2016-03-14 23:26:20 +00:00
095db673c5 feat(i18n): implement a simple version of message extractor
Closes #7454
2016-03-14 21:50:00 +00:00
70d18b5b53 feat(compiler): change html parser to preserve comments 2016-03-14 21:50:00 +00:00
f1796d67f4 feat(facade): add .values to StringMapWrapper 2016-03-14 21:50:00 +00:00
cb38d72ff4 feat(shadow_css): support /deep/ and >>>
Fixes #7562

Closes #7563
2016-03-11 22:14:26 +00:00
b72bab49aa feat(core): introduce a CSS lexer/parser 2016-03-11 13:54:01 -08:00
201475e8d8 cleanup(testing): clean up public api spec
Change the old public api spec to check only the exported top-level symbols. This will make sure that Dart and JS do not diverge. The new public api spec verifies the TS api.

Closes #7447
2016-03-11 19:24:29 +00:00
c25b9fcf97 docs(core): update <content> to <ng-content> 2016-03-11 11:19:52 -08:00
8755a8e188 docs(): fix typo 2016-03-11 11:18:59 -08:00
127fbfd5a6 Revert "feat(core): introduce a CSS lexer/parser"
This reverts commit 293fa5505b.

The rebased commit broke CI: https://travis-ci.org/angular/angular/jobs/115388814
2016-03-11 11:14:58 -08:00
f33dda79e9 chore(build): disable broken FirefoxBeta on SauceLabs
See #7560.
2016-03-11 10:57:44 -08:00
293fa5505b feat(core): introduce a CSS lexer/parser 2016-03-11 10:42:29 -08:00
df1f78e302 feat(i18n): add ngPlural directive 2016-03-10 09:55:21 -08:00
43bb31c6c6 refactor(dart/transform): Use targeted transformers
TL;DR: Modify pubspec.yaml files to use the recommended "targeted"
transformers. The unified "simple" angular2 transformer still works as
always, but we want to encourage use of the targeted transformers
whereever possible.

See [the wiki](https://github.com/angular/angular/wiki/Advanced-Transformer-Configuration)
for details about targeted transformers.

See #1872
2016-03-10 09:30:47 -08:00
169869a195 test(matchers): add support for toMatchPattern in tests 2016-03-09 21:31:15 -08:00
b691da26af chore(facade): add enum index lookup support 2016-03-09 21:30:03 -08:00
8e3e45097a fix(router): handle URL that does not match a route
Closes #7349
Closes #7203
2016-03-09 20:48:52 -08:00
aa43d2f87b docs(changelog): update change log to beta 9 2016-03-09 16:37:30 -08:00
128acbb6eb fix(change_detection): fix a memory leak 2016-03-09 16:24:51 -08:00
5824866a83 fix(closure): don't throw from top-level
workaround for http://b/27151095
2016-03-09 16:22:35 -08:00
0d58b137a7 fix(router/instruction): ensure toLinkUrl includes extra params
Closes #7367
2016-03-09 16:21:43 -08:00
b5c769e1e4 chore(release): bump version to beta.9 2016-03-09 14:38:23 -08:00
7f22bd62ab test(angular_1_router): apply annotations to controller constructors
Until Angular 1.5.1 is released, the `$routeConfig` and `$routerCanActivate`
annotations for components must live on the controller constructor.

In Angular 1.5.1, it will automatically copy these annotations across from
the component definition file.

Closes #7319
2016-03-09 21:50:24 +00:00
83f0e7c975 test(angular_1_router): fix router_spec tests
These tests were registering new components after the application had
been bootstrapped, which is not a valid use case for synchronous routes
in Angular 1.

In particular it was registering the "root" component, which caused the
`$rootRouter` to blow up, when it was instantiated, pointing to a root
component that did not yet exist.
2016-03-09 21:50:24 +00:00
adef68b4d6 refactor(angular_1_router): remove directiveIntrospector
The directiveIntrospector was a bit of a hack to allow the router to
read the `$routeConfig` annocation and `$routerCanActivate` hook from
directives when they were registered.

It turns out that if we put these properties on the component controller's
constructor function (i.e. as static class methods) then we can simply
use the `$injector` to access it as required.

Currently, people put the properties directly on their component definition
objects. In Angular 1.5.1, we will copy these properties onto the controller
constructor to maintain a simple migration path. But going forward it may be
better to encourage people to add the properties directly to the controller
constructor.
2016-03-09 21:50:24 +00:00
14f0e9ada8 chore: fix DDC errors / warnings
Closes #7195
2016-03-08 22:17:32 +00:00
ef9e40e82b refactor(dart/transform): Migrates tests to use package:test
Pt 3 of migrating from package:guinness + package:unittest => package:test.

This PR migrates DirectiveProcessor & InlinerForTest unit tests.

Closes #7475
2016-03-08 01:39:23 +00:00
41e38e4330 fix hammer_gestures infinite loop 2016-03-08 01:37:40 +00:00
2c7c3e3c69 feat(TAG_DEFINITIONS): include <meta> and <base>
needed to parse index.html as a component template
Closes #7455
2016-03-08 01:03:20 +00:00
756f5d884f refactor(dart/transform): AnnotationMatcher tests
These were previously not being run.

Bring them up to modern usage, move them to package:test, and include
them in transform.server.spec.dart.

Closes #7463
2016-03-08 00:47:35 +00:00
45fd6f0a41 feat(transformers): change 'Missing Identifier' to be an error
Closes #7403
2016-03-08 00:08:36 +00:00
75ae4a9159 ci(publish-build-artifacts.sh): skip all the work for builds other than upstream/master
Closes #7413
2016-03-05 19:54:22 +00:00
37d18d0112 ci(travis): publish artifacts only from the upstream/master jobs 2016-03-05 19:54:22 +00:00
773fe8f8c5 ci(travis): simplify job status reporting 2016-03-05 19:54:22 +00:00
4da2b19ea0 docs(CONTRIBUTING.md): clarify the difference between build and ci commit message scopes 2016-03-05 19:54:22 +00:00
9f3547e35d ci(travis): fix typo in webhooks config 2016-03-05 19:54:22 +00:00
5a79358727 ci(travis): fix indentation in of the .travis.yaml 2016-03-05 19:54:22 +00:00
85bfbc13c1 ci(travis): clean up matrix environmental variables
remove all unnecessary ones.
2016-03-05 19:54:22 +00:00
1a01af9e68 ci(travis): clean up, reorganize and document before_install and install scripts
Functionally this should be a noop change.
2016-03-05 19:54:22 +00:00
dd95e901df ci(travis): remove bogus environmental variable 2016-03-05 19:54:22 +00:00
9782d8c32e ci(travis): better document before_cache script 2016-03-05 19:54:22 +00:00
80764c6f71 ci(travis): use gcc v4.8 to compile npm native modules on Node v4 and v5 2016-03-05 19:54:22 +00:00
d9e78e4fa8 build(analytics): allow build analytics to take previous exit code as the first argument 2016-03-05 19:54:22 +00:00
10fedd0dfc ci(analytics): correctly report CI job errors as errors 2016-03-05 19:54:22 +00:00
315e73c47c ci(analytics): report Travis ID without the build number prefix
We need to track latency of individual jobs over time, but don't care to know what's the build ID that these jobs are associted with.
2016-03-05 19:54:22 +00:00
912717ff31 ci(analytics): fix TRAVIS_PULL_REQUEST reporting
process.env.TRAVIS_PULL_REQUEST contains a string and not a boolean value, so we need
to compare it to a string literal rather than do boolean arithmetics.
2016-03-05 19:54:22 +00:00
b857fd1eeb Revert "feat(transformers): collect provider information"
This reverts commit 81beb1c788.

Broke Google3.
2016-03-04 13:51:26 -08:00
6dce4f49c2 feat(router): Added method to get current instruction
This method delegates to the root router to get the current complete instruction.
2016-03-04 02:10:58 -08:00
15e16148f4 feat(dart/transform): Create standalone transformers for phases
Create transformers that allow specifying transformer actions on
specific libraries.

* angular2/transform/codegen: Generates all necessary code.
* angular2/transform/reflection_rewriter: Replaces `bootstrap` calls in
  application entry points to remove transitive dart:mirrors import,
  resulting in smaller code size & faster execution.
* angular2/transform/deferred_rewriter: Rewrites deferred imports and
  `loadLibrary` calls to initialize Angular2 and preserve deferred
  operation.

Proper configuration of these three transformers can replace the single
angular2 transformer, resulting in significant performance gains for
builds of large angular2 apps.

Update angular2 itself to declare the codegen transformer, since it has
neither deferred imports nor application entry points.

Remove the undocumented & unused quick_transformer.
2016-03-04 09:52:44 +00:00
ae49085481 fix(angular_1_router): Renamed require statements after TypeScript files are transpiled
The require function was causing failures when bundled using Browserify and SystemJS

Closes #7049
2016-03-04 09:31:24 +00:00
11e8aa26f6 feat(angular1_router): Add ng-link-active class to active ng-link
Closes #6882
2016-03-04 09:30:58 +00:00
81beb1c788 feat(transformers): collect provider information 2016-03-04 01:19:25 -08:00
6402d61f69 chore: fix up ngClass for types/export missing public API
Closes #7202
2016-03-04 08:03:55 +00:00
5a59e44765 chore(test): migrate Dart tests to package:test
Instead of running with karma and the karma-dart shim, run dart
tests directly using the new package:test runner. This migrates
away from package:unittest.

Fixes a couple tests, mostly associated with depending on absolute
URLs or editing the test providers after an injector had already
been created.

Remove karma-dart and associated files. Change gupfiles to run tests
via `pub run test` instead.
2016-03-04 02:27:44 +00:00
7455b907d1 Revert "feat(dart): Add a dev-mode check for undeclared lifecycle interfaces"
This reverts commit a3d7629134.

Needs co-ordination with google3 changes.
2016-03-03 18:00:18 -08:00
579b890446 chore(dart) Update dev dependency on code_tranformers
Closes https://github.com/angular/angular/issues/6665
2016-03-03 23:12:02 +00:00
19a08f3a43 feat(compiler): Added spans to HTML parser errors
Allows using the HTML parser in contexts errors are reported in a development tool such as an editor.
2016-03-03 22:51:57 +00:00
a3d7629134 feat(dart): Add a dev-mode check for undeclared lifecycle interfaces
Add a check in `ReflectionCapabilities#interfaces` which determines if
the passed-in type implements a Lifecycle Interface but does not declare
that it does so.

See https://goo.gl/b07Kii for details.

Closes #6849
2016-03-03 22:45:50 +00:00
bc9644e86e chore: add github issue / pr template 2016-03-03 14:06:11 -08:00
a10c02cb41 feat(iterable_differ): support immutable lists
Closes #7127
2016-03-03 18:29:01 +00:00
9936e347ff chore(build): Remove circular dependency in Angular 2 ES5 output.
Remove couple of circular dependency between modules in Angular 2 ES5 output caused by exception_handler.ts and router_providers.ts.

Fix the build/checkCircularDependency gulp task to call madge properly to detect the circular deps.

Closes #7287
2016-03-03 17:42:33 +00:00
7d44b8230e fix(router): support outlets within dynamic components
Fixes internal b/27294172
2016-03-03 06:49:29 -08:00
75343eb340 feat(router): add regex matchers
@petebacondarwin deserves credit for most of this commit.

This allows you to specify a regex and serializer function instead
of the path DSL in your route declaration.

```
@RouteConfig([
  { regex: '[a-z]+.[0-9]+',
    serializer: (params) => `{params.a}.params.b}`,
    component: MyComponent }
])
class Component {}
```

Closes #7325
Closes #7126
2016-03-02 16:08:19 -08:00
2548ce86db fix(angular1_router): rename router component binding to $router
The current router is passed to the current component via a binding.
To indicate that this is an angular provided object, this commit
renames the binding to `$router`.

BREAKING CHANGE:

The recently added binding of the current router to the current component
has been renamed from `router` to `$router`.

So now the recommended set up for your bindings in your routed component
is:

```js
{
  ...
  bindings: {
    $router: '<'
  }
}
```
2016-03-02 16:08:19 -08:00
5586c29492 fix(angular1_router): support templateUrl components 2016-03-02 16:08:19 -08:00
1174473e9c fix(angular1_router): rename router component binding to $router
The current router is passed to the current component via a binding.
To indicate that this is an angular provided object, this commit
renames the binding to `$router`.

BREAKING CHANGE:

The recently added binding of the current router to the current component
has been renamed from `router` to `$router`.

So now the recommended set up for your bindings in your routed component
is:

```js
{
  ...
  bindings: {
    $router: '<'
  }
}
```
2016-03-02 16:08:19 -08:00
1d49b3e36b fix(build): Use fixed version of Chromium Canary that will be updated manually instead of automatically using the latest Chrome canary 2016-03-02 15:35:07 -08:00
2830df4190 docs(changelog): update change log to beta 8 2016-03-02 11:32:38 -08:00
143cf89b5f chore(release): bump version to beta. 2016-03-02 11:31:25 -08:00
69c1694900 fix(WebWorker): Make MessageBus EventEmitter synchronous 2016-03-01 23:23:17 +00:00
01fe7f5fac fix(WebWorker): Fix PostMessageBusSink and Source undefined error.
Closes #7156
2016-03-01 14:40:09 -08:00
9aedef208f fix(test): fix a broken test 2016-03-01 14:38:55 -08:00
39b6e0efba feat(transformers): collect information for CompileDiDependencyMetadata 2016-03-01 13:28:36 -08:00
f60fa14767 feat(core): drop ChangeDetectionStrategy.OnPushObserve
BREAKING CHANGE:

`OnPushObserve` was an experimental
feature for Dart and had
conceptual performance problems,
as setting up observables is slow.
Use `OnPush` instead.
2016-03-01 13:28:10 -08:00
d900f5c075 chore(tests): lengthen timeout for templateUrl test
This was flaking on Travis occasionally because the TestComponentBuilder
is actually doing an XHR, and it was slow on the Edge browser.

Closes #7293
2016-03-01 21:01:56 +00:00
391a9edabb chore(build): use Chromium in Travis for JS tests 2016-03-01 11:24:44 -08:00
28a78117eb refactor(dart/transform): Migrates tests to use package:test
Our transformer unit tests currently use package:guinness, which uses
package:unittest under the covers. package:unittest has been updated and
renamed package:test, so for simplicity migrate test to use package:test
syntax.
2016-03-01 19:20:06 +00:00
eeb594c010 fix(dart/payload): Fix runtime error in hello_world payload app
The hello_world app used to measure Dart payload size was broken by a
change in
7ae23adaff.

This breakage does not materially affect the size of the generated code,
(before fix: 298819, after fix: 298825), and since it was a runtime
error it was not noticed & not a problem.

Update the app to work again.

Closes #7358
2016-03-01 18:51:12 +00:00
0bb10d6bb6 feat(transformers): makes the map of resolved identifiers configurable
Closes #7359
2016-03-01 17:57:19 +00:00
59629a0801 feat(i18n): added i18nPlural and i18nSelect pipes
Closes #7268
2016-03-01 16:40:48 +00:00
b5e6319fa9 feat(core): add more debug APIs to inspect the application form a browser
Adds `window.getAllAngularRootElements()`
Adds `ng.coreTokens.ApplicationRef`
Adds `ng.coreTokens.Ngzone`

Closes #7045
Closes #7161
2016-03-01 16:01:28 +00:00
c9a3df970b feat(di): drop support for injecting types with generics in Dart
BREAKING CHANGE:
In Dart we used to support injecting types with generics. As this feature is hard to implement with the upcoming codegen we are dropping it.

Merge cl/115454020 in G3 with this change.
Closes #7262
2016-03-01 05:43:49 +00:00
f72f137261 ci(dart): Uncomment dart.dev build and make it required
Workaround for https://github.com/dart-lang/dartdoc/issues/1099: remove
the `--input=.` parameter to `dartdoc`.

Closes #6823, #6410

Closes #6958
2016-03-01 01:21:27 +00:00
ee3c580e88 fix(transformers): replace an error with a warning when cannot resolve a symbol 2016-02-29 16:03:13 -08:00
05c185a7b1 fix(transformers): record reflection info about abstract classes
Closes #7347
2016-02-29 22:57:22 +00:00
b47f80ec76 fix(Router): Query strings are copied for HashLocationStrategy
b/27210802 P1

Closes #7298
2016-02-29 18:44:56 +00:00
ebd438ff5e fix(change_detection): allow to destroy OnPush components inside of a host event.
Closes #7192
2016-02-29 18:44:13 +00:00
331b9c1317 fix(transformers): special case types some built-in types, so they can be resolved 2016-02-29 10:34:34 -08:00
4a93f58b8b fix(web_worker): wait for bindings in kitchen sink spec 2016-02-26 10:34:32 -08:00
ebe531bf92 feat(transformers): collect data needed for the template compiler
Closes #7299
2016-02-26 17:56:40 +00:00
1779caf5f8 fix(core): support ngFor that has an ngIf as last node
Fixes #6304
Closes #6878
2016-02-25 23:42:17 +00:00
6ef2121e6a feat(pipes): add ReplacePipe for string manipulation
add commonly used pipe that is missing  from framework.

feat(pipes): add ReplacePipe for string manipulation

add commonly used pipe that is missing  from framework.

feat(pipes): add ReplacePipe for string manipulation

add commonly used pipe that is missing  from framework.

feat(pipes): add ReplacePipe for string manipulation

add commonly used pipe that is missing  from framework.

feat(pipes): add ReplacePipe for string manipulation

add commonly used pipe that is missing  from framework.

feat(pipes): add ReplacePipe for string manipulation

add commonly used pipe that is missing  from framework.

feat(pipes): add ReplacePipe for string manipulation

add commonly used pipe that is missing  from framework.

feat(pipes): add ReplacePipe for string manipulation

add commonly used pipe that is missing  from framework.

feat(pipes): add ReplacePipe for string manipulation

add commonly used pipe that is missing  from framework.

feat(pipes): add ReplacePipe for string manipulation

add commonly used pipe that is missing  from framework.

feat(pipes): add ReplacePipe for string manipulation

add commonly used pipe that is missing  from framework.

feat(pipes): add ReplacePipe for string manipulation

add commonly used pipe that is missing  from framework.

feat(pipes): add ReplacePipe for string manipulation

add commonly used pipe that is missing  from framework.

feat(pipes): add ReplacePipe for string manipulation

add commonly used pipe that is missing  from framework.
2016-02-25 22:56:13 +00:00
38cb526f60 feat(forms/validators): pattern validator
Adding static pattern validation method to Validators

Adding a directive for the pattern validator

Applying clang-format rules to modified files

Updating public api spec for new pattern validator

Adding pattern validator to public api guard tool

For #5411

Closes #5561
2016-02-25 22:39:15 +00:00
f6a8d04c32 fix(web_workers): make waitForElementText function more stable 2016-02-25 14:28:20 -08:00
4b3b5d7c53 cleanup(build): fix jsserve not to throw 2016-02-25 13:39:02 -08:00
abff302e52 chore(tests): fix broken test from using the wrong xit
Also, run clang-format.
2016-02-25 10:50:59 -08:00
e1f6679c75 chore: make incremental dart tests work again 2016-02-25 10:26:11 -08:00
aaafdf03ce test(testing): add a test to ensure fakeAsync works with angular2/testing 2016-02-25 10:22:18 -08:00
ee298baa1b test(router): disable a flaky test 2016-02-25 10:21:53 -08:00
d1abada5b7 build(travis): do not cache npm modules 2016-02-24 17:56:55 -08:00
ab36ea097b fix(differ): clean up stale identity change refs
Closes #7193
2016-02-24 17:56:55 -08:00
8bb66a5eb3 chore: noImplicitAny fixes 2016-02-24 15:29:00 -08:00
cfc1e56dd8 refact(angular1_router): make the $$router binding one-time
This binding is never going to change so we can make it a one-time binding

Closes #6978
2016-02-24 21:15:34 +00:00
a1c3be21ec fix(angular1_router): rename $route service to $rootRouter
The singleton service that represents the top level router was called
`$router` but this is confusing since there are actually lots of routers,
which depend upon where you are in the DOM. This is similar to the situation
with scopes.

This commit clarifies this singleton by renaming it to `$rootRouter`.

BREAKING CHANGE:

The `$router` injectable service has been renamed to `$rootRouter`
2016-02-24 21:15:34 +00:00
edad8e3f56 fix(angular1_router): rename router component binding to $router
The current router is passed to the current component via a binding.
To indicate that this is an angular provided object, this commit
renames the binding to `$router`.

BREAKING CHANGE:

The recently added binding of the current router to the current component
has been renamed from `router` to `$router`.

So now the recommended set up for your bindings in your routed component
is:

```js
{
  ...
  bindings: {
    $router: '<'
  }
}
```
2016-02-24 21:15:34 +00:00
d4a4d81173 fix(angular1_router): support templateUrl components 2016-02-24 21:15:34 +00:00
e7470d557d feat(core): Add QueryList.forEach to public api. 2016-02-19 19:23:46 -05:00
b634a25ae0 feat(core): Add QueryList#forEach 2016-02-19 19:23:46 -05:00
c1a0af514f feat(test): add withProviders for per test providers
Closes #5128
2016-02-19 19:23:46 -05:00
c6afea61f1 fix(DomRenderer): correctly handle namespaced attributes 2016-02-19 19:23:46 -05:00
ce10fe92b2 chore(travis): remove problematic chromebeta target for now 2016-02-19 10:43:59 -08:00
b81b1fb81c revert: fix(change_detection): allow to destroy OnPush components inside of a host event
This reverts commit 280b86ec55.
2016-02-19 10:34:03 -08:00
280b86ec55 fix(change_detection): allow to destroy OnPush components inside of a host event. 2016-02-18 17:54:24 -08:00
2f5a2ba671 docs(changelog): update changelog to beta.7 2016-02-18 13:28:10 -08:00
c45ec6f1be chore(release): bump version to beta.7 2016-02-18 13:28:08 -08:00
530470e0ce chore(travis): add an integration hook for the angular hubot daemon 2016-02-17 16:38:42 -08:00
ce72ccf9e8 build(npm): bump zone.js version to 0.15.5 2016-02-17 16:28:50 -08:00
46d9c87ddc build(package): bump rxjs to 5.0.0-beta.2
Closes #7001
2016-02-17 16:28:50 -08:00
d736c31fea test(material): disable problematic e2e test
LGTM from Victor and Jeff in person :)
2016-02-17 16:18:33 -08:00
a7e9bc97f6 ci(typescript): add typescript_next build
Install typescript@next before build.js and test.typings.
Restore the regular version before travis caches node_modules/.

Fixes #6368
2016-02-16 17:29:29 -08:00
265703b950 fix(typing): Remove re-export of the Promise built-in type.
Instead, ts2dart can add the 'dart:async' import whenever
Promise is used.

Fixes #6468
2016-02-12 20:45:41 -08:00
ae275fa4e4 chore(ts2dart): update ts2dart to 0.7.24 2016-02-12 20:45:35 -08:00
3478d5d450 fix(angular_1_router): Added DI string tokens
Closes #4269

Closes #7031
2016-02-12 21:15:34 +00:00
e72dc16dbe docs(changelog): update changelog to beta.6 2016-02-11 16:03:00 -08:00
40a043275d chore(release): bump version to beta.6 2016-02-11 15:59:34 -08:00
f161b5cc28 chore(zone.js): update to 0.5.14 2016-02-11 14:39:41 -08:00
117d57e121 Revert "chore(zone.js) : update to 0.5.14"
This reverts commit 3dcce706fd.
2016-02-11 14:38:06 -08:00
3dcce706fd chore(zone.js) : update to 0.5.14 2016-02-11 14:15:59 -08:00
efb89b83e1 Revert "fix(DomRenderer): correctly handle namespaced attributes"
This reverts commit 61cf499b0b.
2016-02-11 13:44:16 -08:00
3d96c2337f Revert "feat(svg): Provide support for SVG foreignObject by adding xhtml namespace"
This reverts commit eb688f2c8e.
2016-02-11 13:39:02 -08:00
19cfb4eb12 fix(build): publish typings directory to our npm snapshot branch 2016-02-11 11:35:43 -08:00
3d715a2f7b fix(typings): publish es6 typings rather than postinstall.
Despite local testing, multiple users failed to run the postinstall to install typings.
Instead, we can distribute the typings we installed locally.

This is an alternative to #7003.
This also reverts rxjs to beta.1 since we have errors using beta.2, being addressed
in #7001.

Fixes #7000
2016-02-11 11:04:42 -08:00
c7261c295c docs(changelog): update change log to beta.5 2016-02-10 16:31:01 -08:00
1a26f8edd6 chore(release): bump version to beta.5 2016-02-10 16:30:18 -08:00
fc887774da fix(release): need to depend on latest rxjs and zone.js
The version in our package.json gets copied to the one we publish, and users need the latest of these.
2016-02-10 16:29:58 -08:00
7cbf88a691 docs(changelog): update change log to beta.4 2016-02-10 16:04:17 -08:00
1cb1c139cf chore(release): bump version to beta.4 2016-02-10 16:04:17 -08:00
1fd924f7d5 refactor(dart/transform): Simplify deferred rewriting
Simplify the DeferredRewriting and move package:quiver to a dev
dependency.

Closes #6994
2016-02-10 23:43:57 +00:00
eb688f2c8e feat(svg): Provide support for SVG foreignObject by adding xhtml namespace
Closes #6192
2016-02-10 23:23:34 +00:00
61cf499b0b fix(DomRenderer): correctly handle namespaced attributes
Closes #6363
2016-02-10 22:34:13 +00:00
f1f5b45361 feat(typings): install es6-shim typings to a location users can reference.
This makes the upgrade to beta.4 as simple as adding one reference tag, only when --target=es5
Implements option 3 from https://docs.google.com/document/d/1vgepQPkuHS4P3rzANQpoMIDIXe0Rl9Z2QyTtb8dpMoI/edit
2016-02-10 14:13:27 -08:00
50548fb565 fix(forms): use strict runtimeType checks instead of instanceof
Currently, validators extending built-in validators are treated as built-in.
This can result in an error when both a real built-in validator and a custom one are applied to the same element.

Closes #6981
2016-02-10 09:23:59 -08:00
8f47aa3530 fix(forms): add RadioButtonValueAccessor to the list of default value accessors 2016-02-09 15:28:08 -08:00
df7885c9f5 fix(router): Added route data to normalized async route
Closes #6802
2016-02-09 22:08:45 +00:00
0f10624b08 fix(ngFor): update view locals if identity changes
Closes #6923
2016-02-09 22:06:06 +00:00
6f1ef33e32 fix(router): fix url path for star segment in path recognizer
Url path of star segments should equal the original path.

If you register the route `/app/*location` and invoke a url like `/app/foo/bar`
the PathRecognizer should return a url path equal to the invoked url.

Before this patch, everything after `foo` was ignored, which resulted in a
redirect to `/app/foo` which was probably not intended (at least in the angular
1.5 component router).

Closes #6976
2016-02-09 21:45:06 +00:00
231773ea76 fix(compiler): use event names for matching directives
Closes #6870
2016-02-09 13:16:08 -08:00
e725542703 fix(forms): add support for radio buttons
Closes #6877
2016-02-09 19:47:50 +00:00
2337469753 style(angular1_router): license year updated
Closes #6219
2016-02-08 17:21:00 -08:00
55122cd57a fix(angular1-router): add missing wrapper methods
Closes #6763
Closes #6861
Closes #6861
2016-02-08 17:19:50 -08:00
7e0f02f96e fix(upgrade): fix infinite $rootScope.$digest()
Fixes #6385
Closes #6386
2016-02-08 17:18:52 -08:00
e7ad03cba6 fix(core): add detail to dehydrated detector exception
- at least I know what component is causing the error with this. without it the exception is so generic that it's not useful.

Closes #6939
2016-02-08 17:17:37 -08:00
74be3d3fde fix(core): mute mode printing in console in prod mode
Closes #6873
2016-02-08 17:16:19 -08:00
a15ca23469 refactor(mock): update variable names in directive_resolver_mock.ts
Closes #5056
2016-02-08 17:11:43 -08:00
de77700da0 fix(di): throw if a token uses more than 20 dependencies.
Fixes #6690
Closes #6869
2016-02-08 16:21:57 -08:00
e73fee7156 fix(router): fixed the location wrapper for angular1
In angular2 `Location.path()` returns the complete path including query string. In angular1 the query parameters are missing. Similar to this `Location.go` does accept two parameters (path *and query*).

Closes #6943
2016-02-08 16:18:26 -08:00
72ab35bceb test(angular1_router): test that location handles query strings
See 6698
2016-02-08 16:18:13 -08:00
0f22dce036 feat(angular1_router): allow component to bind to router 2016-02-08 16:18:13 -08:00
c6036435f0 fix(router): don't prepend / unnecessarily to Location paths
Closes #6729
Closes #5502
2016-02-08 16:18:13 -08:00
d86be245b8 fix(angular1-router): add support for using the component helper
In Angular 1.5 there is a new helper method for creating component directives.
See https://docs.angularjs.org/guide/component for more information about components.

These kind of directives only match the `E` element form and the previously component
router only created HTML that matched directives that matched the `A` attribute form.

This commit changes the `<ng-outlet>` directive so that it generates custom HTML
elements rather divs with custom attributes to trigger the relevant component to
appear in the DOM.

Going forward, Angular 1.5 users are encouraged to create their router components
using the following style:

```
myModule.componnet('component-name', {
  // component definition object
});
```

Closes angular/angular.js#13860
Closes #6076
Closes #5278

BREAKING CHANGE:

The component router now creates custom element HTML rather than custom attribute
HTML, in order to create a new component. So rather than

```html
<div custom-component></div>
```

it now creates

```html
<custom-component></custom-component>
```

If you defined you router components using the `directive()` helper and
specified the `restrict` properties such that element matching was not allowed,
e.g. `restrict: 'A'` then these components will no longer be instantiated
by the component router and the outlet will be empty.

The fix is to include `E` in the `restrict` property.

`restrict: 'EA'`

Note that this does not affect directives that did not specify the `restrict`
property as the default for this property is already `EA`.
2016-02-08 16:18:13 -08:00
a26053d3ff docs(cheatsheet): fix Dart cheatsheet
Also deletes an extraneous period from the JS cheatsheet.

Closes #5936
2016-02-08 15:58:22 -08:00
24d5b665e1 docs(HostBindingMetadata): Removed brackets from host bindings in HostBindingsMetadata example
Closes #6941
2016-02-08 15:55:49 -08:00
aa98fad338 docs: fix typo in 01_templates.md
Replace `an` with `a`

Closes #6842
2016-02-08 15:52:30 -08:00
9cb6dbbbab docs: fixed typo in documentation
Closes #6842
2016-02-08 15:30:15 -08:00
e21718faa9 docs(router): Updated inconsistencies in router docs
Closes #6805
2016-02-08 22:31:04 +00:00
b0f7d59e64 revert: chore: update the version of ts2dart
This reverts commit 22929a1671.

This commits makes our build red without the other commit that was already reverted.

More info at: https://github.com/angular/angular/pull/6825#issuecomment-181592303
2016-02-08 14:13:00 -08:00
b86829f492 revert: feat(transformers): collect information about di dependencies and providers
This reverts commit 86c40f8474.

Reason: new issues were discovered during the g3sync. @vsavkin is working on fixing them.
2016-02-08 12:15:03 -08:00
22929a1671 chore: update the version of ts2dart
Closes #6804
2016-02-05 21:56:33 +00:00
86c40f8474 feat(transformers): collect information about di dependencies and providers 2016-02-05 21:56:33 +00:00
16b521794c fix(build): don't try to copy .d.ts files into the npm distro
Fixes #6921
2016-02-05 11:53:15 -08:00
2a70f4e4c7 fix(typings): Don't expose typing dependencies to users.
This resolves Duplicate Identifier issues seen by many users,
at the expense of more typings installation required in some
cases.

Removes the quickstart hack of placing all needed dependencies
typings files in our distribution. Removes dependencies on
nodejs from angular2/core.

Fixes #5973
Fixes #5807
Fixes #6266

Angular now depends on es6-promise and es6-collections
(and a handful of manual typings) rather than all of es6-shim.

Fixes #5242

We previously had an undocumented breaking change, this is now
documented in this commit.

Fixes #6817

BREAKING CHANGE:

Transitive typings are no longer included in the distribution.
You may need to install typings in your project using
http://github.com/typings/typings

Users now must rely on getting typings from:
- one of the peerDependencies, such as rxjs, which exposes
  typings via the moduleResolution=node mechanism.
  (see https://github.com/Microsoft/TypeScript/wiki/Typings-for-npm-packages)
  This happens automatically.
- Using --target ES5 now requires manual installation of
  es6-promise and es6-collections typings.
- Using some angular APIs may introduce a dependency on eg. nodejs
  or jasmine, and those typings need manual installation as well.

Closes #6267
2016-02-04 22:42:40 +00:00
2f31c4c1c5 chore(typings): use mainline DefinitelyTyped repo rather than a fork.
The upstream Jasmine typings don't define a type for the global
object with Jasmine methods polluting it, so just use any.

Also zone.js has a different name upstream.
2016-02-04 22:42:40 +00:00
1435763383 chore(deps): update ts2dart and zone.js 2016-02-04 22:42:40 +00:00
05238df89b docs(changelog): add missing breaking change for beta.3 2016-02-03 11:43:17 -08:00
772d60d9fe docs(changelog): changelog for beta.3 2016-02-03 10:36:06 -08:00
24086bf0bb chore(release): bump version to beta.3 2016-02-03 10:36:06 -08:00
9b0e10e9a7 fix(compiler): fix interpolation regexp
- Fix the interpolation regexp to match newline characters (i.e. `\n` and `\r`)

Closes #6056
2016-02-03 15:21:55 +00:00
995a9e0cf8 fix(router): fix incorrect url param value coercion of 1 to true
seriliazeParams is coercing a value of 1 to true, which causes the value to be completey dropped.
Change the test from double equals to triple equals to prevent this from happening.

Closes #5346

Closes #6286
2016-02-03 15:00:24 +00:00
b55f1764b5 fix(Headers): serializable toJSON
fixes #6073

Closes #6714
2016-02-03 14:03:01 +00:00
5e9daed2e8 docs(http.ts): Fix MockBackend examples using backend.connections observer
Properly format observer examples.
2016-02-03 05:58:40 -08:00
aa8c5aa2e2 docs(http): fix example usage of MockBackend 2016-02-03 05:57:08 -08:00
f2c7946cca chore(http): make all typings explicit 2016-02-03 05:31:40 -08:00
da1fcfd820 fix(WebWorkers): Fix flaky WebWorker test
Closes #6851
2016-02-03 05:30:11 -08:00
dbeff6f548 style(ReflectionCapabilities) _zipTypesAndAnnotations, not _zipTypesAndAnnotaions
I was stepping through the Reflector and came across this little guy.

Closes #6535
2016-02-03 03:57:06 +00:00
26e60d658a fix(async): handle synchronous initial value in async pipe
Closes #5996
2016-02-03 03:56:52 +00:00
c2ceb7fba4 fix(Validators): fix Validators.required marking number zero as invalid
Closes #6617
2016-02-03 03:34:42 +00:00
4bfe49cd42 docs(core): update QueryList's onChange to changes.subscribe 2016-02-02 19:23:03 -08:00
cee2318110 feat(ngFor): add custom trackBy function support
Make it possible to track items in iterables in custom ways (e.g. by ID or index), rather than simply by identity.

Closes #6779
2016-02-03 01:03:31 +00:00
cfef76f683 refactor(dart/transform): Error in name convert funcs on unexpected input
Issue raised in PR #6745.
Previously, the transformer name conversion functions could return the
input string on unexpected input, which is almost certainly an error.

`throw` in this case instead, so we know early that something has likely
gone wrong.

Closes #6753
2016-02-02 23:46:27 +00:00
f56df65d48 perf(dart/transform): Only process deferred libs when necessary
Previously, every .dart file in a package was processed to ensure proper
initialization of deferred loaded libraries.

Update the transformer to avoid processing libraries which we know do
not import any deferred libraries.

Closes #6745
2016-02-02 23:06:36 +00:00
3a40cd79f0 build(router): make the build.js script portable to g3 2016-02-02 13:58:51 -08:00
6acc99729c build(router): refactor angular1 router build script 2016-02-02 13:58:51 -08:00
99e6500a2d feat(upgrade): support bindToController with binding definitions
Since angular 1.4 we can also pass controller bindings directly to bindToController, making this syntax more convenient

Closes #4784
2016-02-02 13:27:22 -08:00
5c782d6ba8 Typo: Hash_consing wiki link wrong Markdown syntax 2016-02-02 11:53:30 -08:00
4e43d6f769 docs(http): Added base request options for test example 2016-02-02 11:51:42 -08:00
3529ee9973 docs(cheatsheet): change as to name in routing section 2016-02-02 11:43:29 -08:00
29aa6a6c1c change event to use camel case 2016-02-02 11:42:26 -08:00
7918f3c1fc docs(changelog): fix header for 2.0.0-beta.0 2016-02-02 11:39:23 -08:00
2f4e176054 docs(developer): add linting instructions 2016-02-02 11:34:00 -08:00
d4565fdaf3 Update CHANGELOG.md
Fixed phrasing on breaking changes. It's just one breaking change so just requires one bullet point to explain the before/after.
2016-02-02 11:24:35 -08:00
2a302aa73a fix(docs): rxjs/add/operators/map -> rxjs/add/operator/map (no 's').
Was it with 's' before?
2016-02-02 11:22:10 -08:00
31b819e9c2 test: fix transformer tests 2016-02-02 10:21:40 -08:00
27daeaff5e fix(karma): fix running karma via gulp
As described below, the karma server showdown process can crash, if the done() function, provided
by gulp is referenced directly instead of wrapped in a closure function
http://stackoverflow.com/questions/26614738/issue-running-karma-task-from-gulp

Reformat the gulpfile.js

Squashing the two commits
2016-02-02 06:22:53 -08:00
3e9b532409 fix(dart/transform): Handle edge cases in ReflectionRemover
Handle some cases which would previously result in broken code.

- Importing bootstrap.dart deferred
- Using combinators when importing bootstrap.dart
- Importing bootstrap.dart with a prefix

Closes #6749
2016-02-01 15:17:44 -08:00
c5aa6d17ef docs: Fix small formatting issue in changeling
Closes #6660
2016-02-01 15:16:35 -08:00
e480b0798e docs: Kebab-case does not work. Change to camelCase.
Closes #6630
2016-02-01 15:15:46 -08:00
8a645d5e44 chore(zone.js): update to 0.5.11
Closes #6751
2016-02-01 21:53:42 +00:00
321193889f fix(zone): correct incorrect calls to zone 2016-02-01 21:53:42 +00:00
566d3ede04 test(dart/transform): Update unit tests to expect code in <file>.template.dart
Closes #6711
2016-02-01 21:21:38 +00:00
8c36aa866a feat(dart/transform): Generate all code into <file>.template.dart
Previously, we generated the code to initialize the reflector into the
<file>.ng_deps.dart and the compiled template and change detector code
into <file>.template.dart.

Update the transformer to generate all code into <file>.template.dart to
avoid the additional HTTP requests necessary when debugging
applications in Dartium.
2016-02-01 21:21:37 +00:00
ed2dbf2db7 ci(dart): comment out dart.dev build
See #6823
2016-02-01 12:53:27 -08:00
36a0e04604 fix(circle): pre-dependencies npm install npm
Fixes #6777
2016-02-01 11:26:25 -08:00
8867afdaab fix(build): Revert "build(dart): Make Dart dev build required"
This reverts commit a199772508.
2016-02-01 11:17:57 -08:00
a199772508 build(dart): Make Dart dev build required
Previously, we allowed the Dart dev build to fail presubmit tests.
Make it a required build from now on.

Closes #6410
2016-02-01 07:12:40 -08:00
b008f542fa chore(changelog): improve breaking change description for beta.2 2016-01-30 19:45:17 -08:00
a78dcfa5f3 chore(tests): fix broken linker integration test and fix DebugNode export
Fixes two small issues introduced with pr #6555
2016-01-29 14:29:49 -08:00
e1bf3d33f8 feat(debug): replace DebugElement with new Debug DOM
Now, using `ng.probe(element)` in the browser console returns
a DebugElement when in dev mode.

`ComponentFixture#debugElement` also returns a new DebugElement.

Breaking Change:

This is a breaking change for unit tests. The API for the DebugElement
has changed. Now, there is a DebugElement or DebugNode for every node
in the DOM, not only nodes with an ElementRef. `componentViewChildren` is
removed, and `childNodes` is a list of ElementNodes corresponding to every
child in the DOM. `query` no longer takes a scope parameter, since
the entire rendered DOM is included in the `childNodes`.

Before:

```
componentFixture.debugElement.componentViewChildren[0];
```

After
```
// Depending on the DOM structure of your component, the
// index may have changed or the first component child
// may be a sub-child.
componentFixture.debugElement.children[0];
```

Before:

```
debugElement.query(By.css('div'), Scope.all());
```

After:

```
debugElement.query(By.css('div'));
```

Before:

```
componentFixture.debugElement.elementRef;
```

After:

```
componentFixture.elementRef;
```
2016-01-29 11:28:10 -08:00
ae7d2ab515 fix(bundle): add angular2/platform/testing/browser to SystemJS testing bundle 2016-01-29 13:58:06 +01:00
c6adbf602c fix(query): don’t cross component boundaries
Closes #6759
2016-01-28 23:38:40 +00:00
1f7a41c963 fix(query): update view queries that query directives in embedded views
Fixes #6747
2016-01-28 14:40:53 -08:00
f4f614f3a9 docs(changelog): update change log to beta.2 2016-01-28 12:01:18 -08:00
94139c351f chore(release): bump version to beta.2 2016-01-28 12:01:18 -08:00
fc5b128b43 chore(ci): deflake test and turn on saucelabs_required
Fixes #6725

Closes #6733
2016-01-28 03:18:08 +00:00
68a799af2e tools: implement public api spec
Closes #6309
2016-01-27 21:19:05 +00:00
16d9c60a0e chore(circleci): use a github token when running tsd
Also increase the heap size limit as a workaround for
https://github.com/angular/angular/issues/5229

Fixes #6602
2016-01-27 13:16:57 -08:00
c0b5e7a672 chore(ci): turn off saucelabs_required
Reenable once #6723 fixed.
2016-01-27 11:52:32 -08:00
6932b29acb chore(ci): bump up the error count for dart DDC. 2016-01-27 11:19:56 -08:00
c2a38c05aa fix(WebWorkers): Add support for transitionend events.
Closes #6649
2016-01-26 21:09:01 -08:00
8bea667a0b feat(WebWorker): Add Router Support for WebWorker Apps
Closes #3563.
2016-01-26 21:07:12 -08:00
800c8f196f chore(ddc): make DDC build non-experimental 2016-01-26 21:04:34 -08:00
42231f5719 feat(change_detection): allow all legal programs in the dev mode
BEFORE:

The following would throw in the dev mode because `f` would return a new array when called by checkNoChanges.

@Component({
  template: `
    {{f()}}
  `
})
class A {
  f() { return [1]; }
}

AFTER:

The checkNoChanges function compares only primitives types for equality, and deeply compares iterables. Other objects cannot cause checkNoChanges to throw. This means that the dev mode would never fail given a legal program, but may allow some illegal programs.
2016-01-26 21:01:19 -08:00
db87baeb98 fix(ddc): router, compiler, web worker fixes for DDC
Also enable DDC checks across all non-web worker playground apps. We are
now down to 2 DDC errors across all of them. The remaining two need to be
fixed in package:analyzer, not in angular.

BREAKING CHANGE:

- there's a chance of breakage as router's Instruction constructor
  signature changed.

Closes #6693
2016-01-27 02:30:20 +00:00
c4c43f5a77 docs(contributing.md): add docs for "ci" commit type/scope 2016-01-26 14:55:42 -08:00
0ae77753f3 fix(core): always remove DOM listeners and stream subscriptions
This is needed to prevent memory leaks. The DOM
listeners don’t need to be removed for simple examples,
but a big internal app shows memory leaks because of them.

BREAKING CHANGE:
- `Renderer.listen` now has to return a function that
  removes the event listener.
2016-01-26 07:37:31 -08:00
5f0baaac73 fix(dart/transform): Ensure template codegen is completed sync
Previously, template codegen was done asynchronously, which could result
in reflector state being overwritten and leading to compile errors.

Update the codegen to run synchronously to ensure this does not happen.

Closes #6603
2016-01-26 04:18:11 +00:00
b5b6ece65a chore(ddc): reduce DDC warning cap 260->180 as we fixed a bunch
Closes #6625
2016-01-26 03:58:22 +00:00
4282297c24 fix(ddc): type fixes necessary to bring DDC severe count to 0 2016-01-26 03:58:22 +00:00
9c96b8affc chore: track size of a "Hello world" app built with SystemJS
Closes #6621
2016-01-26 02:54:03 +00:00
132829e5e2 chore(core): deactivate the tests that use Dart isolates
These are broken with Dart 1.13.2 stable, and will soon be obsolete (see #6270).
2016-01-25 17:20:06 -08:00
4a414420e9 fix(bundles): testing bundle should include browser platform
Closes #6626
2016-01-22 06:12:58 +00:00
fb6335ab60 build(gulp): fail hard w/ legacy node version and provide clear upgrade instructions
Closes #6213
2016-01-22 03:25:34 +00:00
89bd008445 docs(DEVELOPER.md): update framework developer instructions 2016-01-22 03:25:34 +00:00
caafb41eb5 build(node): upgrade to node 5.4.1 2016-01-22 03:25:34 +00:00
31b81a7439 build(npm): update to karma-browserstack-launcher@0.1.9 2016-01-22 03:25:34 +00:00
f7b1973358 build(npm): bump Angular's version number in shrinkwrap files to 2.0.0-beta.1 2016-01-22 03:25:34 +00:00
32f01da49a build(npm): update to karma@0.13.17
Mark says that karma-runner/karma#1768 is resolved in 0.13.17
2016-01-22 03:25:34 +00:00
59684c97b0 build(npm): update to minimatch@3.0.0 2016-01-22 03:25:34 +00:00
a32a0a3a97 build(npm): update to semver@5.1.0 2016-01-22 03:25:33 +00:00
96f5b0929d build(npm): lock karma at 0.13.15 due to karma-runner/karma#1768 2016-01-22 03:25:33 +00:00
8e6cf7fca8 build(npm): update to yargs@3.31.0 2016-01-22 03:25:33 +00:00
fdbe8741c9 build(npm): update to proxy-middleware@0.15.0 2016-01-22 03:25:33 +00:00
775fb2c340 build(npm): remove googleapis
it was previously used by benchpress (see d02c0accbb) but that's no longer the case.

I also removed a bunch of extranous dependencies that should never have been part of node_modules (npm bug?)
2016-01-22 03:25:33 +00:00
b60f594798 build(npm): update to gulp-connect@2.3.1 2016-01-22 03:25:33 +00:00
cc49790bdb build(npm): update gulp-connect's dependencies 2016-01-22 03:25:33 +00:00
a4bc19c530 build(npm): lock broccoli-slow-trees to the 1.x.x range 2016-01-22 03:25:33 +00:00
f7985dbdb7 build(npm): update to lodash@3.10.1 2016-01-22 03:25:33 +00:00
0bdcb5c1e0 build(npm): remove del devDependency - use fs-extra instead 2016-01-22 03:25:33 +00:00
a0d25db4a5 build(npm): add tools/npm/reshrinkwrap script and update docs 2016-01-22 03:25:33 +00:00
625474c4e2 build(npm): update to mock-fs@3.6.0 2016-01-22 03:25:33 +00:00
1cd2a6328a build(npm): update to fs-extra@0.26.3 2016-01-22 03:25:33 +00:00
d6bafe4fe3 build(npm): update to minimist@1.2.0 2016-01-22 03:25:33 +00:00
6a2ef15355 build(npm): update to jasmine@2.4.1 2016-01-22 03:25:33 +00:00
a8ca560503 build(npm): upgrade to broccoli@0.16.9 2016-01-22 03:25:33 +00:00
ad361808ec build(npm): upgrade to broccoli-funnel@1.0.1 2016-01-22 03:25:33 +00:00
c47639f2b1 build(npm): upgrade to protractor@3.0.0 2016-01-22 03:25:33 +00:00
ba90a85f7b build(npm): downgrade to karma@0.13.15 due to RangeError bug
Ref https://github.com/karma-runner/karma/issues/1768
2016-01-22 03:25:33 +00:00
d3b569557f build(npm): upgrade to karma-sauce-launcher@0.3.0 2016-01-22 03:25:33 +00:00
c9090ffa31 build(npm): revert clang-format upgrade
there are too many reformatting changes require that would add noise to the upgrade commit
2016-01-22 03:25:33 +00:00
341bf39d23 build(npm): update all npm dependencies + reshrinkwrap 2016-01-22 03:25:32 +00:00
3778ac26aa build(tools): npm/copy-npm-shrinkwrap should gracefully handle situation when shrinkwrap file is missing
This situation occurs during mas update of all dependencies, so we should not throw errors when this happens.
2016-01-22 03:25:32 +00:00
6cfc6f5bb2 build(npm): upgrade to npm v3
Closes #3193
2016-01-22 03:25:32 +00:00
47a3b4d56b feat(dart/transform): Promote missing Directive warning to error
Closes #6519

Closes #6568
2016-01-22 00:46:56 +00:00
c72ed991ad fix(testing): remove test zone for now and rely on returned promises
Adds tests for public Dart and TS frameworks to make sure that
components with templateUrl can be created by the TestComponentBuilder.

Closes #6359

Closes #6601
2016-01-22 00:28:48 +00:00
78bfdf78ea feat(dart/transform): DirectiveProcessor: do not process generated files
Prevent `DirectiveProcessor` from processing files which were generated
by the Angular2 Dart transformer.

Closes #6517
2016-01-22 00:21:27 +00:00
a24ee6add4 fix(HtmlLexer): fix for unicode chars
fixes #6036
Closes #6061
2016-01-21 23:45:41 +00:00
df3074fdfe feat(core/application_ref): Allow asyncronous app initializers.
closes #5929.

Closes #6063
2016-01-21 01:45:24 +00:00
f7424d5aeb chore: track size of a "Hello world" app built with WebPack
Closes #6434
2016-01-21 01:28:35 +00:00
a593ffa6f3 fix(transformer): record HostBinding annotations applied to getters
Closes #6283
2016-01-21 01:02:56 +00:00
761c6d0df7 fix(perf): faster looseIdentical implementation
Remove String type check in looseIdentical in JS-mode. It is not necessary as dart2js already compiles `identical` to `===` which compares string contents. Inline call sites.

This improves change detection of plain fields by 40%. On a large internal app the improvement is 5%.

Closes #6364
2016-01-21 01:01:36 +00:00
3e65d1458e fix(Dart): make some playground samples run with Dart Dev Compiler
Resolve all invalid field override errors, workaround current
reflection limitations in Dart Dev Compiler. todo, hello_world and
key_events samples now work with Dart Dev Compiler.

BREAKING CHANGE: remove TemplateRef.elementRef setter

Closes #6441
2016-01-21 00:41:42 +00:00
a4b5cb8376 build(node): split test and src compilation units 2016-01-19 21:15:16 -08:00
c785a1e474 fix(ddc): use dynamic types in reflection typedefs
Closes #6437
2016-01-19 21:49:11 +00:00
3adc472f06 chore(build): fix race condition for the !bundles.js.docs task 2016-01-19 11:40:30 -08:00
e7081b8b7c chore: don't track size of non-bundle files 2016-01-19 11:32:40 -08:00
9b3a548f6f docs(template_parser.ts): typo 2016-01-19 10:58:04 -08:00
90b3502bb8 ci(circle config): add a circle CI config
This only runs the JS build (no tests) as an easy place to start.

Green build on my branch: https://circleci.com/gh/alexeagle/angular/5

Note, we are just experimenting with Circle at this point...

Closes #6520
2016-01-16 00:17:15 +00:00
e19b31db29 refactor(test): Remove unnecessary noSuchMethod
Remove trivial implementations in many spy objects which just calls the
parent's `noSuchMethod`.

Closes #6410

Closes #6491
2016-01-15 22:53:09 +00:00
bd015f14e8 build(dartanalyzer): Ignore TODOs during build
The newest version of the analyzer emits hints when it encounters TODOs
in code, which is breaking the Dart dev version of our build.

Ignore TODOs for the purpose of build health.

See #6410
2016-01-15 22:53:09 +00:00
ca7ba12fc6 chore(travis): update name of sync branch to be ignored
Closes #6518
2016-01-15 22:26:40 +00:00
ae05ec69c4 Update overview.md
Closes #6478
2016-01-15 17:44:30 +00:00
92dc3b91d8 doc(*): change package.json license field to MIT
Align the package.json license with the LICENSE file from the repo
Closes #6432
2016-01-15 17:42:43 +00:00
8bd697b316 docs(DEVELOPER): fix saucelabs gulp task name
Task is test.unit.js.sauce, not test.unit.js.saucelabs.

Closes #6435
2016-01-15 17:23:14 +00:00
eda4c3eb4c fix(template_compiler): Fix erroneous cycle detection
Before, the check for cycles was wrong and lead to false positives.

Fixes #6404

Closes #6474
2016-01-14 23:08:30 +00:00
4d0c2ed1f6 test(dart/transform): Update dependencies & fix Dart tests
Widen version dependencies for `package:angular`, `package:code_transformers`,
and `package:observe`.

`package:guinness` uses `package:unittest` while
the newest versions of `package:code_transformers` use `package:test`.
This causes our end-to-end Dart transformer tests (which use testing
code in `package:code_transformers`) to be skipped.

To fix this:
- Move e2e tests to run in a separate file
- Run `gulp test.server.dart` tests serially

Closes #5922

Closes #5935
2016-01-14 00:29:03 +00:00
eda6a5d52a refactor(WebWorker): Rename WORKER_RENDER_APP to WORKER_RENDER_APPLICATION
BREAKING CHANGE

WORKER_RENDER_APP is now deprecated. Use WORKER_RENDER_APPLICATION instead
WORKER_RENDER_APP_COMMON has been replaced by WORKER_RENDER_APPLICATION_COMMON

closes #6184

Closes #6378
2016-01-14 00:07:13 +00:00
c1c54ed0f2 refactor(dart/transform): Avoid using package:code_transformers
Replace uses of `package:code_transformers`, which is only used to
convert from uri to `AssetId`, with calls to the utility methods in
`src/transform/common/url_resolver.dart`.

Closes #5931
2016-01-13 22:24:42 +00:00
6b73d09ba1 chore(build): make experimental Dart build useful
Previously we grepped all hand-written Dart code and ran analyzer in strong mode against it.

Now we run it against transformed playground apps, which:

1. does not analyze unnecessary code (we primarily care about stuff that runs in the browser)
2. analyzes generated code, which does run in the browser and which we failed to analyze in the previous version of the build

Closes #6436
2016-01-13 21:09:55 +00:00
ac85cbb28a fix(web_workers): support @AngularEntrypoint in web workers
And enable transformers on all playground apps

Closes #6013
2016-01-13 17:55:01 +00:00
b0cebdba6b feat(test): allow tests to specify the platform and application providers used
With providers split into bundles, the test injector is now able to
use providers for a given bundle. Suggested provider lists for tests are
available in `angular2/platform/testing/<platform>`.

Change the providers for a test suite using `setBaseTestProviders`. This
should be done once at the start of the test suite, before any test cases
run.

BREAKING CHANGE: Tests are now required to use `setBaseTestProviders`
to set up. Assuming your tests are run on a browser, setup would change
as follows.

Before:

```js
// Somewhere in test setup
import {BrowserDomAdapter} from 'angular2/src/platform/browser/browser_adapter';
BrowserDomAdapter.makeCurrent
```

After:

```js
// Somewhere in the test setup
import {setBaseTestProviders} from 'angular2/testing';
import {
  TEST_BROWSER_PLATFORM_PROVIDERS,
  TEST_BROWSER_APPLICATION_PROVIDERS
} from 'angular2/platform/testing/browser';

setBaseTestProviders(TEST_BROWSER_PLATFORM_PROVIDERS,
                     TEST_BROWSER_APPLICATION_PROVIDERS);
```

Closes #5351, Closes #5585

Closes #5975
2016-01-13 02:11:06 +00:00
933a9112da fix(ChangeDetection): chain expressions evaluate to the last expression (codegen)
fixes #4782
Closes #5892
2016-01-12 17:10:42 +00:00
8c37b7e8f2 fix(directive): throw if output the same event more than once
Close: #4798
2016-01-11 16:48:57 -08:00
c8e909f8c9 docs(cheatsheet): fix pipe name in an example
Closes #6399
2016-01-12 00:12:00 +00:00
69ae3634c7 feat(testability): Expose function frameworkStabilizers
Closes #5485
2016-01-11 23:10:51 +00:00
95248f46a1 build(npm): update to ts2dart@0.7.19
Closes #6254
2016-01-09 01:44:01 +00:00
b3c7df1783 docs(cheatsheet): fix bootstrap ts namespace
Fix https://github.com/angular/angular.io/issues/615
Closes #6159
2016-01-09 01:01:17 +00:00
c56679e8e1 Update change from Apache to MIT license 2016-01-08 13:41:58 -08:00
041c599511 docs(changelog): update change log to beta.1 2016-01-08 12:12:38 -08:00
6343f71be5 chore(release): 2.0.0-beta.1 - catamorphic-involution 2016-01-08 11:56:37 -08:00
89f32f808f perf(dart/transform): Avoid unnecessary reads for files with no view
In the `TemplateCompiler` phase, avoid reading in the `.ng_meta.json` files of
imported libraries when we can determine that the file we are processing
does not define any `View`s.

Closes #6183
2016-01-06 08:56:39 -08:00
7ae23adaff feat(core): speed up view creation via code gen for view factories.
BREAKING CHANGE:
- Platform pipes can only contain types and arrays of types,
  but no bindings any more.
- When using transformers, platform pipes need to be specified explicitly
  in the pubspec.yaml via the new config option
  `platform_pipes`.
- `Compiler.compileInHost` now returns a `HostViewFactoryRef`
- Component view is not yet created when component constructor is called.
  -> use `onInit` lifecycle callback to access the view of a component
- `ViewRef#setLocal` has been moved to new type `EmbeddedViewRef`
- `internalView` is gone, use `EmbeddedViewRef.rootNodes` to access
  the root nodes of an embedded view
- `renderer.setElementProperty`, `..setElementStyle`, `..setElementAttribute` now
  take a native element instead of an ElementRef
- `Renderer` interface now operates on plain native nodes,
  instead of `RenderElementRef`s or `RenderViewRef`s

Closes #5993
2016-01-05 08:56:46 -08:00
a08f50badd chore(build): allow to run examples and benchmarks without bundles
The bundles will only be used if the flag `--useBundles` is passed to `gulp build.js`.
2016-01-05 08:27:24 -08:00
0b6e75a85e chore(ci): cleanup artifact upload
This is no longer needed for g3sync.

Closes #6232
2016-01-04 23:02:04 +00:00
4291758079 build(sauce/bs): make some browsers required in CI
Closes #5795
2016-01-04 22:30:48 +00:00
b44d36cf95 fix(forms): fix SelectControlValueAccessor not to call onChange twice
Closes #5969
2016-01-04 20:33:13 +00:00
a038bb9ae3 fix(router): preserve specificity for redirects
Previously when comparing which of multiple possible routes to choose in
an ambiguous case, we looked at the specificity of the target of redirect
matches rather than the original match. This meant that if a redirect
used a whilecard, but redirected to a target that was a static path,
we'd cound the static path's specificity instead of the wildcard.

This change stores the specificity of the redirect on the RedirectInstruction.

Closes #5933
2016-01-04 20:06:21 +00:00
9d28147acb fix(benchpress): fix flake
memory was not allocated to be high enough, resulting in partial results to be
clipped, and therefore failing the assertions

Closes #6161
2016-01-04 19:25:32 +00:00
d116861c8e fix(CHANGELOG): typo
fixes #6075
Closes #6078
2015-12-28 17:14:10 +00:00
9a70f1a1d9 fix(TemplateParser): do not match on attrs that are bindings
Closes #5914
2015-12-24 14:44:16 +00:00
8516473340 build(broccoli-typescript): check for map files before deleting them
fixes #5610
Closes #6065
2015-12-23 02:59:11 +00:00
cab69f689f docs(cheatsheet): fix typo in <template> syntax description
Closes #6051
2015-12-23 02:57:47 +00:00
822e83ebb0 chore(docs): update the merge process docs
use caretaker rather than "on-duty"

Closes #6058
2015-12-23 02:32:02 +00:00
b2bc50dbd1 fix(router): correctly sort route matches with children by specificity
This changes the way we calculate specificity. Instead of using a number,
we use a string, so that combining specificity across parent-child instructions
becomes a matter of concatenating them

Fixes #5848

Closes #6011
2015-12-21 10:38:13 +00:00
e748adda2e refactor(testing): move common testing logic into test_injector
Before, all test framework wrappers (internal for dart and js/ts,
angular2_test for dart and testing for js/ts) had similar logic to
keep track of current global test injector and test provider list.
This change wraps that logic into one class managed by the test
injector.

Closes #5920
2015-12-18 08:23:29 +00:00
630d93150a fix(core): IE only supports parentNode
Closes #5994
2015-12-18 01:48:09 +00:00
76f1f9f1e3 chore(build): tighten up code size check now that regression is fixed
Our code size SLA is 100kb gzipped and 300kb minified. Our target is 10kb gzipped.

We are currently under 90kb gzipped. Let's keep it that way while looking for ways to improve the situation further. We're not <300kb minified yet, so we should be stricter here too.

Closes #5896
2015-12-18 01:06:25 +00:00
c47d85b038 fix(code size): revert previous devMode change to restore size targets
This commit reverts a8d9dbf that introduced a code size regression (16kb gzipped, 63kb minified) in Dart.

Effect on the hello world app:

gzipped: 105kb -> 89kb
minified: 370kb -> 317kb

BREAKING CHANGE:
- This is very unlikely to be breaking, but I'm still marking just in case. The only change to the user should be that dev mode is driven by Dart's checked mode, like it was in the past.
2015-12-18 01:06:25 +00:00
197cf09689 feat(core): improve NoAnnotationError message
Closes #4866

Closes #5927
2015-12-17 23:37:54 +00:00
e67ebb7f70 feat(core): improve stringify for dart to handle closures 2015-12-17 23:37:54 +00:00
3524946581 fix(docs): fix an import in TOOLS_DART.md
Closes #5923
2015-12-17 23:30:44 +00:00
9276dad42c docs: fix some typos in comments and strings
Couple of typos fixed:
- occuring -> occurring
- imlement -> implement
- idenitifer -> identifer
etc...

Closes #5943
2015-12-17 22:57:43 +00:00
2a2f9a9a19 feat(router): support links with just auxiliary routes
Closes #5930
2015-12-16 19:50:19 +00:00
909e70bd61 Update README.md 2015-12-15 12:38:48 -08:00
8ac9719832 Update README.md 2015-12-15 12:38:13 -08:00
3eff7c6f59 docs(changelog): fix typo in "somnambulant" 2015-12-15 11:58:20 -08:00
17fbbfba91 docs(readme): remove angular 1 js & dart links
they are confusing now that we are in beta.
2015-12-15 11:36:07 -08:00
b232dded77 chore(readme): update README: no longer alpha 2015-12-15 11:25:14 -08:00
f50affaf9c chore(release): cut 2.0.0-beta.0 - sonambulent-inauguration 2015-12-15 10:54:10 -08:00
463754bf16 docs(changelog): release notes for 2.0.0-beta.0 sonambulent-inauguration 2015-12-15 10:54:10 -08:00
a45b27e7f9 chore(release): cut 2.0.0-alpha.54 2015-12-15 09:57:05 -08:00
af3ea16acb docs(changelog): add release notes for alpha.55 2015-12-15 09:57:05 -08:00
fc75220d63 fix(router): export ROUTER_LINK_DSL_PROVIDER and hide MockPopStateEvent 2015-12-15 09:45:00 -08:00
00822c3415 chore(publish): add Rx bundles to code.angularjs.org publish step
Closes #5904
Closes #5909
2015-12-15 17:12:42 +00:00
3dca9d522a feat(core): enable dev mode by default
BREAKING CHANGE

Before

Previously Angular would run in dev prod mode by default, and you could enable the dev mode by calling enableDevMode.

After

Now, Angular runs in the dev mode by default, and you can enable the prod mode by calling enableProdMode.
2015-12-15 08:34:44 -08:00
de996ec50b build(publish.sh): uncomment prepare steps for existing tmp repo
I tested these steps manually and they seem to work well.
2015-12-15 03:31:47 -08:00
059e09c3be chore(release): cut alpha.54 - rxjs bundle separation 2015-12-15 03:04:28 -08:00
d5e4686e7e docs(changelog): add alpha.54 release notes 2015-12-15 03:04:28 -08:00
d55655f5a3 fix(bundles): rename the testing.js bundle
BREAKING CHANGE:

System.register testing bundle was renamed:
`testing.js` -> `testing.dev.js`

Closes #5899
Closes #5776
2015-12-15 02:52:25 -08:00
61b9468596 fix(bundles): rename UMD bundles
BREAKING CHANGE:

UMD bundles were renamed:
* `angular2.umd.js` -> `angular2-all.umd.js`
* `angular2-testing.umd.js` -> `angular2-all-testing.umd.js`

Closes #5898
2015-12-15 10:24:32 +00:00
c6f52e3282 docs(cheatsheet): fix the ES5 snippets for services 2015-12-15 01:27:19 -08:00
42ccff859c build(gulp): remove obsolete insertRXLicense bundle transform 2015-12-15 01:11:10 -08:00
29600c0c87 docs(bundles): update RxJS info in bundles/overview.md post-#5893 2015-12-15 01:07:16 -08:00
5b63b6764f fix(docs,benchmarks): remove invalid </input> closing tags
Closing #5752
2015-12-15 00:45:31 -08:00
2835265916 docs(cheatsheet) adding JS specific syntax to cheatsheet
Closes #5861
2015-12-14 23:19:12 -08:00
e950dd6a2a refactor(bundles): make rxjs an external dependency in umd bundle
Closes #5886
Closes #5893
2015-12-14 22:08:22 -08:00
321ed7d099 chore(package): update rxjs to beta.0 2015-12-14 22:08:16 -08:00
42b74f524a chore(bundles): use RxJS bundles 2015-12-14 22:08:16 -08:00
77b7caeceb fix(bundles): don't include RxJS in System.register bundles
BREAKING CHANGE:

RxJS used to be bundled with Angular 2 code and this is not the case
any more. RxJS needs to be loaded explicitly.
2015-12-14 22:08:16 -08:00
b803ecf7e7 refactor(testing): reenable injectAsync checking for return value
Before #5375, injectAsync would check the return value and fail
if it was not a promise, to help users remember that they need to
return a promise from an async test. #5375 removed that with the
introduction of the testing zone.

This un-deprecates `injectAsync` until we can resolve
https://github.com/angular/angular/issues/5515.

To be clear, this means that `inject` and `injectAsync` are now
identical except that `injectAsync` will fail if the test
does not return a promise, and `inject` will fail if the test
returns any value.

Closes #5721
2015-12-15 05:51:54 +00:00
d3a79db48d build(publish.sh): do not error when tmp/code.angularjs.org already exists
I'm not sure what's the best way to update the shallow repo and I'm in a state where there is nothing to be
updated so I'll revisit the proper fix the next time I'm doing a release unless someone beats me to it.

Closes #5872
2015-12-15 05:45:10 +00:00
e891baeea4 chore: remove unused decorator
Closes #5880
2015-12-15 05:20:35 +00:00
2aaef81b1b Revert "refactor(testing): move common testing logic into test_injector"
This reverts commit b88a6d983f.
2015-12-14 20:27:31 -08:00
3191fd1440 cleanup(linker): Remove vestigial ComponentUrlMapper.
Closes #5849
2015-12-15 03:04:49 +00:00
80a5e47e61 docs(*): Document a lot more symbols that are missing comments in our generated docs. 2015-12-15 03:04:48 +00:00
5a04ffec3e refactor(Directive): drop moduleId
moduleId is only used by components to resolve urls.
Directives have no templates and do not need moduleId.
Closes #5873
2015-12-15 01:20:56 +00:00
1c779d8b9e docs(bundles): document existing bundles and their usage
Closes #5777

Closes #5878
2015-12-15 01:18:44 +00:00
a79fe057f9 fix(changelog): fix rxjs operator import paths
Closes #5864
2015-12-15 01:15:57 +00:00
b88a6d983f refactor(testing): move common testing logic into test_injector
Before, all test framework wrappers (internal for dart and js/ts,
angular2_test for dart and testing for js/ts) had similar logic to
keep track of current global test injector and test provider list.
This change wraps that logic into one class managed by the test
injector.

Closes #5819
2015-12-15 01:14:48 +00:00
19396d14cc docs(contributing.md): improve submit issue instructions
Closes #5889
2015-12-15 00:45:29 +00:00
2983558e5e fix(bundles): remove polyfills from angular2.js bundle
BREAKING CHANGE:

Previously `angular2.js`, `angular2.min.js` and `angular2.dev.js` bundles
would have zone.js and reflect-metadata pre-appended. New bundles don't
contain zone.js nor reflect-metadata - those external dependencies can
be easily loaded into a browser using `angular2-polyfills.js`

Closes #5881
2015-12-14 21:34:56 +00:00
0f8e40bb42 chore(zone.js) : update to 0.5.10
Closes #5845
2015-12-14 21:23:18 +00:00
006a96dd20 refactor(WebWorker): Make WebWorker bootstrap synchronous
BREAKING CHANGE

From the app thread, in both TypeScript and Dart, you bootstrap the app
using `application` instead of `asyncApplication`.
Before:
```TypeScript
platform([WORKER_APP_PLATFORM])
.asyncApplication(setupWebWorker, optionalProviders?)
.then((ref) => ref.bootstrap(RootComponent));
```
Now:
```TypeScript
platform([WORKER_APP_PLATFORM])
.application([WORKER_APP_APPLICATION])
.bootstrap(RootComponent);
```

closes #5857

Closes #5862
2015-12-14 21:04:46 +00:00
4deaf0bdd3 chore(bundles): align content of System.register and UMD bundles
Closes #5856
2015-12-14 20:48:29 +00:00
9917d7f8af chore(bundles): properly clean the dist/build folder
The `dist/build` folder is created as part of the bundling
process but it was never cleaned up in the `clean` task.

Closes #5832
2015-12-14 20:48:19 +00:00
1607ef8782 refactor(HtmlLexer): process carriage returns in one pass
Closes #5867
2015-12-14 20:17:06 +00:00
539c5633bf chore(bundles): add http and router mocks to angular2-testing
Closes #5830
2015-12-14 19:04:03 +00:00
f83f4ace2d chore(changelog): fix formatting for alpha.53
Closes #5866
2015-12-14 18:34:51 +00:00
283962f810 fix(bundles): remove ngUpgrade from the angular2.js bundle
Closes #5739

BREAKING CHANGE:

`ngUpgrade` related symbols are no longer part of the `angular2.js`
bundle. `ngUpgrade` has a dedicated `upgrade.js` bundle now.

Closes #5854
2015-12-14 17:55:05 +00:00
892f9e19bc chore(release): cut alpha.53 - no more angular2/angular2 2015-12-12 17:59:35 -08:00
cacfb214b6 docs(changelog): changelog for alpha.53 2015-12-12 17:59:35 -08:00
4e5cd1e558 chore: update ts2dart to 0.7.18
Closes #5853
2015-12-12 19:28:13 +00:00
43f42d9c6e feat(facade): do not reexport Observable from angular2/core
BREAKING CHANGE

Before import {Observable} from 'angular2/core'

After import {Observable} from 'rxjs/Observable';
2015-12-12 19:28:13 +00:00
a885f37dfa fix(web_workers): remove unnecessary setup module and AppRootUrl
Since AppRootUrl is removed, the logic for extending and emitting
the root url as part of the setup seems unnecessary.

BREAKING CHANGES:

The setupWebWorker function exported from 
angular2/platform/worker_app  no longer returns a promise of providers, 
but instead synchronously returns providers.

Related to #5815
Closes #5820
2015-12-12 00:58:56 +00:00
ed2c25eb2f fix(compiler): remove AppRootUrl
Related to #5815

This should not break anything because AppRootUrl wasn't actually
being used by the compiler anymore.
2015-12-12 00:58:56 +00:00
b1b0593ddf docs(core): replace angular2/angular2 with the right barrel import.
Related to #5710
Closes #5847
2015-12-11 15:30:25 -08:00
200dc00dbb fix(angular2): remove angular2.ts module
Closes #5815
Closes #5844

BREAKING CHANGE:

`angular2/angular2` was removed. Use the correct import from one of the barrels. E.g. `angular2/core`, `angular2/platform/browser`,  `angular2/common`, …

Note: This only applies to JavaScript, Dart is not changed.
2015-12-11 14:21:33 -08:00
20c6eebb29 fix(angular2): don't export compiler bits as public API
Closes #5815
Closes #5797

BREAKING CHANGE:

The following symbols are not exported from angular2/angular2 any more:
`UrlResolver`, `AppRootUrl`, `getUrlScheme`, `DEFAULT_PACKAGE_URL_PROVIDER`.
Use imports from `angular2/compiler` instead.
2015-12-11 14:04:01 -08:00
8c69497d8e fix(bundles): don't use angular2/angular2 in config of System.register bundles
Related #5710
2015-12-11 14:04:01 -08:00
44c648fc04 Revert "fix(animate): ensure transition properties are removed once the animation is over"
This reverts commit b8e69a21a9.
2015-12-11 13:13:11 -08:00
979162d324 fix(public_spec): check exports of barrels instead of angular2/angular2
This changes the public api spec to check each public barrel individually
to make sure its API has not changed. The previous API spec has been
preserved but split into respective barrels.

The compiler barrel has been added to the spec, along with all of its
public exports. Previously, angular2/angular2 was only exporting a
handful of symbols from compiler, so there are now many more symbols
being tested in the spec for compiler than previously.

Part of #5710
Closes #5841
Supercedes #5821
2015-12-11 13:05:52 -08:00
2934b82113 chore(tools): remove unused performance import
Closes #5840
2015-12-11 20:32:17 +00:00
92ddc62bed fix(styles): Escape \r characters in compiled text
Closes #5772

Closes #5835
2015-12-11 19:48:43 +00:00
0cb32c2fef feat(Headers): implement toJSON 2015-12-11 19:40:56 +00:00
2ca5e38a78 fix(upgrade): allow directives with empty template 2015-12-11 11:39:45 -08:00
b8e69a21a9 fix(animate): ensure transition properties are removed once the animation is over 2015-12-11 11:38:24 -08:00
3fd898e91f docs(cheatsheet): copyedit
Fixed a few little things. I'll probably have more changes to make later, once I understand everything better.

Also added a missing syntax line.

Closes #5806
2015-12-11 18:41:57 +00:00
a66cc50168 refactor(testing): limit imports of barrel-private APIs
Closes #5603
2015-12-11 18:39:56 +00:00
eb296756fb refactor(benchmarks): remove imports from 'angular2/angular2'
Closes #5799
2015-12-11 18:33:03 +00:00
f1a9a537cb test(core): remove imports from 'angular2/angular2'
Closes #5829
2015-12-11 18:02:23 +00:00
080469f8e6 fix(HtmlParser): allow ng-content elements regardless the namespace
relates to #5547
Closes #5745
2015-12-11 01:36:48 +00:00
7c13372721 fix(TemplateParser): match element and attributes regardless the namespace 2015-12-11 01:36:48 +00:00
778677ba75 docs(core): Myriad of documentation changes including lots of new example code. 2015-12-10 15:23:57 -08:00
f0d876a873 chore(tests): disable flaky firefox test
Tracking issue is #5611
Closes #5817
2015-12-10 22:54:26 +00:00
e9e2a4152e docs: fix variable name, change to camelCase
closes #5801
2015-12-10 14:35:28 -08:00
398f024b24 fix(async): support BehaviorSubjects in async pipe 2015-12-10 21:49:40 +00:00
4a17e6906c fix(async): improve Rx support in ObservableWrapper 2015-12-10 21:49:40 +00:00
8d3e5596dc refactor(playground): remove imports from 'angular2/angular2'
Part of #5710

Closes #5798
2015-12-10 21:46:51 +00:00
df6d2d1e23 refactor(examples): remove imports from 'angular2/angular2'
Closes #5803
2015-12-10 21:45:58 +00:00
d26c338aa0 refactor(material): remove imports from 'angular2/angular2'
Closes #5800
2015-12-10 21:19:38 +00:00
edcb34dc9f fix(dom_renderer): moveNodeAfterSiblings should not detach the reference node
Fixes #5077
Closes #5759
2015-12-10 20:14:27 +00:00
693d9dce5d fix(parse5): support comment nodes with getText and setText
In the browser, calling element.textContent causes child comment
nodes to be ignored, while getting textContent directly on a
comment node will return the comment. This change makes
parse5Adapter consistent with this behavior by adding a 2nd
argument to getText telling if it's being called recursively.

Closes #5805
2015-12-10 19:18:14 +00:00
194dc7da78 feat(renderer): use a comment instead of an element when stamping out template>` elements
Originally authored by @tbosch, this reverts the revert commit
e274ff8a69.

Closes #4805
2015-12-10 19:18:14 +00:00
79399e1c51 feat(dom_renderer): add setBindingDebugInfo method
This is used for setting property binding values as attributes
on elements when running in dev mode. This implementation will
also serialize binding information to template placeholder
comment nodes.

Closes #5227
2015-12-10 19:18:14 +00:00
fe1dd77d94 feat(benchpress): add receivedData + requestCount to PerflogMetric
Closes #5750
2015-12-10 18:51:47 +00:00
24dcd267b8 refactor(gulpfile.js): cleanup obsolete file reference
Closes #5738
2015-12-10 18:16:50 +00:00
cf3ce171a5 docs(kebab-case.md): more fixes and CSS migration instructions
Closes #5773
2015-12-10 04:18:17 -08:00
06d076a6f2 docs(kebab-case): fix typo on property
Closes #5783
2015-12-10 03:42:43 -08:00
3190c5941a fix(changelog): fix ngFor on template
Closes #5785
2015-12-10 03:41:00 -08:00
30e25acb9f fix(core): workaround for typescript@1.7.3 breakage #5784
I don't understand why I need to declare the type-here, but it resolves the issue.

Looks like a bug in tsc.

Fixes #5784
2015-12-10 03:30:16 -08:00
4975cb92ae docs(changelog): add link back to A2 package.json
Closes #5779
2015-12-10 02:28:41 -08:00
c8d6ad2718 chore(release): cut alpha.52 - the new beginning 2015-12-10 00:48:32 -08:00
cde6726e25 docs(changelog): add changelog for alpha.52 2015-12-10 00:48:32 -08:00
b3d10af89a docs(kebab-case.md): fix indentation, add links and other small changes 2015-12-10 00:48:32 -08:00
4724cc664e docs(kebab-case.md): add link to the design doc 2015-12-10 00:18:08 -08:00
4e16feaf72 docs(changelog): add breaking change note about peerDependencies
Closes #5747
2015-12-09 22:10:12 -08:00
9e44dd85ad feat(camelCase Angular): legacy template transformer 2015-12-09 19:59:40 -08:00
da9b46a071 feat: camelCase Angular (kebab-case removal)
BREAKING CHANGE:

Angular is now fully camel case.

Before:

    <p *ng-if="cond">
    <my-cmp [my-prop]="exp">
    <my-cmp (my-event)="action()">
    <my-cmp [(my-prop)]="prop">
    <input #my-input>
    <template ng-for #my-item [ng-for-of]=items #my-index="index">

After

    <p *ngIf="cond">
    <my-cmp [myProp]="exp">
    <my-cmp (myEvent)="action()">
    <my-cmp [(myProp)]="prop">
    <input #myInput>`,
    <template ngFor="#my-item" [ngForOf]=items #myIndex="index">

The full details are found in [angular2/docs/migration/kebab-case.md](https://github.com/angular/angular/blob/master/modules/angular2/docs/migration/kebab-case.md)
2015-12-09 19:59:40 -08:00
b386d1134a doc(camelCase Angular): migration guide 2015-12-09 19:59:40 -08:00
1e740581ee build(npm_publish.sh): run gulp via node --max-old-space-size=1900 to workaround #5229 2015-12-09 19:51:10 -08:00
f1741b10f2 docs(changelog): release notes for 2.0.0-alpha.51 2015-12-09 19:28:52 -08:00
7bce1477ef chore(release): cut alpha.52 - the last release of Angular as we know it 2015-12-09 19:20:20 -08:00
01ba94ba56 build(npm): update to ts2dart@0.7.17
resolves regression in 0.7.16

Closes #5758
2015-12-10 01:32:45 +00:00
51cb7586e0 build(npm): update to typescript@1.7.3 + fix broccoli-typescript + fix src 2015-12-10 01:32:44 +00:00
796eee1e6f build(npm): update to gulp-typescript@2.10.0 2015-12-10 01:32:44 +00:00
c39828f0f2 build(npm): bump ts2dart to 0.7.16 2015-12-10 01:32:44 +00:00
28860d35b2 feat(core): provide support for relative assets for components
Assets defined for `templateUrl` and `styleUrls` can now be loaded
in relative to where the component file is placed so long as the
`moduleId` is set within the component annotation.

Closes #5634
2015-12-09 16:28:49 -08:00
5f0ce30ee6 revert: feat(core): provide support for relative assets for components 2015-12-09 16:26:42 -08:00
f4d937ad8d docs(cheatsheet): add Dart-specific syntax & headings
Closes #5756
2015-12-09 23:05:23 +00:00
db096a5e22 feat(core): provide support for relative assets for components
Assets defined for `templateUrl` and `styleUrls` can now be loaded
in relative to where the component file is placed so long as the
`moduleId` is set within the component annotation.

Closes #5634

Closes #5634
2015-12-09 22:04:00 +00:00
bf484b19b3 chore(changelog): fix formatting for alpha.49
Closes #5732
2015-12-09 21:30:30 +00:00
56a254e6a5 chore: enforce import checks for the 'upgrade' barrel
Closes #5741
2015-12-09 21:04:41 +00:00
793098bcce refactor(upgrade): remove imports from angular2/angular2
Related #5739
2015-12-09 21:04:41 +00:00
d6d759d722 feat(bundles): add angular-testing UMD bundle
Closes #5581

Closes #5734
2015-12-09 19:36:18 +00:00
61e8b60506 docs(Observable): add documentation for Observable and operators
Closes #5642
Closes #5684
2015-12-09 19:32:30 +00:00
2f0744b089 docs(cheatsheet): update to new syntax
See https://github.com/angular/angular.io/pull/459

Closes #5733
2015-12-09 19:04:08 +00:00
ca73852746 docs(AngularEntrypoint): add missing backticks 2015-12-09 19:04:08 +00:00
72444c40a7 typo fix: registerPrimaryOutlet description
Closes #5648
2015-12-08 19:55:35 -08:00
214148d58a chore(release): update package.json and changelog to alpha.50 2015-12-08 19:07:43 -08:00
cc8f1f9552 feat(testing): package angular2_testing to prepare it for publishing
Closes #5682
2015-12-09 03:01:21 +00:00
cbf788869d fix(http): use any for res.json() return
fixes #5636

Closes #5646
2015-12-09 03:00:22 +00:00
c1ae49d91e fix(testing): remove Symbol dummy shim
Closes #5067

Closes #5719
2015-12-09 02:57:19 +00:00
4432cf5438 chore(package): update rxjs dependency to alpha.14
Closes #5722

Closes #5723
2015-12-08 18:54:43 -08:00
869a392357 fix(package) add missing comma in ngHttp package.json
Closes #5727
2015-12-08 18:51:19 -08:00
90c67b4b11 chore(release): update package.json and changelog to alpha.49 2015-12-08 17:41:39 -08:00
7d15e19f2b docs(contributing.md): add docs for "build" commit type
Our build system is pretty complicated and we have many commits that touch it.

For this reason these kids of changes warrant its own type.
Closes #5720
2015-12-09 00:33:51 +00:00
a4ba46cb99 fix(bundles): remove SFX bundle
Closes #5665

BREAKING CHANGE:

The existing sfx bundle (angular2.sfx.dev.js) is replaced by UMD bundles:
angular2.umd.js and angular2.umd.dev.js. The new UMD bundles dont have
polyfills (zone.js, reflect-metadata) pre-appended. Those polyfills
can be easily loaded by including the angular-polyfills.js bundle.

Closes #5712
2015-12-08 16:09:52 -08:00
0df8bc4e52 fix(dynamic_component_loader): leave the view tree in a consistent state when hydration fails
Closes #5718
2015-12-08 16:09:38 -08:00
0d9a1de4d9 fix(bootstrap): fix the configuration of ExceptionHandler 2015-12-08 16:09:37 -08:00
d58f017226 cleanup(pipes): improve the error message of InvalidPipeArgumentException 2015-12-08 16:09:37 -08:00
1d825eb685 chore(bundles): rename angular-polyfills to angular2-polyfills. 2015-12-08 15:42:41 -08:00
b3c91b163b fix(bundles): rename external-dependencies to angular-polyfills
Closes #5714

BREAKING CHANGE:

The `external-dependencies.js` bundle was removed.
Use `angular-polyfills.js` instead.

Closes #5716
2015-12-08 15:38:48 -08:00
aa85856e1c fix(router): set correct redirect/default URL from hashchange
Currently, hashchange events outside of Angular that cause navigation
do not take into account cases where the initial route URL changes
due to a redirect or a default route.

Closes #5590

Closes #5683
2015-12-08 22:34:19 +00:00
fb4f1e8dc9 fix(bundles): clean-up and re-organize UMD bundles
Fixes #5593
Part of #5665

BREAKING CHANGE:

Number and content of UMD bundles have changed:
- we only publish one bundle that contains: core, common, platform/browser, http, router, instrumentation and upgrade
- exported names have changed and now:
  - core is exported as `ng.core`
  - common is exported as `ng.common`
  - platform/browser is exported as `ng.platform.browser`
  - http is exported as `ng.http`
  - router is exported as `ng.router`
  - instrumentation is exported as `ng.instrumentation`
  - upgrade is exported as `ng.upgrade`

Closes #5697
2015-12-08 21:50:00 +00:00
8657ca4298 fix(form): Form directives are exportedAs 'ngForm' (was 'form')
fixes #5658

BREAKING CHANGE:

Before:

    <form #f="form">

After:

    <form #f="ngForm">

Closes #5709
2015-12-08 20:25:16 +00:00
80b025ae53 build(broccoli): convert dependencies to peerDependencies in all package.json templates
This is more correct and resolves the issue of having dupes within the same project.

This change has no impact on our shrinkwrap since peerDeps and deps are merged into one
within the shrinkwrap file.

BREAKING CHANGE: rxjs, reflect-metadata, zone.js and es6-shims now must be specified as
explicit dependencies of each angular app that uses npm for package management.

To migrate, please add the following into the "dependencies" section of your package.json:

```
"dependencies": {
    ...

    "es6-promise": "^3.0.2",
    "es6-shim": "^0.33.3",
    "reflect-metadata": "0.1.2",
    "rxjs": "5.0.0-alpha.11",
    "zone.js": "0.5.8"

    ...
}
```

Closes #5560

Closes #5649
2015-12-08 11:52:26 -08:00
11f98c58b3 build(npm): dedupe es6-promise dependency 2015-12-08 11:52:25 -08:00
c1e3ea9f7f build(npm): add es6-promise as a dependency
This is actually an inherited dependency that comes from zone.js.

See related issue: https://github.com/angular/zone.js/issues/212

It would be better to make this one an optionalPeerDependency but npm
currently doesn't support making peerDependencies optional.
See: https://github.com/npm/npm/issues/3066
2015-12-08 11:52:25 -08:00
21542ed069 fix(npm): move es6-shim from devDependencies to dependencies
To be later used as a peerDependency in the generated package.json

It would be better to make this one an optionalPeerDependency but npm
currently doesn't support making peerDependencies optional.
See: https://github.com/npm/npm/issues/3066
2015-12-08 11:52:25 -08:00
c39f4c3b38 refactor(Observable): implement toPromise and fromPromise without side effects
BREAKING CHANGE:

toPromise is no longer an instance method of the `Observable` returned
by Angular, and fromPromise is no longer available as a static method.

The easiest way to account for this change in applications is to import
the auto-patching modules from rxjs, which will automatically add these
operators back to the Observable prototype.

```
import 'rxjs/add/operator/toPromise';
import 'rxjs/add/observable/fromPromise';
```

Closes #5542
Closes #5626
2015-12-08 18:31:02 +00:00
1f35048d54 feat(TemplateParser): allow template elements regardless the namespace
Closes #5703
2015-12-08 17:46:14 +00:00
eb0ea931d0 fix(HtmlParser): ignore LF immediately following pre, textarea & listing
fixes #5630

Closes #5688
2015-12-08 02:39:17 +00:00
47f1d12731 fix(HtmlLexer): tag name must follow "<" without space
see http://www.w3.org/TR/html5/syntax.html#tag-open-state
2015-12-08 02:39:17 +00:00
aecf68117a feat(HtmlLexer): allow "<" in text tokens
fixes #5550
2015-12-08 02:39:17 +00:00
3a438615c3 fix(HtmlParser): Do not add parent element for template children
fixes #5638
2015-12-08 02:39:17 +00:00
9850e68703 fix(HtmlLexer): handle CR in input stream per HTML spec
fixes #5618
Closes #5629
2015-12-08 02:18:20 +00:00
daaa8ee1cd fix(compiler): support properties on SVG elements
Have DomElementSchemaRegistry support namespaced elements,
so that it does not fail when directives are applied in SVG (or xlink).
Without this fix, directives or property bindings cannot be
used in SVG.

Related to #5547

Closes #5653
2015-12-08 02:18:07 +00:00
50490b55eb fix(HtmlParser): mark <source> elements as void
Fixes #5663

Closes #5668
2015-12-08 02:15:15 +00:00
86c74cf3f3 fix(changelog): correct import path
Closes #5681
2015-12-08 02:14:12 +00:00
7f0925eb2b docs(router): Updated documentation for router generate method
Closes #5399
2015-12-08 01:44:53 +00:00
85d89babce fix(build): lock down version of package:code_transformers
A new verion is causing build issues, perhaps due to an undeclared
dependency on package:test. For now, lock down the version to the
last known working one.
2015-12-07 17:42:24 -08:00
ad481694e1 fix(changelog): add RxJS imports breaking change
Closes #5678
2015-12-07 15:21:16 -08:00
2d313c4d1d chore(parser): add tests for conditional expressions
Closes #5647
2015-12-07 15:16:57 -08:00
e6170e8ac3 docs(http): fix MockBackend imports
Fixes #5639

Closes #5651
2015-12-07 15:16:18 -08:00
4b1618cb03 fix(package): relock RxJS to alpha.11
fixes #5643

Closes #5644
2015-12-07 15:15:22 -08:00
0a44fc69fe chore(changelog): mention Http Mockbackend
Closes #5652
2015-12-07 10:13:29 -08:00
c6d6b75691 refactor(test/linker): fix typo in directive name 2015-12-04 19:32:51 -08:00
f664a9c4d5 refactor(test/linker): remove unused directive in tests 2015-12-04 19:32:51 -08:00
a090843b84 chore(changelog): update change log to alpha 48 2015-12-04 17:12:22 -08:00
d10224d21a chore(release): increment version to alpha.48 2015-12-04 17:05:38 -08:00
7e18d4c539 feat(sourcemaps): use inline source maps and inline sources in node_tree
Closes #5617
2015-12-04 22:01:58 +00:00
22e9590981 feat(typings): import global-es6.d.ts in core
Currently, importing from 'angular2/angular2', in addition to providing Angular tokens, brings in global-es6.d.ts. Since we are deprecating 'angular2/angular2', we need to do the same in 'angular2/core'.
2015-12-04 22:01:58 +00:00
d388c0ae62 feat(HtmlParser): enforce only void & foreign elts can be self closed
BREAKING CHANGE:

`<whatever />` used to be expanded to `<whatever></whatever>`.
The parser now follows the HTML5 spec more closely.
Only void and foreign elements can be self closed.

Closes #5591
2015-12-04 20:05:27 +00:00
56604468e0 feat(HtmlParser): enforce no end tag for void elements
BREAKING CHANGE

End tags used to be tolerated for void elements with no content.
They are no more allowed so that we more closely follow the HTML5 spec.
2015-12-04 20:05:27 +00:00
b925ff5b8d refactor(http): rename enums to be singular
ReadyStates -> ReadyState
RequestMethods -> RequestMethod
ResponseTypes -> ResponseType

Fixes #5574

BREAKING CHANGE:

Before

import {ReadyStates, RequestMethods, ResponseTypes} from 'angular2/http';

After

import {ReadyState, RequestMethod, ResponseType} from 'angular2/http';

Closes #5584
2015-12-04 19:16:00 +00:00
654496b315 docs(changelog): remove reverted template element change
Closes #5609
2015-12-04 19:03:44 +00:00
c6a5d9bc84 refactor(validators) rename maxLength validator parameter
Closes #5592
2015-12-04 18:49:02 +00:00
19b61b1cf3 docs(tools): fix import statement in the example
Closes #5605
2015-12-04 18:14:05 +00:00
5e50859a03 fix(WebWorker): Add @AngularEntrypoint to worker_app bundle
Closes #5588
2015-12-04 01:26:20 +00:00
4ea5b6e57f feat(router): implement router link DSL
Closes #5557

Closes #5562
2015-12-04 00:47:20 +00:00
e67e1952d0 fix(HtmlParser): ng-content is not a void element
fixes #5563
Closes #5586
2015-12-03 23:42:46 +00:00
0614797d84 refactor(test_injector): Provide separate methods for creating test injector with and without runtime compiler.
BREAKING CHANGE:
`createTestInjector()` does not more include the runtime compiler. Use `createTestInjectorWithRuntimeCompiler()` instead.
Closes #5583
2015-12-03 22:50:14 +00:00
0a3a17ff10 fix(dart/reflection): Fix NoReflectionCapabilities interface
Make `NoReflectionCapabilities` conform to the `PlatformReflectionCapbilities`
api, which prevents some confusing error messages.

Closes #5559

Closes #5578
2015-12-03 22:11:26 +00:00
680f7e0299 fix(core/forms): input[type=text] .valueChanges fires unexpectedly
Closes #4768, #5284

Closes #5401
2015-12-03 22:11:16 +00:00
688469c221 refactor(broccoli-check-imports): allow imports from self by default
Closes #5573
2015-12-03 22:06:20 +00:00
7a1fbf1c3a chore(build): enforce import checks for the http module
Closes #5460
2015-12-03 22:06:20 +00:00
478a25ed27 refactor(angular_1_router): Added value for router root component
Closes #4965

Closes #5052
2015-12-03 22:05:51 +00:00
1edb17b8d0 chore(test): add config for pub serve testing.
Closes #5580

Closes #5580
2015-12-03 13:35:16 -08:00
1710272b3c refactor(WebWorker): Use the new generic bootstrap.
BREAKING CHANGE:

You can no longer bootstrap a WebWorker or Isolate using `bootstrap` or `bootstrapWebWorker`. Instead you have to do the following:

In TypeScript:
```TypeScript
// index.js
import {WORKER_RENDER_PLATFORM, WORKER_RENDER_APPLICATION, WORKER_SCRIPT} from "angular2/platforms/worker_render";
import {platform} from "angular2/platform";

platform([WORKER_RENDER_PLATFORM])
.application([WORKER_RENDER_APPLICATION, new Provider(WORKER_SCRIPT, {useValue: "loader.js"});
```
```JavaScript
// loader.js
importScripts("https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.33.3/es6-shim.js", "https://jspm.io/system@0.16.js", "angular2/web_worker/worker.js");
System.import("app");
```
```TypeScript
// app.ts
import {Component, View} from "angular2/core";
import {WORKER_APP_PLATFORM, setupWebWorker} from "angular2/platforms/worker_app";
import {platform} from "angular2/platform";

@Component({
  selector: "hello-world"
})
@View({
  template: "<h1>Hello {{name}}</h1>
})
export class HelloWorld {
  name: string = "Jane";
}

platform([WORKER_APP_PLATFORM])
.asyncApplication(setupWebWorker, optionalProviders?)
.then((ref) => ref.bootstrap(RootComponent));
```

In Dart:
```Dart
// index.dart
import "angular2/platform.dart";
import "angular2/platforms/worker_render.dart";

main() {
  platform([WORKER_RENDER_PLATFORM])
  .asyncApplication(initIsolate("my_worker.dart"));
}
```
```Dart
// background_index.dart
import "angular2/platform.dart";
import "angular2/platforms/worker_app.dart";
import "package:angular2/src/core/reflection/reflection.dart";
import "package:angular2/src/core/reflection/reflection_capabilities.dart";

@Component(
  selector: "hello-world"
)
@View(
  template: "<h1>Hello {{name}}</h1>"
)
class HelloWorld {
  String name = "Jane";
}

main(List<String> args, SendPort replyTo) {
  reflector.reflectionCapabilities = new ReflectionCapabilities();
  platform([WORKER_APP_PLATFORM])
    .asyncApplication(setupIsolate(replyTo))
      .then((ref) => ref.bootstrap(RootComponent));
}

```

You should no longer import from the `angular2/web_worker/worker` and `angular2/web_worker/ui` paths. Instead you can now import directly from core, directives, etc..

The WebWorkerApplication class has been removed. If you want to use ServiceMessageBroker or ClientMessageBroker on the render thread, you must inject their factories via DI.
If you need to use the MessageBus on the render thread you must also obtain it through DI.

closes #3277
closes #5473

Closes #5519
2015-12-03 19:51:43 +00:00
93a1ec29e1 feat(test): add angular2_testing dart library
angular2_testing is a user-facing dart test library built on top of
the package:test dart unittest framework and runner. For usage,
see modules_dart/angular2_testing/README.md.

Closes #3289
2015-12-03 11:33:46 -08:00
d90a2269f9 feat(HtmlParser): add most common named character references
fixes #5546
Closes #5579
2015-12-03 19:28:50 +00:00
69996b1740 test(http): remove stale SpyObserver
Closes #5134
2015-12-03 10:54:42 -08:00
35e32bbea1 feat(mocks): Mark mock objects @Injectable()
Make mock objects `@Injectable()` to allow using them in compiled tests.

Closes #5576
2015-12-03 10:49:56 -08:00
e9f873a365 feat(testing): export useful properties from componentFixture
The component fixture returned from the test component builder
now exports `nativeElement` and `componentInstance` members
directly. They are also still available on the `debugElement`.

See #5385
2015-12-02 16:05:01 -08:00
25a2d7b5db chore(async): clean up unused promise imports 2015-12-02 16:02:34 -08:00
c635a73ed9 refactor(http): remove mockbackend export from angular2/http barrel 2015-12-02 16:02:34 -08:00
f76eea4f9b chore(http): update http example to include map operator 2015-12-02 16:02:34 -08:00
5514dc19d9 refactor(facade): use rxjs package
move to new RxJS distribution.

BREAKING CHANGE:

RxJS imports now are via `rxjs` instead of `@reactivex/rxjs`
Individual operators can be imported `import 'rxjs/operators/map'`
2015-12-02 16:02:34 -08:00
a16ac84840 refactor(async): use ultralight Observable
Closes #5283
2015-12-02 16:02:34 -08:00
ad99199d50 chore(test): remove deprecated RootTestComponent
Uses of `RootTestComponent` should be migrated to `ComponentFixture`.
2015-12-02 15:00:55 -08:00
c7242a39d2 style(playground): use single quotes consistently 2015-12-02 14:59:55 -08:00
4fa1809f80 chore(build): make the unit tests campaign to run again in Edge 2015-12-02 14:34:31 -08:00
2a4ac63a34 chore(build): split browsers between providers 2015-12-02 14:21:09 -08:00
c5ed2d219a chore(changelog): add lifecycle breaking changes 2015-12-02 14:19:47 -08:00
fb16c39496 chore(build): fix flakiness of the element probe global test 2015-12-02 14:19:07 -08:00
62c2ed7c43 feat(HtmlParser): better error message when a void tag has content 2015-12-02 14:17:41 -08:00
9c6b929c7b fix(HtmlParser): close void elements on all node types
fixes #5528
2015-12-02 14:17:41 -08:00
070d818e68 refactor(tests): rename beforeEachBindings -> beforeEachProviders
Change beforeEachBindings to beforeEachProviders but preserve the
@deprecated method beforeEachBindings, in order to keep a working
deprecation warning
2015-12-02 14:09:13 -08:00
7f783289ab build: improve the environmental check and warnings
- we now correctly print errors even on old Node versions
- we print error messages even when node_modules are missing or messed up
- error messages looks better

Closes #5230
2015-12-02 13:03:51 -08:00
1417e12f28 refactor(playground): rename bindings to providers 2015-12-02 13:02:53 -08:00
9a65ea7ea7 feat(core): remove typings from package.json to disallow 'import * as n from 'angular2'''
The typings property is being removed because angular2.ts is deprecated, and the developers should import from angular2/core and angular2/platform/*.  So aliasing angular2 to angular2/angular2 does not make sense.

BREAKING CHANGE

Before

import * as ng from 'angular2';

After

import * as core from 'angular2/core';
2015-12-02 11:48:14 -08:00
c58e7e0e91 fix(HtmlParser): do not add a tbody parent for tr inside thead & tfoot
fixes #5403
2015-12-02 11:43:51 -08:00
bdfed9d850 docs(core): make naming concrete
I think people new to promises, angular etc will find this example easier to understand with concrete identifiers from a simple use-case. The existing naming could be confused with promise/angular functionality (`promise` in the template, `resolved` etc).

Also I made `resolve` private, as then it's clear what we're exposing for the template.
2015-12-02 11:41:52 -08:00
b9b14dc731 docs: fix typo event1 -> event 2015-12-02 11:40:20 -08:00
cf3ceba2cc docs(api): remove extra the 2015-12-02 11:38:24 -08:00
c08d76c7f8 chore(test): remove deprecated angular2/test and angular2/test_lib
These have been deprecated for a while. Instead of angular2/test, use
angular2/testing. Instead of angular2/test_lib, use angular2_testing_internal.
2015-12-02 11:37:29 -08:00
d1c284a3da chore(bundles): use angular2/core in bundles arithmetic 2015-12-02 11:35:32 -08:00
442d6866da test: add a test verifying that the tests are run in the checked mode 2015-12-02 11:29:11 -08:00
093b7948be chore(package.json): add range of supported node versions as engines
Closes #5535
2015-12-02 18:17:25 +00:00
706990c65d docs(changelog.md) fix duplication
Closes #5536
2015-12-02 17:52:05 +00:00
f77ca7b5e2 feat(dart/transform): Add quick_transformer
Add an implementation of the transformer which runs only the phases
which replace `Asset`s, rather than generate them.

Closes #5484
2015-12-01 23:23:28 +00:00
922da62720 chore(browser_tree): fix formatting 2015-12-01 13:44:41 -08:00
87449ab43c feature(dart/transform): Inject initReflector at @AngularEntrypoint
Detect the `@AngularEntrypoint` annotations on methods and/or
functions and add a call to `initReflector` there.

See #4865
2015-12-01 13:34:29 -08:00
6b2ef25c69 feat(dart/transform): Introduce @AngularEntrypoint() 2015-12-01 13:34:29 -08:00
3e364b0d41 test(schema): fix test names 2015-12-01 13:33:06 -08:00
47d0942f3f fix(build): change npm publish script not to remove angular folder when building benchpress 2015-12-01 12:42:54 -08:00
87ac36f65b fix(build): include benchpress into browser_tree 2015-12-01 12:42:22 -08:00
015faeeaf2 chore(changelog): update change log to alpha 47 2015-12-01 11:43:45 -08:00
909426e37d chore: bump up version number to alpha.47 2015-12-01 11:43:33 -08:00
c4c4d045fb chore(playground/routing): remove unused bind import
Closes #5305
2015-12-01 18:23:54 +00:00
2ada3ecad5 refactor(dart/transform): Remove reflectPropertiesAsAttributes
Remove deprecated `reflectPropertiesAsAttributes` as an option. It has
been renamed `reflect_properties_as_attributes`.

Closes #5108

Closes #5512
2015-12-01 17:53:39 +00:00
fcc7ce225e refactor(pipes): use angular lifecycle hooks instead of PipeOnDestroy
BREAKING CHANGE:
Previously, pipes that wanted to be notified when they were destroyed
would implement the PipeOnDestroy interface and name the callback
`onDestroy`. This change removes the PipeOnDestroy interface and
instead uses Angular's lifecycle interface `OnDestroy`, with the
`ngOnDestroy` method.

Before:
```
import {Pipe, PipeOnDestroy} from 'angular2/angular2';
@Pipe({pure: false})
export class MyPipe implements PipeOnDestroy {
  onDestroy() {}
}
```

After:
import {Pipe, OnDestroy} from 'angular2/angular2';
@Pipe({pure: false})
export class MyPipe implements PipeOnDestroy {
  ngOnDestroy() {}
}
2015-11-30 16:40:50 -08:00
604c8bbad5 refactor(lifecycle): prefix lifecycle methods with "ng"
BREAKING CHANGE:
Previously, components that would implement lifecycle interfaces would include methods
like "onChanges" or "afterViewInit." Given that components were at risk of using such
names without realizing that Angular would call the methods at different points of
the component lifecycle. This change adds an "ng" prefix to all lifecycle hook methods,
far reducing the risk of an accidental name collision.

To fix, just rename these methods:
 * onInit
 * onDestroy
 * doCheck
 * onChanges
 * afterContentInit
 * afterContentChecked
 * afterViewInit
 * afterViewChecked
 * _Router Hooks_
 * onActivate
 * onReuse
 * onDeactivate
 * canReuse
 * canDeactivate

To:
 * ngOnInit,
 * ngOnDestroy,
 * ngDoCheck,
 * ngOnChanges,
 * ngAfterContentInit,
 * ngAfterContentChecked,
 * ngAfterViewInit,
 * ngAfterViewChecked
 * _Router Hooks_
 * routerOnActivate
 * routerOnReuse
 * routerOnDeactivate
 * routerCanReuse
 * routerCanDeactivate

The names of lifecycle interfaces and enums have not changed, though interfaces
have been updated to reflect the new method names.

Closes #5036
2015-11-30 16:40:50 -08:00
4215afc639 fix(router): fix a typing issue
Closes #5518
2015-12-01 00:09:40 +00:00
909031e688 refactor(tests): move facades tests out of tests/core
Closes #5472
2015-11-30 22:24:35 +00:00
b7b3c85033 refactor(core): move EventManager from core to platform/dom
Closes #5465
2015-11-30 22:24:35 +00:00
0c9596ae2b feat(testing): use zones to avoid the need for injectAsync
Use a zone counting timeouts and microtasks to determine when a test
is finished, instead of requiring the test writer to use
injectAsync and return a promise.

See #5322
2015-11-30 14:06:06 -08:00
a8c3b9d67c build(gulp): lazy-require modules in order to improve startup time
Closes #5498
2015-11-30 21:36:57 +00:00
65bdf42903 chore(bundles): add source maps to umd dev bundles
Source maps are in-lined to follow the same conventions as
for non-bundled files.

Closes #5511
2015-11-30 20:17:13 +00:00
7f3223bd2c fix(transformers): use BarbackMode instead of assertionEnabled to enable debug info generation
Closes #5245

Closes #5466
2015-11-30 20:08:19 +00:00
87ddc8fb6a fix(compiler): dedup directives in template compiler
Closes #5311

Closes #5464
2015-11-30 19:37:54 +00:00
6ddfff5cd5 refactor(router): improve recognition and generation pipeline
This is a big change. @matsko also deserves much of the credit for the implementation.

Previously, `ComponentInstruction`s held all the state for async components.
Now, we introduce several subclasses for `Instruction` to describe each type of navigation.

BREAKING CHANGE:

Redirects now use the Link DSL syntax. Before:

```
@RouteConfig([
	{ path: '/foo', redirectTo: '/bar' },
	{ path: '/bar', component: BarCmp }
])
```

After:

```
@RouteConfig([
	{ path: '/foo', redirectTo: ['Bar'] },
	{ path: '/bar', component: BarCmp, name: 'Bar' }
])
```

BREAKING CHANGE:

This also introduces `useAsDefault` in the RouteConfig, which makes cases like lazy-loading
and encapsulating large routes with sub-routes easier.

Previously, you could use `redirectTo` like this to expand a URL like `/tab` to `/tab/posts`:

@RouteConfig([
	{ path: '/tab', redirectTo: '/tab/users' }
	{ path: '/tab', component: TabsCmp, name: 'Tab' }
])
AppCmp { ... }

Now the recommended way to handle this is case is to use `useAsDefault` like so:

```
@RouteConfig([
	{ path: '/tab', component: TabsCmp, name: 'Tab' }
])
AppCmp { ... }

@RouteConfig([
	{ path: '/posts', component: PostsCmp, useAsDefault: true, name: 'Posts' },
	{ path: '/users', component: UsersCmp, name: 'Users' }
])
TabsCmp { ... }
```

In the above example, you can write just `['/Tab']` and the route `Users` is automatically selected as a child route.

Closes #4728
Closes #4228
Closes #4170
Closes #4490
Closes #4694
Closes #5200

Closes #5475
2015-11-30 17:06:03 +00:00
a3253210b7 Revert "Revert "test(router): remove View decorator in router link fixtures""
This reverts commit a3353a5e28.
2015-11-30 17:06:03 +00:00
0dbd0b340c Revert "Revert "feat(router): allow linking to auxiliary routes""
This reverts commit cee67e6fe0.
2015-11-30 17:06:03 +00:00
8c670822ce chore(bundles): don't distribute sfx bundles for http
Currently the main sfx bundle already contains http and router
and the http sfx bundles duplicates all core.

Additionally https://github.com/angular/angular/issues/5223
modifies our strategy for individual bundles

Closes #5434
2015-11-30 16:29:58 +00:00
b90de66535 fix(parser): do not crash on untokenizable quote prefixes
Closes #5486
2015-11-25 23:43:52 +00:00
1bec4f6c61 feat(router): add support for APP_BASE_HREF to HashLocationStrategy
Closes #4935
Closes #5368

Closes #5451
2015-11-25 22:29:43 +00:00
b6ec2387b3 feat(templates): introduce quoted expressions to support 3rd-party expression languages
A quoted expression is:

quoted expression = prefix `:` uninterpretedExpression
prefix = identifier
uninterpretedExpression = arbitrary string

Example: "route:/some/route"

Quoted expressions are parsed into a new AST node type Quote. The `prefix` part of the
node must be a legal identifier. The `uninterpretedExpression` part of the node is an
arbitrary string that Angular does not interpret.

This feature is meant to be used together with template AST transformers introduced in
a43ed79ee7. The
transformer would interpret the quoted expression and convert it into a standard AST no
longer containing quoted expressions. Angular will continue compiling the resulting AST
normally.
2015-11-25 14:28:11 -08:00
cf157b99d3 chore(test): fix public API test in some browsers
Fixes #5470

Closes #5478
2015-11-25 21:44:26 +00:00
2cd0f076cc fix(build): increase memory limit 2015-11-25 13:16:01 -08:00
fa725b4512 feat(bundles): publish UMD bundles
Closes #5223
2015-11-25 13:16:01 -08:00
5a27ffb5f5 chore(bundling): prepare bundle with all external dependencies
Currently:
- zone.js
- reflect-metadata

Could contain shims in the future.
2015-11-25 13:16:01 -08:00
d59c20c315 fix(web worker): remove usages of deprecated zone API
Closes #5425
2015-11-25 19:25:08 +00:00
019cb41dd8 fix(EventEmitter): resolve onError and onComplete asynchronously
closes #4443
2015-11-24 16:54:13 -08:00
b4de41b74e chore(parser): cleanup unused imports
Closes #5424
2015-11-24 19:36:30 +00:00
87d56acdaa fix(build): fix source maps
Closes #5444
2015-11-24 19:33:27 +00:00
8daa9b202d cleanup(testing): create top level files for mocks
Closes #5381
2015-11-24 19:29:52 +00:00
89eefcd7b5 cleanup(tooling): move tooling to the browser platform and rename profile into instrumentation
BREAKING CHANGE

Before

import * as p from 'angular2/profile';
import * as t from 'angular2/tools';

After

import * as p from 'angular2/instrumentation';
import * as t from 'angular2/platform/browser';
2015-11-24 19:29:52 +00:00
9ae171e0c8 refactor(dart/transform): Improve logging
Ensure that, where possible, log messages include an [AssetId].

Closes #5369
2015-11-24 18:41:24 +00:00
cee67e6fe0 Revert "feat(router): allow linking to auxiliary routes"
This reverts commit 0b1ff2db9e.
2015-11-23 16:34:40 -08:00
a3353a5e28 Revert "test(router): remove View decorator in router link fixtures"
This reverts commit 422a7b18f6.
2015-11-23 16:34:06 -08:00
c5294c77d9 Revert "refactor(router): improve recognition and generation pipeline"
This reverts commit cf7292fcb1.

This commit triggered an existing race condition in Google code. More work is needed on the Router to fix this condition before this refactor can land.
2015-11-23 16:26:47 -08:00
ba64b5ea5a fix(forms): scope value accessors, validators, and async validators to self
Closes #5440
2015-11-23 23:48:54 +00:00
230aad4047 chore(build): remove iOS9 from CI
Closes #5409
2015-11-23 22:44:49 +00:00
564642d859 chore(core): rename classname to className
Closes #5371
2015-11-23 22:43:01 +00:00
87549c77d4 chore(core): proper camelcasing for styleName and styleValue 2015-11-23 22:43:01 +00:00
fad354904d test(matchers): add support for toHaveCssStyle matcher 2015-11-23 22:43:01 +00:00
e1d7bdcfe7 fix(http): Fix all requests defaulting to Get
Honor method parameter passed to http.request().

Closes #5309

Closes #5397
2015-11-23 22:17:13 +00:00
46fc153f39 fix(http): return URL in Response
Attach reponseURL or X-Request-URL to Response.

Closes  #5165
2015-11-23 22:17:13 +00:00
4332ccf72c fix(http): return Response headers
Properly parse and add response Headers to Response.

Closes #5237
2015-11-23 22:17:13 +00:00
201f189d0e fix(http): error on non-200 status codes
BREAKING CHANGE:

previously http would only error on network errors to match the fetch
specification. Now status codes less than 200 and greater than 299 will
cause Http's Observable to error.

Closes #5130.
2015-11-23 22:17:13 +00:00
a35a93d0da chore(analytics): Include all of angular2 in hello_world
Import dependencies from `angular2/angular2.dart` in `hello_world` to
ensure that any size regressions are caught by our checks.

Update to avoid regressions like #5419.

Closes #5394
2015-11-23 20:10:04 +00:00
163164cb79 chore(analytics): Travis job testing Dart payload size
Add a job to the Travis build matrix that checks the size of the
`hello_world` app against targets hard-coded in the gulpfile.

Closes #5314
2015-11-23 20:10:04 +00:00
31f85f0297 chore(analytics): Build hello_world, check constraints
Create gulp targets to build `hello_world` and check its gzipped size
against size constraints.

See #5312, #5314
2015-11-23 20:10:04 +00:00
225b9d306b chore(analytics): Generalize file size analytics
Move file size analytics code into a reusable module.

See #5312, #5314
2015-11-23 20:10:04 +00:00
9ca8a35553 docs(core): @View annotations are no longer mandatory
@View is [now optional](angular@bd31b01).

Closes #5413
2015-11-23 19:55:43 +00:00
5806babb0b chore(build): increase timeout of the 5 most flaky tests
Closes #5410
2015-11-23 19:23:25 +00:00
30d35b5046 fix(build): do not reexport compiler from angular2/angular2
Closes #5422
2015-11-23 18:57:15 +00:00
88afae15a8 chore(ci): Allow failures in Dart dev channel test until dartdoc bug is fixed. 2015-11-23 09:54:19 -08:00
cf7292fcb1 refactor(router): improve recognition and generation pipeline
This is a big change. @matsko also deserves much of the credit for the implementation.

Previously, `ComponentInstruction`s held all the state for async components.
Now, we introduce several subclasses for `Instruction` to describe each type of navigation.

BREAKING CHANGE:

Redirects now use the Link DSL syntax. Before:

```
@RouteConfig([
  { path: '/foo', redirectTo: '/bar' },
  { path: '/bar', component: BarCmp }
])
```

After:

```
@RouteConfig([
  { path: '/foo', redirectTo: ['Bar'] },
  { path: '/bar', component: BarCmp, name: 'Bar' }
])
```

BREAKING CHANGE:

This also introduces `useAsDefault` in the RouteConfig, which makes cases like lazy-loading
and encapsulating large routes with sub-routes easier.

Previously, you could use `redirectTo` like this to expand a URL like `/tab` to `/tab/posts`:

@RouteConfig([
  { path: '/tab', redirectTo: '/tab/users' }
  { path: '/tab', component: TabsCmp, name: 'Tab' }
])
AppCmp { ... }

Now the recommended way to handle this is case is to use `useAsDefault` like so:

```
@RouteConfig([
  { path: '/tab', component: TabsCmp, name: 'Tab' }
])
AppCmp { ... }

@RouteConfig([
  { path: '/posts', component: PostsCmp, useAsDefault: true, name: 'Posts' },
  { path: '/users', component: UsersCmp, name: 'Users' }
])
TabsCmp { ... }
```

In the above example, you can write just `['/Tab']` and the route `Users` is automatically selected as a child route.

Closes #4170
Closes #4490
Closes #4694
Closes #5200

Closes #5352
2015-11-20 23:18:43 +00:00
422a7b18f6 test(router): remove View decorator in router link fixtures 2015-11-20 23:18:43 +00:00
0b1ff2db9e feat(router): allow linking to auxiliary routes
Closes #4694
2015-11-20 23:18:43 +00:00
a43ed79ee7 feat(parser): allows users install custom AST transformers
Closes #5382
2015-11-20 19:46:02 +00:00
125fa3885e cleanup: removes the render and lifecycle_hooks modules
BREAKING CHANGE

Before

import {Renderer} from 'angular2/render';

After

import {Renderer} form 'angular2/core';

Closes #5367
2015-11-20 19:16:38 +00:00
ae58934d52 docs(async): adding type to EventEmitter now that it is generic
Closes #5391
2015-11-20 00:20:12 +00:00
3c8fa8c50d cleanup: move DomAdapter from angular2/core into angular2/platform/common_dom
BREAKING CHANGE

Before

import {DomAdapter} from 'angular2/core';

After

import {DomAdapter} from 'angular2/platform/common_dom';

Closes #5370
2015-11-20 00:14:24 +00:00
4d59985b74 chore(build): use Chrome by default for all JS tests
Fixes #5380

Closes #5387
2015-11-19 23:27:42 +00:00
4e12b0831e Make Angular2 transformers lazy in debug mode when option lazy_transformers: true is set.
This make apps to load quicker with pub serve (only builds what is
needed).
Note that lazy transformers seem to make pub build slower, so we wrap
transformers to force them to be eager in release mode.

Closes #5372
2015-11-19 20:58:12 +00:00
5ba9ced1ab cleanup(core): stop reexporting angular2/common from angular2/core
All common directives, forms, and pipes have been moved out of angular2/core,
but we kept reexporting them to make transition easier.

This commit removes the reexports.

BREAKING CHANGE

Before

import {NgIf} from 'angular2/core';

After

import {NgIf} from 'angular2/common';

Closes #5362
2015-11-19 19:54:27 +00:00
36a423fac8 feat(Compiler): case sensitive html parser
close #4417
Closes #5264
2015-11-19 18:55:04 +00:00
adb87562bb feat(Compiler): case sensitive html parser 2015-11-19 18:55:04 +00:00
0db02523d3 fix(dart/transform): Omit bootstrap.dart in ng_deps
Special-case to avoid copying the bootstrap{,_static}.dart
import when creating `.ng_deps.dart` files.

Closes #5315

Closes #5348
2015-11-18 22:46:29 +00:00
3c43a8c549 feat(bootstrap): add platform and app initializers
Often some init logic needs to run when a platform or an application is boostrapped.
For example, boostraping a platform requires initializing the dom adapter.
Now, it can be done as follows:

new Provider(PLATFORM_INITIALIZER, {useValue: initDomAdapter, multi: true}),

All platform initializers will be run after the platform injector has been created.

Similarly, all application initializers will be run after the app injector has been
created.

Closes #5355
2015-11-18 22:22:32 +00:00
3fa287aae2 refactor(EventEmitter): rename .next() to .emit()
BREAKING CHANGE:

EventEmitter#next(value) is deprecated, use EventEmitter#emit(value)
instead.

Closes #4287

Closes #5302
2015-11-18 22:16:40 +00:00
929abb9aa3 chore(router): add tests for interaction between router-outer and
@ViewChild.

Closes #5164
2015-11-18 21:23:08 +00:00
837efc2a0f chore(bundles): properly publish router.min.js bundle
Fixes #5244

Closes #5253
2015-11-18 19:13:23 +00:00
3eced6e1a9 chore(publish): use pub/npm_prepare.sh script to prep published builds
Closes #5356
2015-11-18 19:02:51 +00:00
c53a63acca chore(build): spin off pub_prepare.sh from pub_publish.sh 2015-11-18 19:02:51 +00:00
621fa490c7 chore(build): spin off npm_prepare.sh from npm_publish.sh 2015-11-18 19:02:51 +00:00
9691c045a7 chore(build): move publish-build-artifacts.sh to scripts/publish 2015-11-18 19:02:51 +00:00
c855c5ddc2 chore(saucelabs): update browser versions
Closes #5336
2015-11-18 18:33:09 +00:00
2c8fcec432 refactor(core): move render/dom from core
Currently, core depends on DomRenderer, which depends on the browser.
This means that if you depend on angular2/core, you will always
pull in the browser dom adapter and the browser render, regardless
if you need them or not.

This PR moves the browser dom adapter and the browser renderer out of core.

BREAKING CHANGE

If you import browser adapter or dom renderer directly (not via angular2/core),
you will have to change the import path.
2015-11-17 15:53:55 -08:00
60a2bbb226 chore(build): git config prior to committing 2015-11-17 14:57:22 -08:00
d013fc7604 docs(cleanup): fix bad h3 markup and normalize headings
Closes #5341
2015-11-17 22:10:20 +00:00
dd1e212402 chore(build): revert presubmit-queue-setup.sh; fix git login in publish-build-artifacts.sh 2015-11-17 13:53:57 -08:00
ac38812809 fix(router): apply APP_BASE_HREF when using PathLocationStrategy
Correctly initializes APP_BASE_HREF, and falls back to the `<base>` tag in the absence
of an APP_BASE_HREF provider.

Closes #5028
2015-11-17 21:19:22 +00:00
b571baab68 fix(examples): Don't generate Dart code for TS examples in nested directories. 2015-11-17 11:24:02 -08:00
a31e2f5f47 fix(dart/transform): Consider of line numbers in inliner_for_test
Ensure that line numbers aren't changed by inliner_for_test.

Fixes #5281

Closes #5285
2015-11-17 01:51:58 +00:00
bcd926adc5 fix(http): refactor 'require' statements to 'import' declarations for Rx
Looks like this is some old leftover code from the times when Rx didn't distribute typings via npm.

Closes #5287
2015-11-17 01:26:54 +00:00
b22eddf1cb fix(core): Run component disposal before destroyRootHostView() to avoid crash if change detection is triggered.
Closes #5226
2015-11-17 00:58:13 +00:00
857bef9e4f doc(NgSwitch): update API doc
Closes #4423
2015-11-17 00:54:32 +00:00
4e585bca28 feat(build): add an option to disable type checks when running tests
Since editors and IDEs do typechecking and show errors in place,
often there is no benefit to running type checking in our test pipeline.
This PR allows you to disable type checking:

gulp test.unit.js --noTypeChecks

This commit also makes es6 generation optional.

fix(build): removes unnecessary circular dependencies

Closes #5299
2015-11-17 00:45:49 +00:00
94cf671c15 docs(pipes): Add examples for all Angular pipes.
Closes #5103
2015-11-17 00:15:17 +00:00
ad6fb067e9 fix(dart): fix the static_browser platform not to include compiler
Closes #5321
2015-11-16 23:29:36 +00:00
c03fb36e11 docs(cheatsheet): add missing bootstrapping section
Closes #5269

Closes #5269
2015-11-16 23:15:03 +00:00
bccd8a719d build(browserstack): add Windows Phone to CI
Closes #5138
2015-11-16 22:48:05 +00:00
4e1d9c93df Revert "feat(Compiler): case sensitive html parser"
This reverts commit 86aeb8be0a.
2015-11-16 14:37:00 -08:00
0611239a0e Revert "feat(Compiler): case sensitive html parser"
This reverts commit a8edc1eb58.
2015-11-16 14:36:39 -08:00
c5045ac8fe chore(build): print commands in presubmit-queue-setup.sh 2015-11-16 14:22:54 -08:00
41dfaf393b build(analytics): track bundle size
This will send bundle sizes (before and after gzip) to Google Analytics so that we can
track bundle size over time for every bundle we produce.

Closes #5294
2015-11-16 21:42:50 +00:00
96076862cf build(gulp): remove unnecessary dependency duplication 2015-11-16 21:42:49 +00:00
a8edc1eb58 feat(Compiler): case sensitive html parser
close #4417

Closes #5264
2015-11-16 21:09:09 +00:00
86aeb8be0a feat(Compiler): case sensitive html parser 2015-11-16 21:09:09 +00:00
e274ff8a69 Revert "feat(renderer): use a comment instead of an element when stamping out <template> elements"
This reverts commit bb9cfe6f36.
2015-11-16 11:15:28 -08:00
9985968d89 fix(publish): syntax fix 2015-11-13 18:31:40 -08:00
bb9cfe6f36 feat(renderer): use a comment instead of an element when stamping out <template> elements
Closes #4805


Closes #5227
2015-11-14 01:04:20 +00:00
406ace9b25 chore(build): deploy build artifacts to build branches
- use orphan branch
- use upstream .gitignore
- use short SHA in commit messages
- tag commits with source SHA

Closes #5203
2015-11-14 00:36:47 +00:00
6d70cd78ec fix(build): fix npm install not to depend on minimist
Closes #5282
2015-11-13 23:56:43 +00:00
a70a919d14 chore(browserstack): deactivate failing Android browsers
Closes #5158
2015-11-13 23:52:39 +00:00
b16fa45d83 docs(*): onContentInit --> afterContentInit
Closes #5263
2015-11-13 23:25:02 +00:00
1d9c44b34f build: add --projects a.k.a the turbo button
we can now filter build graph via --project flag to speed up build performance

usage:

gulp test.unit.js --project=angular2,angular2_material

Closes #5272
2015-11-13 22:50:38 +00:00
2ecbd0eaaf build(analytics): fix bug that prevented us from collecting OS info 2015-11-13 22:50:38 +00:00
8ab7781b2d build(analytics): keep track of --projects value via a custom dimension 2015-11-13 22:50:38 +00:00
cf0183ac7f build(DiffingPluginWrapper): ignore null/undefined input trees
this is handy to conditionally create build graph but keep mergeTree() declarative - any input tree passed into
mergeTree that is null or undefined will simply be ignored
2015-11-13 22:50:38 +00:00
2ce9e95fc1 docs(DEVELOPER.md): update info about clang-format setup
There is no need to recommend installing clang-format globally.
2015-11-13 22:50:38 +00:00
49e261efd8 build(gulp): add gulpfile.js to files formatted by clang-format 2015-11-13 22:50:38 +00:00
9c94ab1e8e style(build): clang format gulpfile.js 2015-11-13 22:50:38 +00:00
d1d88c32c3 build(analytics): start tracking gulp startup latency
This measures how long does it take for gulp to start the first task up after being invoked from command line.

I'm suspecting that we can optimize this significantly, but let's start tracking it first.
2015-11-13 22:50:38 +00:00
63639895ad chore(package): update karma-browserstack-launcher to 0.1.7
Closes #5276
2015-11-13 22:20:50 +00:00
0eab4fc72c feat(core): extract platforms out of core
Currently, core depends on the browser, which means that other platforms (e.g., NativeScript or webworker) cannot use the bootstrapping logic core provides.
This PR extract makes bootstrapping logic in core completely platform-independent. The browser-specific code was moved to "angular2/platforms/browser".

BREAKING CHANGE

A few private helpers (e.g., platformCommon or applicationCommon) were removed or replaced with other helpers. Look at PLATFORM_COMMON_PROVIDERS, APPLICATION_COMMON_PROVIDERS, BROWSER_PROVIDERS, BROWSER_APP_PROVIDERS to see if they export the providers you need.

Closes #5219

Closes #5280
2015-11-13 19:26:14 +00:00
d9f362a713 fix(transformers): Fix @Input/@Output annotations with setters/getters
Fix @Input annotations to work with setter methods in dart, and fix @Output
annotations to work with getter methods in Dart when using transformers.

Closes #5251

Closes #5259
2015-11-13 02:42:38 +00:00
7f6289c1bf fix(typings): two errors not reported by our build:
third_party/javascript/angular2/github/modules/angular2/src/core/platform_bindings.ts:5:14: Exported variable 'EXCEPTION_PROVIDER' has or is using name 'Provider' from external module third_party/javascript/angular2/github/modules/angular2/src/core/di/provider but cannot be named.
third_party/javascript/angular2/github/modules/angular2/src/core/platform_bindings.ts:8:14: Exported variable 'EXCEPTION_BINDING' has or is using name 'Provider' from external module third_party/javascript/angular2/github/modules/angular2/src/core/di/provider but cannot be named.
third_party/javascript/angular2/github/modules/angular2/src/mock/animation_builder_mock.ts:11:10: Return type of public method from exported class has or is using private name 'MockCssAnimationBuilder'.
2015-11-12 18:39:23 -08:00
78280a48af Revert "feat(core): extract platforms out of core"
This reverts commit 3f4628c0b0.
2015-11-12 13:40:29 -08:00
f80321fd26 feat(dart/transform): Bail early for files with no deferred libraries
In `DeferredRewriter` if we can determine that there are no `deferred`
libraries imported, bail early to avoid parsing the entire file.
2015-11-12 11:27:46 -08:00
8f91ff84c7 feat(dart/transform): Do not re-process generated files
In the `DeferredRewriter` phase, do not process files which were
generated by the transformer, since these will never need to be
rewritten.
2015-11-12 11:23:19 -08:00
3f4628c0b0 feat(core): extract platforms out of core
Currently, core depends on the browser, which means that other platforms (e.g., NativeScript or webworker) cannot use the bootstrapping logic core provides.
This PR extract makes bootstrapping logic in core completely platform-independent. The browser-specific code was moved to "angular2/platforms/browser".

BREAKING CHANGE

A few private helpers (e.g., platformCommon or applicationCommon) were removed or replaced with other helpers. Look at PLATFORM_COMMON_PROVIDERS, APPLICATION_COMMON_PROVIDERS, BROWSER_PROVIDERS, BROWSER_APP_PROVIDERS to see if they export the providers you need.

Closes #5219
2015-11-12 16:57:03 +00:00
4e02e00373 feat(NgClass) allow multiple classes per expression
Closes #5225
2015-11-12 14:54:02 +00:00
9b3b721f08 docs(*): more cheatsheet docs 2015-11-11 16:32:25 -08:00
756727b930 docs(*): more cheatsheet docs 2015-11-11 16:32:25 -08:00
533b722c66 docs(*): move cheatsheet stuff into its own files 2015-11-11 16:32:25 -08:00
029c0534f3 docs(*): add initial cheatsheet tags 2015-11-11 16:32:25 -08:00
d29563fdd3 chore(changelog): update change log to alpha-46 2015-11-11 13:33:18 -08:00
4a43230de4 fix(core): various dart-specific fixes for core and facades
For some reason these showed up only now in internal Dart analyzer output.
2015-11-11 11:45:58 -08:00
01ebff4080 fix(core): reexport PLATFORM_DIRECTIVES and PLATFORM_PIPES in dart
Looks like we missed this in the original PR.
2015-11-11 11:45:58 -08:00
344776f864 fix(renderer): apply host element encapsulation also if the parent component is not encapsulated.
Closes #5240
2015-11-11 10:53:22 -08:00
a3e6406b38 fix(core): Export dev mode API in Dart.
Closes #5233
2015-11-11 07:18:11 +00:00
64bd9639a1 fix(benchmarks): fix tracing categories to work with Dartium
Closes #5209
2015-11-10 15:38:40 -08:00
1ff1792642 fix(core): Unload components when individually disposed. 2015-11-10 12:15:47 -08:00
e6bf33efbf patch(renderer): make glyph not an svg element
This is required because of a conflict with an internal project.
This will go away soon as we are working on a proper SVG 
support..
2015-11-10 11:51:39 -08:00
5fecb3b3f2 fix(build): reorder bundling step
Closes #5208
2015-11-10 14:34:22 +00:00
ee07646059 chore(test): fix public API test failure when no support of Symbol.for
`@@observable` is the token used in RxJS to define `Symbol.observable`

Closes #5093
2015-11-10 11:23:01 +01:00
e27665c368 feat(core): renam AMBIENT_DIRECTIVES and AMBIENT_PIPES into PLATFORM_DIRECTIVES and PLATFORM_PIPES
After discussing it we decided that PLATFORM_ is a better prefix for directives available everywhere in the app.

BREAKING CHANGE

AMBIENT_DIRECTIVES -> PLATFORM_DIRECTIVES
AMBIENT_PIPES -> PLATFORM_PIPES

Closes #5201
2015-11-10 01:45:25 +00:00
2618becaa5 chore(): npm release script for router artifacts.
Closes #5171
2015-11-09 20:45:55 +00:00
0dcca1a28e refactor(ListWrapper): drop filter, find, reduce & any
Closes #5152
2015-11-09 19:24:14 +00:00
e667ad3e6b refactor(compiler): make all commands const
Closes #5135
2015-11-09 10:59:08 -08:00
fb8b8157ff fix(setup): set tsconfig so that it works in editors 2015-11-09 08:43:15 -08:00
a8d9dbf110 feat(dart): Support forcing dev mode via enableDevMode in Dart.
Closes #5193
2015-11-09 07:16:25 +00:00
2645fb0d6c docs(form): Fix typos of indent
Closes #5159
2015-11-07 16:05:56 +00:00
18b508d14a docs(developer.md): add missing link for build commands
Closes #5170
2015-11-07 09:54:34 +00:00
b0009f03d5 chore(ts2dart): update ts2dart to 0.7.14
Closes #5167
2015-11-07 01:36:06 +00:00
79472b77ca refactor(core): move facades out of core
This is part of ongoing work to make core platform-independent.

BREAKING CHANGE

All private exports from 'angular2/src/core/facade/{lang,collection,exception_handler}' should be replaced with 'angular2/src/facade/{lang,collection,exception_handler}'.
2015-11-07 01:36:06 +00:00
3593d85807 fix: remove deprecated zone API usage in testability
Closes #5084
2015-11-07 00:13:29 +00:00
6133f2c08b fix(compiler): don’t lowercase attributes to support svg
This reverts commit b89c5bc581 and adds an additional test.

Closes #5166
2015-11-06 13:04:08 -08:00
63e853dcd7 feat(change_detect): Guard checkNoChanges behind assertionsEnabled
Always generate `checkNoChanges` tests, but guard them behind
`assertionsEnabled` tests.

Closes #4560
2015-11-06 11:59:03 -08:00
2d0c8f1b0e fix(NgFor): allow default templates with ng-for-template
Closes #5161
2015-11-06 19:26:02 +00:00
c6ad269f43 chore(build): remove es5build.js
Fixes #5030

Closes #5144
2015-11-06 18:22:57 +00:00
a0a627f2f9 refactor(StringWrapper): remove useless methods
Closes #5039
2015-11-06 17:04:01 +00:00
c5693f07dc chore(browserstack): use patched karma launcher
closes #5142
2015-11-06 11:11:10 +01:00
253e2b2285 refactor(router): don't import public APIs from internal paths
Closes #5139
2015-11-06 07:57:35 +00:00
aa70275b01 chore(tests): Enable dev mode in all Angular tests.
Closes #5106
2015-11-06 07:07:04 +00:00
0b11051ac1 fix(material): Disable md-grid-list tests until #5132 is fixed. 2015-11-06 07:07:04 +00:00
4bb9c46cf1 fix(core): Provide setDevMode() to enable/disable development mode in Javascript. 2015-11-06 07:07:04 +00:00
7343ef04ae feat(forms): remove controlsErrors
BREAKING CHANGE

Previously, the controlsErrors getter of ControlGroup and ControlArray returned the errors of their direct children. This was confusing because the result did not include the errors of nested children (ControlGroup -> ControlGroup -> Control). Making controlsErrors to include such errors would require inventing some custom serialization format, which applications would have to understand.

Since controlsErrors was just a convenience method, and it was causing confusing, we are removing it. If you want to get the errors of the whole form serialized into a single object, you can manually traverse the form and accumulate the errors. This way you have more control over how the errors are serialized.

Closes #5102
2015-11-06 01:47:37 +00:00
4439106a1f feat(facade): add support for async validators returning observables
Closes #5032
2015-11-06 01:20:03 +00:00
2c201d3f34 feat(facade): add a way to convert observables into promises 2015-11-06 01:20:03 +00:00
fc50829481 feat(facade): add a way to detect if an object is a Promise 2015-11-06 01:20:03 +00:00
695923dcd6 refactor(core): move directives, pipes, and forms into common
BREAKING CHANGE

All private exports from 'angular2/src/core/{directives,pipes,forms}' should be replaced with 'angular2/src/common/{directives,pipes,formis}'

Closes #5153
2015-11-05 23:00:32 +00:00
6edd964a83 chore(core): move compiler out of core
BREAKING CHANGE

All imports from 'angular2/core/compiler' should be changed to 'angular2/compiler'.
2015-11-05 14:44:52 -08:00
f39bbff7bc build(ci): turn on debugging output for ci scripts
Closes #5018
2015-11-05 21:02:42 +00:00
b354b79b50 build(npm): cleanup + update npm dependencies + reshrinkwrap
In the previous commit I removed unused dependencies from package.json, but in order for the change to take
effect I needed to update npm shrinkwrap as well. That got complicated because of how npm dedupes packages.

Long story short, to clean up the mess I did the following:
- deleted npm-shrinkwrap.json and npm-shrinkwrap.clean.json
- ran: npm install
- ran: npm shrinkwrap --dev && ./tools/npm/clean-npm-shrinkwrap

This means that our npm-shrinkwrap now correctly reflects the constraints in package.json, but it also
means that some packages got updated (within the version constrain specified in package.json).

Some dependencies were intentionally not updated. e.g. mudge due to #5022
2015-11-05 21:02:42 +00:00
bcfb0732f9 build(npm): lock systemjs at 0.18.10 due to regressions in future versions
otherwise in dist/js/dev/es5/benchmarks/src/naive_infinite_scroll/index.html
defaultExtension: 'js' is ignored for angular2/src/testing/benchmark_util which
results in test failures.

We'll need to investigate this. Maybe upgrading to 0.19.x will make this issue go
away...
2015-11-05 21:02:42 +00:00
febcde99fa build(npm): bump gulp-clang-format to ^1.0.23
This is due to https://github.com/angular/gulp-clang-format/issues/7
2015-11-05 21:02:42 +00:00
0fbbce7a43 build(npm): freeze madge at 0.5.0 due to #5022 2015-11-05 21:02:42 +00:00
a98c27d974 build(npm): update all gulp-* dependencies 2015-11-05 21:02:42 +00:00
ca3391525e build(npm): remove unused npm dependencies 2015-11-05 21:02:42 +00:00
a8f45a6b43 SQUASH ME! Unit test updates.
Kept separate since these are mostly mechanical changes.
2015-11-05 12:19:27 -08:00
9d0b61bad5 feat(dart/transform): Simplify dependency imports
Store dependency import information in a dedicated list in `NgDepsModel`
rather than as a boolean field on `ImportModel`. An `ImportModel` should
not "care" whether it is a .ng_deps.dart import or not -- this
information belongs in `NgDepsModel`.

This simplifies some of the logic around how `NgDepsModel` imports are
processed and eventually output.
2015-11-05 12:19:27 -08:00
f21e78244f feat(forms): Use the DefaultValueAccessor for controls with an ng-default-control attribute.
Third party controls require a ControlValueAccessor to function with Angular Forms. Many of them, like Polymer's <paper-input>, behave like the <input> native element and thus can use the DefaultValueAccessor. Adding an ng-default-control attribute will now allow them to use that directive.

Closes #5076
2015-11-05 19:53:46 +00:00
fee5dea826 fix(forms): Export the NG_VALUE_ACCESSOR binding token.
This is needed to allow component authors to implement custom ControlValueAccessors for their input components.
2015-11-05 19:53:46 +00:00
b84855f394 refactor: private methods should not be decorated with internal
Closes #5146
2015-11-05 19:28:30 +00:00
7e92d2e6b7 feat(ChangeDetector): Add support for short-circuiting 2015-11-05 19:28:30 +00:00
b91351469f refactor(ChangeDetector): misc minor updates 2015-11-05 19:28:30 +00:00
c56efc0c5f refactor(ChangeDetector): use View/ShadowDom & Content/LightDom consistently 2015-11-05 19:28:30 +00:00
5d9b1e90dc refactor(dart/transform): Separate log & zone code
- Move zone-related code out of logger.dart and into zone.dart.
- Rename `logger` => `log`.
- Add the ability to specify a zone-local `TemplateCompiler`.
2015-11-05 10:24:36 -08:00
4909feddde feat(core): add support for ambient directives to dart transformers
Closes #5129
2015-11-05 17:26:57 +00:00
adc0e32cff refactor(examples): update the Zippy example to rely on ambient directives 2015-11-05 17:26:57 +00:00
c70e07fd1f build(browserstack): add a Gulp task to use Browser Stack locally
Closes #5116
2015-11-05 15:53:04 +01:00
f54ba3cc1b docs(query_list): update highlight language
Closes #5029
2015-11-05 08:55:25 +00:00
f1989e7e1c fix(compiler): remove style when [style.foo]='exp' evaluates to null
Fixes #5110

Closes #5114
2015-11-05 06:50:46 +00:00
a69e7fe297 fix(RouterLink): do not prevent default behavior if target set on anchor element
If the anchor element on which the "router-link" directive is present has a target
attribute other than "_self," the handler will not prevent default behavior of
the browser.

Closes #4233
Closes #5082
2015-11-04 19:55:46 +00:00
a9b1270a5a fix(http): use Observable<Response> on Http methods
use correct type definitions for Http responses.

Closes #5017
2015-11-04 19:19:50 +00:00
31687efd64 fix(http): use Response for JSONP errors
Return Response when JSONP backend errors
2015-11-04 19:19:50 +00:00
69e4b62809 docs(onDestroy): fix broken backticks
Closes #5089
2015-11-04 17:51:32 +00:00
fd92dc0701 build(browserstack): add all supported browsers
Closes #5096
2015-11-04 09:49:43 +01:00
c9a3ba0f48 refactor(dart/transform): Remove generate_change_detectors
The template compiler update removed the option to run the transformer
without generating change detectors and deprecated the
`generate_change_detectors` transformer parameter.

Now that it has been deprecated for several weeks, remove it from the
transformer code.

Forward `reflectPropertiesAsAttributes` => `reflect_properties_as_attributes`
and add a deprecation warning to `reflectPropertiesAsAttributes`.

Closes #4433
2015-11-03 16:40:08 -08:00
d0c65c144a for fixup - keep RootTestComponent around, but deprecate 2015-11-03 14:56:23 -08:00
686457890d chore(test): rename RootTestComponent to ComponentFixture
BREAKING CHANGE:

Before:

```
testComponentBuilder.createAsync(MyComponent).then(root: RootTestComponent => {
}
```

After:

```
testComponentBuilder.createAsync(MyComponent).then(fixture: ComponentFixture => {
}
```

Closes #4711
2015-11-03 14:56:22 -08:00
a16214c614 chore(test): failures in browsers which do no support Symbol.iterator
Closes #5069
2015-11-03 21:27:16 +00:00
c262bda1d3 chore(build): don't create unused folders for npm distribution
Related to 5f2eb3e and 0931195

Closes #5098
2015-11-03 21:01:48 +00:00
62402457a2 fix(playground): fix the inbox example 2015-11-03 11:16:18 -08:00
5948abab7a feat(core): add support for ambient directives
Ambient directives can be configured when bootstraping an application.
Ambient directives can be used in every component of the application without
needing to explicitly list them.
2015-11-03 07:54:29 -08:00
0931195695 chore(build): more clean up for legacy typings bundle creation
Related to 5f2eb3e078

Closes #5091
2015-11-03 14:56:13 +00:00
2cc6927d1a chore(bundles): unify workflow for router bundles
Closes #5068
2015-11-03 08:31:45 +00:00
bff9dc26c7 chore(bundles): don't duplicate reflect-metadata in http bundle
Since HTTP can't be used on its own there is no reason for duplicating
reflect-metadata in the http bundle
2015-11-03 08:31:44 +00:00
2f047887d3 chore(bundles): unify padding with dependencies 2015-11-03 08:31:44 +00:00
9220b0bbc1 chore(bundles): unify router bundles creation with other bundles 2015-11-03 08:31:44 +00:00
16bc238f10 feat(core): make transformers handle @Input/@Output/@HostBinding/@HostListener
Closes #5080
2015-11-03 00:46:54 +00:00
045919b595 refactor(playground): update Zippy to use @Input and @Output 2015-11-03 00:46:54 +00:00
6f1a89e3a9 refactor(playground): update the order management example to use the recommended APIs 2015-11-03 00:46:54 +00:00
134c6f57d5 refactor(playground): update Zippy to use @Input and @Output 2015-11-03 00:46:54 +00:00
bf07f9c3e1 refactor(playground): update the order management example to use the recommended APIs 2015-11-03 00:46:54 +00:00
c814dfbfa5 fix: remove internal usages of deprecated overrideOnTurnDone
Closes #5079
2015-11-02 23:46:20 +00:00
8dc079eee5 docs: add @Input/@Output to deprecation messages 2015-11-02 14:48:23 -08:00
c4129071ef docs(metadata): provide deprecation messages 2015-11-02 14:48:22 -08:00
37c65b74e3 chore: fix incremental test.unit.dart
Always pass the global typings to ts2dart, independent of the result of the riffing

Closes #4881

Closes #5070
2015-11-02 20:46:27 +00:00
1c322f13e5 feat(forms): update FormBuilder to support async validations
Closes #5020
2015-11-02 18:03:03 +00:00
31c12af81f feat(forms): add support for adding async validators via template
Example:

@Directive({
  selector: '[uniq-login-validator]',
  providers: [provide(NG_ASYNC_VALIDATORS, {useExisting: UniqLoginValidator, multi: true})]
})
class UniqLoginValidator implements Validator {
  validate(c) { return someFunctionReturningPromiseOrObservable(); }
}
2015-11-02 18:03:03 +00:00
cf449ddaa9 feat(forms): implements a combinator for composing async validators 2015-11-02 18:03:02 +00:00
53bd6e1642 feat(facade): add ObservableWrapper.fromPromise 2015-11-02 18:03:02 +00:00
d6e7a51d9c chore(build): npm install fails on Windows after analytics feat
Closes #5055
2015-11-02 10:28:47 +01:00
13447e3198 build(browserstack): initial setup
Closes #4941
2015-11-01 23:22:40 +01:00
84fe0c9d3e build(browserstack): add npm dependencies 2015-11-01 23:21:15 +01:00
1b78342e23 chore(ngUpgrade): Move into Angular2
This is moving ngUpgrade into the main repository per #4838.
The ngUpgrade is published from the main import consistent with
https://docs.google.com/document/d/1rbVTKTYLz6p2smQNYI8h4-QN-m2PS6F3iQIDmSzn0Ww/edit#heading=h.6cxvr9awtf5r
Closes #4931
2015-10-31 20:48:27 -07:00
54f7e62c43 chore(travis): upload dist folder anytime the js and dart builds succeed
Closes #5033
2015-10-31 04:29:48 +00:00
0ebe283b37 feat(router): provide RouteConfig object for AuxRoute
Closes #4319
2015-10-30 17:26:12 -07:00
23784a2eca fix(router): properly serialize aux routes
Previously, routes would be generated with a leading slash after the parens:

    example.com/foo(/bar)

This fix removes the trailing slash when generating the URL, so now we have:

    example.com/foo(bar)

This change is not breaking because we still recognize both forms. We just normalize
without the slash.
2015-10-30 17:26:12 -07:00
d8775e0e1f fix(shadow_css): strip comments and fix logic for parsing rules.
Closes #5037
Closes #5011
2015-10-30 16:28:26 -07:00
53bddec1d2 fix(router): respond to hashchange events
Previously if the URL changed in `HashLocation` mode, the router would not pick up the change.
This adds a listener in `HashLocationStrategy` for `hashchange` events to fix the problem.

Closes #5013
2015-10-30 15:04:31 -07:00
cb2b690471 chore(examples): explain the purpose of these examples 2015-10-30 14:27:47 -07:00
7d154e38d1 chore(gulp): rename serve/examples to serve/playground 2015-10-30 14:27:47 -07:00
78875d57c8 chore(typings): add router_spec to test.typings
Closes #4651
2015-10-30 20:28:56 +00:00
45b33c5a90 perf(dart/transform): Restrict visibility/mutability of codegen
For exported, generated templates, declare with `final` so `dart2js`
knows they will never be reassigned.

For non-exported, generated change detector classes, prefix the
classname with `_` to mark them as internal.

Closes #5009
2015-10-30 17:49:06 +00:00
860e88c5be docs(Http): add type annotations to clarify API
IMHO this tiny example is easier to read when some type annotations are added and the parameter names are more concise.

Closes #4614
2015-10-30 05:11:59 +00:00
ebd15a7855 chore(http): assert that url is present when creating new Request
Closes #4650
2015-10-30 04:52:40 +00:00
1dc8a0a95d fix(build): EMFILE error on Windows when executing JS unit tests
Fixes #4525

Closes #4796
2015-10-30 04:45:35 +00:00
fa44da16c8 refactor(linker): Expose ViewResolver to public api
Fixes https://github.com/angular/angular/issues/4780

Closes #4789
2015-10-29 21:21:04 -07:00
56e736439b fix(analyzer): fix dart analyzer errors
Closes #4992
2015-10-30 01:10:36 +00:00
9d58f46ea5 fix(forms): update compose to handle null validators 2015-10-30 01:10:36 +00:00
bb2b961f93 feat(forms): add support for async validations 2015-10-30 01:10:36 +00:00
39626a944d fix(ng-content): wildcard ng-content has to go last.
This was the case before the new compiler landed and should be preserved. 

Related to #4598
Closes #5016
2015-10-29 16:51:16 -07:00
d1b54d6807 fix(core): Add an error state for ChangeDetectors that is set when bindings or lifecycle events throw exceptions and prevents further detection.
- Changes the `alreadyChecked` flag of AbstractChangeDetector to a new `state` flag.
- Changes all checks of alreadyChecked to check that the state is NeverChecked.
- Set state to Errored if an error is thrown during detection.
- Skip change detection for a detector and its children when the state is Errored.
- Add a test to validate this fixes issue #4323.

Closes #4953
2015-10-29 23:11:02 +00:00
c930a533d1 chore(build): add RxJS to typings spec
Closes #4893
2015-10-29 23:06:16 +00:00
389ed2d941 refactor(async): fix ObservableWrapper.isObservable
Makes ObservableWrapper and AsyncPipe work with Observable, Subject, and EventEmitter
2015-10-29 23:06:16 +00:00
0378e55fab chore(package): update RxJS version 2015-10-29 23:06:16 +00:00
ca3986f31d refactor(async): refactor EventEmitter
Refactor EventEmitter and Async Facade to match ES7 Observable semantics, properly use RxJS typedefs, make EventEmitter inherit from RxJS Subject. Closes #4149.

BREAKING CHANGE:
- consumers of EventEmitter no longer need to call .toRx()
- EventEmitter is now generic and requires a type - e.g. `EventEmitter<string>`
- EventEmitter and Observable now use the `.subscribe(generatorOrNext, error, complete)` method instead of `.observer(generator)`
- ObservableWrapper uses `callNext/callError/callComplete` instead of `callNext/callThrow/callReturn`
2015-10-29 23:06:16 +00:00
72e65d6797 refactor(core): Move LifeCycle functionality into ApplicationRef.
BREAKING CHANGE:

Before: constructor(@Inject(LifeCycle) lifecycle) { lifecycle.tick(); }
After: constructor(@Inject(ApplicationRef) appRef) { appRef.tick(); }

Closes #5008
2015-10-29 22:28:30 +00:00
ef23fe66a0 docs(forms): Document the rest of the forms module.
Closes #4437
2015-10-29 22:26:07 +00:00
993b3d62de refactor(compiler): don’t rely on external css parser
We used to use different external css parsers,
depending on the `DomAdapter`. This lead to
inconsistent behavior and environment specific errors.

Closes #5006
Closes #4993
2015-10-29 15:09:39 -07:00
5f2eb3e078 chore(dgeni): clean up legacy typings bundle creation
Fixes #4967

Closes #4991
2015-10-29 21:19:59 +00:00
c17c33ca14 docs(router): Updated example for hash location strategy
Closes #5010
2015-10-29 20:52:03 +00:00
a87c5d989c fix(dart/transform): Gracefully handle empty .ng_meta.json files
Fix the `template_compiler` step to gracefully handle null & empty
.ng_meta.json files.
2015-10-29 11:29:04 -07:00
7d83959be5 refactor(router): rename "as" to "name" in RouteConfig
BREAKING CHANGE:

This is a rename to make routing concepts easier to understand.

Before:

```
@RouteConfig([
  { path: '/', component: MyCmp, as: 'Home' }
])
```

After:

```
@RouteConfig([
  { path: '/', component: MyCmp, name: 'Home' }
])
```

Closes #4622

Closes #4896
2015-10-29 10:52:55 -07:00
cc37d0a7fa chore(router): use new provide API in examples 2015-10-29 10:52:54 -07:00
6b40293c0a refactor(dart/transform): Run ReflectionRemover after codegen phases
Move the `ReflectionRemover` phase to execute after the codegen phases.
2015-10-29 09:53:09 -07:00
eba70736f1 fix(WebWorker): Fix bug causing multi browser demo to crash
Closes #4839
2015-10-29 16:40:28 +00:00
e37799a2a5 fix(test): Android browser does not support calc() a CSS unit value
Closes #5001
2015-10-29 16:32:21 +00:00
c4964e7c9b fix(test): "integration tests svg should support svg elements" fails in non-Chrome browsers
Fixes #4987

Closes #5000
2015-10-29 16:03:15 +00:00
6815acea32 chore(vscode): add jsconfig.json and remove .settings dir
VSCode recognizes jsconfig.json for es6 code in the same way as it recognizes tsconfig.json for ts code.

Closes #4955
2015-10-29 13:53:21 +00:00
b329a58416 build(analytics): track TRAVIS_JOB_NUMBER as a custom dimension 2015-10-29 13:53:21 +00:00
df13e0a581 build(analytics): add basic ci job tracking 2015-10-29 13:53:21 +00:00
ae7f76e91f build(analytics): add support for tracking npm installs
Since the very first npm install is called while node_modules is empty, we need to ignore it, but we can track
the start timestamp and record the install even once the installation is completed.
2015-10-29 13:53:21 +00:00
edd4b93589 refactor(router): use relative imports
Closes #4940
2015-10-29 04:24:13 +00:00
97c60ed3f3 docs(web_workers): Correct typo
Typo in code block on line 229 : "angukar2" -> "angular2"

Closes #4286
2015-10-29 04:09:19 +00:00
35328015b8 chore(build): Avoid publishing dart files to NPM repo
closes #3469

Closes #3964
2015-10-29 04:05:55 +00:00
28be0a59cf docs(application_common): fixes typo and improves docs for bootstrap
Closes #4312
2015-10-29 04:04:10 +00:00
8485ef9230 fix(WebWorker): Don't send messages when the buffer is empty
Closes #4138
2015-10-29 04:00:04 +00:00
1de2d29f96 typo(directives): Fixed the mistake of leading number
The leading number with a dot and space in the Markdown will be compiled to `ol > li`.

The `4 and 6. ` in the docs mistakenly add a new line before the `6. ` cause a misunderstand by the markdown engine.

Closes #4664
2015-10-29 03:39:44 +00:00
0abd218eed docs(core): Document NgFor.
Closes #4533
2015-10-29 03:26:42 +00:00
7f806f7687 refactor: remove useless imports
Closes #4426
2015-10-29 02:49:08 +00:00
e6a721d179 chore(changelog): update change log to alpha-45 2015-10-28 19:03:55 -07:00
e47a9d9644 chore: bump version to 2.0.0-alpha.45 2015-10-28 19:03:55 -07:00
7677dc976e refactor(Pipes): integrate review feedback
Closes #4947
2015-10-29 00:50:52 +00:00
e7f9924b18 style: clang format the code 2015-10-29 00:50:52 +00:00
40586152d1 test(Pipes): assert Date, Json & Slice are non pure 2015-10-29 00:50:52 +00:00
2f1f83a186 fix(Pipes): mark date & slice as non-pure 2015-10-29 00:50:52 +00:00
7ba426c3e6 fix(Pipe): pure is an optional argument 2015-10-29 00:50:52 +00:00
fc016b59dc fix(JsonPipe): marks json pipe as not pure Marked json pipe as not pure so that it runs all the time, reflecting changes on the object.
Closes #4821
2015-10-29 00:50:51 +00:00
e1337dc325 cleanup(forms): minor cleanup
Closes #4778
2015-10-29 00:02:01 +00:00
534db7fe2b cleanup(forms): marks abstract classes as abstract 2015-10-29 00:02:01 +00:00
547e011abe feat(forms): add support for Validator
Currently, the only way for a directive to export a validator is by providing a function. This makes it ackward to write validators that depend on directive inputs. In addition to supporting functions as validators, classes implementing the Validator interface are supported too.
2015-10-29 00:02:01 +00:00
9c63a471bb docs(http): use http.request(FOO) instead of http(FOO)
Closes #4641
2015-10-28 16:22:32 -07:00
127d6b6441 fix(benchpress): increase sampling frequency
The previous sampling frequency didn't capture fast events 100% of the time, causing flakes.
Closes #4985
2015-10-28 22:47:24 +00:00
098201d0b8 fix(lint): enforce that module-private members have @internal.
This is needed to prevent leaking internal APIs to users via our published .d.ts typings.
Fixes #4645

Closes #4989
2015-10-28 22:14:48 +00:00
44188b9072 chore(typings): mark underscore-prefix members @internal
I still haven't made a tslint check for this, so new occurrences leaked in.
See https://github.com/angular/angular/issues/4645

Closes #4986
2015-10-28 21:27:34 +00:00
53fe0fa192 Fix changelog before\after sample
display correctly `feat(core): remove the (^ syntax and make all DOM events bubbling` sample

Closes #4491
2015-10-28 20:29:30 +00:00
e3c9397717 docs(element_injector): fix comment for ElementInjectorDynamicStrategy
Closes #4414
2015-10-28 20:29:05 +00:00
bc10dc3ed0 fix(benchmarks): update react and polymer benchmarks and get tree update numbers for all of the benchmarks as well.
Closes #4709
2015-10-28 13:17:01 -07:00
5c48236f61 fix(lang): avoid infinite loop when calling assert()
The current code doesn't function properly:
- assert are never activated
- even if activated would result in infinite loop

Since the code is broken and blocks other use-cases
this commit turns assert into noop. A proper solution
for asserts will be part of #2830

Fixes #4981

Closes #4983
2015-10-28 19:12:28 +00:00
c90e1920f5 chore(tslint): disallow variable names that look like keywords.
We've had issues such as the one I documented: https://github.com/Microsoft/TypeScript/issues/5187
This tslint check prevents this happening again.
This change also updates to the newest tslint which gets typings from npm.

Closes #4970
2015-10-28 18:31:21 +00:00
25ddd8718d feat(forms): Export NumberValueAccessor
Export `NumberValueAccessor` from `forms/directives.ts`
2015-10-28 10:36:18 -07:00
3ed9796425 docs(SlicePipe): fix ng-for example
Closes #4975
2015-10-28 15:54:47 +00:00
bdd031aecc feat(dart/transform): Match runtime semantics for template values
Match [ViewResolver][]'s semantics for reading template and style values
from `@Component` and `@View` annotations.

We now warn if template and/or style values appear on an `@Component`
annotation and a `@View` annotation is present.

[ViewResolver]: 7c6130c2c5/modules/angular2/src/core/linker/view_resolver.ts
2015-10-28 08:18:56 -07:00
798be2776d refactor(dart/transform): Rename dumbEval to naiveEval 2015-10-28 08:18:56 -07:00
d69bd021ee refactor(dart/transform): Fix potential import collision
Previously, importing a library twice using different prefixes could
cause the template compiler step to incorrect omit `Directive`
dependencies provided by that library.
2015-10-28 08:18:56 -07:00
26044026c9 feat(dart/transform): Parse directives dependencies from the Dart ast
Previously, we parsed dependencies out of a the stringified value of
`directives`, which is brittle and error-prone.

Move this parsing into `DirectiveProcessor` where we have the full Dart
ast to help.
2015-10-28 08:18:56 -07:00
ca5e31bc77 feat(dart/transform): Avoid overwriting assets
For easier debugging, avoid overwriting assets in Dart transform steps
where possible.
2015-10-28 08:18:56 -07:00
e9c4c61986 refactor(dart/transform): Have DeferredRewriter run in parallel
Previously, `DeferredRewriter` checked for the existence of
`.ng_deps.dart` files to determine which deferred libraries it needed to
rewrite, requiring that those assets exist at the time it was run.

Update to check for `.ng_meta.json` files instead, which exist after the
`DirectiveProcessor` phase. This allows the `DeferredRewriter` (which
only processes *.dart files) to run in
parallel with `TemplateComplier` (which only processes *.ng_meta.json
files) and `StylesheetCompiler` (which only processes *.css files).

Have DeferredRewriter to check existence of .ng_meta.json assets rather than .ng_deps.dart assets
2015-10-28 08:18:56 -07:00
563a76304a refactor(dart/transform): Delete unused bind_generator
All getters & setters generated by `bind_generator` are now generated in
the `directive_processor` or `template_compiler` stage.
2015-10-28 08:18:56 -07:00
c91fc49d01 test(dart/transform): Update tests for new codegen
Update unit tests for `bind_generator` responsibility move.
2015-10-28 08:18:56 -07:00
a18358d484 refactor(dart/transform): Fold bind_generator into other phases
Update `DirectiveProcessor` and `TemplateCompiler` to generate the
getters, setters, and methods currently generated in `BindGenerator`.

Update `DirectiveMetadataLinker` to output `.ng_meta.json` files instead
of `.ng_deps.dart` files, avoiding full codegen until the last phase.

This allows us to dedupe codegen logic and remove an additional phase
from the transformer.
2015-10-28 08:18:56 -07:00
d68955ac6d feat(dart/transform): Add getters, setters, methods to NgDepsModel
Add `List<String>` `getters`, `setters`, and `methods`, which will be
used to generate code that registers those closures with the reflection
system.
2015-10-28 08:18:56 -07:00
b318945680 refactor(dart/transform): Create common dumbEval function 2015-10-28 08:18:56 -07:00
150d3686c3 refactor(dart/transform): Remove unused test files
Remove directive_metadata_linker test files which are no longer used as
of 820b30c181.
2015-10-28 08:18:56 -07:00
f9963d3d21 refactor(di): minor cleanup 2015-10-28 07:32:40 -07:00
6514b8ced0 fix(di): allow dependencies as flat array 2015-10-28 07:32:40 -07:00
c02f2bdab0 chore: adjust formatting to new clang-format.
- fixes wrapping for object literal keys called `template`.
- spacing in destructuring expressions.
- changes to keep trailing return types of functions closer to their
  function declaration.
- better formatting of string literals.

Closes #4828
2015-10-28 11:19:10 +01:00
4a1b873fad feat: upgrade clang-format to 1.0.32. 2015-10-28 08:43:14 +01:00
edfa35b11d fix(facades): reduce node count by 1 in assertionsEnabled 2015-10-27 23:14:52 -07:00
a881f09b77 chore(typings): don't expose es6-shim typing.
Also clean up unused typings generation; we publish the node tree, not browser tree.
Fixes #4882

Closes #4928
2015-10-28 04:24:50 +00:00
137549d010 chore(changelog): add link to the issue that gives more info about the release
closes #4767

Closes #4966
2015-10-28 02:18:15 +00:00
5fc28e65ef docs(provider): fix formatting
Closes #4957
2015-10-28 01:42:10 +00:00
1316c3e391 fix(ChangeDetector): support for NaN
Closes #4853
2015-10-28 00:44:06 +00:00
758062807a feat(forms): support adding validators to ControlGroup via template
Closes #4954
2015-10-28 00:13:20 +00:00
f98faf0702 refactor(forms): make Validators.group and Validators.array private 2015-10-28 00:13:20 +00:00
42ea31b993 docs(QueryMetadata): fix wrong selectors and improve syntax highlighting
closes #4544

Closes #4958
2015-10-27 23:39:58 +00:00
fdbb505a8a docs(di): fix SelfMetadata example
closes #4580
2015-10-27 23:39:58 +00:00
61e514bf77 docs(Http): fix parameter name
closes #4613
2015-10-27 23:39:58 +00:00
7478105178 docs(PipeTransform): added pure parameter
closes #4667

The documentation was outdated since alpha 38 when the `pure` parameter
was added to the `PipeMetadata`.
2015-10-27 23:39:58 +00:00
540b8c2a1a fix(renderer): support xlink:href attribute in svg
Closes #4956
2015-10-27 16:22:32 -07:00
dc6a066fed refactor(application): rename Binding into Provider
while creating the server version I noticed bindings are still
mentioned

Closes #4951
2015-10-27 22:39:22 +00:00
ac52bfd80f fix(render): create svg elements with the right namespace
Temporary fix for #4506
Closes #4949
2015-10-27 14:45:00 -07:00
27dbd2ded4 fix(compiler): load style urls in runtime mode correctly
Closes #4952
2015-10-27 14:31:21 -07:00
ed4826b08c feat(forms): Implement a way to manually set errors on a control
Example:

var login = new Control("someLogin");
c.setErrors({"notUnique": true});
expect(c.valid).toEqual(false);
expect(c.errors).toEqual({"notUnique": true});

c.updateValue("newLogin");
expect(c.valid).toEqual(true);

BREAKING CHANGE:

Before:

ControlGroup.errors and ControlArray.errors returned a reduced value of their children controls' errors.

After:

ControlGroup.errors and ControlArray.errors return the errors of the group and array.
And ControlGroup.controlsErrors and ControlArray.controlsErrors return the reduce value of their children controls' errors.

Closes #4917
2015-10-27 19:31:25 +00:00
689ded5c47 doc(web_workers): fixes some typos and adjusts formatting
Closes #4425
2015-10-27 11:31:23 -07:00
cd219b92a2 docs: edit DART_TOOLS.md
Add more info about reflector, and copyedit other sections.

Closes #4422
2015-10-27 17:58:33 +00:00
a31b2175dc chore(gulpfile): fix link to clang formatting
Seems like the anchor tag wasn't updated here.

Closes #4410
2015-10-27 09:59:52 -07:00
b87da8f47c refactor(router): RouteData as a type
BREAKING CHANGE

The ROUTE_DATA token has been removed and replaced with a type RouteData,
allowing a type injection like we do with RouteParams.

Before:

    constructor(routeParams: RouteParams, @Inject(ROUTE_DATA) routeData) {
      let id = routeParams.get('id');
      let name = ROUTE_DATA.name;
    }

After:

    constructor(routeParams: RouteParams, routeData: RouteData) {
      let id = routeParams.get('id');
      let name = routeData.get('name');
    }

Fixes #4392

Closes #4428
2015-10-27 14:23:44 +00:00
fbe748f273 build(node): update node from 4.1.1 to 4.2.1
This is just a maintenance upgrade to keep us close to the latest release.

No known bugs are being fixed by this upgrade.

I also removed the npm override in .travis.yaml since node 4 ships with a recent version of npm
and usually this version is preferred (it might contain custom patches).

Closes #4939
2015-10-27 14:15:54 +00:00
4fe17923cf docs(router): move examples into own file and add tests
Closes #4620
2015-10-27 14:12:56 +00:00
f59adf3fd7 chore(karma): exclude e2e examples from unit tests 2015-10-27 14:12:55 +00:00
14f8bcc40a chore(package): bump reflect-metadata version
Closes #4885
2015-10-27 13:34:41 +00:00
bfe3efab3b chore(compiler): dead code clean-up.
Dead code that uglifyJS found.

Closes #4907
2015-10-27 12:00:44 +00:00
ea6b316932 build(gulp): rename angularBuilder.mock to angularBuilder.uninitialized to prevent confusion with testing mocks
Closes #4936
2015-10-27 11:34:39 +00:00
ef7050892e build(gulp): don't exit prematurely during cleanup
Before this change we would exit while there were cleanup micro tasks scheduled for executions,
this caused tmp files to be left over and consume a lot of space.

Fixes #4441
2015-10-27 11:34:39 +00:00
94274049d4 chore(saucelabs): update to Safari 9
Closes #4927
2015-10-27 11:34:24 +00:00
2a3e11d32d fix(router): respect LocationStrategy when constructing hrefs in links
Note that this introduces more behavior for LocationStrategy which needs
yet more refactoring to test. See #4935.

Closes #4333
2015-10-27 10:45:49 +00:00
280cd33f2e fix(router): fix error message text 2015-10-27 10:09:15 +00:00
07cdc2ff44 feat(router): add support for route links with no leading slash
Closes #4623
2015-10-27 09:01:16 +00:00
7af27f9617 chore(test): bump jasmine timeout to 500ms 2015-10-27 09:01:15 +00:00
9f8043e51e chore(build): update node version in .nvmrc file
The node version was updated in DEVELOPER.md due to #4527,
but nvm still uses v0.12 if not specified otherwise.
Update .nvmrc file to v4.2, which is the last node version.

Closes #4894
2015-10-27 04:30:32 +00:00
391a6fbc2a docs(developer.md): add PUB_CACHE variable to setup instructions
If PUB_CACHE is not set the pub dependencies are downloaded to a default
folder during the build because `gulp build` also runs `pub get`.

Running the tests locally PUB_CACHE is set to a subdirectory of the SDK
 when the `env_dart.sh` script is sourced.

Therefore `build/pubbuild.dart` fails as it can't find the dependencies.

Closes #4900
2015-10-27 03:41:50 +00:00
3416984cce refactor(RuntimeMetadataResolver): simplify the code
Closes #4874
2015-10-27 01:16:46 +00:00
abdd524911 refactor(RuntimeMetadata): Annotation -> Metadata 2015-10-27 01:16:46 +00:00
e1e52c098b refactor(Compiler): misc minor updates 2015-10-27 01:16:46 +00:00
dd2598ccd8 refactor: use ListWrapper.find() 2015-10-27 01:16:46 +00:00
b90d899408 doc(DynamicComponentLoader): update API doc 2015-10-27 01:16:46 +00:00
d8b3601927 fix(style_url_resolver): include asset: urls into precompiled stylesheets.
Closes #4926
2015-10-26 17:19:33 -07:00
60bedb43de fix(debug_element): don’t descend into merged embedded views on componentChildren.
Closes #4920
2015-10-26 16:39:49 -07:00
c5f490ba43 chore(forms): deprecate the old Query API
The old API has been replaced with ContentChildren and ViewChildren.

Closes #4922
2015-10-26 22:47:37 +00:00
2e059dc916 feat(router): Make RootRouter disposable to allow cleanup of Location subscription. ROUTER_PROVIDERS now automatically disposes of the RootRouter when the application is disposed.
Closes #4915
2015-10-26 21:35:18 +00:00
2674eaca51 feat(router): Support unsubscription from Location by returning the subscription. 2015-10-26 21:35:18 +00:00
8dd3082ea3 feat(core): PlatformRef and ApplicationRef support registration of disposal functions.
These functions will be called whenever the platform or application are being disposed.
2015-10-26 21:35:18 +00:00
b2dc5c2c7e fix(compiler): create literal property bindings for empty *… directives.
Closes #4916
2015-10-26 13:55:34 -07:00
2957b0b32e fix(ng_class): support sets correctly
Previously, NgClass threw in Dart checked mode.

Closes #4910
2015-10-26 13:37:33 -07:00
28db864690 cleanup(forms): add missing tests 2015-10-26 11:50:30 -07:00
28d88c5b12 feat(validators): Allow errors at both the group/array level or their children
Allow ControlGroups and ControlArrays to contain errors from their level, and
errors from their children. [Design Doc](https://docs.google.com/document/d/1EnJ3-_iFpVKFz1ifN1LkXSGQ7h3A72OQGry2g8eo7IA/edit?pli=1#heading=h.j53rt81eegm4)

BREAKING CHANGE: errors format has changed from validators. Now errors from
a control or an array's children are prefixed with 'controls' while errors
from the object itself are left at the root level.
Example:
Given a Control group as follows:
var group = new ControlGroup({
  login: new Control("", required),
  password: new Control("", required),
  passwordConfirm: new Control("", required)
});

Before:
group.errors

{
  login: {required: true},
  password: {required: true},
  passwordConfirm: {required: true},
}

After:
group.errors

{
  controls: {
    login: {required: true},
    password: {required: true},
    passwordConfirm: {required: true},
  }
}
2015-10-26 11:48:32 -07:00
c9fba3fa1f feat(validators): Add a pending state to AbstractControl
Add a pending state to AbstractControl and a function to set that state on
themselves and their parents. This will be used for both individual async
validators and when the imperitive mode is used. [Design Doc](https://docs.google.com/document/d/1EnJ3-_iFpVKFz1ifN1LkXSGQ7h3A72OQGry2g8eo7IA/edit?pli=1#heading=h.j53rt81eegm4)
2015-10-26 11:48:32 -07:00
04b4035ecd refactor(AppViewListener): prefix listener with on for consistency
Closes #3925
2015-10-26 18:28:27 +00:00
608cdc4077 cleanup(forms): clean up NgFormControl
Closes #4912
2015-10-26 18:15:58 +00:00
d29a9a99aa fix(forms): handle control change in NgFormControl
when a new Control instance is bound to the directive, use the new instance, not the old one
2015-10-26 18:15:58 +00:00
485c85bfe7 fix(core): Fix typo
arithemtic should be arithmetic.

Closes #4803
2015-10-26 17:52:42 +00:00
3118d5cebb fix(compiler): support events on a template element that are consumed via a direct expression
Closes #4883
2015-10-26 10:45:01 -07:00
56a9b020d4 fix(default_value_accessor): support custom input elements that fire custom change events.
Closes #4878
2015-10-26 14:33:47 +00:00
de6774cd97 docs(typo): fix invalid TypeScript synatx in example
Closes #4870
2015-10-23 21:03:58 +00:00
84d1f93d83 fix(WebWorker): Serialize scroll events
closes #4836

Closes #4840
2015-10-23 20:26:29 +00:00
785abe5a1d chore(http): remove double "var http" in http spec
Closes #4859
2015-10-22 10:08:35 +00:00
27ead8c883 feat(dart/transform): Do not declare outputs
Experience shows that for large projects, declaring transformer outputs
can cause ~10x slowdown. Remove output declarations to avoid this.
2015-10-21 14:20:03 -07:00
1caccc410a refactor(dart/transform): Simplify logging class
Use `TransformLogger` for the transformer rather than `BuildLogger`,
which has additional funtionality (and complexity) that is unused.
2015-10-21 12:52:28 -07:00
4639f449cf feat(Parser): associate pipes right to left
closes #4605

BREAKING CHANGE:

Before:

`1 + 1 | pipe:a | pipe:b` was parsed as `(1 + 1) | pipe:(a | pipe:b)`

After:

`1 + 1 | pipe:a | pipe:b` is parsed as `((1 + 1) | pipe:a) | pipe:b`

Closes #4716
2015-10-21 18:43:10 +00:00
77604b8b18 chore: add test showing CSS calc() failure 2015-10-21 11:02:55 -07:00
491e1fdd2c feat: move NgZone to Stream/Observable-based callback API
BREAKING CHANGES:
- deprecates these methods in NgZone: overrideOnTurnStart, overrideOnTurnDone, overrideOnEventDone, overrideOnErrorHandler
- introduces new API in NgZone that may shadow other API used by existing applications.
2015-10-20 21:51:19 -07:00
a7c95ade2e chore: use interface types in ng_zone/JS 2015-10-20 21:49:36 -07:00
711dbf4975 fix(compiler): do not match directives to variable names
BREAKING CHANGES:
- you can no longer use a #foo or a var-foo to apply directive [foo], although
  it didn't work properly anyway.

This commit is fixing breakage caused by the switch to pre-compiler (exact SHA
unknown).
2015-10-20 20:31:55 -07:00
91f71d2c3f refactor(ChangeDetection): fix a typo
Closes #4675
2015-10-20 18:19:43 +00:00
0a940211d5 feat(change detection): remove support for "if"
BREAKING CHANGE: Remove if statement support from actions.

Closes #4616
2015-10-20 18:15:08 +00:00
fd0ba37734 refactor(dart): Format Dart code
Use the dart formatter to clean up all pure Dart code.

Closes #4832
2015-10-20 17:39:37 +00:00
6be95ae88a fix(dart/transform): Fix issue with deferred in .ng_deps
Fix an issue in the linking step which prevents libraries from being
imported as `deferred`.
2015-10-19 13:50:47 -07:00
9d0d33f95a feat(ngUpgrade): simple example 2015-10-19 12:43:28 -07:00
cf9d4662c9 refactor(dart/transform): Update protobuf dependencies
Update
- libprotoc to 2.6.1
- dart-protoc-plugin to 0.5.0
- pkg/protobuf 0.5.0

Closes #4681
2015-10-19 10:32:17 -07:00
be3e7db5db docs(chore): make styles consistent for API doc headings
Closes #4816
2015-10-19 14:58:22 +00:00
2c98a0f771 build(broccoli-typescript): add support for moduleResolution=node
Closes #4779
2015-10-18 16:44:30 +00:00
b09788993d build(broccoli): make broccoli-typescript consume tsconfig style option
Previously it supported a weird mixture of tsconfig and internal options.
2015-10-18 16:44:30 +00:00
e4e74ae65c chore: rename modules/examples to modules/playground
The directory contains code authored in a style that makes it transpilable to dart. As such, these are not idiomatic examples of Angular 2 usage.

The main purpose of this directory is to enable experimentation with Angular within the angular/angular repository.

Closes #4342

Closes #4639
2015-10-18 11:48:43 +00:00
c3ab20cc87 docs(router): Updated documentation for router outlet deactivate method
Closes #4752
2015-10-16 02:26:12 +00:00
05d29a936d fix(typings): don't expose RootTestComponent_
fixes #4776

Closes #4777
2015-10-16 01:37:14 +00:00
fd9b67537d fix(url_resolver): always replace package: in Dart, even if it came from baseUrl.
Closes #4775
2015-10-15 16:57:54 -07:00
5256457144 chore: update v2.0.0-alpha.44 changelog 2015-10-15 16:38:08 -07:00
169cb5f270 chore: bump version to 2.0.0-alpha.44 2015-10-15 16:35:53 -07:00
6c7bc09f70 chore(package): update RxJS dependency version 2015-10-15 16:28:49 -07:00
8efb49dd2d chore: bump version to 2.0.0-alpha.43 2015-10-15 16:23:00 -07:00
c066d696e8 chore(package.json): remove typings bundles
This was used for , but now that our typings are laid out in the node_module, users should no longer need that.
Also fix the project name in root package.json. There is a risk that someone runs npm publish in this directory, which will create a new version of angular 1, and contain a scary source tree.
So this package.json may as well have a name that doesn't exist on npm, and if we did publish by accident, it would be a package name that matches the contents.
2015-10-15 16:17:17 -07:00
d896e4350a feat(ngUpgrade): add support for upgrade/downgrade of injectables
Closes #4766
2015-10-15 20:28:28 +00:00
486c1eda8e docs(ngUpgrade): document public methods 2015-10-15 20:28:28 +00:00
053b7a50e1 feat(ngUpgrade): faster ng2->ng1 adapter by only compiling ng1 once
The adapter only compiles ng1 template. This means that we need to 
reimplement / emulate all of the ng1’s API on the HOST element.


interface IDirective {
  compile?: IDirectiveCompileFn;               // NOT SUPPORTED
  controller?: any;                            // IMPLEMENTED
  controllerAs?: string;                       // IMPLEMENTED
  bindToController?: boolean|Object;           // IMPLEMENTED
  link?: IDirectiveLinkFn | IDirectivePrePost; // IMPLEMENTED (pre-link only)
  name?: string;                               // N/A
  priority?: number;                           // NOT SUPPORTED
  replace?: boolean;                           // NOT SUPPORTED
  require?: any;                               // IMPLEMENTED
  restrict?: string;                           // WORKING
  scope?: any;                                 // IMPLEMENTED
  template?: any;                              // IMPLEMENTED
  templateUrl?: any;                           // IMPLEMENTED
  terminal?: boolean;                          // NOT SUPPORTED
  transclude?: any;                            // IMPLEMENTED
}
2015-10-15 20:28:28 +00:00
059e8faae2 refactor(ngUpgrade): renames and docs
BREAKING CHANGE:

- Changes the terminology to Adapter and upgrade/downgrade
- Removes the Module from the public API to prevent confusion
2015-10-15 20:28:28 +00:00
d7ab5d44a5 fix(testing): let DOM adapter dictate XHR implementation for tests
The test injector now uses an XHR implementation based on DOM.getXHR,
which allows the current DOM adapter to dictate which XHR impl should
be used.

To prevent the changes to DOM adapter from introducing undesired new
dependencies into the benchmarks, separate the async facade into
a promise facade which is reexported by facade/async.

See #4539
2015-10-15 12:12:27 -07:00
65c737fc95 feat(forms): add input[type=number] value accessor
Closes #4014

Closes #4761
2015-10-15 18:41:17 +00:00
427860a5bd chore(saucelabs): add Edge
Closes #4758
2015-10-15 18:20:41 +00:00
a941fb08f7 fix(style_compiler): don’t resolve absolute urls that start with a / during compilation
Closes #4763
2015-10-15 11:13:52 -07:00
cec8b58373 fix(compiler): explicitly support event bindings also on <template> elements
Although these events don’t fire events themselves, there might be directives on them that fire events.

Closes #4712
2015-10-15 10:08:22 -07:00
b89c5bc581 fix(compiler): attribute case in IE9
Closes #4743
2015-10-15 10:18:15 +02:00
7dde18b181 fix(style_compiler): don’t touch urls in stylesheets and keep stylesheets with absolute urls in templates
We can’t resolve relative urls (e.g. for images) in the compiler as
these urls are meant to be loaded in the browser
(unless we would inline images as base64…).

Also, keep `<link rel=“stylesheet”>` in templates that
reference absolute urls with e.g. `http://`. This
behavior was already present for `@import` rules
within stylesheets.
Closes #4740
2015-10-15 01:42:48 +00:00
2be9fef86d chore(travis): reenable lasted Dart dev channel build
Closes https://github.com/angular/angular/issues/4467

Closes #4745
2015-10-15 00:19:31 +00:00
a91ae291e4 fix(test) fix Dart annotation for integration_dart_spec.dart 2015-10-15 00:19:31 +00:00
b716d2335b fix(forms): emit value changes after errors and status are set
Closes #4714
2015-10-14 19:36:43 +00:00
6436f96fd1 fix(transformers): show nice error message when an invalid uri is found
Closes #4731
2015-10-14 10:20:29 -07:00
efddc9069c fix(dart/transform): Parse directives agnostic of annotation order
Now that we can specify `directives` in either `@View` or `@Component`,
we will try to parse from both.

Previously, we would trash any `directives` parsed in the first
annotation upon encountering the second annotation. This ensures that we
maintain that list of `directives` regardless of annotation ordering.
2015-10-14 10:17:14 -07:00
f5159389b3 chore(changelog): document the breaking change of including typings 2015-10-14 09:43:04 -07:00
5a505975bf fix(dart/transform): Handle empty .ng_deps.dart files
Handle the situation where a `.dart` file generates a `.ng_meta.json`
file but does not register any reflective information.

An example of this would be a file that defines a const list that looks
like a directive alias. The transformer keeps track of this, and creates
a `.ng_meta.json` file but never creates a `.ng_deps.dart` file, which
can result in other files being linked to it and it not defining an
`initReflector` method.
2015-10-14 01:34:55 +00:00
115ad4d062 refactor(dart/transform): Allow inlining only using inline_views
Remove the `inliner_for_test` standalone transformer and make inlining
available via the `inline_views` parameter to the main angular2
transformer.
2015-10-13 18:06:59 -07:00
bfbf18d983 feat(query): add filter and reduce to QueryList
Closes #4710
2015-10-13 23:52:17 +00:00
9fc24b9c52 chore(changelog): update changelog to alpha.42 2015-10-13 16:04:27 -07:00
247479d017 chore(release): bump angular version to alpha.42 2015-10-13 15:58:13 -07:00
57649d1839 fix(publish): emit type declarations with CJS build
Closes #4706
Closes #4708
2015-10-13 22:17:12 +00:00
e82a35d1fd feat(forms): add minlength and maxlength validators
Closes #4705
2015-10-13 21:42:12 +00:00
50e922f37b feat(build): add tasks to watch and recompile js and dart 2015-10-13 21:42:12 +00:00
3b036601cc fix(build): Fix serve.js.dev to build bundles
Closes #4700
2015-10-13 21:04:10 +00:00
e15e2428c5 fix(test): command compiler attr merge test in IE 2015-10-13 13:39:32 -07:00
3a801c16fa fix(docs): minor @link fixes.
Closes #4696
2015-10-13 20:24:55 +00:00
717bd23c37 docs(changelog): add a note about how we changed the d.ts file distribution 2015-10-13 13:02:30 -07:00
d02b794af2 chore(changelog): update changelog to alpha.41 2015-10-13 12:52:33 -07:00
bb9d299b38 chore(release): bump angular version to alpha.41 2015-10-13 12:28:03 -07:00
1bc35208df test(router): add testing code for querystring serialization 2015-10-13 12:06:22 -07:00
ea661fa10f chore(examples): extend inbox example code to include sorting 2015-10-13 12:06:22 -07:00
c0b7bae9d3 test(router): add missing tests for the url parser 2015-10-13 12:06:22 -07:00
8bc40d3f4d fix(router): properly read and serialize query params
This splits out `path` and `query` into separate params for `location.go`
and related methods so that we can handle them properly in both `PathLocationStrategy`
and `HashLocationStrategy`.

This handles the problem of not reading query params to populate `Location` on the
initial page load.

Closes #3957
Closes #4225
Closes #3784
2015-10-13 12:06:22 -07:00
440fd11c72 feat(facade): add fromISODate method 2015-10-13 12:06:22 -07:00
f529236bfc refactor(test): rename test_lib to testing
Old test_lib is now testing_internal
test_lib_public is now testing
2015-10-13 10:36:49 -07:00
5a504e6b78 chore(bundles): use proper bundle arithmetic for all http bundles
Closes #4699
2015-10-13 15:28:33 +00:00
a1fa2e472f feat(test): Add an external version of the test library
Adds test adapters for TypeScript and JavaScript only, exported
as part of the test_lib module. These work with the Jasmine test
framework, and allow use of the test injector within test blocks
via the `inject` function.

See #4572, #4177, #4035, #2783

This includes the TestComponentBuilder. It allows using the
test injector with Jasmine bindings, and waits for returned
promises before completing async test blocks.
2015-10-12 23:14:03 -07:00
eb2c15786e refactor: Update multiple ctors warning with a space and grammar
Add a space before the word "using" and make spelling of
constructor/ctor consistent

Closes #3923
2015-10-13 02:35:43 +00:00
947bf11cb6 chore(docs): copy [Decorator]Metadata docs to the [Decorator]
This allows editors to show the docs when users navigate to definition.

See #4668

Closes #4683
2015-10-13 00:30:24 +00:00
1aeafd31bd feat(di): change the params of Provider and provide to start with "use"
Closes #4684
2015-10-12 21:09:09 +00:00
f443ecbfa6 refactor(router): use compiler's public API in imports
Closes #4662
2015-10-12 20:14:22 +00:00
8667b760f4 refactor(router): use DI imports from public API
This allows us to create smaller CJS bundles for router,
where the bundle doesn't duplicate code from angular2 core.
2015-10-12 20:14:22 +00:00
6abed8d996 fix(test_lib): don't mock out XHR via MockXHR by default in tests
This is useful for the compiler tests, but otherwise it's not useful.

Additionally if an application has external templates (as is common) then
we should actually fetch these templates in tests.

Fixes #4539

Closes #4682
2015-10-12 17:45:19 +00:00
eacc8e3803 fix(compiler): merge class and style attributes from the element with the host attributes
Closes #4583
Closes #4680
2015-10-12 15:35:49 +00:00
da1272f368 build(analytics): add basic build-analytics to the project
This is pretty experimental, but the goal is to track the performance
of our build over time so that we can more easily track perf regressions.

Currently it's integrated only with gulp tasks, but I'd like to expand it
to tracking travis jobs, protractor/benchpress test runs, npm installs, etc.

No PII is being collected. And the data is collected via a Google Analytics
property owned by the Angular team account.

Closes #4672
2015-10-12 03:50:00 +00:00
0def28e594 fix(compiler): shadow CSS @import test in some browsers
Closes #4629
2015-10-12 00:28:07 +02:00
b96784756c chore(docs): remove @View decorator from examples in docs
Closes #4666
2015-10-11 22:02:38 +00:00
62005dd127 docs(core): fix links in core docs 2015-10-11 14:42:36 -07:00
52ebb8f0dd docs(di): fix links di docs 2015-10-11 14:42:15 -07:00
35878c559f doc(LifecycleHooks): change Property for Input
Closes #4652
2015-10-11 16:44:28 +00:00
0c1f9dab54 refactor(http): use shared code from public 'angular2/angular2' namespace
Closes #4648
2015-10-11 11:38:19 +00:00
1eb0162cde feat(di): rename Binding into Provider
Closes #4416

Closes #4654
2015-10-11 05:13:31 +00:00
7c6130c2c5 feat(core): desugar [()] to [prop] and (prop-change)
BREAKING CHANGE

Before

```
<cmp [(prop)]="field"> was desugared to <cmp [prop]="field" (prop)="field=$event">
```

After
```
<cmp [(prop)]="field"> is desugared to <cmp [prop]="field" (prop-change)="field=$event">
```

Closes #4658
2015-10-11 02:58:13 +00:00
df09389df8 docs(NgClass): update docs, add example
Closes #4520
2015-10-10 11:42:25 +00:00
90191ce261 refactor(router): use ApplicationRef to provide the first bootstrapped component as ROUTER_PRIMARY_COMPONENT automatically.
This removes the routerBindings function as it is no longer necessary. ROUTER_BINDINGS will automatically pick the first bootstrapped component to satisfy ROUTER_PRIMARY_COMPONENT.

BREAKING CHANGE:

Before: bootstrap(MyComponent, [routerBindings(myComponent)]);
After: bootstrap(MyComponent, [ROUTER_BINDINGS]);

Closes #4643
2015-10-10 05:19:55 +00:00
19c1bd7375 feat(ngUpgrade): transclude content from ng2->ng1
Closes #4640
2015-10-09 21:41:56 -07:00
84c3124292 chore(ngUpgrade): cleanup TS errors 2015-10-09 21:25:48 -07:00
cd90e6ed8f feat(ngUpgrade): support for content project from ng1->ng2 2015-10-09 21:25:45 -07:00
867c08ac84 chore(typings): mark underscore methods @internal.
This allows TypeScript to produce an API surface which matches the Dart semantics.
I found these with:
gulp build.js.dev && find dist/js/dev/es5/angular2/src -name "*.d.ts" -exec grep -H -n '^ *_' {} \;

Closes #4638
2015-10-10 02:18:33 +00:00
95f984615b Produce .d.ts files from our typescript compilation.
Deliver them into our npm module output so users can consume them directly.

Fixes #3082
2015-10-10 02:18:33 +00:00
393b0526b4 refactor(NgZone): improve types
Closes #4642
2015-10-09 23:54:31 +00:00
6207b1af88 feat(ngFor): support a custom template
Part of #1989

Closes #4637
2015-10-09 21:52:59 +00:00
a8c34ae290 refactor(MapWrapper): drop delete(), get(), forEach() and size
Closes #4618
2015-10-09 20:07:43 +00:00
aab0c57aee fix(typings): add more missing typings.
This is the same bug pattern I reported in https://github.com/Microsoft/TypeScript/issues/5187

Closes #4636
2015-10-09 19:00:42 +00:00
c178ad476e fix(typings): fix typings which were previously unchecked
Closes #4625
2015-10-09 16:23:30 +00:00
597f79e0c7 fix(typings): missing types in ListWrapper typings 2015-10-09 16:23:30 +00:00
31f48ae943 refactor(ngOutlet): using some typescript features
Closes #4386
2015-10-09 03:40:42 +00:00
1272affe5c refactor(ngOutlet): move to typescript 2015-10-09 03:40:42 +00:00
431ac33c26 refactor($router): removed some redundant code 2015-10-09 03:40:42 +00:00
cd2050b6e0 docs(router): route alias has to be written in PascalCase
Closes #4547
2015-10-09 03:25:51 +00:00
075011f2fe fix(docs): Updated docs for default router location strategy
Closes #4517
2015-10-09 02:57:10 +00:00
35a61b449a chore(changelog): update change log to alpha-40 2015-10-08 18:46:46 -07:00
984b6fc487 chore(package): update package version for alpha-40 2015-10-08 18:43:20 -07:00
1100c9b1e3 fix(web-workers): fix bindings 2015-10-08 16:42:34 -07:00
f3ab527688 resolve rebase conflicts 2015-10-08 13:59:09 -07:00
bba0248989 fix(core): remove NgZone_ and use NgZone instead 2015-10-08 13:55:26 -07:00
bc8c194665 temporary ignore warnings about unused unimplemented 2015-10-08 13:54:44 -07:00
14fa00791e fix(analyzer): fix dart analyzer errors 2015-10-08 13:54:44 -07:00
d60c7a9118 fix(tests): fixes public api spec 2015-10-08 13:54:44 -07:00
d63f3c123e fix benchmarks 2015-10-08 13:54:44 -07:00
8b725c77fd fix(tests): fix tests 2015-10-08 13:54:44 -07:00
5458036de7 fix(typings): update test.typings for abstract superclasses 2015-10-08 13:54:43 -07:00
6075509f26 chore(typing): extract abstract superclasses to replace @private constructors 2015-10-08 13:54:43 -07:00
ee32b1bc37 feat(router): allow async routes to be defined with "loader" 2015-10-08 12:29:14 -07:00
6d4bd5d901 fix(render): recurse into components/embedded templates not until all elements in a view have been visited
Fixes #4551
Closes #4601
2015-10-08 11:43:21 -07:00
ff77230edb chore(bundles): use proper bundle arithmetic for http
Closes #4575
2015-10-08 18:28:06 +00:00
21b53c3143 docs(http) remove .toRx() from http calls
Closes #4578
2015-10-08 17:41:15 +00:00
04b3dee667 fix(css): when compiling CSS, leave absolute imports alone
Closes #4592
2015-10-08 16:39:32 +00:00
6b00b60488 fix(XhrBackend): setRequestHeader takes a string arg
Closes #4597
2015-10-08 15:59:10 +00:00
bffab0f2db chore(pub): upgrade observe dependency
Closes #4594
2015-10-08 06:35:38 +00:00
811d4c03bd fix(dart/transform): Run DeferredRewriter in the correct phase
`DeferredRewriter` depends on the presence of `.ng_deps.dart` files,
which do not yet exist in the phase where it was previously run.

Update the transformer phases to fix this and add an integration test to
prevent regression.
2015-10-07 17:10:23 -07:00
af1119063c chore(ci): update Protractor version, remove custom waits
The latest Protractor version supports waiting for Angular2 applications,
so remove custom waiting logic.

Closes #3829
2015-10-07 13:08:58 -07:00
fcc6f2c561 refactor(dart/transform): Generate inputs setters in TemplateCompiler step
Move generation of setters for `inputs` from `BindGenerator` into
`TemplateCompiler`.
2015-10-07 12:29:35 -07:00
c94f239536 fix(dart/transform): Write correct ng_deps without deferred imports
Previously, the presence of a `deferred` import would cause us to output
incomplete `.ng_deps.dart` code.

Closes #4587
2015-10-07 11:21:59 -07:00
5600a95e97 chore(changelog): mention breaking test API change 2015-10-07 10:50:38 -07:00
07572652ff feat(dart/transform): Track timing of transform tasks 2015-10-07 17:44:48 +00:00
aee176115b refactor(ListWrapper): drop forEach and removeLast
Closes #4584
2015-10-07 17:17:31 +00:00
4ed642f921 refactor(AppRootUrl): simplify the code
Closes #4563
2015-10-07 15:20:32 +00:00
a7b2ab771e docs(NgStyle): update docs, add examples
Closes #4519
2015-10-07 13:24:48 +00:00
a0277f1b3a refactor: add missing types for ts2dart
Closes #4568
2015-10-07 06:39:14 +00:00
aaa215514b refactor(ListWrapper): get ride of ListWrapper.map 2015-10-07 06:39:14 +00:00
b6537ad609 refactor(ListWrapper): get ride of ListWrapper.join 2015-10-07 06:39:14 +00:00
62e14dc529 build(bundle): fix angular2/test_lib bundle to reexport test_lib rather than test
Closes #4556
2015-10-07 04:49:46 +00:00
15ab6f6ea8 fix(location): improve the 'No base href set' error message 2015-10-06 20:59:02 -07:00
dea6a4593b cleanup(core): making @View optional
Closes #4566
2015-10-07 02:16:42 +00:00
d38689677c example(core): update hellow world example to use components without @View 2015-10-07 02:16:42 +00:00
a2e7ae568e feat(transformers): update transformers to handle components without @View 2015-10-07 02:16:42 +00:00
bd31b01690 feat(core): add syntax sugar to make @View optional 2015-10-07 02:16:42 +00:00
f7b75330e0 chore(test): make e2e tests use the bundles.
After this change, only web_worker thread in its e2e test is not using
the bundles.

Closes #4565
2015-10-07 01:17:19 +00:00
f7aa890ade chore(docs): rename @private to @internal
The latter is understood by TypeScript's --stripInternal option, so this lets us
rely more on the tooling provided by typescript team.
2015-10-06 17:08:41 -07:00
4a36fd8203 fix(core): make .toRx() return Subject
this was broken in the original great RxNext migration.
fixes #4521

Closes #4540
2015-10-06 23:27:35 +00:00
ba6e0e11fa fix(dart/transform): Sanitize generated library names
Sanitize generated library names by removing unsafe characters and
ensuring that Dart keywords do not appear as library segments.
2015-10-06 16:18:58 -07:00
4ac29621f4 refactor(dart/transform): Compose NgDepsModel & NgMeta phases
Link `NgDeps` & `NgMeta` data in the same phase to avoid unnecessary asset
creation & reading.

Remove `NgMeta#exports` and instead use `NgDeps#exports` to link `NgMeta` files
in `ng_meta_linker.dart`.
2015-10-06 16:18:58 -07:00
75187d605b chore: remove unused docs/dgeni tasks and packages
This stuff now lives in angular.io repo.

Related to #4477

Closes #4552
2015-10-06 22:54:17 +00:00
5040a8e0df chore(saucelabs): fallback from Firefox dev to beta
Closes #4553
2015-10-06 22:24:59 +00:00
a4869c874b build(dart): Remove unused Dart benchmarks 2015-10-06 14:11:03 -07:00
b6210be648 chore(changelog): update change log to alpha.39 2015-10-06 13:13:23 -07:00
8e1d2fb325 feat(upgrade): support binding of Ng1 form Ng2
Closes #4542
2015-10-06 19:08:56 +00:00
bb4fd2de94 build(gulp): simplify Dart transformer tasks
Now that `modules_dart` contains only `transform` code, simplify its
`gulp` rules.
2015-10-06 11:27:49 -07:00
fd5cd84065 chore(zone.js): update to 0.5.8
fixes #4531
2015-10-06 11:16:38 -07:00
6117a7037b chore(build): copy bundles so they can be used with e2e tests 2015-10-06 10:55:08 -07:00
4d9de666c8 chore: remove dead code 2015-10-06 10:12:53 -07:00
4ebb1a9096 fix: add test_lib.d.ts to type definitions in generated package.json 2015-10-06 10:12:53 -07:00
9679fc94f6 fix(shims): Don't rely on prefixed requestAnimationFrame
The `ms` & `moz` prefixes are not needed. `ms` was never available in a public
IE release (IE 10 has an unprefixed version) and Firefox has unprefixed
rAF since v24 - current version is 41. Even more, Firefox versions below 22
don't have cancelAnimationFrame so it's better to not use the prefixed version
at all to avoid surprises.

The `o` prefix is also useless - Opera Presto never had rAF and the
Chromium-based Opera doesn't use the `o` prefix.

Also, switched from `new Date().getTime()` to `Date.now()` as it's supported
everywhere (even in Android 2.3) except IE<9 and it avoids a useless date
object construction.

See http://caniuse.com/#feat=requestanimationframe for more info.

Refs 4f56a01b3b

Closes #4394
2015-10-06 09:38:49 -07:00
076191cf9d chore(bundles): publish minified router bundle
Closes #4503
2015-10-06 15:50:33 +00:00
74c0daab27 chore(build): minify bundles in parallel 2015-10-06 15:50:33 +00:00
6093e28b61 fix(typings): repair broken typechecks
We had the typechecker disabled by accident, and many problems snuck in

Fixes #4507

Closes #4508
2015-10-06 13:28:17 +00:00
ae6f549f10 chore(typings): re-enable type-checking on the browser trees 2015-10-06 13:28:17 +00:00
74c852b160 docs(developer.md): update node version in setup instructions
Closes #4527
2015-10-05 14:26:28 -07:00
349416ea53 test(dart/transform): e2e test inliner_for_test
Add an e2e test for the `inliner_for_test` transformer.
2015-10-05 20:18:15 +00:00
f638834fcf docs(CHANGELOG): add breaking change for the NgNonBindable directive
Closes #4499

Closes #4501
2015-10-05 20:07:42 +00:00
09371a3f0b feat(upgrade): support binding of Ng2 form Ng1
Closes #4458
2015-10-05 19:37:31 +00:00
0b3e4fa090 refactor(core): move ViewEncapsulation and ViewType to the right places
Closes #4526
2015-10-05 11:22:21 -07:00
0299d4af00 fix(core): keep styles for ViewEncapsulation.Native isolated per component
BREAKING CHANGE:
- `Renderer.registerComponent` now takes an additional argument.

Fixes #4513
Closes #4524
2015-10-05 10:34:42 -07:00
a9aef8e5e6 fix(core): set ViewEncapsulation.Emulated as the default again
Fixes #4494
2015-10-05 10:33:58 -07:00
6fe8b85295 fix(render): keep bindings of components in content and view in the right order
Bindings in the component view have to be first, before 
bindings of components in the light dom (i.e. have the same
order as used in the `ViewManagerUtils.createView()` method.

Fixes #4522
Closes #4523
2015-10-05 10:10:47 -07:00
649d310c31 chore: remove traceur from package.json published to npm
Closes #4498
2015-10-05 02:47:49 +00:00
14b194ea21 chore(ci): update sauce connect to 4.3.11
From 4.3.8.

Closes #4453
2015-10-05 02:18:47 +00:00
758efba34b fix(gulp): use the new karma.Server api
Closes #4375
2015-10-03 21:33:58 +00:00
e21bf120b9 build(travis): add travis log folding for verbose tasks 2015-10-03 21:33:57 +00:00
9fa57d06da style(gulp): make code more readable 2015-10-03 21:33:57 +00:00
9fc9704cdd test(tools): temporarily disable tests that depend on mock-fs
mock-fs is currently incompatible with node 4.x, but a fix is in progress
https://github.com/tschaub/mock-fs/issues/59

Since we are currently not actively developing the affected broccoli plugins,
the risk of disabling these tests is low, especially in the light of
improvements we get from node 4.x.
2015-10-03 21:33:57 +00:00
39e9bb64ef fix(karma): socket.io 1.x transport is now called 'polling' instead of 'xhr-polling'
And we really need it only when using sauce, so I'm making the condition more strict.
2015-10-03 21:33:57 +00:00
a649992ccd fix(karma-dart-evalcache): make the code compatible with karma 0.13.x 2015-10-03 21:33:57 +00:00
2628631aff fix(tslint): fix d.ts file paths for node_modules dependencies 2015-10-03 21:33:57 +00:00
4b0013c7e7 build(npm): resolve shrinkwrap conflicts after rebase 2015-10-03 21:33:57 +00:00
5ff1eb75d0 build(npm): upgrade gulp-sass to v2.0.4 2015-10-03 21:33:57 +00:00
1b20873433 build(npm): update chokidar and karma* dependencies
These dependencies required upgrade in order for us to run on Node v4.x

chokidar 1.0.1 -> 1.1.0
karma 0.12.23 -> 0.13.10
karma-chorome-launcher 0.1.8 -> 0.2.0
karma-cli 0.0.4 -> 0.1.0
karma-dart 0.2.8 -> 0.3.0
karma-sauce-launcher 0.2.11 -> 0.2.14
2015-10-03 21:33:57 +00:00
36562ecaae build(gulp): bump check-environment node version to 4.1.1 and npm to 2.14.5 2015-10-03 21:33:57 +00:00
fc764b42f6 build(travis): bump node version to 4.1.1 and npm to 2.14.5 2015-10-03 21:33:57 +00:00
9f688d314f chore: remove devDependencies from package.json published to npm
Closes #4502
2015-10-03 17:09:48 +00:00
150cc22532 fix(http): add missing semicolon 2015-10-03 10:05:11 -07:00
208f3d4c65 fix(typings): repair broken type-checking for StringMap
Note that the previous type of StringMap was overly permissive and didn't catch errors.
Also we have to explicitly type empty objects, which is explained here:
https://github.com/Microsoft/TypeScript/issues/5089

Closes #4487
2015-10-03 01:09:42 +00:00
7c4199cd1c chore(typings): remove StringMap
This was a poorly typed attempt to mimic TypeScript's index signatures,
which we can use instead.
This eliminates a very strange type that we were exposing to users, but
not re-exporting through our public API.

Fixes #4483
2015-10-03 01:09:42 +00:00
2ebc74ddcc fix(npm_publish): update transitive typings provided in npm distribution 2015-10-02 18:06:12 -07:00
c7e9f86557 chore(package): bump version to alpha 38 2015-10-02 18:06:12 -07:00
75cf0aeaeb chore(changelog): update changelog to alpha 38 2015-10-02 18:06:12 -07:00
decdbea7d7 fix(dart/transformer): Correctly handle const object annotations
Previously, annotations which were const objects (as opposed to const
instance creation expressions) were incorrectly output as instance
creation expressions.

Before:
```
const override() // A const instance creation expression
```

After
```
override // A const instance
```

Closes #4481
2015-10-03 00:27:52 +00:00
01fb06a377 chore(http): Use Observables in Http
- Remove ObservableWrapper/EventEmitter from Http.
- Temporarily use complete Rx build w/ all operators.
2015-10-02 17:20:25 -07:00
c9901c5fe0 feat(core): support properties and events in addition to inputs and outputs to make transition easier
Closes #4482
2015-10-02 23:23:15 +00:00
5ea6dc844c refactor(dart/transform): Remove reflection_entry_points
`reflection_entry_points` was deprecated on Aug 26 and is no longer used
by the transformer. Remove its deprecation message.

Closes #3856
2015-10-02 22:31:02 +00:00
b44c13bc46 fix(compiler): const is not supported in IE9 and IE10
Closes #4465
2015-10-02 21:49:44 +00:00
6ae9686a0d fix(benchpress): update build step, read and config
Closes #4419
2015-10-02 14:42:15 -07:00
4342a1eb7b refactor(core): move DI bindings of compiler into core/compiler/compiler.ts
Closes #4470
2015-10-02 13:39:14 -07:00
13161ae5aa refactor(core): move APP_ID from render/dom/dom_tokens into application_tokens 2015-10-02 13:38:52 -07:00
6b5d345a2b refactor(core): adjust imports for move files to the right place
- render/xhr_* -> compiler/xhr_*
- render/event_config -> linker/event_config
- render/dom/schema -> compiler/schema
- render/dom/compiler/* -> compiler/*
- render/dom/view/shared_styles_host -> render/dom/shared_styles_host
2015-10-02 13:38:51 -07:00
2450a3c5b0 refactor(core): move files to the right place
- render/xhr_* -> compiler/xhr_*
- render/event_config -> linker/event_config
- render/dom/schema -> compiler/schema
- render/dom/compiler/* -> compiler/*
- render/dom/view/shared_styles_host -> render/dom/shared_styles_host
- services/url_resolver -> compiler/url_resolver
- services/app_root_urlo -> compiler/app_root_url
2015-10-02 13:38:51 -07:00
34518f0f2d feat(http): Add support for strings as http method names
Closes #4331
2015-10-02 11:33:49 -07:00
a251df9df4 docs: api docs for Renderer and all the related apis
Closes #4459
2015-10-02 17:05:48 +00:00
a110ce95dc doc(LifecycleHooks): update API doc
Closes #4357
2015-10-02 16:44:48 +00:00
e8e57cdd73 refactor(core): adjust imports for rename angular2/src/compiler -> angular2/src/core/compiler 2015-10-02 08:59:43 -07:00
aa3d94149f refactor(core): rename angular2/src/compiler -> angular2/src/core/compiler 2015-10-02 08:42:12 -07:00
6248a5e846 refactor(core): move core/compiler to core/linker, adjust imports 2015-10-02 08:42:12 -07:00
9f4fa1ab0a refactor(core): move core/compiler to core/linker 2015-10-02 08:42:11 -07:00
43cca2de76 fix(build): lock dart dev version
Related to #4467
2015-10-02 08:37:05 -07:00
d21c7bdf90 refactor(compiler): remove unused code
BREAKING CHANGE:
- Removes `ChangeDetection`, use a binding for `ChangeDetectorGenConfig` instead
  to configure change detection.
- `RenderElementRef.renderBoundElementIndex` was renamed to `RenderElementRef.boundElementIndex`.
- Removes `ViewLoader`, use `XHRImpl` instead.
2015-10-01 22:27:41 -07:00
b154f1a44f refactor(analyzer): remove analyzer code
This now lives under https://github.com/angular/angular2-dart-analyzer
2015-10-01 18:48:28 -07:00
76247b7097 refactor(compiler): use the new compiler everywhere
Closes #3605

BREAKING CHANGE:
- we don't mark an element as bound any more if it only contains text bindings
  E.g. <div>{{hello}}</div>
  This changes the indices when using `DebugElement.componentViewChildren` / `DebugElement.children`.
- `@Directive.compileChildren` was removed,
  `ng-non-bindable` is now builtin and not a directive any more
- angular no more adds the `ng-binding` class to elements with bindings
- directives are now ordered as they are listed in the View.directives regarding change detection.
  Previously they had an undefined order.
- the `Renderer` interface has new methods `createProtoView` and `registerComponentTemplate`. See `DomRenderer` for default implementations.
- reprojection with `ng-content` is now all or nothing per `ng-content` element
- angular2 transformer can't be used in tests that modify directive metadata.
  Use `angular2/src/transform/inliner_for_test` transformer instead.
2015-10-01 18:48:27 -07:00
30ca0434a2 refactor(transformer): apply properties/events rename 2015-10-01 18:48:27 -07:00
841f8789fd refactor(transformer): precompile stylesheets
Part of #3605
2015-10-01 18:48:27 -07:00
52236bd765 refactor(transformer): use the new compiler
Part of #3605
2015-10-01 18:48:26 -07:00
a5622304de fix(upgrade): assert correct interleaving of evaluation.
Closes #4436
2015-10-01 23:07:43 +00:00
074e289e62 chore(upgrade): inline the tests for better readability 2015-10-01 23:07:43 +00:00
617acf4cd6 docs(core): add docs to HostBinding and HostListener 2015-10-01 15:47:51 -07:00
a87ebb28e2 docs(CORE_DIRECTIVES): improve docs for CORE_DIRECTIVES
Closes #4310
2015-10-01 08:49:46 +00:00
adbfd29fd7 feat(core): renames Property into Input and Event into Output
BREACKING CHANGE:

Before: @Directive({properties: ['one'], events: ['two']})
After: @Directive({inputs: ['one'], outputs: ['two']})

Before: @Component({properties: ['one'], events: ['two']})
After: @Componet({inputs: ['one'], outputs: ['two']})

Before: class A {@Property() one; @Event() two;}
After: class A {@Input() one; @Output() two;}
2015-10-01 04:36:23 +00:00
33593cf8a2 fix(build): Use Angular's testability API to wait for end of e2e tests
Closes #3911
2015-10-01 03:41:10 +00:00
00a4b2e28f feat(forms): make NgControl -> NgValueAccessor dependency unidirectional
Closes #4421
2015-10-01 01:47:18 +00:00
7b2d8fce07 refactor(forms): extract NgControlStatus 2015-10-01 01:47:18 +00:00
cec4b36d9b fix(change_detection): _throwError should not mask the original exception 2015-09-30 18:18:28 -07:00
5557a5716d chore(saucelabs): fix badge
Closes #4412
2015-10-01 00:02:05 +00:00
eafa482052 chore(saucelabs): add latest Safaris
Closes #4411
2015-09-30 21:38:04 +00:00
3aa204791b feat(query): make QueryList notify on changes via an observable
BREAKING CHANGE:

Before: query.onChange(() => ...);
After: query.changes.subscribe((iterable) => {});

Closes #4395
2015-09-30 15:45:16 +00:00
9b7378d132 chore(typings): remove traceur-runtime.d.ts
fixes #4297

Closes #4415
2015-09-30 00:07:16 +00:00
fb9796130d chore(zone.js): update to 0.5.7
fixes #4179

Closes #4418
2015-09-29 22:31:35 +00:00
e1853b33d3 chore(saucelabs): add matrix badge to README.md
Closes #4400
2015-09-29 10:03:45 +02:00
4731714244 chore(saucelabs): update browsers list
Closes #4366
2015-09-29 10:02:13 +02:00
b4fe590b2d chore(ts): fix TODOs that were pending on 1.6 upgrade
Closes #4377
2015-09-29 03:23:25 +00:00
8ff65a30c7 refactor(compiler): don’t require id in metadata and use appId
The output of the compiler has to be the same
given the same input. Requiring a unique id for
every type already during compilation makes it
hard to parallelize compilation.

Part of #3605
Closes #4397
2015-09-28 19:47:24 -07:00
cd0e9c9cd4 chore(zone.js): update zone.js to 0.5.6
Closes #4399
2015-09-29 00:14:38 +00:00
a7b8624b55 docs(forms): Documentation and examples for Control, ControlGroup, and ControlArray.
Closes #4398
2015-09-29 00:08:21 +00:00
7ae74cf91d docs(forms): FORM_BINDINGS and FORM_DIRECTIVES 2015-09-29 00:08:21 +00:00
6a6396963f refactor(http): remove useless constant
Closes #4364
2015-09-29 00:06:27 +00:00
4319563bba docs(http): add language annotations and fix method value to enum
Closes #4348
2015-09-29 00:03:00 +00:00
e2f5d87ff7 fix(services): export title service
Signed-off-by: cexbrayat <cedric@ninja-squad.com>

Closes #4271
2015-09-28 23:23:40 +00:00
7714d6a6eb fix(forms): avoid issues with nulls checking on validation status and other form states.
Closes #4338
2015-09-28 21:01:51 +00:00
1f2302e39e fix(dart/transform): Fix transformer output declaration
Ensure that the transformers are properly declaring all consumed
outputs. In particular, when a transformer overwrites an output, make
sure the transformer calls `consumePrimary` followed by `addOutput` for
that file.

Prevent `DirectiveLinker` from consuming `.ng_deps.json` files. When we
do this, barback incorrectly calculates the available assets for that
phase, resulting in broken builds.
2015-09-28 12:20:21 -07:00
a88e6f3106 refactor(http): use Observables in Http backends
BREAKING CHANGE: Http now returns Rx Observables directly, so calling .toRx() is no longer necessary. Additionally, Http calls are now cold, so backend requests will not fire unless .subscribe() is called.

closes #4043 and closes #2974

Closes #4376
2015-09-27 22:15:30 +00:00
3dd9919bbd chore(ts2dart): remove hand-written ts2dart typings
Now that we are on TS 1.6, we can use the new node module resolution strategy.

Closes #4372
2015-09-25 23:47:41 +00:00
589ce31dfc feat(transformers): record setters for query fields
Closes #4344
2015-09-25 23:34:42 +00:00
e7d65ad96f fix(dart/transform): Handle export cycles
Currently, an export cycle in dart inputs will cause the transformer to
hang indefinitely on the `DirectiveMetadataExtractor` step.

Closes #4370
2015-09-25 23:08:45 +00:00
af9f916a9c docs(compiler): compiler/view related api docs
Closes #4268
2015-09-25 23:03:24 +00:00
d348e5051f docs(Type): improve api docs 2015-09-25 23:03:24 +00:00
7771ef4873 refactor: rename all "atIndex" parameters to just "index"
This makes it easier to word the documentation of the signature.
2015-09-25 23:03:24 +00:00
7ee295ad94 docs(compiler): compiler related api docs 2015-09-25 23:03:24 +00:00
0319417a1b feat(Binding): improve errors
fix #4358

Closes #4360
2015-09-25 22:05:36 +00:00
5bf6a3af15 chore(typescript): fixes dart failures and linter
Closes #4359
2015-09-25 20:15:55 +00:00
7a53f82516 chore(typescript 1.6 upgrade): fix build.js and docs 2015-09-25 20:15:55 +00:00
2ee32fb02c chore(typescript 1.6 upgrade): fix build.tools 2015-09-25 20:15:55 +00:00
1cf45757cd feat(render): add generic view factory based on the template commands
Part of #3605
Closes #4367
2015-09-25 11:56:58 -07:00
0ed6fc4f6b fix(compiler): minor cleanups and fixes
Part of #3605
2015-09-25 11:27:39 -07:00
9c9769047d fix(test): StyleCompiler tests failing in Android browsers
Closes #4351
2015-09-25 07:34:17 +00:00
5f640c79bb refactor(compiler_benchmark): simplify by using bootstrap and DI
Closes #4356
2015-09-25 04:01:14 +00:00
0a88e7b736 feat(change detection): export SimpleChange
Closes #4337
2015-09-25 02:33:41 +00:00
711ab6d573 docs(forms): Add documentation and live examples for NgForm, NgFormControl, NgFormModel, and NgModel.
Closes #4343
2015-09-24 22:22:03 +00:00
4e5c663b02 docs(di): fix incorrectly fomatted code blocks 2015-09-24 14:34:04 -07:00
4efc4a5520 feat(query): remove the 3-query-per-element limit
Closes #4336
2015-09-24 21:09:02 +00:00
ce6b364dc5 docs(core): add docs to Property and Event 2015-09-24 13:46:29 -07:00
ef61b81b0c fix(bundles): add explicit format: cjs for empty files. 2015-09-24 13:42:12 -07:00
225eab8f25 cleanup(change_detection): make Locals private
Closes #4321
2015-09-24 18:10:47 +00:00
7c2c1a8e03 docs(change_detection): add docs to ChangeDetectorRef 2015-09-24 18:10:47 +00:00
9d2d674ef8 docs(change_detection): add docs to change detection exceptions 2015-09-24 18:10:47 +00:00
7470ad1bd1 refactor(compiler): various cleanups
- use `$implicit` variable value correctly
- handle `ng-non-bindable` correctly
- add some more assertions to `TemplateCompiler`
- make `CompiledTemplate` const
- fix default value for `@Directive.moduleId`
- add new compiler to application bindings

BREAKING CHANGE:
- `Compiler.compileInHost` and all methods of `DynamicComponentLoader` don’t take `Binding` any more, only `Type`s. This is in preparation for the new compiler which does not support this.

Part of #3605

Closes #4346
2015-09-24 10:56:29 -07:00
bffa2cb59b feat(animate): cross-browser compatibility
Closes #4243
2015-09-24 10:24:40 +02:00
4f56a01b3b fix(shims): add requestAnimationFrame shim for IE9 and Android
Fixes #4209
2015-09-24 10:23:58 +02:00
29f75c3c63 chore(saucelabs): MdButton tests time out
Closes #4248
2015-09-24 10:22:50 +02:00
ea15d6646b docs(examples): add empty examples directory for api docs examples
This is a place for api docs examples hand written in an idiomatic way.

Closes #4341
2015-09-23 21:30:17 +00:00
44c171e399 build(travis): make sauce connect process query a bit more specific 2015-09-23 13:59:41 -07:00
4087e3115b docs: copyedit DART_TOOLS.md 2015-09-23 12:23:05 -07:00
4d4d20edb9 build(travis): block travis while we are shutting down the tunnel
This is to prevent Travis from prematurely shut down the VM while we are still waiting for the sauce connect client
to tear down the tunnel.

Closes #4335
2015-09-23 18:00:21 +00:00
3b609fbae9 build(travis): gracefully shut down the sauce connect tunnel after the tests are done running
This is to prevent tunnel leaks which cause us to run out of allocated tunnels.

Closes #4329
2015-09-23 05:21:34 +00:00
8427863bab feat(upgrade): Allow including ng2/1 components in ng1/2
Closes #3539
2015-09-23 05:02:43 +00:00
db6d289d82 chore(upgrade): infrastructure to allow running upgrade module specs 2015-09-23 05:02:43 +00:00
ec68074e69 docs(router): improve docs for Instruction and related classes
Closes #4303
2015-09-22 21:27:47 -07:00
3d6e3c2551 fix(http): change http interfaces to types
Types were previously not handled correctly by the type definition
generation process, so a couple of things in http had to be changed 
to interfaces. This issue has been fixed, so now they're types again.

Closes #4024
2015-09-23 01:06:23 +00:00
0366f317af docs(router): improve docs for Location and related classes
Closes #4299
2015-09-23 00:47:15 +00:00
8a2370750a docs(router): improve documentation for router bindings 2015-09-23 00:47:15 +00:00
c01f327194 docs(router): improve docs for lifecycle hooks
Closes #4300
2015-09-23 00:47:15 +00:00
5c0a9eff62 docs(router): improve docs for RouteDefinition classes 2015-09-23 00:47:15 +00:00
9c4ab2b2b8 docs(http): fix missing variable from BaseRequestOptions example 2015-09-22 17:21:05 -07:00
5ea9c1e7fd docs(http): add docs and examples for BaseResponseOptions
Closes #4324
2015-09-23 00:16:53 +00:00
662a585fc2 docs(http): add docs and examples for ResponseOptions 2015-09-23 00:16:53 +00:00
ae3713ef95 docs(http): add docs and examples for BaseRequestOptions 2015-09-23 00:16:53 +00:00
707e6f7671 docs(http): improve docs and add example for RequestOptions 2015-09-23 00:16:53 +00:00
a554f1c45d chore(router): do not export Url class
Closes #4304
2015-09-22 23:51:19 +00:00
41b019f5f8 refactor(router): do not export RootRouter
BREAKING CHANGE:

It's unlikely that any apps were explicitly referencing `RootRouter`, but if they were they should
prefer to use the `routerBindings` helper or the `ROUTER_BINDINGS` const exported from `angular2/router`
2015-09-22 23:51:19 +00:00
af2cd4d6f3 fix(api): align dart/js APIs 2015-09-22 23:11:40 +00:00
577ee3744a fix(bug): reflect Dart interfaces from superclass as well
fixes #4221

Closes #4222
2015-09-22 22:31:07 +00:00
9dd32d658e build(npm): update shrinkwrap with the missing hash-files dependency 2015-09-22 15:19:32 -07:00
fd3eae9623 docs(di): add missing docs
Closes #4302
2015-09-22 21:38:33 +00:00
238dfc1e17 cleanup(di): make KeyRegistry private 2015-09-22 21:38:33 +00:00
29b56ceb40 cleanup(di): make DependencyProvider private 2015-09-22 21:38:33 +00:00
820b30c181 refactor(dart/transform): Use protos to run & test directive_linker
Use the proto ng_deps model objects internally and while testing the directive
linker rather than reading & comparing Dart code.
2015-09-22 13:40:07 -07:00
cc0c30484f refactor(compiler): cleanup and preparation for integration
- Rename `DirectiveMetadata` into `CompileDirectiveMetadata`, merge
  with `NormalizedDirectiveMetadata` and remove `ChangeDetectionMetadata`
- Store change detector factories not as array but
  directly at the `CompiledTemplate` or the embedded template
  to make instantiation easier later on
- Already analyze variable values and map them
  to `Directive.exportAs`
- Keep the directive sort order as specified in the
  `@View()` annotation
- Allow to clear the runtime cache in `StyleCompiler`
  and `TemplateCompiler`
- Ignore `script` elements to match the semantics of the
  current compiler
- Make all components dynamically loadable and remove
  the previously introduced property `@Component#dynamicLoadable`
  for now until we find a better option to configure this
- Don’t allow to specify bindings in `@View#directives` and `@View#pipes` as this was never supported by the transformer (see below for the breaking change)

BREAKING CHANGE:
- don't support DI bindings in `@View#directives` and `@View@pipes` any more in preparation of integrating the new compiler. Use `@Directive#bindings` to reexport directives under a different token instead.

Part of #3605
Closes #4314
2015-09-22 12:50:03 -07:00
eb7839e0ec fix(build): temporarily test dart with dart2js instead of pub serve
Should be changed back when #4316 is resolved.
2015-09-22 11:32:14 -07:00
f600d88209 docs: fix typo
Closes #4306
2015-09-22 13:32:43 +00:00
662ff47627 docs: fix typos
Closes #4308
2015-09-22 12:15:49 +00:00
da6def3772 docs(http): add documentation for Request
Closes #4238
2015-09-21 22:20:58 +00:00
c868f40bef docs(http): improve docs for Headers 2015-09-21 22:20:58 +00:00
17af481134 docs(http): add docs and examples for JSONP_BINDINGS 2015-09-21 22:20:58 +00:00
b2695e46e1 docs(http): add docs and examples for HTTP_BINDINGS 2015-09-21 22:20:58 +00:00
b0effe8e27 docs(di): add docs to Injector
Closes #4254
2015-09-21 21:55:04 +00:00
794e3870c5 docs(di): make TypeLiteral private
Closes #4290
2015-09-21 20:44:49 +00:00
95c8eef97a docs(di): add docs to OpaqueToken 2015-09-21 20:44:49 +00:00
b8c4d3e7fb docs(di): add docs to Key 2015-09-21 20:44:49 +00:00
aed34e1f82 feat(angular_1_router): add ngRouteShim module
This module attempts to provide a shim for `$routeProvider` to aid in
migrating from ngRoute to Component Router.

Closes #4266
2015-09-21 12:13:07 -07:00
5205a9e65f refactor(angular_1_router): use directives for route targets
BREAKING CHANGE:

Previously, route configuration took a controller constructor function as the value of
`component` in a route definition:

```
$route.config([
  { route: '/', component: MyController }
])
```

Based on the name of the controller, we used to use a componentMapper service to
determine what template to pair with each controller, how to bind the instance to
the $scope.

To make the 1.x router more semantically alligned with Angular 2, we now route to a directive.
Thus a route configuration takes a normalized directive name:

```
$route.config([
  { route: '/', component: 'myDirective' }
])
```

BREAKING CHANGE:

In order to avoid name collisions, lifecycle hooks are now prefixed with `$`. Before:

```
MyController.prototype.onActivate = ...
```

After:

```
MyController.prototype.$onActivate = ...
```

Same for `$canActivate` (which now lives on the directive factory function),
`$canDeactivate`, `$canReuse`, and `$onDeactivate` hooks.
2015-09-21 12:13:07 -07:00
6e0ca7f39a fix(router): use StringWrapper.startsWith 2015-09-21 12:13:07 -07:00
43f97a951c refactor(router): move assertComponentExists into facade
This is to make way for a refactor to the ng 1.x router directives,
which will use strings rather than controller functions in route configs.
2015-09-21 11:17:19 -07:00
a443ea64a1 refactor(router): remove unused dependencies in ngOutlet 2015-09-21 11:17:19 -07:00
c2a60f1624 feat(core): add support for @ContentChild and @ViewChild
Closes #4251
2015-09-20 01:45:09 +00:00
2e9de0b169 feat(core): add sugar to use ContentChildren and ViewChildren as prop decorators
Closes #4237
2015-09-20 00:43:04 +00:00
5dbe292615 feat(core): add support for ContentChildren and ViewChildren 2015-09-20 00:43:04 +00:00
5809a02624 docs(query): edit and extend query and view query docs. 2015-09-18 18:27:42 -07:00
3525d8a394 fix(http): throw if url is not string or Request
Closes #4245

Closes #4257
2015-09-18 23:33:17 +00:00
dd9b3b4ed0 docs(typings): don't emit @private members during the d.ts generation
Some of our class/interface members are "package private". Typescript doesn't have this concept, so we need to hide them
via the @private doc annotation.

Closes #4262

Closes #4264
2015-09-18 22:56:57 +00:00
283415beab fix(sfx): Include ngHttp in SFX bundle
fixes: #3934

Closes #3933
2015-09-18 09:07:31 -07:00
390aacd442 fix(facade): workaround for lack of Symbol.iterator in es6-shim
Closes #4219
Fixes #4216
2015-09-18 09:46:13 +02:00
e166f6fe95 fix(browser): make Firefox to work with es6-shim
es6-shim.js must be loaded first
2015-09-18 09:39:41 +02:00
5a3ce87915 chore(http): remove unused properties from Request
This removes properties mentioned in #3339

Closes #3339
Closes #3823
2015-09-17 17:16:47 -07:00
2acc1ad08b feat(dart/transform): Declare transformer outputs
Update transformers to declare a superset of their outputs. This helps
barback compute the Asset graph and can lead to faster transformation.
2015-09-17 16:00:03 -07:00
b9ea394c85 docs(core): Add plnkr example for *ng-if. 2015-09-17 15:28:11 -07:00
06f8330cfa fix(core): Document the new bootstrap APIs. Also rename rootBindings() to platformBindings() to be more clear about what it is.
Closes #4218
2015-09-17 20:58:38 +00:00
f490565b09 refactor(compiler): cleanup method and property names
Closes #4236
2015-09-17 20:41:37 +00:00
d05df30a94 docs(di): add docs to forwardRef 2015-09-17 13:13:40 -07:00
e1c0b1abcb docs(di): add docs to DI exceptions 2015-09-17 13:13:30 -07:00
b2e9da4905 docs(di): add docs for Binding 2015-09-17 13:12:50 -07:00
be6d92c29a fix(dist): don't distribute the HTML dart api docs
fixes #4115

Closes #4211
2015-09-17 15:49:53 +00:00
9179afb2a1 docs(compiler/element_injector): fix typo
Closes #4210
2015-09-17 13:35:21 +00:00
adb3813e85 docs(shared/service_message_broker): fix typo
Typo fix on line 32 suggested by PatrickJS
Closes #4226
2015-09-17 12:59:48 +00:00
563fffd9b0 docs(chore): fix bad links in the API docs 2015-09-16 23:28:16 -07:00
a588d4894b chore(doc-gen): filter unwanted decorators from angular.io docs
Closes #3705
2015-09-16 23:03:07 -07:00
dad40751d4 chore(doc-gen): make the module of the export's original declaration available 2015-09-16 23:03:01 -07:00
19274e744d chore(doc-gen): add docType info into _data.json files 2015-09-16 23:03:01 -07:00
608f35b4a7 chore(doc-gen/angular.io): sort exports alphabetically 2015-09-16 23:03:01 -07:00
457b689bf0 feat(compiler): add TemplateCompiler
TemplateCompiler is the entry point to the new compiler

Related to #3605
Closes #4220
2015-09-17 04:24:15 +00:00
eaa20f661a fix(exceptions): NoAnnotationError message is not displayed
Closes #4215

Closes #4223
2015-09-17 00:58:55 +00:00
626e1cda5f chore(doc-gen): fix blank line trimming for Jade docs
Closes #4217
2015-09-16 22:34:18 +00:00
34aa1425b7 chore(doc-gen/angular.io): add ids to members so they can be linked to
Closes #4206
2015-09-16 20:56:16 +00:00
241632aaa1 feat(code size): make assertionsEnabled() statically computable by dart2js
Our existing implementation prevented dart2js from statically deducing the
return value. This fix does not yet result in better tree-shaking due to the
following dart2js bugs:

https://github.com/dart-lang/sdk/issues/24354
https://github.com/dart-lang/sdk/issues/24355

Closes #4198
2015-09-16 19:01:48 +00:00
06f0d6c046 docs(pipe_transform): make example headers consistent 2015-09-16 11:44:37 -07:00
d276370ba1 docs(core): add docs for PipeOnDestroy interface 2015-09-16 11:44:36 -07:00
d9776b4112 docs(core): add docs for PipeTransform interface 2015-09-16 11:44:36 -07:00
53412a71e5 docs(NgZone): add public api docs 2015-09-16 11:42:30 -07:00
70586b668c fix(debug): make debug tools take ComponentRef
The debug tools used to take ApplicationRefs, which are the old return
type of bootstrap. Now bootstrap returns ComponentRef, so the debug
tools should be updated.

Closes #4203
2015-09-16 18:00:28 +00:00
8f985dd558 docs(pipe_transform): remove extra backticks 2015-09-16 10:01:37 -07:00
64e8f93f32 feat(dart/transform): Record property metadata
Update the transformer to generate code registering annotations on class
properties, getters, and setters.

Closes #1800, #3267, #4003
2015-09-16 08:54:35 -07:00
cc1d758eba chore(doc-gen): fix incorrect description field in class template
Closes #4191
2015-09-16 13:14:09 +00:00
045cb90a46 docs(core/facade/collection): Correct typo
Add correct spelling of the word "statically"
Closes #4193
2015-09-16 12:14:24 +00:00
d6cda15879 refactor(form): misc minor refactoring
Closes #3951
2015-09-16 10:34:26 +00:00
73351ac00f fix(NgClass): ignore empty and blank class names
Fixes #4033

Closes #4173
2015-09-16 07:56:48 +00:00
5bab607f44 chore(examples): remove dynamic versions of example apps
Closes #4200
2015-09-16 00:23:49 +00:00
16bf335a4a refactor(async): replace RxJS with RxNext
Closes #3110
Closes #4201
2015-09-15 23:44:57 +00:00
7b3161a229 fix(pipes): add triple ticks around async_pipe code sample
Closes #4110
2015-09-15 15:50:44 -07:00
267121ee17 refactor(dart/transform): Test directive processor using protos
Directly test the `NgDepsModel` object created by the
`DirectiveProcessor` rather than string comparing output Dart code.
2015-09-15 13:56:44 -07:00
045cc8269f fix(compiler): remove attributes when expression in [attr.foo]='exp' evaluates to null
Fixes #4150

Closes #4163
2015-09-15 19:59:12 +00:00
9f999dd8e4 cleanup(pipes): clean up imports 2015-09-15 11:47:09 -07:00
d890c4f827 refactor(pipes): remove LimitTo pipe in favor of slice pipe 2015-09-15 11:42:31 -07:00
c2043ec681 feat(pipes): add slice pipe that supports start and end indexes 2015-09-15 11:42:30 -07:00
0808eeaa0c feat(StringWrapper): add support for JS slice method to string 2015-09-15 11:42:30 -07:00
bced3aaa17 fix(ListWrapper): make list slice in dart return empty list if start and end are inverted like JS 2015-09-15 11:42:30 -07:00
105db02e07 fix(api): remove DomRenderer from public API
Closes #4187
2015-09-15 18:12:05 +00:00
61b6a475a6 fix(api): remove RecordViewTuple / cleanup NgFor 2015-09-15 18:12:05 +00:00
6db9f9013d fix(api): remove UNDEFINED 2015-09-15 18:12:05 +00:00
f7d46e7159 fix(api): remove animation from public API 2015-09-15 18:12:05 +00:00
5b6d576f93 chore: add test to prevent accidental changes to public API 2015-09-15 18:12:05 +00:00
255ed69392 docs(router): Typo
Closes #4152
2015-09-15 18:07:00 +00:00
851b1cf013 build(gulp): properly exit tasks that don't use broccoli pipeline when ctrl+c is hit
Closes #4194
2015-09-15 18:00:01 +00:00
dcd2df2486 build(gulp): add docs/angular.io/watch and docs/angular.io/copy tasks 2015-09-15 18:00:01 +00:00
5f15363dab feat(CORE_DIRECTIVES): add NgStyle to CORE_DIRECTIVES
Fixes #4096

Closes #4161
2015-09-15 17:55:13 +00:00
a15b679494 feat(ng_for): Add Even and Odd variables to ng_for
Add even and odd local variables to ng_for to allow developers to style table rows differently and other features.

Closes #4181
2015-09-15 17:45:32 +00:00
db098650ee docs: correct typo 2015-09-15 10:19:49 -07:00
f7b6ff0520 chore(build): improve reliability of the saucelabs job
Closes #4091
Closes #4047
2015-09-15 18:34:13 +02:00
df7f59b3a8 fix(test): do not set ng.probe when ng is null or undefined 2015-09-15 18:33:33 +02:00
abc4ef31e2 fix(test): AngularProfiler should check before using modern APIs 2015-09-15 18:33:32 +02:00
55290b9b21 fix(test): PostMessageBusSink tests failing in slow browsers 2015-09-15 18:33:31 +02:00
d6464633fa fix(test): StyleCompiler tests failing in Android browsers 2015-09-15 18:33:30 +02:00
c83207f231 fix(test): Android browser does not support element.click() 2015-09-15 18:33:29 +02:00
3a7b50f244 fix(shims): function.name to return empty string when no name 2015-09-15 18:33:28 +02:00
e889ec8335 refactor(dart/transform): Use a protobufs representation during transform
To simplify processing and testing in the future, use protobufs to
represent of `.ng_deps.dart` files rather than always dealing
directly in Dart code.

This update does not actually use the protobuf representation, but this
is a step towards moving all phases to parse and use protobufs rather than
Dart code.
2015-09-15 08:39:07 -07:00
cb4ff7491a chore(dart/transform): Integrate protoc into gulp build
This change detects if the user has `protoc` available and, if so, uses
it to generate `.pb.dart` files. If not, pre-built files are used
instead.
2015-09-15 08:39:07 -07:00
5298eb0709 feat(router): enforce convention of CamelCase names in route aliases
Closes #4083
2015-09-14 22:46:02 -07:00
cb4a9a3c04 refactor(router): use CamelCase aliases for routes 2015-09-14 22:46:02 -07:00
97d1844bfc feat(core): Add a long-form syntax for Angular bootstrapping.
This change adds a syntax for bootstrapping Angular on a page that allows more fine-grained control of the hierarchy created. platform() creates a platform injector (of which there can only be one). From the platform, .application() creates an Angular application including a Zone and all specified application bindings (e.g. for the DOM, HTTP, Compiler, Renderer, etc). At the application level, .bootstrap() will bootstrap the given component into that application.

Closes #3852
2015-09-14 23:37:39 +00:00
193792c27f refactor(router): Switch from using APP_COMPONENT binding to a manual ROUTER_PRIMARY_COMPONENT binding.
With the coming bootstrapping changes, a single application (and thus Router) can have multiple root components. One of these needs to be identified as the "primary" component from which the Router will load its configuration. This is now done by providing a ROUTER_PRIMARY_COMPONENT binding to the primary component type.
2015-09-14 23:37:39 +00:00
4f57990d45 feat(core): Support multiple ChangeDetectors in a single LifeCycle.
This allows a single LifeCycle to be shared among multiple root components, since each root component has its own ChangeDetector configured.
2015-09-14 23:37:39 +00:00
9dc1d6ae81 fix(code size): do not rely on Uri in BrowserDomAdapter
Closes #4182
2015-09-14 22:51:53 +00:00
e4f94f0678 fix(build): lazy-require es6-shim in the a1 router to prevent npm/gulp issues
We should really remove this shim from the angular 1 bundle. I'll create an issue for that.
2015-09-14 15:38:10 -07:00
bfbce542e6 chore(material): add unit tests for MdButton. 2015-09-14 14:36:57 -07:00
d2458866c1 refactor(router): remove unused Pipeline 2015-09-14 21:21:57 +00:00
cac25fe003 chore(build): replace traceur-runtime with es6-shim.
This removes traceur as a dependency for the t push -f
angular2 build.

Closes #4148
2015-09-14 21:02:29 +00:00
309944931f fix(router): recognize child components with empty segments
Previosly, recognition ended when a parent captured all the parsed URL segments.
This caused routes that delegated from a parent to a child with an empty segment
to never be recognized.

Closes #4178
2015-09-14 20:22:40 +00:00
63e785902f feat(change_detection): allow triggering CD form ChangeDetectorRef
Closes #4144
2015-09-14 18:07:31 +00:00
83715f06d1 chore(docs): typo 2015-09-14 18:07:31 +00:00
b42b9fc42d refactor(hooks): change to intrefaces 2015-09-14 18:07:31 +00:00
39ce9d3397 feat(animate): adds basic support for CSS animations on enter and leave
Closes #3876
2015-09-14 17:37:09 +00:00
effbb54f3d docs(metadata): fix some minor typos
Closes #4157
2015-09-13 13:36:35 +00:00
d1dbc973c4 docs(DirectiveMetadata): fix some minor typos 2015-09-13 13:36:35 +00:00
feddefdc84 docs(DirectiveMetadata): fix typo
Closes #4153
2015-09-12 13:28:29 +00:00
787d1f955f fix(Typings): Remove public exports added in 1926335b85
Closes #4147
2015-09-11 19:16:57 -07:00
0246b2a2cb feat(compiler): support creating template commands
Closes #4142
2015-09-12 01:16:06 +00:00
71cbb49672 refactor(compiler): allow to serialize and deserialize DirectiveMetadata 2015-09-12 01:16:06 +00:00
67c79ba3f6 fix(test): make evalModule faster by caching spawned modules in the browser 2015-09-12 01:16:06 +00:00
d9036c6cf3 feat(router): introduce new navigate method
Previously, `router.navigate` took a string representing the URL.
Now, it accepts an array that mirrors the link DSL.

Closes #4040

BREAKING CHANGE

The old method has been renamed to `router.navigateByUrl`.
Either change your navigation calls to use the DSL (preferred) or
call `router.navigateByUrl` instead.

Closes #4074
2015-09-11 17:20:13 -07:00
acc2722cb8 refactor(router): rename navigate and navigateInstruction methods 2015-09-11 17:17:45 -07:00
5e49d7e624 fix(router): load route config from async instructions
Previously, async routes generated from links would not load the configs of
their resolved components, which led to broken links in the children of the
async instruction's component.

This commit fixes the bookkeeping in the Router to correctly load the configs.

Fixes internal b/23791558

Closes #4146
2015-09-11 16:23:40 -07:00
4c2fb1f6e8 chore(package.json): update karma-jasmine
Closes #4116
2015-09-11 23:22:31 +00:00
de9dc55852 chore(bundles): switch bundler tool input from es6 to es5.
Http sfx bundle was not regenerated when bundles.js task was called.

The new bundles are a bit bigger (angular2.min.js 519604 -> 590056 bytes).
Part of it is because TS inlines class shims vs defering to
TraceurRuntime.

BREAKING CHANGE:

TraceurRuntime is no longer need when consuming the angular 2 bundles.
Shims or native support for ES6 Map, Set and Symbol are still needed (can be
provided by es6-shim.js or core.js).

Closes #4141
2015-09-11 23:11:11 +00:00
013811c171 chore(benchmarks): enable the transformer on the static_tree benchmark
Closes #4143
2015-09-11 23:03:29 +00:00
e34a29dafe docs(http): fix http documentation
Closes #3931
2015-09-11 15:37:40 -07:00
9b009b3159 chore(DEVELOPER.md): add details for configuring Dart on Windows
Follows #3865
Closes #3939
2015-09-11 15:37:40 -07:00
d4383af022 docs: Fix broken link to download angular page
Closes #3958
2015-09-11 15:37:35 -07:00
b91a966d05 docs: RenderProtoViewMergeMapping typo
Closes #4042
2015-09-11 15:37:26 -07:00
958863d038 docs: correct typo 'specifity' to 'specificity'
Closes #4082
2015-09-11 15:37:21 -07:00
fd14460148 docs: fixed misspelling of the word 'explicitly'
Closes #4108
2015-09-11 15:37:13 -07:00
4df0604f09 docs: cleanup
According to dictionary 'syntax' is countable and according to context it should be plural.

fix the broken table of template summary.

fix the table in Property Binding.

fix a position of right parethesis in Property Binding.

fix a occurance of a non-sense underscore.

fix a table in Inline Templates.

fix a missing '.' in Template Microsyntax.

fix the table in '## Binding Events'.

fix an article usage of 'an' against 'a' in '## Binding Events'.

fix a statement against the usage of plural after 'any'.

fix the typo error in former fixes.

Closes #3994
2015-09-11 15:25:34 -07:00
a826f22698 docs(di): fix typo "before before"
Closes #3986
2015-09-11 15:25:34 -07:00
7ccef08715 docs(core): fixed typo in RenderCompiler comments
Just a small typo fix :)
Closes #4046
2015-09-11 15:25:34 -07:00
716ce08a93 docs(angular2/angular2_sfx): Correct typo
Add correct spelling of the word "arithmetic"

Closes #4066
2015-09-11 15:25:33 -07:00
646b9200a2 docs(web_workers): fix typo
Closes #4070
2015-09-11 15:25:33 -07:00
6449c3c1c6 docs(CompilePipeline): correct compiliation to compilation
Closes #4072
2015-09-11 15:25:33 -07:00
1fba78b12a docs(web_workers/shared/message_bus.ts): correct typo
Closes #4076
2015-09-11 15:25:32 -07:00
80a04b4323 docs(message_bus.ts):Change initilialized to initialized
Closes #4077
2015-09-11 15:25:32 -07:00
41c7c57c65 docs(web_workers/worker/renderer.ts): correct typo
Closes #4078
2015-09-11 15:25:32 -07:00
f7fb5097b9 docs(proto_view_merger.ts):Change seprate to separate
Closes #4079
2015-09-11 15:25:32 -07:00
20fbbcc72d docs(web_workers/ui/di_bindings): Correct typo
Closes #4081
2015-09-11 15:25:32 -07:00
f94a2d86fb docs(web_workers/shared/message_bus.ts): correct typo 'messsage' to 'message'
Corrects the typo 'messsage' to 'message' on line 35.
Closes #4085
2015-09-11 15:25:31 -07:00
55358a39dc docs(core/render/dom/compiler/property_binding_parser.ts): correct typo
"identifier" was misspelled.
Closes #4095
2015-09-11 15:25:31 -07:00
a2bcf71b6b docs(core/di/binding.ts): Correct typo
Closes #4099
2015-09-11 15:25:31 -07:00
18de0ceeb1 Fixes typo 'partialy' -> 'partially'
Closes #4102
2015-09-11 15:18:29 -07:00
fc82700364 docs(web_workers/shared/application.ts): correct typo
Closes #4109
2015-09-11 15:18:29 -07:00
16ecc7e82d docs(core/pipes/date_pipe.ts): configurable typo
Closes #4121
2015-09-11 15:18:28 -07:00
ed586f0b4a docs(forward_ref): typo
Closes #4123
2015-09-11 15:18:27 -07:00
f66c3a21eb docs(di/binding): Typo
Closes #4124
2015-09-11 15:18:26 -07:00
17eb41ff48 docs(core/render): view typo
Closes #4125
2015-09-11 15:18:26 -07:00
31e385c70d docs(compiler/element_injector): typo beneficial
Closes #4126
2015-09-11 15:18:25 -07:00
cc8a6ebf68 docs(codegen_logic_util): typo
Closes #4127
2015-09-11 15:18:24 -07:00
19408968f3 docs(di/binding.ts): Typo on line 73
Closes #4128
2015-09-11 15:18:24 -07:00
efaed076ab docs(pipes): add missing parenthesis in AsyncPipe example
Closes #4139
2015-09-11 15:18:23 -07:00
47e09a38e6 Add ES5 examples - before and after
Closes #4130
2015-09-11 19:41:21 +00:00
ffd4f06ab7 Adding lifecycle breaking change to the changelog.md 2015-09-11 19:41:21 +00:00
3c13f5fd4b test(router): add integration test for async routes with children 2015-09-11 11:24:36 -07:00
f6cc573687 fix(exception_handler): fix error messages of wrapped exceptions
Closes #4117
2015-09-10 22:26:56 +00:00
892d2b9652 refactor(exception_handler): move ExceptionHandler into facade 2015-09-10 22:26:55 +00:00
8d538ff42e tools: add .vscode to .gitignore 2015-09-10 22:26:55 +00:00
63141ab9ab chore(tools): remove rtts from the repo.
Closes #4107
2015-09-10 21:10:36 +00:00
6a4a8a60ab docs(WebWorker): Fix typos in WebWorker docs 2015-09-10 10:39:28 -07:00
7ec4da40ce chore(changelog): update change log to alpha 37 2015-09-10 10:18:17 -07:00
4fd9cc26d5 fix(core): export bootstrap from core exports for JS
Closes #4097
2015-09-10 05:05:09 +00:00
1926335b85 fix(Typings): Output public constructors in .d.ts files
Closes #3926.

Closes #3963
2015-09-10 01:37:43 +00:00
12dd44f7f6 feat(compiler): add change detector generation
Runtime and Codegen.

Part of #3605
Closes #4057
2015-09-10 00:59:34 +00:00
2daf2eedb6 docs(WebWorkers): Add overview of WebWorker design
Closes #4103
2015-09-09 23:16:11 +00:00
2ab8c59ad5 docs(pipes): improve docs for async pipe
Closes #4104
2015-09-09 22:31:07 +00:00
0653b82048 fix(benchpress): fix benchpress overreporting in chrome45
closes #4011

Closes #4101
2015-09-09 21:37:48 +00:00
77e8304fc4 fix(router): do not reuse common children with different parents 2015-09-09 12:03:59 -07:00
8aec215ca0 fix(router): throw when generating non-terminal link
Closes #3979

Closes #4092
2015-09-09 15:53:30 +00:00
f91c087c46 feat(TestComponentBuilder): add #overrideBindings and #overrideViewBindings
Closes #4052
2015-09-09 14:20:05 +00:00
39a6f85e95 test(TestComponentBuilder): add tests for overriding child component's directive 2015-09-09 14:20:05 +00:00
3dfb7d406b docs(angular1_router/build): Correct typo
Closes #4069
2015-09-09 06:20:55 +00:00
8810f53435 chore(benchmarks): rename static_tree to static_tree_perf
Closes #4061
2015-09-09 03:58:26 +00:00
998c7c2e03 doc: add some API doc
Closes #4060
2015-09-09 02:49:07 +00:00
5e013c4aef doc(DEVELOPER): describe how to generate & serve API docs
Closes #3968
2015-09-09 01:43:42 +00:00
8dd6c4680b feat(perf): change detection profiler
Closes #4000
2015-09-09 01:12:58 +00:00
28a29f5557 refactor(dart/transform): Make implementation details private 2015-09-08 15:47:15 -07:00
f3da37c92f fix(WebWorker): Add zone support to MessageBus
Closes #4053
2015-09-08 14:03:58 -07:00
3b9c08676a fix(compiler): Implement Token#toString for Operator
Include a case for `TokenType.Operator`.

Closes #4049
2015-09-08 10:30:27 -07:00
a8bdb693b9 feat(pipes): add support for pure pipes
By default, pipes are pure. This means that an instance of a pipe will be reused and the pipe will be called only when its arguments change.

BREAKING CHANGE

Before:

@Pipe({name: 'date'}) class DatePipe {} defines an impure pipe.

After:

@Pipe({name: 'date'}) class DatePipe {} defines a pure pipe.
@Pipe({name: 'date', pure: false}) class DatePipe {} defines an impure pipe.

Closes #3966
2015-09-08 16:24:27 +00:00
5a59e8be82 chore: update reflect-metadata to 0.1.1
Closes #3989
2015-09-08 15:51:06 +00:00
26a064ce87 docs(CHANGELOG.md): Remove duplicate alpha.36 notes
Remove duplicate notes for alpha.36 release to fix formatting issues.

No issue to close

Closes #3954
2015-09-08 15:17:10 +00:00
70f6a46f1c fix(forms): Also update viewModel in NgFormControl 2015-09-05 11:58:42 -07:00
e36966b83c fix(forms): Update NgModel's viewModel when model changes
Closes #3627
2015-09-05 11:58:42 -07:00
f14b212dc9 refactor: export core APIs from angular2/core
This change moves many APIs to the angular2/core export.

This change also automatically adds FORM_BINDINGS in
the application root injector.

BREAKING CHANGE:
    Many dependencies that were previously exported from specific
    APIs are now exported from angular2/core. Affected exports, which
    should now be included from angular2/core include:

    angular2/forms
    angular2/di
    angular2/directives
    angular2/change_detection
    angular2/bootstrap (except for dart users)
    angular2/render
    angular2/metadata
    angular2/debug
    angular2/pipes
Closes #3977
2015-09-05 07:01:34 +00:00
6d13cf9b8f refactor(core): move more modules into core 2015-09-05 07:01:34 +00:00
841aa1af5b fix(annotation_matcher): fix typo with Directive matchers 2015-09-05 07:01:34 +00:00
2d4f331c63 chore: update ts2dart version 2015-09-05 07:01:34 +00:00
86bda288bd fix(DirectiveResolver): Synced with latest changes
Closes #3928
2015-09-05 01:02:33 +00:00
3d38ec8aac refactor(Lifecycle hooks): move the hooks to their own module (lifecycle_hooks)
BREAKING CHANGE

Lifecycle hooks now live in the `angular2/lifecycle_hooks` module.
They previously lived in the `metadata` module.
2015-09-05 01:02:33 +00:00
ef88e0f804 refactor(transformers): extract lifecycle hooks from the interfaces 2015-09-05 01:02:33 +00:00
8302afffb4 refactor(LifecycleEvent): remove LifecycleEvent
fixes #3924

BREAKING CHANGE

The `lifecycle` configuration for directive has been dropped.

Before

    // Dart
    @Component({lifecycle: const [LifecycleEvent.OnChanges], ...})
    class MyComponent implements OnChanges {
      void onChanges() {...}
    }

    // Typescript
    @Component({lifecycle: [LifecycleEvent.OnChanges], ...})
    class MyComponent implements OnChanges {
      onChanges(): void {...}
    }

    // ES5
    var MyComponent = ng.
    Component({lifecycle: [LifecycleEvent.OnChanges], ...}).
    Class({
      onChanges: function() {...}
    });

After

    // Dart
    @Component({...})
    class MyComponent implements OnChanges {
      void onChanges() {...}
    }

    // Typescript
    @Component({...})
    class MyComponent implements OnChanges {
      onChanges(): void {...}
    }

    // ES5
    var MyComponent = ng
      .Component({...})
      .Class({
        onChanges: function() {
        }
      });
2015-09-05 01:02:33 +00:00
67b9414268 fix(benchpress): make benchpress fit for chrome 45
Closes #3411

Closes #3982
2015-09-05 01:01:13 +00:00
d8c5ab232c refactor: add leading underscore to private fields
Closes #4001
2015-09-05 00:54:50 +00:00
c320240086 chore(benchmarks): enable transformer on the benchmarks
Closes #3960
2015-09-05 00:25:51 +00:00
15164a8e6c fix(reflector): merge prop metadata from getters and setters
Closes #4006
2015-09-04 23:44:22 +00:00
4ec4dcabe9 feat(docs): document change detection profiler 2015-09-04 16:38:53 -07:00
e9ad100b1f fix(build): switch to cjs output for es5.
System output does not work at the current versions of TS and
system.js. Will revisit after upgrading TS.

Removes unused traceur tooling.

Closes #3974
2015-09-04 23:10:34 +00:00
b025f94351 chore(build): Remove traceur from build.
This removes traceur from the compilation step in broccoli. Broccoli now
transpiles to es5 using the typescript compiler.
2015-09-04 23:10:34 +00:00
df8e15cab7 feat(core): add support for @HostBinding and @HostListener
Example:

@Directive({selector: 'my-directive'})
class MyDirective {
  @HostBinding("attr.my-attr") myAttr: string;
  @HostListener("click", ["$event.target"])
  onClick(target) {
    this.target = target;
  }
}

Closes #3996
2015-09-04 22:18:22 +00:00
855cb16cc7 refactor(event_manager): use multi bindings to configure EventManager
Closes #3978
2015-09-04 21:57:36 +00:00
5ebeaf7c9b feat(query): implement query update mechanism based on views.
Instead of working with finer grained element injectors, queries now
iterate through the views as static units of modification of the
application structure. Views already contain element injectors in the
correct depth-first preorder.

This allows us to remove children linked lists on element injectors and a
lot of book keeping that is already present at the view level.

Queries are recalculated using the afterContentChecked and
afterViewChecked hooks, only during init and after a view container has
changed.

BREAKING CHANGE:
ViewQuery no longer supports the descendants flag. It queries the whole
component view by default.

Closes #3973
2015-09-04 21:39:35 +00:00
9d42b52d2c chore(doc-gen): add spaces when removing linebreaks for Jade _data.json files
Closes #3623

Closes #3997
2015-09-04 21:39:15 +00:00
34b91c62c5 chore(doc-gen): convert private classes to interfaces in the docs
Closes #3576
2015-09-04 21:39:15 +00:00
4bffd97edd chore(doc-gen): move the "private class" converter into a helper service
This will allow it to be reused in other doc gen configurations
2015-09-04 21:39:15 +00:00
be954115f8 feat(NgFor): $last property support
Makes a new `$last` property available during the loop with a boolean
showing if it's the last item in the iteration.

closes: #3102

Closes #3991
2015-09-04 21:01:42 +00:00
2384082b5c feat(compiler): add stylesheet compiler
Part of #3605
Closes #3891
2015-09-04 19:22:43 +00:00
2a126f72f3 feat(tests): add helper to eval a module
Needed later for unit tests for code gen and runtime code
in #3605
2015-09-04 19:22:43 +00:00
896add7d77 feat(core): add support for @Property and @Event decorators
Example:

@Directive({selector: 'my-selector'})
class MyDirective {
  @Property() prop;
  @Property('el-prop') prop2;
  @Event() event;
  @Event('el-event') event2;
}

Closes #3992
2015-09-04 18:33:31 +00:00
337ce21149 docs(util): fix typos
Closes #3988
2015-09-04 15:35:29 +00:00
d78261695b fix(dts generation): add support for type aliases
Closes #3952
2015-09-03 23:52:10 +00:00
ad3b9cf232 fix(dts generation): rewrite the d.ts file code generator to fix bugs and apply type remap correctly
Previously the type remap was not being applied to comments and free floating functions.

The nunjucks template was becoming unreadable so rather than making a tweak there I
rewrote it into imperative code that is much easier to follow.

The output was diffed against the old output. The diff contained only the expected changes.
2015-09-03 23:52:10 +00:00
34deda594f fix(test_lib): add missing types 2015-09-03 23:52:10 +00:00
f6108c54ec fix(build): add config for outputting the missing test_lib.d.ts file 2015-09-03 23:52:10 +00:00
687e7b565f fix(test_lib): reexport fake_async via angular/test
previously fake_async was not being publically exported at all
2015-09-03 23:52:10 +00:00
ddde7117a7 fix(fake_async): remove unused variable 2015-09-03 23:52:10 +00:00
44c303aad2 refactor(collection.ts): simplify ListWrapper.clear implementation 2015-09-03 23:52:10 +00:00
53d0861372 style(di): fix a variable name typo 2015-09-03 23:52:09 +00:00
696edde17c fix(WebWorker): Fix Todo Server demo and add test to ensure the demo can bootstrap.
Closes #3970
2015-09-03 18:52:06 +00:00
3ff321475d cleanup(di): fix dart analyzer errors
Closes #3962
2015-09-03 15:18:18 +00:00
d43bd9b4ca refactor(forms): update example apps to use the new way of registering validators 2015-09-03 15:18:18 +00:00
79994b2abf refactor(forms): use multibindings instead of query to get a list of validators
BREAKING CHANGE

Before:

@Directive({selector: '[credit-card]', bindings: [new Binding(NgValidator, {toAlias: forwardRef(() => CreditCardValidator)})]})
class CreditCardValidator {
  get validator() { return CreditCardValidator.validate; }
  static validate(c): StringMap<string, boolean> {...}
}

After:

function creditCardValidator(c): StringMap<string, boolean> {...}
@Directive({selector: '[credit-card]', bindings: [new Binding(NG_VALIDATORS, {toValue: creditCardValidator, multi: true})]})
class CreditCardValidator {}
2015-09-03 15:18:18 +00:00
7736964a37 feat(di): add support for multi bindings
BREAKING CHANGE

Previously a content binding of a component was visible to the directives in its view with the host constraint. This is not the case any more. To access that binding, remove the constraint.
2015-09-03 15:18:18 +00:00
2fea0c2602 feat(compiler): allow to create ChangeDetectors from parsed templates
Part of #3605
Closes #3950
2015-09-02 23:20:14 +00:00
5c9613e084 test(query): add a test for view query with var bindings
Closes #3920

Closes #3946
2015-09-02 20:26:59 +00:00
01cdd31339 fix(query): clean-up queryref during dehydration
The QueryRef objects persists during dehydration but needs to be
cleaned-up by removing callbacks and previous elements.

Closes #3944

Closes #3948
2015-09-02 19:00:17 +00:00
44a991e245 refactor(test_lib): do not execute jasmine test as async if not required
fixes #3893
2015-09-01 17:49:24 -07:00
46f751bd2f feat(docs): document unused reflection info tracking 2015-09-01 16:59:19 -07:00
358908e605 feat(WebWorker): Expose MessageBroker API
Closes #3942
2015-09-01 23:53:54 +00:00
6532171997 feat(docs): document code size management tools for Dart 2015-09-01 16:18:34 -07:00
b9cf945b30 chore(di): do not double export DI 2015-09-01 13:28:15 -07:00
5b8ce1e42a chore(http.d.ts): have http properly reexport core types 2015-09-01 13:28:15 -07:00
7c7888de4f fix(ComponentUrlMapper): support relative template URLs in Dartium
When running in Dartium without using transformers (i.e. with a normal
static web server), handle relative template URLs. This works by using
mirrors to get the URL of the library where the component class is
defined.

Closes #2771

Closes #3743
2015-09-01 18:19:55 +00:00
42e1b07705 fix(build): delete unreferenced typings on npm install
fixes #1636

Closes #3940
2015-09-01 17:37:56 +00:00
60ce884671 feat(core): remove the (^ syntax and make all DOM events bubbling
BREAKING CHANGE

Before
<div (^click)="onEventHandler()">
  <button></button>
</div>

After
<div (click)="onEventHandler()">
  <button></button>
</div>

Closes #3864
2015-09-01 15:54:47 +00:00
9934b3ec7f chore(package.json): remove unused es6-module-loader dependency
Closes #3867
2015-09-01 13:52:57 +00:00
12a8064c27 chore(gulpfile.js): Fix some hint issues in gulpfile.js
Closes #3905
2015-09-01 05:01:39 +00:00
ad1bd5fc11 refector(router): rename outlet integration spec to navigation spec
The new name better reflects the behavior under test.
2015-08-31 23:24:09 +00:00
fc7068550c chore(changelog): update change log to alpha 36 2015-08-31 16:23:15 -07:00
a8028b87c4 chore(package): bump up the version 2.0.0-alpha.36 2015-08-31 16:23:07 -07:00
78f11f6333 chore: update zone to 0.5.4
Closes #2912
2015-08-31 15:37:37 -07:00
3791c4a682 fix(RouteRegistry): initialize RouteParams.params
Fix a bug caused by RouteRegistry.generate not initializing RouteParams.params to a StringMap

Closes #3755
2015-08-31 22:02:50 +00:00
ecf6ba3974 refactor: prefer const over var for constants
Closes #3818
2015-08-31 21:59:33 +00:00
b29b045d78 refactor(WTF): rename scopes to follow coding conventions 2015-08-31 21:59:33 +00:00
c349bbbc08 refactor(ViewEncapsulation): rename to PascalCase
BREAKING CHANGE

- ViewEncapsulation.EMULATED => ViewEncapsulation.Emulated
- ViewEncapsulation.NATIVE => ViewEncapsulation.Native
- ViewEncapsulation.NONE => ViewEncapsulation.None

Closes #3889
2015-08-31 21:32:10 +00:00
e916836261 chore(ts2dart): replace List with Array
Closes #3514
2015-08-31 21:32:10 +00:00
4415855683 refactor(ngProbe): rename to ng.probe
BREAKING CHANGE:

Closes #3786

- ngProbe => ng.probe
2015-08-31 21:32:10 +00:00
cebd670a8e refactor(ChandeDetection): Rename ChangeDetectorRef.markForCheck
BREAKING CHANGE

Closes #3403

- ChangeDetectorRef.requestCheck() => ChangeDetectorRef.markForCheck()
2015-08-31 21:32:10 +00:00
b8be4bfaaf fix(router): re-export of Type
Closes #3632

Closes #3704
2015-08-31 20:47:37 +00:00
6c3c6060a5 fix(core): Fix type error
Ensure that values passed to `DomRenderer#setElementAttribute` are
strings. Currently, booleans can be passed to this method, resulting in
failures when running in Dart checked mode.
2015-08-31 13:02:29 -07:00
46dd5fcbb0 refactor(transform): Remove reflection_entry_points parameter
Remove the now unnecessary `reflection_entry_points` parameter from the
Angular 2 transformer.

Support glob syntax for `entry_points`.
2015-08-31 13:02:29 -07:00
0f54ed0306 chore(docgen): Use updated dartdoc tool
Use the new `dartdoc` tool, which
[shipped with 1.12](https://groups.google.com/a/dartlang.org/forum/#!topic/announce/Q1JSlVaFFnY)

Update the sdk constraint to 1.12
2015-08-31 19:30:22 +00:00
9619636ba7 fix(WebWorker): WebWorkerRenderer removes views after they're destroyed
closes #3240

Closes #3894
2015-08-31 18:33:25 +00:00
fa2c6791b4 docs(router): improve docs for RouterOutlet methods
Closes #3909
2015-08-31 18:09:32 +00:00
ad16e9d910 refactor(router): move setting reuse flag from RouterOutlet to Router 2015-08-31 18:09:32 +00:00
7de447e4b5 test(router): fix typo in spec name 2015-08-31 18:09:32 +00:00
36eb9d392d feat(router): router-link-active CSS class support
The `[router-link]` directive now applies the `router-link-active` CSS
class to the associated element whenever the link is active.

Closes #3209
2015-08-31 18:09:32 +00:00
de37729823 feat(router): implement Router.isRouteActive 2015-08-31 18:09:32 +00:00
e1a7e0329c feat(router): hash-cons ComponentInstructions 2015-08-31 18:09:32 +00:00
76e1f863a2 docs(router): add description for Url class 2015-08-31 18:09:32 +00:00
d49bc438e8 feat(core): added afterContentInit, afterViewInit, and afterViewChecked hooks
Closes #3897
2015-08-31 17:16:54 +00:00
f93cd9ced7 feat(compiler): add full directive metadata and validation logic
With this, the new `TemplateParser` has feature/data parity with the `ProtoViewDto` of the `RenderCompiler`.

Part of #3605

Closes #3880
2015-08-28 14:55:47 -07:00
0f4eb1b524 refactor(compiler): simplify metadata 2015-08-28 14:55:23 -07:00
3468f7cfd5 chore(build): Add WebWorker bundle.
Closes #3207

Closes #3881
2015-08-28 20:40:16 +00:00
be07390859 refactor(test_lib): BrowserDetection util
Closes #3805
2015-08-28 11:41:17 +02:00
551d9a1688 chore(LifecycleEvent): change to PascalCase / rename
BREAKING CHANGE

Closes #3863

- LifecycleEvent.onInit => LifecycleEvent.OnInit
- LifecycleEvent.onDestroy => LifecycleEvent.OnDestroy
- LifecycleEvent.onChange => LifecycleEvent.OnChanges
- LifecycleEvent.onCheck => LifecycleEvent.DoCheck
- LifecycleEvent.onAllChangesDone => LifecycleEvent.AfterContentChecked
- OnCheck.onCheck() => DoCheck.doCheck()
- OnChange.onChange() => OnChanges.onChanges()
- OnAllChangesDone.onAllChangesDone() => AfterContentChecked.afterContentChecked

Closes #3851
2015-08-27 22:32:21 -07:00
ac3f5106e4 refactor(view): remove hostActions
BREAKING CHANGE

Closes #3396

Replacement. Either direct DOM access or Renderer in WebWorkers.
2015-08-27 22:32:21 -07:00
37b042b361 chore: Make enum names consistent with TypeScript convention
BREAKING_CHANGE

Ts2Dart issue: https://github.com/angular/ts2dart/issues/270
TypeScript convention: https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines
DartConvertion: https://www.dartlang.org/articles/style-guide/

Rename:

- NumberFormatStyle.DECIMAL => NumberFormatStyle.Decimal
- NumberFormatStyle.PERCENT => NumberFormatStyle.Percent
- NumberFormatStyle.CURRENCY => NumberFormatStyle.Currency
- RequestMethods.GET => RequestMethods.Get
- RequestMethods.POST => RequestMethods.Post
- RequestMethods.PUT => RequestMethods.Put
- RequestMethods.DELETE => RequestMethods.Delete
- RequestMethods.HEAD => RequestMethods.Head
- RequestMethods.PATCH => RequestMethods.Patch
- ReadyStates.UNSENT => ReadyStates.Unsent
- ReadyStates.OPEN => ReadyStates.Open
- ReadyStates.HEADERS_RECEIVED => ReadyStates.HeadersReceived
- ReadyStates.LOADING => ReadyStates.Loading
- ReadyStates.DONE => ReadyStates.Done
- ReadyStates.CANCELLED => ReadyStates.Canceled
2015-08-27 22:32:21 -07:00
465f7c95b0 chore(cjs): make async tests fail faster 2015-08-27 21:41:47 -07:00
69926dd002 refactor(change_detection): introduce enum ChangeDetectionStrategy
BREAKING CHANGE

Closes #2497

- change detection strategy type changes from string to ChangeDetectionStrategy
- CHECK_ONCE => ChangeDetectionStrategy.CheckOnce
- CHECKED => ChangeDetectionStrategy.Checked
- CHECK_ALWAYS => ChangeDetectionStrategy.CheckAlways
- DETACHED => ChangeDetectionStrategy.Detached
- ON_PUSH => ChangeDetectionStrategy.OnPush
- DEFAULT => ChangeDetectionStrategy.Default
- ON_PUSH_OBSERVE => ChangeDetectionStrategy.OnPushObserve
2015-08-27 21:41:46 -07:00
e41d7451bf chore: update NAMING.md with TypeScript conventions 2015-08-27 21:41:46 -07:00
3bb27deecc feat(exception_handler): changed ExceptionHandler to use console.error instead of console.log
Closes #3812
2015-08-28 00:09:01 +00:00
a34d4c6a5f fix(typings): emit spread parameters
Closes #3875
2015-08-27 21:55:10 +00:00
02d9e18279 chore(transform): Move registrations tests to modules_dart
This moves tests which were created in 104302a958
and were not moved in 88a5b8da0f.
2015-08-27 20:54:47 +00:00
8536df16d9 chore(build): fail experimental Dart build but allow Travis failures 2015-08-27 13:52:47 -07:00
a94f051d43 fix(bundle): don't include System.config in dev bundle
Fixes #3826

Closes #3862
2015-08-27 17:20:03 +00:00
78200868f4 fix(test): error in karma when systemjs imports fail
Closes #3846
2015-08-27 16:51:17 +00:00
256b2dc9b7 chore: remove ENUM_INDEX from facade
The ENUM_INDEX utility was added to return the index of an enum
consistently between Dart and TypeScript, so that the index
could be used to look up the name of the enum. Since dart is no
longer supported by Http, and since no other part of the framework
is using this function, it has been removed.

Closes #3843
2015-08-27 08:39:24 -07:00
51285666d8 chore(http): remove RequestMethodsMap
This class was only added to do a reverse lookup of
RequestMethods enum to get its name (i.e. "GET") for Dart.
Since Dart is no longer supported by Http, method names
can just be retrieved with TypeScript's support for
enum name lookup,
i.e. RequestMethods[RequestMethods.GET] === 'GET',
making the RequestMethodsMap utility obsolete.

Closes #2904
2015-08-27 08:36:40 -07:00
557d309377 chore(build): improve reliability of the saucelabs job
Closes #3848
2015-08-27 09:46:15 +02:00
4ba4427510 feat(WebWorkers): Add WebSocket MessageBuses for debugging apps
Closes #3858
2015-08-26 19:07:53 -07:00
9f576b0233 feat(compile): add HtmlParser, TemplateParser, ComponentMetadataLoader
First bits of new compile pipeline #3605
Closes #3839
2015-08-27 00:05:48 +00:00
343dcfa0c0 refactor(tests): removed @IMPLEMENTS 2015-08-26 15:06:25 -07:00
457eb5d69c fix(WebWorker): Return boolean from dispatchRenderEvent
Update web_worker `dispatchRenderEvent` to return a boolean, which
[view.ts](https://github.com/angular/angular/blob/master/modules/angular2/src/core/render/dom/view/view.ts#L85) expects.
2015-08-26 14:12:45 -07:00
5863f50316 chore(transform): Remove reflection_entry_points from examples pubspec
Specifying `reflection_entry_points` is no longer necessary for most
Angular 2 apps.

Closes #3850
2015-08-26 17:36:26 +00:00
8ed22ce6e7 chore: update all import paths 2015-08-25 15:33:23 -07:00
10437ab85c fix(http): change type declarations to interfaces and export EventEmitter 2015-08-25 15:33:22 -07:00
38a5a2a955 chore: move core modules into core directory
BREAKING CHANGE:
    This change moves the http module into angular2/, so its import
    path is now angular2/http instead of http/http.

    Many other modules have also been moved around inside of angular2,
    but the public API paths have not changed as of this commit.
2015-08-25 15:33:22 -07:00
56e88058f1 chore(shrinkwrap): update ts2dart version 2015-08-25 15:33:22 -07:00
5f6b7ffadb chore(build): Fix flaky builds caused by doc generation.
Closes #3836
2015-08-25 21:29:45 +00:00
6d2345accb chore(build): Fix test.unit.dart and test.unit.dartvm transformer load errors
Closes #3832
2015-08-25 19:47:58 +00:00
cc2a2e4bbc chore: add NAMING.md
Closes #3787
2015-08-25 19:19:47 +00:00
e72305e685 fix(build): do not run build/pubbuild.dart twice
Closes #3831
2015-08-25 18:33:00 +00:00
c2279dd651 fix(build): make e2e tests faster
Closes #3822
2015-08-25 17:04:46 +00:00
9cc1cd29ed feat(url_resolver): Allow a developer to customize their package prefix
Allow a developer to specify a package prefix where the 'package:' dart urls
will be resolved. By default this will be '/packages' keeping the current
behavior, but allows for flexibility of different environments where a
developer may not control their directory structure.

Closes #3794
2015-08-25 16:53:06 +00:00
894af28529 fix(typings): include static members
Fixes #3175

Closes #3780
2015-08-25 16:49:37 +00:00
bf4b75ee9c fix(build): error when running npm test locally
Closes #3806
2015-08-25 15:46:27 +00:00
21f60c5dce refactor(WebWorker): Abstract message passing and serialization to UIMessageBroker
closes #3703

Closes #3815
2015-08-25 03:18:22 +00:00
aeef19e2a6 refactor(router): reorganize 2.x tests 2015-08-24 20:55:50 +00:00
64ffd9e99c refactor(router): split 1.x tests into separate files 2015-08-24 20:55:50 +00:00
944ccc9a94 Removed unused parameter
Closes #3810
2015-08-24 20:41:05 +00:00
9262727ae1 feat(docs): export type info for var and const exports
Closes #3700
2015-08-24 20:31:51 +00:00
3963e0ab39 refactor(router): rename HTML5LocationStrategy to PathLocationStrategy
"HTML5" is a bit confusing. We want to differentiate between persisting location state
to the URL path, and the URL hash. Hence `PathLocationStrategy`.

BREAKING CHANGE

`HTML5LocationStrategy` -> `PathLocationStrategy`

Closes #3776
2015-08-24 12:13:53 -07:00
d2a3b76a71 chore(build): change comment to indicate the temporary fix is permanent.
Fixes #3770

Closes #3775
2015-08-24 18:33:18 +00:00
377e3ac962 chore(build): add mode Safari versions to CI
Close #3802
2015-08-24 18:17:56 +00:00
a191c89193 refactor(dart/analyzer plugin): update to latest version of plugins
Closes #3681
2015-08-24 16:45:21 +00:00
5725f71777 fix(http): allow using JSONP_INJECTABLES and HTTP_INJECTABLES in same injector
Fixes #3365

Closes #3390
2015-08-23 22:20:23 -07:00
88a5b8da0f chore(transform): move transform module to modules_dart
The build/pure-packages.dart gulp task has also been updated to move the files into the angular2 tree.
Closes #3729
2015-08-24 03:39:07 +00:00
92da5430e7 fix(injector): support getRootInjectors on dehydrated injectors.
Closes #3760
2015-08-24 02:41:43 +00:00
50eee42668 chore(build): add Android to CI
Closes #3756
2015-08-24 00:28:07 +02:00
d07b9181fe chore: update zone to 0.5.3
Closes #3785
2015-08-23 21:20:57 +00:00
5f0a0fd8d2 fix(wtf): fix NgZone.run instrumentation
Closes #3788
2015-08-23 18:52:09 +00:00
a205807191 chore(build): remove references to e6-module-loader
I believe that it is no longer necessery after migration
to a newer version of SystemJS

Closes #3752
2015-08-23 16:06:04 +00:00
b039ec3da3 fix(parser): detect and report interpolation in expressions
Fixes #3645

Closes #3750
2015-08-23 14:06:30 +00:00
5ee9630be1 docs(CORE_DIRECTIVES): documentation update after renames
Closes #3791
2015-08-23 12:53:16 +00:00
c4044102d6 test(ViewMetadata): use ViewMetadata consistently in tests
Closes #3746
2015-08-23 10:47:23 +00:00
215c4aa8fb fix(compiler): detect and report error for views with empty templateUrl
Fixes #3762

Closes #3768
2015-08-23 07:26:56 +00:00
3871f89119 fix(ViewLoader): provide componentId in missing template / templateUrl errors
Befor this change it wasn't clear which component is faulty
2015-08-23 07:26:56 +00:00
d853d19dd7 chore: have presubmit ignore builds which can fail. 2015-08-22 20:28:59 -07:00
5d403966d5 refactor: rename web-workers to web_workers
Closes #3683
2015-08-22 14:20:33 -07:00
20acb86ca2 chore: reformat npm-shrinkwrap.readme.md for normal line length 2015-08-22 14:20:33 -07:00
e8e430e630 feat(change_detection): added support for observable components and directives 2015-08-21 15:44:45 -07:00
85ec34d1d9 feat(build): added a temporary fix to make test.unit.dart work 2015-08-21 14:58:29 -07:00
a9ce454b21 fix(change_detection): fixed reflect properties as attributes
Closes #3761
2015-08-21 19:08:32 +00:00
b6146394ae refactor(change_detection): replaced devMode with ChangeDetectorGenConfig 2015-08-21 19:08:32 +00:00
764726d78e refactor(ApplicationRef): Move ApplicationRef to its own file
Closes #3763
2015-08-21 10:17:40 -07:00
65344fcac9 chore(build): add IE9 to CI
Closes #3747
2015-08-21 15:46:26 +00:00
ebb3236ad5 Revert "chore(benchmarks): disable broken benchmarks"
This reverts commit 09e0b0ac6f.

Closes #3764
2015-08-21 05:59:53 +00:00
9d44ae3d32 fix(docs) Added more readable links
Follows https://github.com/angular/angular/pull/3677

I hope this works.
2015-08-21 05:17:28 +00:00
d2d0715568 feat(change_detection): do not reparse AST when using generated detectors 2015-08-21 05:16:31 +00:00
b986c54079 chore: remove int in favor for number
Closes #3511
2015-08-21 05:10:31 +00:00
8336881a85 feat: track unused reflection data 2015-08-20 18:20:53 -07:00
b0d27ee896 chore(build): add IE10 to CI 2015-08-21 00:16:34 +02:00
9ba2ab5cea chore(build): add IE11 to CI 2015-08-21 00:16:33 +02:00
1c9be9b5aa chore(build): add Firefox to CI 2015-08-21 00:16:33 +02:00
49997ca932 chore(build): add iOS8 to CI 2015-08-21 00:16:33 +02:00
195c5c21d4 fix(change_detection): update the right change detector when using ON_PUSH mode
Previously, in a case where you have a mix of ON_PUSH and DEFAULT detectors, Angular would update the status of a wrong detector.
2015-08-20 21:55:50 +00:00
a0b240884b fix(.d.ts): show unknown fields as ‘any’ not ‘void’.
Closes #3637
2015-08-20 21:49:35 +00:00
9afcb00216 fix: wtf paramater passing on scope
Closes #3726
2015-08-20 13:47:44 -07:00
bde6416b40 Revert "Revert "feat(router): add reuse support for angular 1.x router""
This reverts commit cef51a7e0d.
2015-08-20 13:19:58 -07:00
06487237e5 Revert "Revert "feat(router): add angular 1.x router""
This reverts commit 298f1fb6a6.
2015-08-20 13:19:34 -07:00
964884e761 Revert "Revert "refactor(router): move ROUTE_DATA token into own file""
This reverts commit abb3bd266b.
2015-08-20 13:19:18 -07:00
09e0b0ac6f chore(benchmarks): disable broken benchmarks
Remove once https://github.com/angular/angular/issues/3757 is resolved
2015-08-20 12:43:48 -07:00
984e7b8e17 fix(dart): bad export in core.dart 2015-08-20 08:44:15 -07:00
abb3bd266b Revert "refactor(router): move ROUTE_DATA token into own file"
This reverts commit 78a8ba2307.
2015-08-20 08:06:24 -07:00
298f1fb6a6 Revert "feat(router): add angular 1.x router"
This reverts commit fde026a9e4.
2015-08-20 08:06:14 -07:00
cef51a7e0d Revert "feat(router): add reuse support for angular 1.x router"
This reverts commit ddb62feae6.
2015-08-20 08:06:07 -07:00
ddb62feae6 feat(router): add reuse support for angular 1.x router
Closes #3698
2015-08-19 20:27:39 +00:00
fde026a9e4 feat(router): add angular 1.x router 2015-08-19 20:27:39 +00:00
78a8ba2307 refactor(router): move ROUTE_DATA token into own file
This change is to accomodate the router in Angular 1.x
2015-08-19 20:27:39 +00:00
ffc63fc6d6 docs(dgeni): fix a dgeni link error due to ambiguous link 2015-08-19 12:25:13 -07:00
9757c137db docs(cleanup): Remove extra heading from nav and var templates 2015-08-19 12:25:13 -07:00
0b59e664ec feat(WebWorker) Add channel support to MessageBus
closes #3661 and #3686
2015-08-19 10:57:22 -07:00
104302a958 refactor(dart/transform): Remove unnecessary getter/setter codegen
Currently the transformer generates all getters and setters even when
creating pre-generated change detectors, which remove the need for them.

Generate getters and setters via the model provided by `ProtoViewDto`,
which contains enough information to allow omitting unnecessary getters
and setters from code output.

Allow generating getters, setters, and method names which are Dart
pseudo keywords.

Closes #3489
2015-08-19 17:36:12 +00:00
ba2c077b01 refactor(core): Create reusable RecursiveAstVisitor in ast.ts 2015-08-19 17:36:12 +00:00
94733069a4 build(publish): don't try to publish the http module into npm
we bundle it into the angular2 package and currently don't plan to make it a separate package
2015-08-19 10:11:27 -07:00
cba388bb65 build(publish): uncomment "pub publish" section in pub_publish.sh
it seems that this got commented out by accident in the past
2015-08-19 10:10:31 -07:00
efbd8fca4c build(typings): make router.d.ts depend on angular2.d.ts
if this is not done, DefinitelyTyped tests fail because of missing definitions for List, Map and other
apis that are part of router's public api
2015-08-19 10:10:31 -07:00
6b38d249c5 chore(build): add Safari8 to CI
Closes #3717
2015-08-19 17:00:33 +00:00
abb0e279a5 docs(metadata): correct ES5 annotation examples
Closes #3720
2015-08-19 15:55:49 +00:00
d191ec4c33 chore(release): bump version to 2.0.0-alpha.35 and add changelog 2015-08-19 07:19:01 -07:00
873b6da120 chore(test): disable tests based on Intl API in non-Chrome browsers
Closes #3692
2015-08-19 09:45:34 +02:00
f0e7f13f30 doc(NgStyle): fix missing []
Closes #3711
2015-08-19 05:46:55 +00:00
ccfadb9b47 refactor: make bindings/directives names consistent
BREAKING CHANGE

- `routerDirectives` => `ROUTER_DIRECTIVES`
- `routerInjectables` => `ROUTER_BINDINGS`
- `ELEMENT_PROBE_CONFIG` => `ELEMENT_PROBE_BINDINGS`
2015-08-18 21:23:26 -07:00
8dc509f688 fix(karma): corrected race condition with RX loading
RX was loaded twice. Once by karma and once by system.js This 
seemed to create a race condition and Rx.Subject was not available. 
Serving but not loading seems to fix the issue.
2015-08-18 21:23:26 -07:00
72e0b8f7dc fix(router): allow router-link to link to redirects
Closes #3335

Closes #3624
2015-08-19 01:34:46 +00:00
b5c4d8ba79 feat(facade): add maximum method for ListWrapper 2015-08-19 01:34:45 +00:00
5c95b376b5 fix(router): subscribe should return subscription
Closes #3491

Closes #3695
2015-08-19 01:34:08 +00:00
f2d3bdb801 feat(http): xhr error listener invokes throw on EventEmitter
Closes #2667
2015-08-19 01:11:23 +00:00
3b9411cbeb chore: removed a VI tmp file
Closes #3706
2015-08-19 00:32:49 +00:00
16eb8ced58 fix(http/http): allow for commonjs as ngHttp
when using the commonjs build for node the module ngHttp can not find module(s) `http/src/http`. currently
Closes #3633
2015-08-19 00:11:22 +00:00
63a94ee941 fix(docs) Fixes typo in ProtoViewRef class
Changed 'foctary' to 'factory'.

I wanted to change `{@link AppViewManager#createViewInContainer}` to `{@link AppViewManager#createViewInContainer}#createViewInContainer` and `{@link AppViewManager#createRootHostView}` to `{@link AppViewManager#createRootHostView}#createRootHostView` for readibility (see https://angular.io/docs/js/latest/api/core/ProtoViewRef-class.html it shows `AppViewManager and AppViewManager`). But I'm not sure if that'll work so I'm just going with the typo.
Closes #3677
2015-08-18 23:57:32 +00:00
ddcfd465ad fix: <template> tag for browsers that do not suppor them
Closes #3636
2015-08-18 23:52:28 +00:00
3b4965279c feat(browser): support Edge
Closes #3667
2015-08-18 23:07:59 +00:00
914ca88e5d chore(build): enable SauceLabs job
Closes #3690
2015-08-18 22:05:15 +00:00
675cb87c76 fix(examples): Modifies web worker examples to be compatible with systemjs 0.18.10.
Adds the rx path to each respective web worker loader.

Closes #3630
2015-08-18 21:45:12 +00:00
53df0d8b3f chore(npm): Upgrades systemjs dependency to 0.18.10. 2015-08-18 21:45:12 +00:00
8a7a783ff2 chore(build): Modifies replace scripts to reflect new changes in systemjs. 2015-08-18 21:45:12 +00:00
e68c978202 chore(npm): Upgrades systemjs to 0.18.3. 2015-08-18 21:45:12 +00:00
272ad61ab1 fix(injectors): reset the construction counter in dynamic strategy.
Adds tests for hydrate / dehydrate in cycle.

Closes #3635
2015-08-18 21:03:20 +00:00
5f7d4faa88 fix(docs): export bootstrap in core.ts but not in core.dart 2015-08-18 13:32:43 -07:00
235dec26fc fix(browser_adapter.ts): baseElement.getAttribute
currently throwing an error
```error
Error during instantiation of LocationStrategy! (RouterLink -> Router
-> Location -> LocationStrategy).
ORIGINAL ERROR: TypeError: baseElement.attr is not a function
```

Closes #3214
2015-08-18 19:07:47 +00:00
52da220016 feat(change_detection): added an example demonstrating how to use observable models
Closes #3684
2015-08-18 19:00:04 +00:00
cbfc9cb344 feat(change_detection): added an experimental support for observables 2015-08-18 19:00:04 +00:00
ed81cb94b0 feat(router): user metadata in route configs
Provide the ability to attach custom data onto a route and retrieve
that data as an injectable (RouteData) inside the component.

Closes #2777

Closes #3541
2015-08-18 10:33:19 -07:00
1f54e64fcf feat(PropertyBindingParser): support onbubble-event as an alternate syntax for (^event)
fixes #3448

Closes #3616
2015-08-18 17:30:48 +00:00
20cf61756a chore: update DEVELOPER.md with version information 2015-08-18 09:47:18 -07:00
ea6673947c refactor: rename annotations to metadata
BREAKING CHANGE (maybe)

Well as long as our customers use public API this should not be a
breaking change, but we have changed import structure as well as
internal names, so it could be breaking.

import:
  angular2/annotations => angular2/metadata

Classes:
  *Annotations => *Metadata
  renderer.DirectiveMetadata => renderer.RendererDirectiveMetadata
  renderer.ElementBinder => renderer.RendererElementBinder
  impl.Directive => impl.DirectiveMetadata
  impl.Component => impl.ComponentMetadata
  impl.View => impl.ViewMetadata

Closes #3660
2015-08-17 21:23:25 +00:00
5e6317fecc feat(change_detection): request a change detection check when an event happens
Closes #3679
2015-08-17 19:08:03 +00:00
823fa4689e refactor(change_detection): generate handleEvent only when necessary 2015-08-17 19:08:03 +00:00
6c9e712c34 fix(query): do not visit dehydrated injectors. 2015-08-17 11:43:44 -07:00
4845583dcf refactor(change_detector): made change detection responsible for processing events
Closes #3666
2015-08-17 15:39:00 +00:00
8b655c7be3 docs(annotations): replaces old syntax for hostListeners with host
Closes #3672
2015-08-17 14:38:18 +02:00
a06f48e357 test(query_integration): remove duplicated change detection call
Closes #3673
2015-08-17 09:22:10 +00:00
841206c678 fix(testability): properly throw when no testability available 2015-08-15 19:44:58 -07:00
296851797b fix(WebWorkers): Run XHR requests on the UI
Fixes issues in dart where dart:html is not available in isolates and
allows for better profiling of XHR requests

Closes #3652
2015-08-15 21:54:51 +00:00
ee5df00146 refactor(directives): minor cleanup & refactoring
Closes #3629
2015-08-15 17:19:15 +00:00
89a0f2457d doc(di): minor fixes
Closes #3614
2015-08-15 16:06:01 +00:00
26d2ea8afc fix(router): fix regression with generating links to async routes
Closes #3650
2015-08-14 22:32:48 +00:00
2686316c90 test(query): adds a view query test in presence of a long ng-for.
Closes #3638

Closes #3649
2015-08-14 21:04:29 +00:00
83b69e8edc chore: add repository field to npm package.json files
Fixes #2366

Closes #3621
2015-08-14 18:09:52 +00:00
35a83b495a feat(query_list): delegate toString to _results array
Closes #3004
2015-08-14 03:42:11 +00:00
dfe0130753 docs(dgeni): Fix an extra newline in the markdown for type. 2015-08-14 01:48:24 +00:00
2fcb4cb769 test(Router): increase the timeout for the back button test
The test would fail on Ubuntu 15.04 + Chrome 46 with the standard
timeout.
2015-08-13 17:50:16 -07:00
da4bcd5d91 docs: removed outdated docs
Closes #3581
2015-08-13 21:18:31 +00:00
512340e39b chore: Remove IRequestOptions / IResponseOptions
BREAKING CHANGE:

Reasons:

1) Interfaces should not start with letter ‘I’
2) Interfaces do not help with mistype properties, but literal types do.
   - https://github.com/Microsoft/TypeScript/pull/3823
   - https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#strict-object-literal-assignment-checking
2015-08-13 21:18:31 +00:00
284dc67076 chore: disable dart for HTTP package
BREAKING CHANGE

Stop supporting http module in Dart. This is because Dart has a
well developed http package which should be used by Dart
customers instead.
2015-08-13 21:18:31 +00:00
38945955ab refactor: Remove IQueryList
BREAKING CHANGE:

Closes #3577
2015-08-13 21:18:31 +00:00
b7837389d7 refactor: Remove isDart from public API
BREAKING CHANGE:

- `IS_DARTIUM` no longer exported
2015-08-13 21:18:31 +00:00
5c328adb4b refactor(di): Visibility.(Private|Public|PublicAndPrivate)
BREAKING CHANGE:

Rename:
- `PRIVATE` => `Visibility.Private`
- `PUBLIC` => `Visibility.Public`
- `PUBLIC_AND_PRIVATE` => `Visibility.PublicAndPrivate`
2015-08-13 21:18:31 +00:00
60af19f0e1 refactor: rename all const to UPPER_CASE
Closes #3573

BREAKING CHANGE

Rename:
- `appComponentTypeToken` => `APP_COMPONENT`
- `coreDirectives` => `CORE_DIRECTIVES`
- `formDirectives` => `FORM_DIRECTIVES`
- `formInjectables` => `FORM_BINDINGS`
- `httpInjectables` => `HTTP_BINDINGS`
- `jsonpInjectables` => `JSONP_BINDINGS`
- `PROTO_CHANGE_DETECTOR_KEY` => `PROTO_CHANGE_DETECTOR`
- `appComponentRefPromiseToken` => `APP_COMPONENT_REF_PROMISE`
- `appComponentTypeToken` => `APP_COMPONENT`
- `undefinedValue` => `UNDEFINED`
- `formDirectives` => `FORM_DIRECTIVES`
- `DOCUMENT_TOKEN` => `DOCUMENT`
- `APP_ID_TOKEN` => `APP_ID`
- `MAX_IN_MEMORY_ELEMENTS_PER_TEMPLATE_TOKEN` => `MAX_IN_MEMORY_ELEMENTS_PER_TEMPLATE`
- `appBaseHrefToken` => `APP_BASE_HREF`
2015-08-13 21:18:31 +00:00
1d65b38b28 feat(test): find testabilities across dart js applications
Find angular testability objects across different dart js contexts by
registering each application in a global array and interrogating each
for testabilities.

Closes #3611
2015-08-13 11:25:14 -07:00
64ebf278c0 fix: improper use package name in facade
Closes #3613
2015-08-13 05:04:00 +00:00
416fd085b1 refactor(pipes): removed BasePipeTrasnform
Closes #3608
2015-08-13 01:39:21 +00:00
839edaa15b feat(pipes): changed PipeTransform to make onDestroy optional
BREAKING CHANGE:

Before:
  Angular called onDestroy on all pipes.

After:
  Angular calls onDestroy only on pipes that have the onDestroy method.
2015-08-13 01:39:21 +00:00
ac311911c0 fix(typescript): update to typescript with fixed system emit
Closes #3594
2015-08-13 00:46:29 +00:00
aa480fee72 feat(dart/transform): Support part directives
Allow users to split libraries using the `part` directive.

Closes #1817
2015-08-13 00:28:42 +00:00
b6ee20846b fix(benchmarks): remove reference to String.prototype.contains()
https://github.com/tc39/tc39-notes/blob/master/es6/2014-11/nov-18.md#51--44-arrayprototypecontains-and-stringprototypecontains

removed String.prototype.contains() from standard, and is not
implemented in most runtimes (SpiderMonkey still being an exception).

Closes #3570
2015-08-12 23:16:57 +00:00
b5fb05b735 feat(npm): add typescript block to package.json
This makes it simple to run the `tsd link` command in a project
to automatically include paths to typings files. The definitions
also include transitive dependencies of rx.d.ts and es6-promise.d.ts.

Closes #3590

Closes #3609
2015-08-12 22:05:41 +00:00
7b3cca20d2 feat(npm): publish bundles and their typings in npm distribution
The same bundles that are published to https://code.angularjs.org
are now included in a "bundles" folder inside the npm distribution.

Closes #3555
2015-08-12 22:05:41 +00:00
8f5360c387 feat(testability): option to disable tree walking 2015-08-12 21:56:24 +00:00
ed25a29cc8 fix(NgClass): take initial classes into account during cleanup
Closes #3557
2015-08-12 20:08:03 +00:00
a7a1851c0f feat(compiler): allow binding to className using class alias
Closes #2364
2015-08-12 20:08:03 +00:00
f2f4b905e5 fix(docs): ng-non-bindable
Closes #3607
2015-08-12 19:00:51 +00:00
08dbe87819 fix(testability): throw if no testability available
this implements the same behavior for dart that is already implemented in the typescript version
2015-08-12 10:21:32 -07:00
218b037d98 test(NgClass): remove code duplication in tests 2015-08-12 10:29:37 +02:00
2150a8f9d1 feat(query): view query is properly updated when dom changes.
Fixes a bug in view manager util where sibling injector is not correctly
calculated.

ViewQuery no longer includes the view's initiating component injector.

Includes some refactoring of view methods and a removal of a polymorphic
map call.

Closes #3033

Closes #3439
2015-08-12 06:16:09 +00:00
720a3c8edd refactor: update analyzer_plugin dev_dependencies to include version constraints
Closes #3592
2015-08-12 05:11:50 +00:00
585ea5d600 feat(query): allow to query for TemplateRef
Part of #1989

Closes #3202
2015-08-12 01:51:18 +00:00
5b5d31fa9a feat(pipe): added the Pipe decorator and the pipe property to View
BREAKING CHANGE:
    Instead of configuring pipes via a Pipes object, now you can configure them by providing the pipes property to the View decorator.

    @Pipe({
      name: 'double'
    })
    class DoublePipe {
      transform(value, args) { return value * 2; }
    }

    @View({
      template: '{{ 10 | double}}'
      pipes: [DoublePipe]
    })
    class CustomComponent {}

Closes #3572
2015-08-12 00:38:40 +00:00
02b7e61ef7 chore: reenable analyzer_plugin tests
Closes #3591
2015-08-11 22:53:17 +00:00
280d8f3148 chore: add dartdoc compliance checks to build
Closes #3582
2015-08-11 22:53:08 +00:00
5a405011de refactor(http): move http files to top-level module
Closes #2680
Closes #3417
2015-08-11 22:32:17 +00:00
2374e16104 chore(build): use pub upgrade instead of pub get
Closes #3585
2015-08-11 22:32:03 +00:00
561066f899 chore(docs): explain the process for merging changes to master
Closes #3566
2015-08-11 21:28:46 +00:00
903a0f0513 fix(router): throw when component in route config is not defined
Close #3265

Closes #3569
2015-08-11 21:21:32 +00:00
f83289b1a0 chore(build): do not run analyzer_plugin tests 2015-08-11 13:30:42 -07:00
77d3668432 feat(http): serialize search parameters from request options
- Extends URLSearchParams API to include operations for combining
  different URLSearchParams objects:

  These new methods include:
  setAll(otherParams): performs `this.set(key, values[0])` for each
      key/value-list pair in `otherParams`

  appendAll(otherParams): performs `this.append(key, values)` for
      each key/value-list pair in `otherParams`

  replaceAll(otherParams): for each key/value-list pair in
      `otherParams`, replaces current set of values for `key` with
      a copy of the list of values.

- RequestOptions do not merge search params automatically (because
  there are multiple ways to do this). Instead, they replace any
  existing `search` field if `search` is provided. Explicit merging
  is required if merging is desirable.

- Some extra test coverage added.

Closes #2417
Closes #3020
2015-08-10 16:29:36 -07:00
dfa5103b1d feat(typings): allow defining custom namespace for bundle
Allows declaring a bundle's namespace in generated typings file,
which should correspond to the global object representing the module
inside its bundle.

BREAKING CHANGE
    The router was previously exported as ng.router in the 
    angular.sfx.dev.js bundle, but now it is exported as ngRouter.

Closes #2948

Closes #3544
2015-08-10 12:59:35 -07:00
1f692ae263 feat(typings): allow declaration of reference paths
Without this feature, each bundle would have to create its own typings
template to include references to dependent typings. Now, the references
can be declared in JS, along with other meta information about the 
bundle typings.


Closes #3540
2015-08-10 12:58:49 -07:00
1562bc91ba chore(build): don't use global module format in router bundle
Empty ES6 files are detected as "global" module format by
default which means that we end up with 2 module formats in
a bundle (es6 and global). This makes module loading more
complex and make break with certain SystemJS builder / loader
combinations.

Fixes #3528

Closes #3561
2015-08-10 19:56:04 +00:00
6bd95c1455 feat(coreDirectives): add NgClass to coreDirectives
Closes #3534
2015-08-10 19:52:10 +00:00
4f5e405676 fix(UrlResolver): encode URLs before resolving
This commits makes JS implementation to behave like Dart one.

Fixes #3543

Closes #3545
2015-08-10 19:50:10 +00:00
86eb46af09 fix(transformers): be more specific in the imports to rewrite
Instead of just matching on the filename match on the full uri.

Closes #3473

Closes #3523
2015-08-10 19:07:48 +00:00
6651aab11f refactor: allow the latest dart_style version 2015-08-10 19:05:09 +00:00
5a8b1bcaec docs(router): add documentation for lifecycle hooks
Closes #3334
2015-08-10 10:47:37 -07:00
ac6227e434 feat(router): auxiliary routes
Closes #2775
2015-08-10 10:47:37 -07:00
96e34c1d36 fix(presubmit): uses proper branch instead of hard coded
Closes #3552
2015-08-09 17:41:58 +00:00
4038150246 chore(ci): presubmit-pr-888 adds Closes #888 on merge
Closes #1234
2015-08-08 19:23:14 -07:00
24eabb9bb1 test(matchers): add support for toHaveClass in tests 2015-08-08 02:22:45 +00:00
574bbea747 fix(Testability): fix type error in getAllAngularTestability (dart)
This fixes the following type error that is thrown when calling getAllAngularTestability() while running Dartium in checked mode:

type 'MappedListIterable' is not a subtype of type 'List<PublicTestability>' of 'publicTestabilities'.
2015-08-07 17:35:19 -07:00
a1c53eec6b Refactor(WebWorker): Unify WebWorker naming
Closes #3205
2015-08-07 14:43:52 -07:00
84463cf0bd Feat(WebWorker): Add WebWorker Image Filter Demo 2015-08-07 11:25:07 -07:00
2dcf714d2b refactor(pipes): use Injector instead of pipe factories for pipe instantiation
BREAKING CHANGE
    - Pipe factories have been removed.
    - PIpe names to pipe implementations are 1-to-1  instead of 1-to-*

 Before:
     class DateFormatter {
         transform(date, args){}
     }

     class DateFormatterFactory {
       supporst(obj) { return true; }
       create(cdRef) { return new DateFormatter(); }
     }
     new Pipes({date: [new DateFormatterFactory()]})

After
    class DateFormatter {
      transform(date, args){}
    }
    new Pipes({date: DateFormatter})
2015-08-07 10:02:11 -07:00
06da60f4b7 feat(di): added resolveAndInstantiate and instantiateResolved to Injector
These two methods can be used to create objects in the context of the injector without storing them in the injector.
2015-08-07 08:29:19 -07:00
ff1b110ae1 fix(CSSClass): change selector to ng-class
BREAKING CHANGE:

The selector for the CSSClass directive was changed
from [class] to [ng-class]. The directive itself was
renamed from CSSClass to NgClass

Closes #3498
2015-08-07 14:56:41 +02:00
748c2d6c97 fix(compiler): strip <script> tag from templates
Fixes #2766
Closes #3486
2015-08-07 11:54:33 +00:00
339071cb07 refactor(CompileElement): remove unused methods
Closes #3500
2015-08-07 09:20:27 +00:00
a37de36fa6 fix(test_lib): run unit tests in default Documnent
Closes #3501
Fixes #3475
2015-08-07 09:57:59 +02:00
cf6ffd5469 docs(fix-docgen): Fix docgen issues with some recent updates to core 2015-08-06 23:17:22 -07:00
d40ff0bb89 chore(doc-gen): render enum doctypes correctly 2015-08-06 23:10:35 -07:00
c4296285f3 chore(doc-gen): render enum doctypes correctly 2015-08-06 23:10:35 -07:00
106a28b8dc feat(refactor): replaced ObservablePipe and PromisePipe with AsyncPipe 2015-08-07 02:10:32 +00:00
bd498977bd chore(material): clean up old workarounds with new features. 2015-08-06 17:54:34 -07:00
7c52bc9768 chore(release): update version & changelog to alpha34 2015-08-06 17:39:27 -07:00
643c71740e chore(build): enable type-checking for TypeScript ES6 emit.
This requires delicate handling of type definitions which collide, because
we use TypeScript-provided lib.d.ts for --target=es5 and lib.es6.d.ts for
--target=es6.
We need to include our polyfill typings only in the --target=es5 case,
and the usages have to be consistent with lib.es6.d.ts.
Also starting with this change we now typecheck additional modules,
so this fixes a bunch of wrong typings which were never checked before.

Fixes #3178
2015-08-06 16:57:52 -07:00
40a3cd2ab1 style(dart/transform): Do not format generated code by default
Formatting code requires time and memory during the build -- do not do
it unless explicitly requested via a parameter to the transformer.

Add an entry to the
[wiki](https://github.com/angular/angular/wiki/Angular-2-Dart-Transformer)
describing the added parameter.
2015-08-06 23:32:01 +00:00
3db0ae1dac refactor(dart/transform): Show friendly messages for transform failures
Previously, the error messages coming out of the Dart transformer were
opaque when those errors came from the analyzer (for example, analyzer
parse errors). Log more useful errors when they are caught by the
transform code.
2015-08-06 22:28:10 +00:00
07b9be798c fix(exception_handler): log errors that are thrown by the compiler 2015-08-06 15:26:24 -07:00
b4a062983b fix(dart): @proxy is a value, not a factory
Previously I added parens everywhere to make this @proxy() because our typing indicated
it was a function that returned a decorator, but this breaks dart. Instead, the typing needs
to be changed.

Fixes #3494
2015-08-06 10:02:49 -07:00
f11f4e0b45 style(dart): Format with dartfmt v0.2.0
Format all pure Dart code with package:dart_style v0.2.0

Command:
```
find -type f -name "*.dart" | xargs dartformat -w
```
2015-08-05 11:04:29 -07:00
450d3630cc test(router): add tests for router.d.ts
Closes #3282
2015-08-05 00:29:32 +00:00
166688348a chore(browsers): fix failing tests in IE11
Closes #3388
2015-08-04 22:45:46 +02:00
39ad50657e refactor(di/tests): removes unecessary for-loop
Closes #3268
2015-08-04 20:14:04 +00:00
a62a6ba40a feat: upgrade ts2dart to 0.7.1.
This supports the promise re-export from es6-promise.d.ts.
2015-08-04 19:56:02 +00:00
0bb78b7ef4 feat: enable the decorators compiler option.
This quenches a warning during compilation.
2015-08-04 19:56:02 +00:00
861be30021 feat: export a proper promise type.
Promise used to be typed as any, giving incorrect results. This change
fixes places that were incorrectly typed and re-exports the actual
Promise type from es6-promise.

It also fixes a series of compilation errors discovered/triggered by
this change.
2015-08-04 19:56:02 +00:00
27aa9187f0 docs(CONTRIBUTING): sync with the change of angular/angular.js#12032
Closes #3468
2015-08-04 19:54:31 +00:00
c58b0ff787 refactor(change_detect): Share more codegen logic
Move more logic in our codegen into a shared util which is called by the
Jit & Prege change detector code.
2015-08-04 18:55:07 +00:00
392de4af67 feat(pipes): replaces iterable and key value diffing pipes with services
BREAKING CHANGE:
    Directives that previously injected Pipes to get iterableDiff or keyvalueDiff, now should inject IterableDiffers and KeyValueDiffers.
2015-08-04 10:39:55 -07:00
c20a5d65d8 fix(compiler): Allow components to use any style of selector. Fixes #1602 2015-08-04 09:34:03 -07:00
4422819754 fix(parser): detect empty expression in strings to interpolate
Fixes #3412

Closes #3451
2015-08-04 08:44:14 +02:00
6eaa09ac20 refactor(injector): remove unused consts
Closes #3454
2015-08-04 08:40:27 +02:00
c0adae69ac docs(Router): router config
Closes #2853
2015-08-04 02:03:26 +00:00
cfedc77ce1 test(XHRConnection): normalize responseText and response
normalize xhr.responseText and xhr.response

- [x] Tests

Closes #2882
2015-08-04 00:39:11 +00:00
96eefdfebc fix(XHRConnection): use xhr status code
closes #2841

- [x] Tests
2015-08-04 00:39:11 +00:00
7bf7ec6d9c fix(router): ensure navigation via back button works
The router will now navigate and respect the current address value
accordingly whenever a popState event is handled.

Closes #2201
2015-08-03 22:24:57 +00:00
60f38eab78 feat(router): add back() support to MockLocationStrategy 2015-08-03 22:24:57 +00:00
209aefee57 docs(fix-docgen): Fix docgen issues with some recent updates to core 2015-08-03 14:27:02 -07:00
be79942ebd feat(transformers): add more information to factory debug reflection
Add the symbol information to debug_reflection_capabilities when asking
for a factory to make finding the type easier in large codebases.
2015-08-03 13:36:13 -07:00
1beaf81e98 docs(View): correct templateUrl and template definition
Fixes #3444
Closes #3447
2015-08-03 14:20:35 +02:00
12e4c738c9 fix(collection): MapIterator.next() is not supported (Safari)
Fixes #3015
Closes #3389
2015-08-03 12:18:21 +02:00
8822460858 chore(browsers): fix failing tests in Firefox
Closes #3386
2015-08-03 12:17:44 +02:00
53788ef827 revert "chore(doc-gen): render enum doctypes correctly"
This reverts commit b8e82e4db3
as it was breaking build on master.
2015-08-03 11:00:47 +02:00
b8e82e4db3 chore(doc-gen): render enum doctypes correctly 2015-08-02 22:45:20 -07:00
94690ec5b0 docs(link): Fix the link to an enum for ViewEncapsulation 2015-08-02 22:29:39 -07:00
77875a270d feat: implement web-tracing-framework support
This includes implementation and minimal instrumentation

Closes #2610
2015-07-31 23:04:05 +00:00
6d272cc5f9 chore(travis): upload artifacts for all branches
We want to get the presubmit* branch artifacts for further testing
2015-07-31 15:58:53 -07:00
6d280ea31f feat(md-button): enhance button focus appearance. 2015-07-31 14:12:25 -07:00
7354206c74 chore(examples): manual encoding of data: urls is no longer necessary 2015-07-31 20:46:53 +00:00
39b0286d6b fix: remove unused imports 2015-07-31 20:40:33 +00:00
dad9338c82 docs(type): Export Type so that we can link to it in our docs.
Closes #3345
2015-07-31 20:40:33 +00:00
f6da89f74f chore(doc-gen): export interfaces over vars
If a symbol is declared as an interface and a var then we should export
it as an interface rather than a var.
2015-07-31 20:40:33 +00:00
3437d56904 feat(core): made directives shadow native element properties
BREAKING CHANGE
    Previously, if an element had a property, Angular would update that property even if there was a directive placed on the same element with the same property. Now, the directive would have to explicitly update the native elmement by either using hostProperties or the renderer.
2015-07-31 20:29:57 +00:00
3c58878b19 chore(build): Upgrade to TypeScript@1.5.3
This change also makes us compliant with 1.6.0-dev compiler,
so we can do some experiments with apps that use 1.6 features
and compile against Angular.

We should probably add a travis build for 1.6 so we stay compatible
with both versions.
2015-07-31 20:01:27 +00:00
c5cb7009ca feat(WebWorkers): Add WebWorker Todo Example. Add support for more DOM events.
Fixed breakage caused by previous DI commit in WebWorker Todo example
2015-07-31 19:48:18 +00:00
adc27398fd perf(change_detection): do not generate onAllChangesDone when not needed 2015-07-31 19:23:00 +00:00
dd06a871b7 fix(render): allow to configure when templates are serialized to strings
Introduces the injectable `TemplateCloner` that can be configured via the new token `MAX_IN_MEMORY_ELEMENTS_PER_TEMPLATE_TOKEN`.

Also replaces `document.adoptNode` with `document.importNode` as otherwise
custom elements are not triggered in chrome 43.

Closes #3418
Closes #3433
2015-07-31 12:04:32 -07:00
014b6cb397 Revert "feat(WebWorkers): Add WebWorker Todo Example. Add support for more DOM events."
This reverts commit d44827a4c5.

This broke master due to a race condition in our presubmit queue.
2015-07-31 11:40:15 -07:00
d44827a4c5 feat(WebWorkers): Add WebWorker Todo Example. Add support for more DOM events. 2015-07-31 18:33:12 +00:00
3cda7128d0 cleanup(di): renamed viewInjector and hostInjector
BREAKING CHANGE
    Replace viewInjector with viewBindings
    Replace hostInjector with bindings
2015-07-31 09:49:51 -07:00
70bc485755 fix(browser_adapter): fix clearNodes() in IE
Fixes #3295

Closes #3355
2015-07-31 14:56:31 +02:00
0a40024995 test(integration): minor tests cleanup
Closes #3329
2015-07-31 10:52:42 +02:00
985627bd65 cleanup(DI): clean up visibility decorators
BREAKING CHANGE:
    Replace @Ancestor() with @Host() @SkipSelf()
    Replace @Unbounded() wwith @SkipSelf()
    Replace @Ancestor({self:true}) with @Host()
    Replace @Unbounded({self:true}) with nothing
    Replace new AncestorMetadata() with [new HostMetadata(), new SkipSelfMetadata()]
    Replace new UnboundedMetadata() with new SkipSelfMetadata()
    Replace new Ancestor({self:true}) with new HostMetadata()
2015-07-31 02:30:26 +00:00
a9ec6b9064 docs(di): added a doc describing advanced di topis 2015-07-31 01:57:17 +00:00
f5864afdbb docs(di): updated di docs 2015-07-31 01:57:17 +00:00
21e2f3c1db chore(button): dramatically clean-up button css. 2015-07-31 01:34:17 +00:00
7b94bbf3e4 feat(testability): Expose function getAllAngularTestabilities 2015-07-31 01:23:55 +00:00
71ea19902a perf(change_detection): removed the currentProto property 2015-07-31 00:31:11 +00:00
9e7363f686 refactor(benchmarks): Remove unnecessary style setter
Remove `style` setter that is no longer used / necessary.

Closes #3375
2015-07-31 00:29:02 +00:00
2768158eaf tests(ProtoViewBuilder): host properties binding to unknown props
When binding a host property, we shouldn't try to bind to any
directive properties that might exist on a host element

Closes #3383
2015-07-30 16:16:35 -07:00
f8fa47e939 chore(release): release alpha.33 2015-07-30 16:09:29 -07:00
d4ded1a60d fix(docs): add ViewDefinition, DirectiveMetadata to public API
Closes #3346
2015-07-30 22:02:30 +00:00
4e76cac5b7 fix(core): export LifeCycle at top-level modules
LifeCycle can now be imported via angular2/angular2 or
angular2/core, so that end users can inject it without
having to use the full source path.

Closes #3395
2015-07-30 21:52:29 +00:00
0dbdd5cd3c refactor(render): don’t store DOM nodes but store strings for big ProtoViews.
Also inserts comment nodes before/after projected nodes so that text nodes don’t get merged when we serialize/deserialize them.

Closes #3356
First part of #3364
2015-07-30 14:11:13 -07:00
c08403935f chore(build): faster feedback for broken lint
Originally we ran gulp enforce-format at the beginning of the build.
This was annoying because you came back from lunch to find that no tests
ran so you have to start your PR over.
Then we changed it to run the linters at the end. This is annoying because
you might be ready to merge to master, and could have fixed the lint
issues immediately, but now much wait for another PR.
The solution is to run the lint checks in another build. This marks
your PR red very early, but you still get the feedback of whether the
tests are passing.
2015-07-30 20:22:41 +00:00
4893002408 chore(transfomer): code style in rewriter 2015-07-30 12:06:53 -07:00
29095766e6 fix(bootstrap): fix expressions containing bootstrap (fixes #3309) 2015-07-30 12:06:53 -07:00
eee2146735 fix(testing): Fixed race condition in WebWorker and Routing tests 2015-07-30 18:54:12 +00:00
5c21af95c7 chore(docs): fix bad link syntax for ViewEncapsulation enums 2015-07-30 10:55:13 -07:00
cb6fc9c7cb chore(doc-gen): fix jade whitespace errors 2015-07-30 11:29:06 +01:00
68a581a04c fix(dart/transform): Remove malfunctioning zone error handler
Remove `onError` zone callback which is consuming exceptions thrown by
the `Transformer`s and can cause `pub` to become unresponsive.

Closes #3368
2015-07-30 00:07:19 +00:00
7b834e02ec feat(WebWorkers) Add DOM event support
closes #3046
2015-07-29 23:34:43 +00:00
8e960d4052 chore(changelog): update to new changelog package.
Regen-ed the CHANGELOG.md (for consistency). Seems like some old commits
are not present in new the CHANGELOG.md, but it doesn't seem worthy of
further investigation.

closes #3204, #3172
2015-07-29 22:42:05 +00:00
34acef58e7 fix(query): view query should not be updated when subviews are attached. 2015-07-29 22:33:15 +00:00
c1ee943533 perf(change_detection): do not check intermediate results 2015-07-29 21:58:29 +00:00
f7d7789915 fix(decorators): stop directives inheriting parent class decorators.
Fixes #2291
2015-07-29 21:23:31 +00:00
9c19eb906b refactor(change_detect): Move (de)hydrate methods into superclass
Move the implementation of `(de)hydrate`, `hydrated`, and
`detectChangesInRecords` into `AbstractChangeDetector`.

Add comments clarifying the contract between `AbstractChangeDetector`
and its subclasses.

Closes #3245
2015-07-29 13:12:53 -07:00
73b7d99dc4 fix(style_url_resolver): fix data: url resolution 2015-07-29 11:24:17 -07:00
192cf9ddf5 refactor(change_detect): Move common fields to AbstractChangeDetector
Move fields common to Dynamic, Jit, and Pregen change detectors into the
`AbstractChangeDetector` superclass to save on codegen size and reduce
code duplication.

Update to #3248, closes #3243
2015-07-29 10:46:49 -07:00
d894aa9101 feat(compiler): introduce schema for elements
Closes #3353
2015-07-29 19:40:46 +02:00
aae5a4cece refactor(ElementBinderBuilder): remove unused code
Closes #3326
2015-07-29 07:56:30 -07:00
16e3d7e96e refactor(shadow_dom): remove ShadowDomStrategy in favor of @View(encapsulation)
BREAKING CHANGES:
- `ShadowDomStrategy` was removed. To specify the encapsulation of a component use `@View(encapsulation: ViewEncapsulation.NONE | ViewEncapsulation.EMULATED | ViewEncapsulation.NATIVE)`
- The default encapsulation strategy is now `ViewEncapsulation.EMULATED` if a component contains styles and `ViewEncapsulation.NONE` if it does not. Before this was always `NONE`.
- `ViewLoader` now returns the template as a string and the styles as a separate array
2015-07-28 22:33:11 -07:00
e40ff36832 fix(presubmit): corrected user/email for git push 2015-07-29 03:39:43 +00:00
c5f8c9586f chore: added presubmit-queue to travis 2015-07-28 23:29:20 +00:00
4cfe92c47a example(routing): adding routing example and e2e tests 2015-07-28 15:31:17 -07:00
9d2776183a chore(build): copy JSON files for Dart examples 2015-07-28 15:31:17 -07:00
2faa89852b fix(transformer): Fix generation of annotations argument when registering functions. 2015-07-28 15:26:33 -07:00
d84993faf1 refactor(change_detect): Move (de)hydrate logic into dedicated methods
Call new `(de)hydrateDirectives` methods from `(de)hydrate`. Add a null
implementation in `AbstractChangeDetector` and only override if
necessary for the specific change detector.

Update to #3248
2015-07-28 15:10:06 -07:00
a9efc48e71 refactor(change_detect): Create & use looseNotIdentical
Create `looseNotIdentical => !looseIdentical`, which will save a lot of
unnecessary '!' characters in generated change detectors.

Update to https://github.com/angular/angular/issues/3248
2015-07-28 14:59:31 -07:00
8543c347a8 feat(core): provide an error context when an exception happens in an error handler 2015-07-28 14:22:15 -07:00
1d4502944c fix(query): the view should not be visible to @Query.
@ViewQuery is the correct way to query the view template.
2015-07-28 14:16:14 -07:00
448ca384cc docs(chore): de-link Type because there's no doc for dgeni to find 2015-07-28 13:48:03 -07:00
d426af741c chore(doc-gen): trim leading blank lines from markdown content
Harp 0.17 does not allow blank lines to appear between filters and their
content. This change ensures that any blank lines that could appear have
been trimmed inside Nunkjucks.

Closes #3325
2015-07-28 13:48:03 -07:00
6ab2a871ce chore(doc-gen): add - var ... to jade variable declarations
Harp 0.17 requires that jade variables are declared correctly

Closes #3325
2015-07-28 13:48:02 -07:00
2c9951273a style(dart): Run dartfmt v0.1.8+2 on all pure Dart code
Update formatting for all pure Dart code in the repo.
2015-07-28 12:44:03 -07:00
6fac901151 feat(http): call complete on request complete
closes #2635
2015-07-28 11:45:15 -07:00
74b311a472 revert: style(ngFor): add whitespace to Directive annotation
Reverted from commit 35597a8349

This style change makes the docs look nicer but clang-format doesn't
like it. @mhevery perhaps we can tweak the clang-format rules for this?
2015-07-28 14:14:44 +01:00
81d298dc6b chore(doc-gen): fix when decorator has no argument list 2015-07-28 12:45:51 +01:00
35597a8349 style(ngFor): add whitespace to Directive annotation 2015-07-28 11:29:57 +01:00
45cbc430e8 chore(doc-gen): render decorators (annotations) for exported classes
Closes #3167
Closes #3221
2015-07-28 11:29:56 +01:00
03fc7fe8c2 refactor(change_detect): Make ChangeDetectionUtil#uninitialized a var
Previously, `uninitialized()` was a method, requiring a call as well as
two extra characters everywhere it was used.

Make this value a variable, saving the characters and avoiding the
method call to get its value.

This change also removes the export of `uninitialized` from
change_detect.ts, which is technically a breaking change, however
`uninitialized` is an implementation detail and nobody should be using
it in app logic. By convention, apps should not be importing from files
under `src/`.

Update to #3248.
2015-07-27 17:14:09 -07:00
8a91d71625 feat(http.ts): export BrowserXHR
needed for replacing BrowserXHR bindings with mock/server version  etc

Closes #2641
2015-07-27 16:34:34 -07:00
4dc6d748a9 fix(lowercase,uppercase): make stateless pipes
same problem as `json` previously of transforming only on reference
check

Closes #3173
Closes #3189
2015-07-27 16:28:48 -07:00
99587a9907 docs: Update 02_directives.md
Closes #3191
2015-07-27 16:27:00 -07:00
eebd736cfe feat(build): initial SauceLabs setup
Closes #2347
2015-07-27 16:15:28 -07:00
bb50cda181 chore(gulp): moves bundles to dist/js/bundles
- renames bundle.js.deps to bundles.js.
- makes all other bundle tasks private.

Closes #3286
2015-07-27 16:12:24 -07:00
05c4fb2fac docs(typo): ngzone referencing misspelled api
Closes #3292
2015-07-27 16:09:05 -07:00
448264be39 fix(core): fix type error in setElementProperty
Convert propertyValue to string when calling setElementAttribute.

Closes #3279
2015-07-27 16:05:10 -07:00
78fdf9a11f fix(.d.ts): Correct new Type interface return type
Closes #2399
Closes #3316
2015-07-27 16:02:47 -07:00
71bb4b3ee5 feat(change_detection): generate checkNoChanges only in dev mode 2015-07-27 15:50:19 -07:00
a2bb81c406 Revert "fix(url_resolver): in Dart make package urls relative to AppRootUrl"
This reverts commit 469afda53e.
2015-07-27 14:15:02 -07:00
30bd2a3fc7 chore(build): add trend for travis time
We discussed last week that our build has been steadily getting longer.
We should track the time so we can easily notice that it went up and
find the culprit.
This hooks us up to https://buildtimetrend.herokuapp.com/ which seems
capable and very quick to setup. We can easily gather the data and
then evaluate the dashboard.
Note that we want to have two different webhooks, and only notify gitter
on transitions, but we want to have timing for all builds, since a
series of passing builds might have a big jump in build time in the middle.
I don't see how to do this with travis.yml so I've overnotified gitter.
2015-07-27 14:03:57 -07:00
7cbaf1076f refactor(Async): Unify TS and Dart PromiseCompleter naming
Also add explicit typing wherever we use PromiseCompleter
2015-07-27 10:28:07 -07:00
a8b57256c8 fix(class): allow class names with mixed case
Fixes #3001

BREAKING CHANGE:

View renderer used to take normalized CSS class names (ex. fooBar for foo-bar).
With this change a rendered implementation gets a calss name as specified in a
template, without any transformations / normalization. This change only affects
custom view renderers that should be updated accordingly.

Closes #3264
2015-07-27 16:46:42 +02:00
329a6e00dc chore(API): cleaned up top level imports (render) 2015-07-25 03:20:15 +00:00
c83a3f3372 chore(docs): added more docs for core.ts 2015-07-25 03:20:12 +00:00
0906ee8a4e refactor(change_detect): Abstract name logic into NameRegistry
Create `NameRegistry`, responsible for understanding how names are
generated for change detector fields and variables.

Use `NameRegistry` for both JS Jit & Dart pre-generated detectors.
Making progress on #3248
2015-07-24 18:58:09 -07:00
23cd385f20 fix(dart/transform): Handle mixed lifecycle specs
Update the transformer to handle classes which both have a `lifecycle`
value and `implement` lifecycle interfaces.

Closes #3276
2015-07-24 18:02:04 -07:00
45b10a1f0f cleanup(forms): value accessors inject NgControl only from self 2015-07-24 16:56:22 -07:00
469afda53e fix(url_resolver): in Dart make package urls relative to AppRootUrl 2015-07-24 16:37:01 -07:00
c2bbda02a1 feat(change_detection): provide error context for change detection errors 2015-07-24 15:45:26 -07:00
e744409cb9 feat(exception_handler): print originalException and originalStack for all exceptions 2015-07-24 15:45:26 -07:00
0a8b3816f7 style(lexer): idiomatic TypeScript
Closes #3228
2015-07-24 15:40:32 -07:00
bc21aa0124 refactor(di/injector): fixes typo in InjectorStrategy interface
Closes #3269
2015-07-24 15:36:27 -07:00
2577f5eebf test(query): adds a test for query in the presense of projection.
Query uses only the logical structure of the application, so it is not
affected by projection, which only the rendering structure.

Closes #3278
2015-07-24 15:30:57 -07:00
f575ba60fb fix(transformer): Don't throw on annotations that don't match a descriptor.
Closes #3280
2015-07-24 15:29:14 -07:00
5b5de6662f chore(transformer): Use class for reflection info instead of a map
closes https://github.com/angular/angular/issues/906
2015-07-24 13:12:57 -07:00
a8b75c3d41 feat(testability): hook zone into whenstable api with async support
closes(#428)
2015-07-24 12:46:12 -07:00
19d8b221b4 fix(typings): test our .d.ts with --noImplicitAny
This matches how DefinitelyTyped tests it, so we are
one step closer to publishing the same file we generate.

See #3195
2015-07-24 11:24:44 -07:00
345fa521dd fix(change_detection): convert interpolated null values to empty strings
Fixes #3007

Closes #3271
2015-07-24 18:05:06 +02:00
16493e9769 refactor(integration_test): remove unused imports 2015-07-24 18:05:06 +02:00
dbbb7385f5 docs(annotations): remove reference to Parent annotation
This annotation was removed in 6f4a39c337
2015-07-23 19:21:28 -07:00
3a7c9e4c62 docs(links): change bad links for Type RenderViewRef RenderFragmentRef, onEventDoneFn, and Renderer api. 2015-07-23 19:21:28 -07:00
408618b836 feat(url_resolver): support package: urls (fixes #2991) 2015-07-23 18:35:05 -07:00
771c0170d9 feat(web-workers) Add WebWorker Renderer
Allows angular apps to be rendered from the webworker!
Closes #3052, #3053, and #3097
2015-07-23 18:29:10 -07:00
21b988f554 chore(release): fix pub publish release script.
Relevant SO:
http://stackoverflow.com/questions/2953646/how-to-declare-and-use-boolean-variables-in-shell-script

tl;dr - bash does not really have booleans, 'true' and 'false' are just
strings.
2015-07-23 17:30:33 -07:00
1438922ffb fix(class): correctly clean up on destroy
Fixes #3249
Closes #3256
2015-07-23 17:13:33 -07:00
f1e4292072 fix: addresses a couple ddc type errors
See analyzer_plugin target here: https://travis-ci.org/angular/angular/jobs/72343034
2015-07-23 15:31:04 -07:00
fd46b49ea6 feat(transformers): directive aliases in Dart transformers (fix #1747) 2015-07-23 15:25:32 -07:00
46502e4d61 fix(projection): allow more bound render elements than app elements.
Fixes #3236
Closes #3247
2015-07-23 15:05:46 -07:00
b44b06c2c9 fix(projection): allow to project to a non text node
We already had a test for this, but too low level that it did not catch this null value in `hasNativeShadowRoot`

Fixes #3230
Closes #3241
2015-07-23 14:29:15 -07:00
5ec67ee2a7 fix(compiler): prevent race conditions
Previously, the compiler would detect cycles where there were none just because of other components that were compiled in parallel. Furthermore, the way ProtoView merging was triggered could result into early exits resulting in errors when trying to instantiate ProtoViews.

Fixes #3206
Closes #3211
2015-07-23 14:28:38 -07:00
61b7703406 fix(build): don't trigger travis on g3sync branch 2015-07-23 13:52:42 -07:00
49dc819d23 chore(build): add experimental Dart build that uses DDC for code analysis 2015-07-23 11:30:00 -07:00
03c8e7428f fix(element_injector): do not throw when cannot find element when trying to report an error 2015-07-23 11:22:04 -07:00
70792c744d refactor(exception_handler): unified all exception handling
BREAKING CHANGE
    Previously it was possible to pass a custom error reporter to bootstrap, which was used only during the construction of Injector. This had limited utility, so this capability has been removed.
2015-07-23 11:22:04 -07:00
fdf226ab69 feat(exception_handler): change ExceptionHandler to output context 2015-07-23 11:22:04 -07:00
bd65b63c65 fix(transformer): Loggers now are per zone and each transform runs in its own zone 2015-07-23 09:36:04 -07:00
09226cdd75 chore(dart logging): Only print relevant messages in debug mode. 2015-07-23 07:32:30 -07:00
3c2b165de1 chore(doc-gen): add processor to check for unbalanced code fences (backticks)
See https://github.com/angular/angular/pull/3213/files#diff-da1eabc74e0bafaa56d2bfe4bc223b05R19
2015-07-23 09:35:03 +01:00
76f63bc6a5 chore(doc-gen/angular.io): check for not private rather is public
In 2e4a2a0e5a we removed the `@public` tags but the `addJadeDataDocsProcessor`
was still relying upon them being there to identify whether a doc should
be included in the public docs.

Instead we should just check for the doc not being marked with the
`@private` tag.

Closes #3212
2015-07-23 08:55:41 +01:00
3531bb7118 feat(bootstrap): remove the need for explicit reflection setup in bootstrap code
BREAKING CHANGES:

Dart applications and TypeScript applications meant to transpile to Dart must now
import `package:angular2/bootstrap.dart` instead of `package:angular2/angular2.dart`
in their bootstrap code. `package:angular2/angular2.dart` no longer export the
bootstrap function. The transformer rewrites imports of `bootstrap.dart` and calls
to `bootstrap` to `bootstrap_static.dart` and `bootstrapStatic` respectively.
2015-07-22 17:02:32 -07:00
55e8dca8de chore(changelog): adds a changelog for 2.0.0-alpha.32 release. 2015-07-22 16:46:28 -07:00
820c4b9b16 chore(release): releases 2.0.0-alpha.32. 2015-07-22 16:34:05 -07:00
fdffcaba9b feat(router): use querystring params for top-level routes
Closes #3017
2015-07-22 14:40:55 -07:00
a9e7c90960 cleanup: removed an invalid export 2015-07-22 14:22:50 -07:00
5a86f85936 feat(di): added context to runtime DI errors 2015-07-22 14:22:46 -07:00
8ecb632d70 feat(lang): added "context" to BaseException 2015-07-22 14:21:44 -07:00
8ad4ad57d1 feat(dart/transform): Populate lifecycle from lifecycle interfaces
When a `Directive` implements a lifecycle interface (e.g. `OnChange` or
`OnInit`), populate its `lifecycle` property if not already populated).

Closes #3181
2015-07-22 11:34:29 -07:00
854b5b7da8 feat(benchmark): add static_tree benchmark
Static binary component tree of depth 10, i.e. 1024 components.

Current numbers for `pureScriptTime` are:

JavaScript:

Baseline: 27.10+-9%
Ng2: 26.84+-8%
Ng1: 55.30+-14%

Dart:

Baseline: 30.13+-4%
Ng2: 45.94+-3%
Ng1: 128.88+-10%

I.e. in JS we are same speed as baseline right now!

Some background: We had a recent change in the compiler that merges components into their parents already during compilation (#2529). This made Ng2 2x faster in this benchmark (before the Ng2 JS time was 49.59+-14%ms).

Closes #3196
2015-07-22 10:58:50 -07:00
231962aaf7 chore: add serve.e2e.dart task for easy benchmark development 2015-07-22 10:08:56 -07:00
51e6f33d32 chore(build): Make PRs 15m faster.
Don't precompile Dart2JS for pull requests, instead serve the dart
sources with pub serve. We were already testing with Dartium so
all we lose is some test coverage of defects exposed only by the
Dart2JS transpiler.
This still runs the dart transformer.

Fixes #3030
2015-07-21 22:14:38 -07:00
476988876c test(router): refactor integration tests to use TestComponentBuilder
Closes #3182
2015-07-21 20:40:42 -07:00
c3d61bc63c docs: Add period for consistency.
Closes #2861
2015-07-21 16:38:32 -07:00
6f4a39c337 refactor(di): removed @Parent
BREAKING CHANGE
    The @Parent annotation has been removed. Use @Ancestor instead.
    @Parent was used to enforce a particular DOM structure (e.g., a pane component is a direct child of the tabs component).
    DI is not the right mechanism to do it. We should enforce it using schema instead.
2015-07-21 14:39:28 -07:00
a472eacc07 fix(content_projection): allow to project text nodes to a place without bindings
Fixes #3163
Closes #3179
2015-07-21 14:18:35 -07:00
078475a082 refactor(compiler): speed up proto view merging
- Don't create intermediate merge results
- Only merge embedded ProtoViews that contain `<ng-content>` tags

Closes #3150
Closes #3177
2015-07-21 13:39:41 -07:00
de18da2a0d feat(build): require parameter types
Fixes #2833
2015-07-21 06:20:13 -07:00
6d760666a9 chore(build): upgrade ts2dart to 0.7.0 2015-07-21 06:20:12 -07:00
b2a0be87e8 fix(change_detect): Sort DirectiveMetadata properties during processing
The Angular 2 render compiler can get out of sync between its transformer
execution and its runtime execution, leading to incorrect change detectors with
out-of-order property values. Stable sorting solves this problem (temporarily).
2015-07-20 17:08:02 -07:00
4c8ea12903 feat(pipes): changed .append to .extend
BREAKING CHANGE:
    Pipes.append has been renamed into Pipes.extend.
    Pipes.extend prepends pipe factories instead of appending them.
2015-07-20 15:36:42 -07:00
e94270946a feat(compiler): Support $baseUrl in HTML attributes when loading a template.
Angular fetches template HTML files outside of the browser's normal parsing flow. As a result, URLs in template files are interpreted relative to the root application, when the components defined by the template files are inserted into the DOM. This change enables a template author to prefix URLs with the string $baseUrl, which will be replaced with the relative base path of the template file.

So for an example template loaded from /component/foo/template.html:

<img src="$baseUrl/logo.png" />

becomes:

<img src="/component/foo/logo.png" />

Addresses #2384.
2015-07-20 15:26:00 -07:00
40d21b808d refactor(dart/transform): Remove chatty formatter message
Remove informational formatter message that is very chatty and not
actually useful.
2015-07-20 15:24:23 -07:00
095def3845 refactor(dart/transform): Add warning about issue #1747
Add a more descriptive warning about the lack of support for `Directive`
dependency aliases and a pointer to more information.
2015-07-20 14:11:17 -07:00
153660fe7b perf(dom): Only send values for existing properties to js interior
Due to #3019 we have to check whether a property exists on a DOM element
not before runtime of the application.

Previously, we did this check in JavaScript, making all property values
go through dart js interop. However, this is slow for complex objects.

This commit changes this behavior to first check whether the property exists
before sending the property value to the DOM element via js interop.

Closes #3149
2015-07-20 13:43:10 -07:00
3dd05ef7db feat: FunctionWithParamTokens.execute now returns the value of the function
Closes https://github.com/angular/angular/issues/3131
2015-07-20 09:03:00 -07:00
cfc18b5a6f refactor: remove direct import of unittest from test_lib 2015-07-20 09:01:12 -07:00
57496926ca fix(di): fixed dynamic component loading of components created in child injector 2015-07-17 16:18:19 -07:00
19e4ee81b9 style(change_detect): Minor readability updates 2015-07-17 15:24:10 -07:00
f74d97e1f1 feat(forms): Export NgSelectOption directive
Make the `NgSelectOption` directive visible from top-level forms module.
2015-07-17 15:24:10 -07:00
011fab37af fix(router): improve error for missing base href
Closes #3096
2015-07-17 14:00:04 -07:00
8296dcec09 fix(facade): use base element to get base href
Previously, calls to getBaseHref used document.baseURI, which defaults
to the current path in the absence of a base element in the document.
This leads to surprising behavior.

With this change, getBaseHref returns null when a base element is not
present in the document.
2015-07-17 14:00:04 -07:00
3df8363a94 chore(transformers): cleanup unneeded _toDepsUri function
Cleanu unneeded _toDepsUri function in favor of the common toDepsExtension.
2015-07-17 13:10:12 -07:00
5cc84ed4bb feat(transformers): implement initializing deferred libraries
Implement deferred libraries to work with dependency injection and other
angular codegen. This is done by not initializing the library in the parent
ng_deps file when it is declared as deferred, rewriting the import and,
chaining a future that initializes the library in any files that are using
deferred libraries which need angular codegen.
2015-07-17 13:07:31 -07:00
2f08ed8d3e fix(di): fixed types 2015-07-17 13:04:34 -07:00
1386977a34 chore: cleanup to pubspec.yaml files
Depend on the released version of Dart 1.10
Sort dependencies per convention
2015-07-17 12:34:06 -07:00
cdb6c9cda2 chore: support any version of pkg/observe >= 0.13.1
Closes https://github.com/angular/angular/issues/3117
2015-07-17 12:34:06 -07:00
13b1d85058 refactor(forms): removed iterableToList 2015-07-17 10:52:23 -07:00
c6409cb624 fix(router): throw when reserved characters used in route definition
Closes #3021
2015-07-17 10:51:23 -07:00
573c047d50 chore(build): Fix .d.ts generation errors caused by invisible types of exported declarations
Fixes #3098
2015-07-17 10:43:21 -07:00
f42382db3b refactor(views): split ViewManager/ViewContainerRef.createView into 2 methods
BREAKING CHANGES:

`ViewManager.createView` / `ViewContainerRef.create` have been split into 2 methods:

- `createHostView` which takes dynamically created bindings
- `createEmbeddedView` which takes the newly introduced `TemplateRef`

The new type `TemplateRef` is the combination of a `ProtoViewRef` and and `ElementRef`
from the same place. Use `TemplateRef` when working with embedded views in
`ng-if`, `ng-for`, ... instead of `ProtoViewRef`.

Also, `ProtoViewRef` is no more injectable, but `TemplateRef` is.

First part of #1989 to clean up manual content projection.
Closes #3114
2015-07-17 10:40:32 -07:00
762a94f2cd fix(transformers): fix sort order for reflective imports
Fix sort order for reflective imports in reflection_remover/rewriter.dart.
Currently there is only one import so the sort order happens to be correct,
but if another one is added the rewrite code will break.
2015-07-17 10:38:44 -07:00
5b597de18c fix(forms): default the initial value of Control to null 2015-07-16 18:34:03 -07:00
4d28167bc0 feat(router): add interfaces for route definitions in RouteConfig
Closes #2261
2015-07-16 16:36:22 -07:00
61c73576c8 fix(renderer): handle empty fragments correctly
Closes #3100
2015-07-16 16:18:58 -07:00
116b64de25 fix(view_manager): allow to create host views even if there is an embedded view at the same place. 2015-07-16 16:18:43 -07:00
b785503543 refactor(ProtoViewBuilder): improve error message for dangling bindings
Closes #3066
2015-07-16 16:16:49 -07:00
fc8f4688c7 docs(Title): add documentation for the Title service
Closes #3063
2015-07-16 16:11:35 -07:00
3f6dd6cd42 chore(build): remove traceur from node_tree (cjs build)
Fixes #3094
2015-07-16 15:48:05 -07:00
2147ce45c2 fix(di): do not rely on the fact that types are canonicalized 2015-07-16 15:19:18 -07:00
c701664e07 chore(transformers): remove reflector parameter from initReflector signature
Remove reflector parameter from initReflector method to simplify ng_deps for reflection
initialization. It wasn't used and was added for testability, but wasn't used. This
keeps the interface simplier.
2015-07-16 14:11:27 -07:00
a4915ad634 fix(api_docs): slightly more accurate description of Dart overrideOnEventDone 2015-07-16 14:03:27 -07:00
fe3a55966d fix(api_docs): slightly more accurate description of TS overrideOnEventDone 2015-07-16 14:02:39 -07:00
f1e8176995 fix(change_detect): Handle '$' in change detector strings
In Dart, '$' indicates the beginning of an interpolation.
- Escapes '$' in strings when generating change detector classes.
- Adds a unit test to cover this case.
2015-07-16 13:01:53 -07:00
621604dc66 fix(publish): add force flag for pub publish script
The pub publish process was not following through with publishing
packages because the -f flag was not be provided to pub publish,
causing the process to prompt for confirmation before publishing,
which was causing the pub_publish.sh script to skip publishing.

Closes #3077
2015-07-16 11:20:16 -07:00
5654f2f4e2 test(dom_renderer): test that properties on the root element can be changed.
Closes #3013
Closes #3085
2015-07-16 10:39:32 -07:00
b1231593b6 fix(forms): do not reset the value of the input when it came from the view 2015-07-16 10:00:32 -07:00
b1df54501a feat(compiler): attach components and project light dom during compilation.
Closes #2529

BREAKING CHANGES:
- shadow dom emulation no longer
  supports the `<content>` tag. Use the new `<ng-content>` instead
  (works with all shadow dom strategies).
- removed `DomRenderer.setViewRootNodes` and `AppViewManager.getComponentView`
  -> use `DomRenderer.getNativeElementSync(elementRef)` and change shadow dom directly
- the `Renderer` interface has changed:
  * `createView` now also has to support sub views
  * the notion of a container has been removed. Instead, the renderer has
    to implement methods to attach views next to elements or other views.
  * a RenderView now contains multiple RenderFragments. Fragments
    are used to move DOM nodes around.

Internal changes / design changes:
- Introduce notion of view fragments on render side
- DomProtoViews and DomViews on render side are merged,
  AppProtoViews are not merged, AppViews are partially merged
  (they share arrays with the other merged AppViews but we keep
  individual AppView instances for now).
- DomProtoViews always have a `<template>` element as root
  * needed for storing subviews
  * we have less chunks of DOM to clone now
- remove fake ElementBinder / Bound element for root text bindings
  and model them explicitly. This removes a lot of special cases we had!
- AppView shares data with nested component views
- some methods in AppViewManager (create, hydrate, dehydrate) are iterative now
  * now possible as we have all child AppViews / ElementRefs already in an array!
2015-07-15 20:23:27 -07:00
d449ea5ca4 feat(change_detection): added support for ObservableList from package:observe 2015-07-15 17:06:42 -07:00
583c5ffcb5 fix(ng_for): fixed ng_for to pass a change detector ref to the pipe registry 2015-07-15 17:06:42 -07:00
7879761a41 fix(element_injector): inject the containing change detector ref to directives 2015-07-15 17:06:42 -07:00
f7dfd2325d chore(query): refactor QueryList and BaseQueryList.
Closes #3035, #3016
2015-07-15 15:49:52 -07:00
b03560b670 fix(examples): add a couple entrypoints, adjust pubspec, fix change detector bug in Dart 2015-07-15 15:41:40 -07:00
f25e43fab8 chore(build): add material css to dart build. 2015-07-15 15:36:22 -07:00
903ff9047f feat(core): add ability to reflect DOM properties as attributes
By binding the token `DOM_REFLECT_PROPERTIES_AS_ATTRIBUTES` provided by 
the dom_renderer module to `true` in the root injector (i.e. bootstrap()), 
all elements whose properties are set by angular will be reflected as 
attributes with the prefix "ng-reflect-".

Fixes #2910
2015-07-15 13:59:44 -07:00
66ec4d1f5c fix(build): clang-format 2015-07-15 13:20:38 -07:00
93055f78ea chore(lint): require semicolons
Relying on ASI (automatic semicolon insertion)
is allowed in TypeScript because JavaScript allows
it. However, when we run clang-format it doesn’t
understand that these statements are terminated
with a newline and changes the indentation, in bad
cases even breaking the code.

Fixes #817
2015-07-15 12:57:32 -07:00
33500e986b feat(webworkers) Add MessageBus, Broker, and Serializer 2015-07-15 11:49:10 -07:00
b26f99787e chore(router): fix formatting 2015-07-15 11:10:39 -07:00
9d66b5b09e chore(build): upload dist.tgz for js builds 2015-07-15 10:58:51 -07:00
8bdca5c03e fix(router): improve error messages for routes with no config
Closes #2323
2015-07-15 10:28:25 -07:00
ccb41632c7 feat(facade): add getTypeNameForDebugging function 2015-07-15 10:28:25 -07:00
cd532b00d4 test(e2e): fix error setting style property of DOM element
Fixes the following error in e2e tests: "Cannot set property style of
\#<HTMLElement> which has only a getter".

Closes #2874
2015-07-15 11:37:25 +02:00
81abc39929 feat(http): add support for JSONP requests
Closes #2905
Closes #2818
2015-07-14 21:31:05 -04:00
b4cde697b5 chore(facade): make normalizeBlank less nonsensical 2015-07-14 17:21:54 -07:00
7531b48d02 fix(di): instatiate services lazily 2015-07-14 17:10:30 -07:00
2bc1217409 feat(transformers): expose DI transformer for use by packages
Expose the DI transformer for packages that have injectable objects but do not
contain the application or angular views.

Closes #2814
2015-07-14 16:59:03 -07:00
b73ba68215 refactor(LifecycleEvent): change from onInit to Lifecycle.onInit
BREAKING CHANGE

Closes #2928
2015-07-14 16:51:44 -07:00
e1e7912ab2 chore(benchmarks): use isSupported() rather than !isJsObject()
Seems more accurate, and would allow `isJsObject()` to handle typical
`{}`-literals in dart, which could be useful

Closes #2995
2015-07-14 16:46:25 -07:00
e988f59c08 fix(html_adapter): Implement hasAttribute and getAttribute.
Fixes the template compiler when running on the server.
2015-07-14 14:48:00 -07:00
3810e4bed3 feat: upgrade ts2dart to 0.6.9. 2015-07-14 11:15:15 -07:00
27233cff31 chore(process): add core/webworker component to TRIAGE_AND_LABELS.md 2015-07-14 11:15:10 -07:00
34993f7691 chore(package.json): bump version to 2.0.0-alpha.31 2015-07-14 10:52:39 -07:00
7dc1dff816 refactor(NgZone): idiomatic Dart 2015-07-14 09:17:15 +02:00
5677bf73ca feat(router): introduce matrix params
Closes #2774
Closes #2989
2015-07-13 17:15:13 -07:00
97ef1c27df fix(router): export lifecycle hooks in bundle 2015-07-13 17:03:42 -07:00
04baa46efe fix(di): removed default visibility
BREAKING CHANGE:
    Directives will use the Unbounded visibility by default, whereas before the change they used Self
2015-07-13 16:00:07 -07:00
4bdc91892a chore(transformer): add a test that generated change detectors dont call notifyOnBinding for template variables 2015-07-13 15:09:06 -07:00
b3a763a718 fix(compiler): keep DOM.hasProperty in sync between browser and transformer.
Right now, we always return true until
we have property schema support (#2014).

Fixes #2984
Closes #2981
2015-07-13 15:09:06 -07:00
7ee6963f5d feat(query): initial implementation of view query.
ViewQuery is a new API that allows a component to query its view.

Closes #1935
2015-07-13 14:44:55 -07:00
1eab4f5f07 feat(license): include license files in dev and dev.sfx bundles 2015-07-13 14:01:56 -07:00
cf103de4a7 fix(transformer): Event getters now use property name not event name 2015-07-13 10:42:09 -07:00
a9a552c112 feat(router): lifecycle hooks
Closes #2640
2015-07-13 09:12:15 -07:00
f5f85bb528 chore: added modules/.settings to .gitignore
Closes #2993
2015-07-13 09:15:46 +02:00
bdfef4ed16 docs(util/decorators): fix typos in ClassDefinition interface
Closes #3000
2015-07-13 09:08:12 +02:00
4d80ce5b4a chore(doc-gen): add some tests for typescript-definition-package 2015-07-12 19:10:58 +01:00
09bb114a4d chore(doc-gen): convert heritage for private constructor classes
When we are creating a type definition file for a class has a private constructor,
we convert it to a combination of an instance of a concrete type with no constructor and an interface that contains the other methods.

When this happens, we must also convert the class's heritage from
`implements` to `extends` since interfaces cannot implement other interfaces
or classes.

Fixes a problem with #2996
Closes #3002
2015-07-12 18:53:31 +01:00
3bf8c18c56 chore: run clang-format on code base.
This fixes several minor indentation issues (instanceof precendence,
type declaration specificity, template string length calculation).

This should also fix some flip-flop situations with template strings.
2015-07-12 18:50:52 +02:00
45994a53ce feat: upgrade clang-format to v1.0.28. 2015-07-12 18:50:52 +02:00
875db11822 chore(doc-gen): update dgeni-packages to 0.10.18
0.10.18 has fixed the `@private` tag so this is not needed locally any more
2015-07-11 07:21:46 +01:00
2e4a2a0e5a chore(doc-gen): remove unnecessary @public and @exportedAs tags 2015-07-11 07:21:46 +01:00
9fa7d38133 chore(doc-gen): put typescript stuff into its own package
This means that we can now run just the d.ts file generation by running:

```bash
gulp docs/typings
```

In addition the type definition generation was messing with the other docs tasks
so separating it also fixes problems there.
2015-07-11 07:21:45 +01:00
927454c8fa chore(doc-gen): don't use string module to stripTags
This module writes a file called `string` containing the text `testtest`
to the file system when it initialize.

See https://github.com/arturadib/shelljs/issues/212
2015-07-11 07:21:33 +01:00
0e28297e68 feat(zone): add "on event done" zone hook 2015-07-10 15:45:52 -07:00
1eebceab27 feat(pipes): add static append method to Pipes
This change allows creation of a new Pipes binding with new pipes appended
to pipes of an inherited Pipes instance.

Closes #2901
2015-07-10 15:42:57 -07:00
9a70f84e60 refactor(pipes): rename PipeRegistry to Pipes
BREAKING CHANGE:
    This change renames all instances of PipeRegistry to Pipes.
    As part of this change, the former "defaultPipes" export is
    now a Pipes instance, instead of a map. The map that was previously
    called "defaultPipes" no longer exists, but may be accessed via
    defaultPipes.config.
2015-07-10 15:42:56 -07:00
8b3efdf229 chore(pipes): rename pipe_registry.ts -> pipes.ts
This is its own commit so that tools have an easier time of preserving
history of the file, by keeping the diff between pipes.ts and
pipe_registry.ts minimal.

Also moved pipe_registry_spec.ts
2015-07-10 15:42:56 -07:00
1427d73b66 fix(example): add missing todo 2015-07-10 15:21:03 -07:00
62589293aa fix(transformer): fix 'pub build' in examples 2015-07-10 15:08:48 -07:00
749d043258 fix(css_shim): fixes multiple uses of polyfill-unscoped-rule. 2015-07-10 12:40:57 -07:00
a6210466c7 fix(di): do not use exceptions to detect if reflection is enabled 2015-07-10 10:50:03 -07:00
71c65b47f9 feat(test): add test bundle
Create a bundle for the test library, TestComponentBuilder,
TestInjector, and DebugElement.

Internal tests use a superset of the bundle.
2015-07-09 18:07:48 -07:00
0ed5dd0d7b fix(di): hostInjector and viewInjector support nested arrays 2015-07-09 15:03:38 -07:00
b716046b97 feat(pipes): add date pipe
Closes #2877
2015-07-09 15:00:14 -07:00
3143d188ae feat(pipes): add number (decimal, percent, currency) pipes 2015-07-09 14:59:57 -07:00
b54e7214f0 chore: removed angular2.api.ts
BREACKING CHANGE:

We export InjectMetadata instead of InjectAnnotation
2015-07-09 13:54:07 -07:00
d6dadc6efc fix(router): fix broken HashLocationStrategy string issue for dart 2015-07-09 13:21:17 -07:00
546a8f9218 fix(package.json): move some deps into dev deps.
Closes #2448
2015-07-09 12:59:20 -07:00
fe49a7fc40 chore(build): upload dart artifacts to GCS
second attempt after rollback of https://github.com/angular/angular/pull/2946

After each successful build in the dart stable variant, this uploads just enough of the dart
artifacts to mirror what we would push to pub.
By uploading the files instead of a zip, this lets dart users depend on an unreleased snapshot
of angular2, and lets us easily fetch the dart artifacts for sync into google3
without having to re-build (potentially in a subtly different environment).
This doesn't upload anything for pull requests.
2015-07-09 11:55:04 -07:00
447926dc08 refactor(RegExp): use /.../ to create RegExp literal
fixes #2691
2015-07-09 09:14:25 +02:00
258da88765 revert: example(routing): adding routing example and e2e tests
This reverts commit 718fa35167.
2015-07-08 23:03:29 -07:00
e79dd6aa2d fix(build) clang-format 2015-07-08 18:34:39 -07:00
2c37cc5fcb chore(examples): fix dart issues with router example 2015-07-08 18:01:32 -07:00
206c9bdd74 fix(build): remove the travis deploy step, which is broken.
I need to test this on a fork+travis rather than break the angular build.
2015-07-08 17:42:50 -07:00
4264bd3bd2 fix(build): reduce the deploy upload.
Travis is currently stalling, presumably it takes too long to upload this many files.
Also it picks up the dart directory when deploying js, which looks like a bug
with multiple gcs providers, so just do dart for now.
2015-07-08 17:10:52 -07:00
ae5cd51f50 chore(examples): fix broken router example code for Dart 2015-07-08 16:43:28 -07:00
df877a7d5b fix(build): clang-format 2015-07-08 16:30:43 -07:00
4572157c49 chore(build): add GCS upload of build artifacts
This copies the dist/ folder for each successful travis run
to a google cloud storage bucket, under the SHA of the commit.
We only upload for submitted changes, not PRs.
We can use this to fetch the dart sources for each SHA
without having to re-build them, which is hard to reproduce
since the environment might differ (eg. different Dart SDK)
2015-07-08 16:25:03 -07:00
6596c72131 docs(NgStyle): add documentation
Closes #2931
2015-07-08 16:11:19 -07:00
f1f578436b feat(build): Allow building in windows without admin priviledges
Closes #2873
2015-07-08 16:10:23 -07:00
f827e1532e docs(CSSClass): add documentation
Closes #2933
2015-07-08 16:09:24 -07:00
bab271fcb4 test(CssClass): verify that classes from string exp are cleared properly
Closes #2888
Closes #2934
2015-07-08 16:08:32 -07:00
0792f1a7a1 fix(tsconfig): target should be lower case
closes #2938
2015-07-08 16:07:25 -07:00
ac50ffca5e fix(transform): handle multiple interfaces in directive processor
Comma separate the list of interfaces in the directive transformer.

Closes #2941
2015-07-08 16:05:42 -07:00
caa252e57b chore(router): change substr to substring 2015-07-08 15:46:51 -07:00
d5edc748d2 chore(changelog): add support for to and from flags in changelog.js
This commit adds support for "--to=SHA" and "--from=SHA" when running
the script at scripts/publish/changelog.js to override defaults.

Fixes #2913
2015-07-08 15:19:30 -07:00
718fa35167 example(routing): adding routing example and e2e tests
Closes #2650
2015-07-08 15:14:46 -07:00
c177d889a2 fix(router): ensure that page refresh with hash URLs works
This patch fixes the `HashLocationStrategy` to always return a string
path value without a hash symbol as the starting value.

Closes #2920
2015-07-08 15:08:17 -07:00
3f7ebde037 feat(forms): changed all form directives to have basic control attributes 2015-07-08 12:04:38 -07:00
4656c6f5cf tools: added experimentalDecorators flag to tsconfig 2015-07-08 10:46:03 -07:00
e0fb50cc3c docs(view_ref): fix typos
Closes #2930
2015-07-08 18:06:40 +02:00
7d9f5d7538 docs(element_ref): fix typos 2015-07-08 18:06:39 +02:00
2ac8ebd3ef refactor(directive_parser): improve code readability
Closes #2876
2015-07-08 18:02:08 +02:00
871267d578 chore(.d.ts): remove private Compiler deps
Closes #2929
2015-07-08 08:07:08 +02:00
d050ce20a9 chore(doc-gen): fixup private constructor declarations
Closes #2883
2015-07-08 08:06:59 +02:00
6c933a4485 chore(packaging): bump version to 2.0.0-alpha.30 2015-07-07 21:39:10 -07:00
c33e3be735 chore(.d.ts): remove *Args files 2015-07-07 20:04:14 -07:00
3ab8a0c438 chore(docs): adding docs to core.ts and annotations.ts 2015-07-07 20:04:13 -07:00
12a427e158 fix(.d.ts): correct ComponentAnnotation inheritance
Closes #2356
2015-07-07 20:04:13 -07:00
0052c6b120 chore: improve angular2.d.ts file
- support ambient and import format for .d.ts
2015-07-07 20:04:13 -07:00
65a767d9b0 refactor: export angular as ‘ng’ in SFX 2015-07-07 20:04:13 -07:00
0e945e465d chore(doc-gen): stop crash in gulp public_docs
This change prevents the doc generation from crashing due to a missing module,
but perhaps we need to think of a way of being able to generate the angular.d.ts
file correctly in `gulp public_docs`, perhaps by removing the need for
angular2/angular2.api
2015-07-07 20:04:13 -07:00
72257ec87d chore(doc-gen): include type parameters in d.ts file
Closes #2859
2015-07-07 20:04:07 -07:00
e5405e4ba2 fix(forms): Remove cyclic dependency
correctly resolve Renderer by removing cyclic dependencies

Closes #2856
2015-07-07 16:25:43 -07:00
b60d714acf docs: Corrects article to 'a' instead of 'an' in comment
Closes #2858
2015-07-07 16:24:23 -07:00
edf5053bf0 feat(NgStyle): Export NgStyle in angular2/directives
Closes #2878
2015-07-07 16:20:24 -07:00
3869818d8f docs(modules): fix typos
closes #2914
2015-07-07 16:14:43 -07:00
abc1580fa9 chore(package.json) upgrade zone.js to 0.5.2 2015-07-07 16:13:18 -07:00
286a249a9a feat(router): support deep-linking to siblings
Closes #2807
2015-07-07 14:54:59 -07:00
d828664d0c fix(router): allow generating links with numeric params 2015-07-07 14:54:59 -07:00
355ced92eb chore(doc-gen): fix spacing in heritage clauses 2015-07-07 22:04:10 +01:00
9e1158de4f fix(transformer): Support prefixed annotations in the transformer.
closes https://github.com/angular/angular/issues/2754
2015-07-07 11:26:42 -07:00
569766fa8b refactor(di): added support for custom dep providers 2015-07-07 08:27:54 -07:00
e987ac4034 tools: updated the VS Code config 2015-07-07 08:17:58 -07:00
c2efa23e94 fix(change_detection): throw ChangeDetectionError in JIT mode 2015-07-06 18:03:50 -07:00
d2774421e8 fix(change_detection): do not coalesce records with different directive indices 2015-07-06 17:59:38 -07:00
8681f79182 chore(typings): move comments to decorator args.
The properties of the annotation classes are not really the public API.
Users will interact with these via a decorator, and the decorator
takes a single arg, typed with the args class. Thus the comment is
more useful on the arg class.

This also fixes the problem of intellisense/autocomplete not showing
the important docs as you fill in the properties in a decorator
declaration.
2015-07-06 17:25:59 -07:00
b10d7a2e51 fix(angular2.d.ts): show typing for Component, etc
We had the same symbol exported as the interface
for Component decorator as well as the class for
Component annotation, and dgeni only showed the
latter.
Rename the interfaces for decorators with an ‘I’
prefix so they are retained in the .d.ts output.
2015-07-06 17:25:59 -07:00
a56d33d7ca feat(typings): mark void methods in angular2.d.ts
Previously, when a return type was missing it
could have been any. But following #2746 we
require return types so remaining untyped returns
must be void.
2015-07-06 17:25:59 -07:00
2b45bd2a63 fix(transformer): Put paramater data in the same order as the reflected version.
Previously it would be [@Inject(#thing), Thing], but it should be [Thing, @Inject(#thing)].
2015-07-06 15:48:00 -07:00
7986e7ce7e feat(transformer): Support @Injectable() on static functions 2015-07-06 15:47:54 -07:00
311b47720b fix(transformer): Fix string interpolation for bindings.
Previously it did not stringify properties and used `+` instead of ` `.
2015-07-06 14:57:21 -07:00
582551bea9 test(ProtoViewBuilder): correct duplicate tests
Closes #2860
2015-07-06 22:40:49 +02:00
19a0349681 chore(build): re-enable dev build for Dart
This reverts commit b3fc357a15.

Closes #2798
2015-07-06 13:25:30 -07:00
883b506445 fix(Http): add support for headers 2015-07-06 10:06:12 -07:00
d381c5fc8a feat: upgrade t2dart to 0.6.8. 2015-07-06 16:15:10 +02:00
ad506a7aaa chore(doc-gen): render "call" and "new" members of interfaces correctly
Partially Closes #2849
2015-07-03 09:00:20 +01:00
ef3cc8e6eb chore(doc-gen): render optional members correctly
Partially Closes #2849
2015-07-03 09:00:20 +01:00
561b78a5b3 chore(doc-gen): generate router typings file
Closes #2659
2015-07-03 08:58:36 +01:00
a7ea2e5566 build(broccoli): concat all typescript error messages into the message of thrown exception
This allows us to to do better error handling and for cli this means that we can show typescript
errors in the output of the webserver
2015-07-02 23:21:33 -07:00
1c94c32f4d fix(router): child routers should delegate navigation to the root router
There is an e2e tests in the examples/routing app testing this behavior
2015-07-02 23:21:33 -07:00
d5ace7a562 test(route_link): add missing unit tests 2015-07-02 23:21:33 -07:00
2ed251a5db docs(router): fix doc 2015-07-02 23:21:05 -07:00
8d0d05c65f build(protractor): don't require benchpress bundle for all protractor tests
by moving the benchpress init into the function, we make it possible to run other protractor tests
without having bechpress bundle around
2015-07-02 23:21:05 -07:00
ac24a301bd build(gulp): remove the tmp cleanup code
this is no longer necessary and if anyone runs two gulp processes in parallel can actually cause
issues because once one of the processes ends, it delets the tmp dir which can affect the remaining
process
2015-07-02 23:21:05 -07:00
ba440a04d1 chore: ignore .packages file
This is new in Dart 1.12
2015-07-02 10:52:56 -07:00
cd65fc2a5e fix(compiler): detect and strip data- prefix from bindings
Fixes #2687

Closes #2719
2015-07-02 17:32:12 +02:00
e69af1a3cd fix: handle errors w/o file information.
TypeScript errors do not always include file information, e.g. for
global errors triggered by incorrect compiler options.
2015-07-02 12:24:38 +02:00
d1393b0581 fix(di): injecting null causes a cyclic dependency 2015-07-01 17:08:45 -07:00
46bb4e37ba chore(packaging): bump version to 2.0.0-alpha.29 2015-07-01 16:29:03 -07:00
3a8e1661fa examples: added an example of a crud app 2015-07-01 16:25:53 -07:00
0598226e24 fix(compiler): don't trigger duplicated directives
Fixes #2756
Closes #2568
2015-07-01 16:13:26 -07:00
0b50258814 feat(pipes): add limitTo pipe 2015-07-01 13:36:01 -07:00
600d53c68e feat(pipes): support arguments in transform function 2015-07-01 13:36:01 -07:00
f0e962c55e feat(di): removed app injector
BREAKING CHANGE:

THe appInjector property has been removed. Instead use viewInjector or hostInjector.
2015-07-01 13:33:43 -07:00
73a939e76c fix(change detectors): Fix deduping of protos in transformed dart mode.
In non-transformed mode the funcOrValue check was enough, but once
transformed these all use the same function for getters, so we need
to also check the name.
2015-07-01 12:56:31 -07:00
dcdd73065a feat(transformers): provide a flag to disable inlining views
Add a flag to allow a user to disable inlining css/html content into the views.

Closes #2658
2015-07-01 11:39:16 -07:00
34eaf65a79 docs(Http): add docs about breaking changes with EventEmitter/Observable
BREAKING CHANGE:
    The Http module previously would return RxJS Observables from method calls
    of the Http class. In order to support Dart, the module was refactored to
    return the EventEmitter abstraction instead, which does not contain the same
    combinators or subscription semantics as an RxJS Observable. However, the
    EventEmitter provides a toRx() method which will return an RxJS Subject,
    providing the same subscription and combinator conveniences as were
    available prior to this refactor.

    This is temporary, until issue #2794 is resolved, when Observables will
    again be returned directly from Http class methods.
2015-07-01 10:34:12 -07:00
27e710019c chore(typing): use types for DOM API
This is possible now that ts2dart special cases these for dart.

Fixes #2770
2015-07-01 09:57:11 -07:00
c2c361efcf build(npm): don't rely on fs-extra when purging node_modules
Travis creates an empty node_modules directory when the cache is empty which confuses
our current script into thinking that it's ok to require fs-extra. While this is rare,
it's better not to depend on anything in node_modules when purging it, so I reimplemented
recorsive delete that we use to purse node_modules.
2015-07-01 09:19:03 -07:00
f020a5cdea chore(gulp): add a task to print dart & pub versions 2015-07-01 17:54:23 +02:00
530e742628 refactor(injector): remove unused function
Closes #2815
2015-07-01 15:27:23 +02:00
a90063a827 chore(typing): restore some defn's now that dgeni is fixed
Closes #2446
Closes #2805
2015-07-01 12:53:10 +01:00
de05d1bf46 build: speedup test.untit.dart by removing unneeded pub symlinks
This is an alternative to #2778. All of the symlinks to packages directory within the test directory
are not needed for running tests, so we can safely remove them. This removes 80k files from the test directory
which significantly speeds up Karma.

Closes #2437
2015-06-30 21:55:35 -07:00
1fb948461e style: fix formatting for real 2015-06-30 20:38:08 -07:00
27c050be86 style: fix formatting 2015-06-30 19:55:44 -07:00
f66ce096d8 feat(router): support deep-linking to anywhere in the app
Closes #2642
2015-06-30 17:21:50 -07:00
2335075506 feat(facade): add ListWrapper.toJSON method 2015-06-30 17:21:50 -07:00
b3fc357a15 chore(build): temporarily deactivate dev build for Dart
Please revert when #2798 is closed!
2015-06-30 17:17:32 -07:00
b3d98cba77 refactor(http): remove default settings from RequestOptions constructor
The BaseRequestOptions class is responsible for declaring default values,
while the RequestOptions class is merely responsible for setting values
based on values provided in the constructor.
2015-06-30 15:21:36 -07:00
146dbf1270 refactor(Http): remove HttpFactory
BREAKING CHANGE: HttpFactory is no longer available. 
    This factory provided a function alternative to the `request` method of the
    Http class, but added no real value. The additional factory required an
    additional IHttp interface, an odd way to inject while preserving type information
    (`@Inject(HttpFactory) http:IHttp`), and required additional documentation in the
    http module.

Closes #2564
2015-06-30 15:21:36 -07:00
55bf0e554f feat(http): refactor library to work in dart
Mostly internal refactoring needed to make ts2dart and DartAnalyzer happy.

Fixes #2415
2015-06-30 15:21:36 -07:00
fa7da0ca5d revert: "build: speed up karma run by passing in list of dist files that changed"
This reverts commit 7fc1ee67d1.

This commit caused the build to break.
2015-06-30 14:44:44 -07:00
d49459750a revert: "style: fix formatting"
This reverts commit d6b56c2380.

The previous commit caused the build to break.
2015-06-30 14:44:12 -07:00
d6b56c2380 style: fix formatting 2015-06-30 13:03:03 -07:00
7fc1ee67d1 build: speed up karma run by passing in list of dist files that changed
This change causes the build system to write a log file into the tmp folder after each build.
This file contains command line arguments that tell karma about all the added/changed/removed files
from the last build. Karma can then use this list instead of doing internal globbing which can be
very expensive especially for hte dart builds that contain thousands of files.

Closes #2437
2015-06-30 11:53:47 -07:00
3e6503789f fix(docs): to run js test 'gulp docs' is needed
The docs processing generates the angular2/angular2.d.ts file, which is
needed by the typing_spec

Closes #2762
2015-06-30 02:24:37 +01:00
8bab6dd239 fix(build): Reduce rx typings to what we actually require.
This should help a lot with github rate limiting by removing about
2/3 of the dependencies.
2015-06-29 16:59:04 -07:00
a9008eecba chore(build): record the version of node we expect.
The .nvmrc file is used by nvm if you don't specify a version. This lets us type Found '/Users/alexeagle/Projects/angular/.nvmrc' with version <0.12>
Now using node v0.12.2. It doesn't check that you are using the node version from the file, however, so this won't prevent version skew.

See https://github.com/creationix/nvm#usage

closes #1995
2015-06-29 16:30:55 -07:00
73b3ed18c1 build(broccoli): don't set stored diffResult to null on use
Doing this would break trees which are used multiple times.
2015-06-29 16:13:02 -07:00
a93ec73e72 build(broccoli): store DiffResult for re-use only if DiffResult
One of the non-angular broccoli plugins returns a weird object. We can't
assume that all trees meet the contract that we expect them to meet, so
we do a typecheck before storing the result of the rebuild.

Closes #2662
2015-06-29 16:13:02 -07:00
9a290f0c22 Revert "Revert "build(broccoli): allow rebuild() to return DiffResult""
This reverts commit 2c3c235969.
2015-06-29 16:13:02 -07:00
5de916ecd0 docs(DEVELOPER.md): fix file suffixes
Also related to #2455
Closes #2743
2015-06-29 16:09:39 -07:00
44891996b5 fix(build): add missing return types now enforced by linter 2015-06-29 15:31:41 -07:00
bc585f2724 feat(build): add tslint to the build.
The first enabled rule enforces return types
declared on non-private (underscore-prefix)
methods that return something.
2015-06-29 15:31:41 -07:00
d629ed7d5b fix(bundle): don’t bundle traceur/reflect into benchpress - amended change
Don’t need to bundle them as they are already
present in G3. I.e. the benchpress bundle
only includes benchpress and Angular2 bits.

Also removes adding license headers for now,
as we only have one license.
2015-06-29 15:03:15 -07:00
8c66a25270 chore(test): remove TestBed
Instead, use TestComponentBuilder.

Closes #2354
2015-06-29 14:18:33 -07:00
82e8e8c638 chore(test): upgrade form tests to testcomponentbuilder
Part of #2354
2015-06-29 13:59:12 -07:00
27ad984626 refactor(Router): re-use resolved promise instances 2015-06-29 21:27:07 +02:00
1f04f70eda refactor(Router): idiomatic TS 2015-06-29 21:27:07 +02:00
eea989bef8 fix(Router): mark Pipeline and RouteRegistry as Injectable
fix #2755
2015-06-29 21:27:07 +02:00
d6cef88dd8 fix(dynamic_component_loader): check whether the dynamically loaded component has already been destroyed
Fixes #2748
Closes #2767
2015-06-29 11:30:56 -07:00
da4de21f28 fix(bundle): don’t bundle traceur/reflect into benchpress
Don’t need to bundle them as they are already
present in G3.
2015-06-29 11:30:34 -07:00
eb0fd7967c feat(di): changed InstantiationError to print the original stack 2015-06-29 11:16:12 -07:00
56245c6aa2 feat(lang): added originalException and originalStack to BaseException 2015-06-29 11:16:12 -07:00
ab3f2365fd chore(test): move ng-style tests to TestComponentBuilder
Part of #2354
2015-06-29 10:59:32 -07:00
66d0e4e656 chore(test): migrate router tests to TestComponentBuilder
Part of #2354
2015-06-29 10:58:39 -07:00
0f7dd62f16 chore(npm): correct generated package json files. 2015-06-29 10:30:00 -07:00
c4e10ea9ac chore(benchpress): add browserify bundling
Use browserify to bundle benchpress and its dependencies.
2015-06-29 10:29:59 -07:00
f1cf5298d8 fix(docs): link to clang-format 2015-06-26 16:00:37 -07:00
22d3943831 refactor(di): unified di injector and core injector
BREAKING CHANGES:

* InjectAsync and InjectLazy have been removed
* toAsyncFactory has been removed
2015-06-26 15:59:18 -07:00
b688dee4c8 feat(async): added PromiseWrapper.wrap 2015-06-26 15:58:52 -07:00
71e0f89594 chore: updated tsconfig to ignore test and dist 2015-06-26 15:58:31 -07:00
5a21dc5340 fix(transformer): Add getters for events.
closes https://github.com/angular/angular/issues/2725
2015-06-26 08:07:46 -07:00
d037c082fb fix(transformer): Don't hang on bad urls and log better errors
closes https://github.com/angular/angular/issues/2605
2015-06-26 07:18:58 -07:00
9c768501c4 fix(transformer): Fix annotation_matcher for NgForm directive.
The NgForm directive imports Directive from a previously unlisted import.
2015-06-26 07:16:03 -07:00
b50edfd1f3 feat(NgStyle): add new NgStyle directive
Closes #2665
2015-06-26 12:50:20 +02:00
dd7910347a chore(windows): fix the test.server.dart task
Closes #2703
2015-06-26 10:25:26 +02:00
65769699b0 chore(windows): fix the Dart e2e/benchmark tasks 2015-06-26 10:24:56 +02:00
8b685466f5 chore(windows): fix the JS e2e/benchmark tasks 2015-06-26 10:24:42 +02:00
91d9e8d649 chore(windows): fix the test.transpiler.unittest task 2015-06-26 10:24:31 +02:00
746efe7eba chore(windows): fix the test.unit.tools task 2015-06-26 10:24:22 +02:00
ecb2bd0cbe chore(windows): fix the build.dart task 2015-06-26 10:24:12 +02:00
7e8a2b9cec chore(windows): fix the test.unit.dart task
Closes #2676
2015-06-26 10:21:48 +02:00
1f7296c093 feat: upgrade clang-format and gulp-clang-format.
This makes sure just running clang-format will use whatever version is
used in the project, by loading it from the closest node_modules folder.

It also moves the clang-format dependency to the top and explicitly
passes it to gulp-clang-format, giving us more control over the version
used.
2015-06-25 22:55:58 -07:00
d1f7900eeb docs: consolidate clang-format docs.
Move the section from `CONTRIBUTING.md` (which should only be policy) to
`DEVELOPER.md` (which should document developer tooling).

Consolidates the whole thing a bit, and adjusts for the now always
installed `git clang-format` hook. Also mentions clang-format's lookup
behaviour.
2015-06-25 16:26:30 -07:00
393f703a97 fix: export top-level pipe factories as const
Also appComponent(Ref|Type)Token

Related to https://github.com/angular/angular/issues/1485
2015-06-25 15:16:24 -07:00
7a7b3a6cb9 perf(Compiler): do not resolve bindings for cached ProtoViews 2015-06-25 14:45:08 -07:00
0949a4b045 feat(benchpress): initial support for firefox
Closes #2419
2015-06-25 14:40:46 -07:00
7a4a3c850f fix(typings): Minor issues preventing angular2.d.ts from working in TS 1.4.
This removes some, but not all, of the manual work needed to patch up our
.d.ts for pushing to DefinitelyTyped. Remaining manual steps are:
- some types still missing
- declaration of decorators
- remove destructuring args

See #2686.
2015-06-25 14:13:05 -07:00
8a5cf8f6bd docs(directives): correct property binding examples
Closes #2663
2015-06-25 15:12:16 +02:00
aeb17d8d44 test(NgSwitch): simplify tests with static values 2015-06-25 15:12:16 +02:00
85d6ae38b9 chore(test): migrate directives tests to testcomponentbuilder
Part of #2354
2015-06-24 21:58:36 -07:00
d3dda614dd chore(test): migrate remaining core tests to testcomponentbuilder
Also add a small utility function to debug element to get an
array of native elements, which works smoothly with the
toHaveText matcher.
2015-06-24 21:52:03 -07:00
1c8a58963c fix(build): fix paths in test.typings task 2015-06-24 21:18:46 -07:00
19a9dc67bd chore(packaging): bump version to 2.0.0-alpha.28 2015-06-24 16:20:57 -07:00
a0e0f3123b refactor: change template for view where it makes sense 2015-06-24 18:40:04 +02:00
b15474c6f2 refactor(TemplateResolver): rename to ViewResolver 2015-06-24 18:40:04 +02:00
356c927d12 refactor(TemplateLoader): rename to ViewLoader 2015-06-24 18:40:04 +02:00
b89c0672e6 test(refactor): cleanup test to use the new UrlMapper 2015-06-24 18:40:04 +02:00
0a2f6ddc64 fix(parse5): do not try to insert empty text node 2015-06-24 18:40:03 +02:00
3ea655918e refactor(Compiler): inline styles before compiling the template 2015-06-24 18:40:03 +02:00
3875f02a52 refactor(UrlResolver): move away from the anchor link
fixes #2029
fixes #872
2015-06-24 18:40:03 +02:00
06aaa0c50e refactor(UrlResolver): extract app url resolution into AppRootUrl
fixes #1732
2015-06-24 18:40:03 +02:00
8c993dca03 feat(CSSClass): add support for string and array expresions
Closes #2025
2015-06-24 16:17:10 +02:00
2c11205b96 chore(testbed): migrate compiler integration spec to testcomponentbuilder
Part of #2354
2015-06-23 19:02:46 -07:00
d800d2f5d7 fix(injectors): sync injector tree with dom element tree.
Changes adds createGrowableSize method to allow for growable lists with fixed
start.

Closes: #2498
2015-06-23 18:32:57 -07:00
24646e7eb8 feat(typings): add typing specs
add test in gulpfile which will compile a basic TS file with generated
angular2.d.ts to ensure generated d.ts is valid syntactic TS

Adds support for enums in .d.ts generation pipeline.
Removes renaming reexports in http module.
2015-06-23 18:22:47 -07:00
6149ce28a7 fix(render): fix failing tests in dynamic_component_loader.ts 2015-06-23 17:43:36 -07:00
c8bdacb195 refactor(render): cleanup access to native dom elements
BREAKING CHANGES:
- rename `ElementRef.domElement` to `ElementRef.nativeElement`
- add `Renderer.getNativeElementSync` to make the app side
  less dependent on the dom renderer.
- don’t use `ElementRef.nativeElement` in directives but
  use the methods on `Renderer` directly.
- Removed `ElementRef.setAttribute`. Use `Renderer.setElementAttribute` instead.

Closes #2712
Last part of #2476
Closes #2476
2015-06-23 17:27:59 -07:00
5c9e53a25e chore(testbed): migrate dynamic component loader spec to testcomponentbuilder
Part of #2354
2015-06-23 16:33:11 -07:00
ba9fecd068 refactor(render): use RenderElementRef in all renderer methods
BREAKING CHANGES:
- Almost all methods in `Renderer` now take a `RenderElementRef` instead
  of a `ViewRef` + `boundElementIndex`.
- These methods can be called with the `ElementRef` from the app side
  directly.

Closes #2706
Related to #2476
2015-06-23 14:26:34 -07:00
2c3c235969 Revert "build(broccoli): allow rebuild() to return DiffResult"
This reverts commit d575915d7a.

See #2662
2015-06-23 13:21:17 -07:00
7b2f757b2b build(gulp/travis): move circular check and style check to before pre/post-test tasks
In order to speedup the startup time of test.unit.js task, we are moving the circular dependency check into
a pre-test check that executes only on travis. Similarly we are moving the style check to a post-test check
that executes on travis.

This way if a circular dependency issue occurs, we find it before running tests on CI and if the code
is not formatted we fail the build only if all the tests pass.

Related to #2536
Related to #2094
2015-06-23 10:52:08 -07:00
a67f2314f9 feat(router): add support for hash-based location
Closes #2555
2015-06-22 18:46:20 -07:00
0a51ccbd68 feat(render): don’t use the reflector for setting properties
BREAKING CHANGES:
- host actions don't take an expression as value any more but only a method name,
  and assumes to get an array via the EventEmitter with the method arguments.
- Renderer.setElementProperty does not take `style.`/... prefixes any more.
  Use the new methods `Renderer.setElementAttribute`, ... instead

Part of #2476
Closes #2637
2015-06-22 18:35:16 -07:00
2932377769 feat(mock): add mock module and bundle
Closes #2325
2015-06-22 16:14:25 -07:00
e5de1f771a refactor(router): refactor BrowserLocation into LocationStrategy
This makes it easy to mock browser location and paves the way to
implementing hash routing.
2015-06-22 16:14:24 -07:00
b48f000657 docs(benchpress): document frame time metrics
closes #2656
closes #2685
2015-06-22 16:09:13 -07:00
d8929c1d73 fix(benchmarks): add waits for naive scrolling benchmark to ensure loading
Also, simplify selectors.

Closes #1706.
2015-06-22 12:39:59 -07:00
92ffc465d6 feat(host): limits host properties to renames 2015-06-22 12:10:02 -07:00
c1a494bc37 chore(ShadowDomStrategy): remove redundant field styleInliner 2015-06-22 11:15:46 -07:00
783654e6a3 chore(example): adds zippy example 2015-06-22 17:00:42 +02:00
dee0e008f5 chore(doc-gen): refactor versionInfo logic to new git dgeni-package
Closes #2444
2015-06-21 02:15:42 +01:00
d7b9345b6d feat(compiler): detect dangling property bindings
BREAKING CHANGE: compiler will throw on binding to non-existing properties.

Till now it was possible to have a binding to a non-existing property,
ex.: `<div [foo]="exp">`. From now on this is compilation error - any
property binding needs to have at least one associated property:
eaither on an HTML element or on any directive associated with a
given element (directives' properites need to be declared using the
`properties` field in the `@Directive` / `@Component` annotation).

Closes #2598
2015-06-20 08:06:07 +02:00
f158fbd131 chore(ShadowDomStrategy): fix MapWrapper usage, DemoUrlResolver 2015-06-19 18:50:30 -07:00
1c4d233fe7 fix(ShadowDomStrategy): always inline import rules
fixes #1694
2015-06-19 18:50:30 -07:00
d575915d7a build(broccoli): allow rebuild() to return DiffResult
Plugins may opt to return a DiffResult themselves, and avoid the
need to calculate a diff

Closes #2514
2015-06-19 21:35:44 -04:00
ed9d9d5096 build(broccoli): make node_trees produce strict-mode scripts
Closes #2575
Closes #2648
2015-06-19 21:19:12 -04:00
2d2ae9b8d8 feat(router): enforce usage of ... syntax for parent to child component routes 2015-06-19 20:54:45 -04:00
fa7a3e3449 cleanup: explicitly export symbols from di, cd, forms 2015-06-19 16:59:40 -07:00
a057789235 docs: clang-format instructions in CONTRIBUTING.md
Document installation, command line usage, editors, etc.
2015-06-19 16:57:44 -07:00
20a8f0dbe5 refactor(pipes): removed pipes from properties
BREAKING CHANGE:

This PR remove an ability to use pipes in the properties config. Instead, inject the pipe registry.
2015-06-19 16:56:52 -07:00
ad7aca631d refactor(NgClass): remove pipes from property bindings 2015-06-19 16:56:52 -07:00
c899b0a74c feat(element_injector): support multiple injectables with the same token 2015-06-19 16:02:56 -07:00
5ba5da5d25 cleanup(forms): cleanup 2015-06-19 16:02:43 -07:00
4d1ed509e3 refactor(forms): refactored forms to user Query to get html validators 2015-06-19 16:02:43 -07:00
85b8a15374 chore(build): add a task to watch and render examples and e2e tests for production
You can now run `gulp serve.e2e.prod` to instantiate a task that watches
and compiles example and module files into the prod directory in dist
and then allows the code to be run via protractor.

Closes #2369
2015-06-19 18:57:41 -04:00
920982c4e8 chore: update files to match clang-format 1.0.21. 2015-06-19 15:00:32 -07:00
254e58c28f feat: update clang-format to 1.0.21. 2015-06-19 15:00:31 -07:00
f9d72bd85b fix(transformer): Throw unimplemented errors in HtmlAdapter.
closes #2624
closes #2627
2015-06-19 14:45:58 -07:00
b8ef20e353 chore(doc-gen): ignore @param tags
At the moment we are not parsing param tags. This commit ignores them
completely.

TODO: hook up param descriptions with the actual param data in the doc.

Closes #2633
2015-06-19 12:10:01 -07:00
c8ef5b5811 chore: readme link to community-help hotlist 2015-06-19 11:25:00 -07:00
22f4cd26ae chore(doc-gen): remove redundant processors from angular.io generation 2015-06-19 19:08:34 +01:00
aadaa20706 chore(doc-gen): clean dist/angular.io folder when generating those docs 2015-06-19 19:04:41 +01:00
f2ef90b240 feat(transformers): inline styleUrls to view directive
While creating the ng_deps.dart file for a view inline the styleUrls attribute.
This copies the pattern used for templateUrl, aleviating the need to make an
XHR request for those resources.

closes #2566
2015-06-18 22:12:44 -07:00
f80f97253c refactor(change_detection): made ChangeDetector and ProtoChangeDetector interfaces
List of changes:

- Makes ChangeDetector and ProtoChangeDetector interfaces
- Assigns a unique id to every detector
2015-06-18 17:41:22 -07:00
ee8da36d08 chore(pub): add angular2_material to pub 2015-06-18 16:33:28 -07:00
9d4111d69d fix(compiler): make text interpolation more robust
Allows to add or remove previous siblings of text
interpolations (e.g. by added `<script>` tags for
content reproduction, or by removed `<style>` tags).

Also calculates correctly whether an element is
empty.

Fixes #2591
2015-06-18 15:45:00 -07:00
180e617866 Revert "fix(Compiler): fix text nodes after content tags"
This reverts commit d599fd3434.
but keeps the integration test. The test is made green by the
following commits.
2015-06-18 15:45:00 -07:00
bc798b182d fix(router): return promise with error handler
See https://github.com/angular/angular/pull/2528\#discussion_r32493195
2015-06-18 14:57:33 -07:00
941362014b feat: remove MapWrapper.clear().
It's the same in Dart and JavaScript.
2015-06-18 14:55:13 -07:00
dfd30910aa feat: remove MapWrapper.contains(). 2015-06-18 14:55:12 -07:00
be7ac9fd41 feat: remove MapWrapper.create()/get()/set().
Better dart2js code, better Angular code.
2015-06-18 14:55:12 -07:00
35e882e74f feat: add constructors without type arguments.
As the constructed objects have an any type, the
resulting containers are assignable to any type:

    var x: Map<string, number> = new Map();

That is useful to avoid having to specify types
twice when declaration and assignment are in
different places.
2015-06-18 14:55:12 -07:00
58b38c9201 feat: upgrade ts2dart to 0.6.4. 2015-06-18 14:55:12 -07:00
ed3af5f751 fix(benchpress): do not throw on unkown frame timestamp event
Closes #2622
2015-06-18 13:48:08 -07:00
5beaf6d735 fix(change detection): preserve memoized results from pure functions 2015-06-17 17:33:37 -07:00
b0e2ebda70 feat(query): added support for querying by var bindings 2015-06-17 16:36:55 -07:00
cd21df3572 refactor(element_injector): renamed Query.directive into Query.selector 2015-06-17 16:25:41 -07:00
c7e48350d3 chore: kill ListWrapper.create() and .push().
These wrappers are not natively understood by
ts2dart. Removing them will improve Dart2JS
compilation due to fewer megamorphic calls to List
functions.

It also makes Angular code more succinct and
improves type safety in Angular due to better type
inference of the Array component type.

This change exposed several bugs in Angular.
2015-06-17 16:21:55 -07:00
6af41a4543 chore: add missing .d.ts to type reference.
/// <reference> tags actually take a precise
path, it seems.
2015-06-17 16:21:55 -07:00
f9eb8a44d1 chore: add some FIXMEs to globals.d.ts.
StringMap really ought to always enforce a string
key, and also ought to have an index property.

This currently breaks too much code in Angular, so
should be fixed in a follow up Pull Request
separate from this.
2015-06-17 16:21:54 -07:00
d43394f7b7 chore(build): overwrite tsd files on npm install 2015-06-17 15:06:57 -07:00
dcc4bc2735 fix(annotations): swap DirectiveArgs & ComponentArgs 2015-06-17 21:59:53 +02:00
5dee8e26cc fix(views): remove dynamic component views, free host views, free embedded views
Closes #2472
Closes #2339

BREAKING CHANGE
- `Compiler.compile` has been removed, the only way to compile
  components dynamically is via `Compiler.compileInHost`
- `DynamicComponentLoader.loadIntoExistingLocation` has changed:
  * renamed into `loadIntoLocation`
  * will always create the host element as well
  * requires an element with a variable inside of the host component view
    next to which it will load new component.
- `DynamicComponentLoader.loadNextToExistingLocation` was renamed into
  `DynamicComponentLoader.loadNextToLocation`
- `DynamicComponentLoader.loadIntoNewLocation` is removed
  * use `DynamicComponentLoader.loadNextToLocation` instead
    and then move the view nodes
    manually around via `DomRenderer.getRootNodes()`
- `AppViewManager.{create,destroy}Free{Host,Embedded}View` was removed
  * use `AppViewManager.createViewInContainer` and then move the view nodes
    manually around via `DomRenderer.getRootNodes()`
- `Renderer.detachFreeView` was removed. Use `DomRenderer.getRootNodes()`
  to get the root nodes of a view and detach them manually.
2015-06-17 11:33:51 -07:00
df6acedd25 refactor(RenderCompiler): minor changes to PropertyBindingParser
Closes #2583
2015-06-17 13:53:33 +02:00
ffd1ac425e style(DI): idiomatic TS 2015-06-17 11:22:16 +02:00
edd01615c3 refactor(Lexer): switch token types to an enum 2015-06-17 11:16:33 +02:00
9700e80698 fix(docs): Fix docs for Directive.compileChildren 2015-06-17 09:14:44 +02:00
cd735c4837 fix(XHRImpl): file:/// and IE9 bugs 2015-06-17 09:14:26 +02:00
f93aae4802 chore(release): releases 2.0.0-alpha.27 2015-06-16 21:34:47 -07:00
b2c66949b2 feat: allow Type.annotations = Component(...).View(...)
Closes #2577
2015-06-16 16:36:46 -07:00
eb3586d777 fix: makes NgModel work in strict mode 2015-06-16 16:36:46 -07:00
5b5ffe75d0 docs(Http): add docs for Http lib
Fixes #2442
2015-06-16 15:42:18 -07:00
e68e69e7e5 refactor(Http): rename request options interface 2015-06-16 15:42:01 -07:00
70ffd267f8 refactor(Http): implement Request object parameter for http.request
Fixes #2416
2015-06-16 15:42:01 -07:00
b68e561c0f feat(Http): add Http class
Fixes #2530
2015-06-16 15:42:01 -07:00
93596dff3f feat(BaseRequestOptions): add merge method to make copies of options 2015-06-16 15:42:01 -07:00
ea27704ea9 fix(docs): order class members in order of declaration
Previously, class members were ordered alphabetically.
This change leaves it up to the class author to
determine the order in which they would like
properties and methods to appear in class
documentation, without having to create methods like
`zUnimportantMethod`.

Fixes #2569
2015-06-16 15:21:54 -07:00
35589a6b3c feat(benchpress): more smoothness metrics
Benchpress now prints out the best and worst frame time in addition to the percentage of frames that hit the target of 60fps.

It also renames 'meanFrameTime' to 'frameTime.mean'. That way, all frameTime metrics start with a common suffix and will be grouped together in the console reporter.

part of #821
2015-06-16 13:34:32 -07:00
598a75ec1c style(ChangeDetection): idiomatic TS 2015-06-16 19:45:00 +02:00
cdfb635737 refactor(facade): refactor type check function - is*() 2015-06-16 19:27:34 +02:00
37fceda7e8 chore(broccoli): improve overwrite error in merge-trees
Modified the error message to include the relative duplicate path,
to help in diagnosing the cause of the error message.

Closes #2521
2015-06-16 13:01:35 -04:00
2d499de2bd refactor(view): remove unused const
Closes #2561
2015-06-16 17:56:21 +02:00
91c75f99fe refactor(ShadowDomStrategy): remove unused imports in test 2015-06-16 17:41:32 +02:00
6e38515402 fix(ShadowDom): fix emulation integration spec to test all 3 strategies
fixes #2546
2015-06-16 17:38:42 +02:00
d599fd3434 fix(Compiler): fix text nodes after content tags
fixes #2095
2015-06-16 17:38:42 +02:00
b2e6ad85ea style(TestComponentBuilder): fix a typo in the spec 2015-06-16 17:37:58 +02:00
d8e2795368 fix(view): local variables override local variables set by ng-for 2015-06-16 07:48:26 -07:00
7a41b19e58 test(PropertySetterFactory): add more tests
There are upcoming changes to the way we generate
and verify setters so more test are needed to cover
all the corner cases that are being handled today.

Closes #2559
2015-06-16 14:49:59 +02:00
bc9e482b39 fix: Class factory now adds annotations 2015-06-15 22:23:54 -07:00
cab1d0ef0f feat(router): allow configuring app base href via token 2015-06-15 18:04:09 -07:00
0c282e826a chore(doc-gen): ensure github links have the correct text 2015-06-15 21:59:52 +01:00
8112b0baa7 chore(doc-gen): fix versionInfo population 2015-06-15 21:51:45 +01:00
c34cb01404 fix(forms): updated form examples to contain select elements 2015-06-15 13:16:41 -07:00
f1541e65b3 fix(forms): fixed the handling of the select element 2015-06-15 13:16:41 -07:00
9bad70be5e fix(selector): select by attribute independent of value and order
Closes #2513
2015-06-15 12:10:11 -07:00
5bfcca2d5b feat(query): notify on changes 2015-06-15 11:10:21 -07:00
73d152506b fix(router): ensure that root URL redirect doesn't redirect non-root URLs
Closes #2221
2015-06-15 10:48:47 -07:00
3154cea0bf docs(router): alias should be as 2015-06-15 10:48:29 -07:00
ac3e624d0f feat(View): add support for styleUrls and styles
fixes #2382
2015-06-15 19:35:16 +02:00
f065a2ecb7 style(ShadowDomStrategy): remove an extra semi-colon 2015-06-15 19:35:16 +02:00
a46df6f829 refactor(StringWrapper): add missing types 2015-06-15 19:35:16 +02:00
98fcf8c6ef refactor(material): use static strings for aria roles
Closes #2542
2015-06-15 18:58:10 +02:00
da60381c89 feat(AstTranformer): add support for missing nodes 2015-06-15 18:54:12 +02:00
7d32879929 feat(Parser): support if statements in actions
fixes #2022
2015-06-15 18:54:12 +02:00
d64cc8d87d style(render): idiomatic TS 2015-06-15 18:53:47 +02:00
cebf69933c style(compiler): idiomatic TS 2015-06-15 18:53:47 +02:00
c3ae34f066 feat: support decorator chaining and class creation in ES5
Closes #2534
2015-06-14 16:54:08 -07:00
4f581671dc style(change_detection): fix clang error: line too long 2015-06-15 00:44:20 +01:00
5a542d8ba8 docs(change_detection): fix link to PreGeneratedChangeDetection 2015-06-15 00:16:10 +01:00
dd23bab3ad fix(docs): update link paths in annotations
Partial fix to #2452
Closes #2475
2015-06-15 00:11:59 +01:00
14d28d7473 chore(doc-gen): fix id and alias generation for exports and members
This helps to ensure that links to exports are not confused with links
to members, which was causing some missing link issues.

Helps #2475
2015-06-15 00:11:59 +01:00
992293a196 chore(doc-gen): include enum in the export doc types
Fixes errors about missing "path templates" such as:

```
warn:    No path template provided - doc "ViewType" (enum)  - from file "angular2/src/render/api.ts"
warn:    No output path template provided - doc "ViewType" (enum)  - from file "angular2/src/render/api.ts"
```
2015-06-15 00:11:59 +01:00
9908def857 fix(bootstrap): temporary disable jit change detection because of a bug in handling pure functions 2015-06-13 16:06:22 -07:00
552d1ed61b feat(e2e): added e2e tests for forms 2015-06-13 16:06:21 -07:00
5782f063f1 fix(router): rethrow exceptions
Closes #2391
2015-06-12 18:27:00 -07:00
4ae7df27d2 fix: improve type safety by typing refs. 2015-06-12 18:02:07 -07:00
c3c2ad1454 fix: improve type of TreeNode.children. 2015-06-12 18:02:07 -07:00
c51aef9f7d fix(element_injector): changed visibility rules to expose hostInjector of the component to its shadow dom 2015-06-12 17:17:31 -07:00
bbfb4e1dcc fix(dynamic_component_loader): Fix for ts2dart issue
Fix a build break by declaring a type for `locals`.
See https://github.com/angular/ts2dart/wiki/Builtin-fa%C3%A7ade-methods#fixing-untyped-property-access-errors
for some context.
2015-06-12 16:55:08 -07:00
e0fbd4b624 fix(change detect): Fix bug in JIT change detectors
Fix the "ifChangedGuard" code in the JIT change detector which was
incorrectly refactored in a2770c8a52.
2015-06-12 16:32:21 -07:00
8e3bf3907a feat(dart/transform): Use the best available Change Detectors
Enable pregenerated (for Dart) and JIT (for Js) change detectors when
possible. Previously we would always use `DynamicChangeDetector`s, but
these cause megamorphic calls and are therefore much slower.

Closes #502
2015-06-12 16:04:09 -07:00
21dcfc89e9 fix(dynamic_component_loader): implemented dispose for dynamically-loaded components 2015-06-12 15:47:09 -07:00
9613772455 feat: update ts2dart to 0.6.1.
This introduces façade transpilation, special casing a select set of Array and
Map methods for the beginning.
2015-06-12 15:41:30 -07:00
f3d741854a fix: add types for ts2dart's façade handling.
... in many, many places.
2015-06-12 15:41:08 -07:00
c4ecbf0a7f fix: rename FORWARD_REF to forwardRef in the Angular code base.
Now that ts2dart understands forwardRef, there's
no need to maintain the old syntax.
2015-06-12 15:41:08 -07:00
13466604f9 fix: declare var global.
This is required as otherwise our code ends up
with an undeclared symbol in `global`. It declares
it to the same type as it'd have in nodejs, <any>.
2015-06-12 15:41:08 -07:00
cdc7b03e67 fix(router): avoid two slash values between the baseHref and the path 2015-06-12 15:23:29 -07:00
e372cc779d fix(router): do not prepend the root URL with a starting slash 2015-06-12 15:23:29 -07:00
6834c4992d feat(benchpress): add mean frame time metric
This is useful to measure the smoothness of animations and scrolling actions.

part of #821
closes #2474
2015-06-12 12:40:46 -07:00
1cf807c319 fix(ci): remove non-existent gulp task from test_e2e_dart
The `build.http.example` task was removed from gulp and replaced by another task, but a reference to the task was not removed from `test_e2e_dart.sh`.

Fixes #2509
2015-06-12 12:00:03 -07:00
833048f310 fix(shrinkwrap): restore fsevents dependency
Fixes #2511
2015-06-12 10:57:07 -07:00
38e5c3f918 style: format the code with the updated clang 2015-06-12 19:07:13 +02:00
b4e82b8bc7 fix(DirectiveMetadata): add support for events, changeDetection 2015-06-12 19:05:51 +02:00
db3d5d4941 refactor(_DirectiveMetadataVisitor): simplify the code
fixes #2493
2015-06-12 19:05:51 +02:00
a6e7123995 feat: adjust formatting for clang-format v1.0.19. 2015-06-12 09:51:57 -07:00
1c2abbc61d feat: upgrade to clang-format v1.0.19.
This fixes a performance regression with arrow
functions, allowing us to re-enable formatting for
the specs.
2015-06-12 09:51:57 -07:00
7648bb8ee3 doc(Lifecycle events): Document the call order 2015-06-12 18:51:04 +02:00
35197acc1a fix(forms): fixed the selector of NgRequiredValidator 2015-06-12 09:45:56 -07:00
6622826587 docs(forms): updated forms docs to cover new apis 2015-06-12 09:45:55 -07:00
4fe919335c refactor(forms): made directive names consistent 2015-06-12 09:45:55 -07:00
a858f6ac42 fix(forms): getError does not work without path 2015-06-12 09:45:55 -07:00
cee26826d7 fix(benchmarks): Do not apply the angular transformer to e2e tests
fix #2454
2015-06-12 18:26:20 +02:00
e89fe0a9ff chore(dart2js): remove helpless warnings 2015-06-12 17:47:53 +02:00
d10bbf0cbc chore(package.json): bump dgeni-packages version 2015-06-11 23:31:07 -07:00
05d02fa90b fix(docs): ensure no duplicates in alias names of docs
Having multiple identical names in a doc's aliases would cause Ambiguous Link warnings
for each reference to one of the aliases.

Related to #2452
2015-06-11 17:52:13 -07:00
796fc66771 chore(build): rename .es6 files to .js
Change es6 source files in npm distribution to use .js extensions.

Closes #2447
2015-06-11 17:22:19 -07:00
6cafaba993 chore(test): setup a gulp task for quickly running e2e tests against the dev server 2015-06-11 16:58:32 -07:00
60b97b27fa fix(build): ensure that asset files are copied over to example directories 2015-06-11 16:58:23 -07:00
355ab5b3a6 feat(query): adds support for descendants and more list apis.
Additional clean up of query code.

Closes: #1935

BREAKING CHANGE:
By default Query only queries direct children.
2015-06-11 16:05:06 -07:00
ca09701343 perf(render): only create LightDom instances if the element has children 2015-06-11 14:45:44 -07:00
4f27611ae6 perf(render): don't create property setters if not needed 2015-06-11 14:45:44 -07:00
24e647e0f7 perf(render): precompute # bound text nodes and root nodes in DomProtoView 2015-06-11 14:45:44 -07:00
9cd510abaa perf(render): don’t create an intermediate element array in renderer 2015-06-11 14:45:43 -07:00
d07ed581a9 refactor(benchmark): add view cache param to largetable benchmarks 2015-06-11 14:45:43 -07:00
5ab92ce844 bug: increase number of supported contstructor args to 20
Closes #2487
2015-06-11 14:02:36 -07:00
76797dfbd4 fix(build): Minify files for angular2.min.js bundle
Uglify files related to angular2.min.js bundle in one task.

Include reflect.js in the bundle, which was previously missing. Minify reflect.js, zone.js, and angular2.min.js using uglify.
2015-06-11 13:18:04 -07:00
591f742d42 feat(transform): update for Directive.host 2015-06-11 13:11:10 -07:00
20953ed492 doc(Directive): update docs for Directive.host 2015-06-11 13:11:09 -07:00
f3b49378e4 feat(Directive): Have a single Directive.host which mimics HTML
fixes #2268

BREAKING CHANGE:

Before

    @Directive({
      hostListeners: {'event': 'statement'},
      hostProperties: {'expression': 'hostProp'},
      hostAttributes: {'attr': 'value'},
      hostActions: {'action': 'statement'}
    })

After

    @Directive({
      host: {
        '(event)': 'statement',
        '[hostProp]': 'expression'  // k & v swapped
        'attr': 'value',
        '@action': 'statement'
      }
    })
2015-06-11 13:11:09 -07:00
47b6b05017 doc(Directive): fix the inline doc for lifecycle events 2015-06-11 13:11:09 -07:00
f9745327e6 fix(Parser): Parse pipes in arguments
fixes #1680
2015-06-11 21:02:40 +02:00
659adf83dc chore(doc-gen): move typeParams and heritage rendering to template
Partially solves #2452
2015-06-11 19:15:17 +01:00
a187c782aa feat(dart/transform): Allow absolute urls in templates
Allow `templateUrl` to be specified as an absolute `package:` import.
2015-06-11 09:35:17 -07:00
950f2a38cd refactor(dart/transform): Rename parser.dart > ng_deps.dart
- Rename the file that defines NgDeps from parser.dart to ng_deps.dart.
- Remove the `Parser` class and replace with the static `NgDeps.parse`
  method.
2015-06-11 08:42:34 -07:00
f2371487a1 refactor(ProtoRecord): switch to enum 2015-06-11 17:11:34 +02:00
6ca81fb98c refactor(ProtoViewDto): switch to enum 2015-06-11 17:11:34 +02:00
af35ab56a3 fix(life_cycle): throw when recursively reentering LifeCycle.tick 2015-06-11 07:43:14 -07:00
15dab7c5b2 fix(ng_zone): updated zone not to run onTurnDown when invoking run synchronously from onTurnDone 2015-06-11 07:43:13 -07:00
37f8fd6551 chore(windows): fix !test.unit.js/karma-run and !test.unit.dart/karma-run tasks
Closes #2431
2015-06-11 10:45:25 +02:00
f04b606bb0 chore(package): add Matias to authors list 2015-06-10 16:57:30 -07:00
2ccc65d7fd fix: Improve error message on missing dependency 2015-06-10 16:40:38 -07:00
7501ad11ca chore: Define ReflectionCapabilities interface 2015-06-10 16:40:38 -07:00
331a051e75 feat(Parser): implement Unparser
fixes #1949
closes #2395
2015-06-10 16:24:59 -07:00
92f1af86d8 perf(RouterLink): use hostListeners for click
with a `<router-outlet>` and lots of `router-link` you start to see
noticeable lag since we’re not removing the listener

Closes #2401
2015-06-10 16:20:58 -07:00
a6cb86bab3 feat(forms.ts): formInjectables with FormBuilder
Closes #2367
2015-06-10 16:13:37 -07:00
76beaa2097 refactor(change detect): Clean up change detector test layout
- Rename simple_watch_config > change_detector_config
- Add a bunch of comments explaining what's going on with the change
  detector tests.

Closes #2468
2015-06-10 16:09:48 -07:00
94272af45b chore: update zone.js to 0.5.1
fix #1862
2015-06-10 23:41:45 +02:00
ad95601e3c test(change detect): Port remaining unit tests
Move all remaining unit tests for change detectors to exercise Dart
pre-generated change detectors as well as `dynamic` and `JIT` change
detectors.

See #502
2015-06-10 14:11:42 -07:00
17c6d6a92d feat(dart/transform): Add onInit and onCheck hooks in Dart
Implement `onInit` and `onCheck` hooks in pre-generated Dart change
detectors. This mirrors the changes made to the JIT change detector in
c39c8ebcd0.
2015-06-10 14:11:42 -07:00
633cf63682 fix: compare strings with StringWrapper.equals
Fixes https://github.com/angular/angular/issues/2458
2015-06-10 23:02:48 +02:00
92d565848b fix(shadow_dom): moves the imported nodes into the correct location. 2015-06-10 13:50:12 -07:00
617d693102 fix(dartfmt): don't break win32 command line limit
Closes #2420
Closes #1875
2015-06-10 14:43:33 -04:00
4530b93a6e build(broccoli): remove unneded reference path from broccoli-ts2dart 2015-06-10 11:13:41 -07:00
dc45559c17 build(broccoli): add support for DiffResult#addedPaths
Some plugins want to explicitly know of new paths, so we need to distinguish them from changed paths.
2015-06-10 11:11:28 -07:00
efab03274f chore(doc-gen): autogenerate Angular version in angular.d.ts file 2015-06-10 12:42:24 +01:00
f2e2ce15cd chore(doc-gen): add type-alias export doc type
See #2446
2015-06-10 12:14:10 +01:00
ddd5a235c3 test(change detect): Port change detect tests for mode
More the change detect tests that exercise various detection modes to
use the Dart pre-generated change detectors in addition to the `dynamic`
and `JIT` change detectors.

See #502
2015-06-09 17:04:50 -07:00
2cc2196140 docs(annotations_impl): fix invalid code blocks 2015-06-09 23:11:08 +01:00
65cbcb2f73 chore(doc-gen): ensure log is injected into getExportDocType
See #2446
2015-06-09 23:07:35 +01:00
002101521c chore(broccoli): implement diffing LodashRenderer plugin
Closes #2438
2015-06-09 16:13:42 -04:00
902759e1c7 fix(analzyer): removed unused imports 2015-06-09 12:35:47 -07:00
c564475251 example(forms): removed old forms example 2015-06-09 11:51:17 -07:00
4cd29f791f examples(forms): added an example of using model-driven forms 2015-06-09 11:51:16 -07:00
3eff7be9a6 examples(forms): added an example of using template-driven forms 2015-06-09 11:51:15 -07:00
e7e82cbee6 feat(forms): set exportAs to form for all form related directives 2015-06-09 11:51:15 -07:00
73bce40287 feat(forms): export validator directives as part of formDirectives 2015-06-09 11:51:14 -07:00
5fc23caef7 feat(forms): changed forms to capture submit events and fires synthetic ng-submit events 2015-06-09 11:51:13 -07:00
1a4d23742b feat(forms): added hasError and getError methods to all controls 2015-06-09 11:51:08 -07:00
8923103c3b fix(npm): update scripts and readme for npm packages.
Replaces AtScript with Typescript.

Closes #2377
2015-06-09 11:39:08 -07:00
f34f8df319 refactor(xhr): move render's xhr implementation to render/
The existence of this module in the services/ folder led some to believe xhr
is meant to be a general-purpose http library.

Fixes #2305
2015-06-09 10:28:35 -07:00
21568106b1 feat(http): add basic http service
This implementation only works in JavaScript, while the Observable transpilation
story gets worked out. Right now, the service just makes a simple request,
and returns an Observable of Response.

Additional functionality will be captured in separate issues.

Fixes #2028
2015-06-09 10:00:04 -07:00
363b9ba415 build(bower): remove moot version property from bower.json
Per bower/bower.json-spec@a325da3

Closes #2426
2015-06-09 08:53:49 -07:00
0409b4ca49 test(change detect): Port more change detect tests
Move more change detector unit tests to exercise the Dart pre-generated
change detectors in addition to `dynamic` and `JIT` change detectors.

See #502
2015-06-09 07:18:48 -07:00
7611f92f5b fix(diffing-broccoli-plugin): wrapped trees are always stable 2015-06-08 23:35:32 -07:00
7aa9751054 build(broccoli): replace broccoli-flatten with diffing flatten implementation
Once we add support for addedPaths then this implementation will be significantly faster than the original.
In the meantime we benefit from having stable output directory which solves issues with certain files disappearing
during rebuild of a tree that contains flatten and mergeTree plugins.

Closes #2418
2015-06-08 23:35:31 -07:00
77b52d65c7 build(broccoli): remove unused import from broccoli-replace 2015-06-08 23:35:31 -07:00
5df56b47d6 build(gulp): don't double build during init of serve.js.dev 2015-06-08 23:35:31 -07:00
1eefde7f0d build(broccoli): replace stew.map with diffing replace
This fixes issues with broken symlinks that occur due to some weird interaction between stew.mv,broccoli-funnel
and our diffing plugins.

Closes #2386
2015-06-08 23:35:31 -07:00
44b31f326b build(broccoli): log the build tree after each build into tmp/build.*.log
This log can then be used to visualize the build tree and map paths in the tmp/ dir
to individual nodes in the build tree.
2015-06-08 23:35:31 -07:00
b5431e4cc0 fix(build): only pass ts files to ts2dart transpilation.
Originally, we had .js as transpilation targets, but all those files
have been converted.
2015-06-08 18:56:57 -07:00
83e99fc72d fix(bundle): makes interfaces.ts non-empty when transpiled.
System.js seems detect an empty file as global and choke on exporting
symbols from angular2/angular2 (possibly a bug in system.js).

As temporary measure we make sure that the file has some (fake) runtime
code left.

Closes: #2343
2015-06-08 17:52:25 -07:00
cd6175827f refactor: use a custom replacement build step instead of broccoli-replace 2015-06-08 16:28:19 -07:00
e77710a372 fix(JsonPipe): always transform to json
BREAKING CHANGE:

no longer cache ref
2015-06-08 16:22:04 -07:00
b6e95bb96e feat(change detect): Throw on attempts to use dehydrated detector
- Modify change detectors to `throw` when attempting to detect changes
  on a dehydrated detector.
- Modify `DynamicChagneDetector` to use `null` for the `context` of a
  dehydrated detector.
2015-06-08 16:10:41 -07:00
cd95e078fe feat(router): add routing to async components
Note that this also removes the `components` option from `RouteConfig`.
This functionality will be reintroduced with the more general `//` routing.
See #2329 for more details.
2015-06-08 15:49:56 -07:00
548f3dd5cc feat(facade): add isMap method 2015-06-08 15:49:56 -07:00
d5195d4097 test(change detect): Port Locals tests to pregenerated cds
Move existing unit tests exercising Locals to also test Dart's
pre-generated change detectors.

See #502
2015-06-08 13:27:11 -07:00
fda8b1d87c build(gulp): don't try to run cleanup.builder task if builders were not initialized 2015-06-08 13:05:04 -07:00
7140c9cc34 build: make 'npm install' work reliably and issue build warning when node_modules look stale
This is done a in bit kludgy way on purpose so that it works on Windows and CI.

Works around npm/npm#8452.

Closes #2038
2015-06-08 13:05:04 -07:00
4d338a4f5c test(ElementInjector): test that hostInjector has priority over viewInjector 2015-06-08 20:34:44 +02:00
6a6b43de07 feat(ElementInjector): throw if multiple directives define the same host injectable
relates to #2015
2015-06-08 20:34:44 +02:00
309ef0f354 refactor(test): remove explicit calls to flushMicrotasks()
flushMicrotasks() is now called at after the fakeAsync callback returns,
see https://github.com/angular/angular/pull/2290
2015-06-08 20:30:49 +02:00
81fc657356 refactor(change detect): Remove unnecessary param from tests 2015-06-08 11:21:45 -07:00
29c72abcc4 feat(Events): allow a different event vs field name
closes #2272
closes #2344
2015-06-08 19:29:49 +02:00
79f3f3b456 refactor(Lexer): refactor scanComplexOperator() 2015-06-08 14:46:55 +02:00
d1b35f9174 fix(dart/transform): Don't set ReflectionCapabilities over an async gap
Update the transformer's `TemplateCompiler` phase to avoid setting
`reflector.reflectionCapabilities`, allowing asynchronous
operations, and restoring the original value, which allows
`reflector.reflectionCapabilities` to get into a bad state.
2015-06-06 17:10:06 -07:00
f3dd9b5b31 build(clang-format): skip formatting of spec files until angular/clang-format#11 is fixed
otherwise checking format and reformatting takes 50seconds or more :-(
2015-06-06 15:07:01 -07:00
72736a1b09 revert: refactor: use a custom replacement build step instead of broccoli-replace
This reverts commit d5c528ac2b.
2015-06-06 00:58:57 -07:00
a418397174 fix: corrected var/# parsing in template
Closes #2084
2015-06-05 16:22:41 -07:00
ab8eb4f652 fix: increase the stack frame size for tests 2015-06-05 16:22:41 -07:00
8d081ea7af fix: include error message in the stack trace 2015-06-05 16:22:41 -07:00
d5c528ac2b refactor: use a custom replacement build step instead of broccoli-replace
Closes #2050
2015-06-05 16:16:09 -07:00
7141c15e65 fix(docs): Working generated angular2.d.ts
This requires some hacks, documented in
https://docs.google.com/document/d/1nNebWTiLzz5ePcit_bjZPtaiSIFU4EsQKUlX7LX0c0A/edit

Changes:
- include subtyping info in angular2.d.ts by adding 'extends supertype'
- export missing symbols needed transitively by angular2/angular2
- because of decorator/annotation mismatch, we can't export these to applications.
  So I've added a separate angular2.api.ts file to re-export specifically to .d.ts
  generation.
- Hack to remove aliases introduced by 'import * as alias' syntax
- Hack to deal with Error still an interface

note that we require users to install the transitive dependencies - this is how TSD works.
2015-06-05 15:33:23 -07:00
5357b1548a chore(broccoli): disable logging in DiffingBroccoliPlugin
It is very noisy, especially when multiple trees are used. Since the
tree differ is fairly quick, it's not measuring the real costs of a
plugin anyhow.

Closes #2378
2015-06-05 17:49:25 -04:00
928ec1c5f8 fix(broccoli): ensure that inputTrees are stable 2015-06-05 16:48:54 -04:00
dc8dac7c35 feat(broccoli): improve merge-trees plugin and add "overwrite" option 2015-06-05 16:48:54 -04:00
c593dfc26c chore(tsd): update jasmine 2015-06-05 16:48:54 -04:00
6b31d82263 chore(tsd): update fs-extra 2015-06-05 16:48:54 -04:00
4ee3fdaf7f feat(broccoli): add diffing MergeTrees plugin
Closes #1815
Closes #2064
2015-06-05 16:48:46 -04:00
41ae8e76f0 feat(diffing-broccoli-plugin): support multiple inputTrees
Closes #1815
Closes #2064
2015-06-05 16:48:32 -04:00
8a52375fb8 chore(transformer): add tests for property bindings and multiple executions 2015-06-05 13:11:24 -07:00
87b3b718e3 refactor(render): don’t use a global cache for property setters
Related to #2359
2015-06-05 13:11:23 -07:00
46eeee6b5e feat(build): add test.unit.dartvm for a faster roundtrip of dartvm tests 2015-06-05 13:11:23 -07:00
529805508a feat(dart/change_detect): Add type to ChangeDetector context
Add a type for the `context` field in Dart's pre-generated change
detectors. This requires slight changes to set the dehydrated value of
`context` to `null` rather than `ChangeDetectionUtil.uninitialized()`,
which was its former dehydrated state.

Mirror these chagnes as closely as possible in the
`ChangeDetectionJITGenerator` to allow easier maintenance.

Closes #2070
2015-06-05 12:53:25 -07:00
851797aecb refactor(dart): Run dartfmt 0.1.8
Format Dart code using dartfmt 0.1.8. Update pubspec to require
dart_style 0.1.8.
2015-06-05 11:45:36 -07:00
13d0815839 chore: update TRIAGE_AND_LABELS.md 2015-06-05 11:20:05 -07:00
dc6e7eb19b feat(dart/transform): Record Type interfaces
To support interface-based lifecycle methods (#2220), we need to be able
to query for the `interface`s a class supports. Record implemented
interfaces to allow mirror-less querying at runtime.

Closes #2204
2015-06-04 15:02:12 -07:00
e5419febe4 feat(transformers): updated transformers 2015-06-04 14:14:03 -07:00
69b75b7fd8 feat(view): added support for exportAs, so any directive can be assigned to a variable 2015-06-04 14:14:03 -07:00
4eb8c9b2dd fix(locals): improved an error message 2015-06-04 14:14:02 -07:00
827841ec5b refactor(render): add DomElement
Replaces the multiple arrays of `DomView`
by a single array with `DomElement`s.

Note: this commit does not show a performance regression
(tested against the tree benchmark locally).
2015-06-04 11:44:26 -07:00
0a50a3f564 build(npm): update gulp-clang-format to v1.0.19
Closes #2338
2015-06-04 10:19:28 -07:00
ce9271739f build(tsd): update tsd to v0.6.1 which is shrinkwrappable without fuss 2015-06-04 10:12:36 -07:00
2621d6be8b docs(shrinkwrap): update npm-shrinkwrap.readme.md with info about deleting dependencies 2015-06-04 10:10:03 -07:00
d76a2ee9c9 docs(shrinkwrap): remove minichain references from the npm-shrinkwrap.readme.md 2015-06-04 10:05:09 -07:00
b2596dd302 refactor(benchamrks_external): Ts'ify benchmarks_external
Translates benchmarks_external to TypeScript.
2015-06-04 09:22:52 -07:00
4d0973d7ba chore(karma): remove a link to an unexisting file 2015-06-04 16:37:47 +02:00
1afdb3cbb1 chore(package.json): add karma-sauce-launcher to dev dependencies
Closes #2342
2015-06-04 16:08:43 +02:00
53694eb64a feat(FakeAsync): check pending timers at the end of fakeAsync in Dart
Made possible with quiver 0.21.4
2015-06-04 09:09:18 +02:00
31a3a19dac doc(Visibility): fix inline docs 2015-06-04 09:09:11 +02:00
a50b8a2694 docs(triage): Update to triage doc for new label names 2015-06-03 20:45:13 -07:00
9e8108ee14 refactor(rtts_assert): Ts'ify rtts_assert
Translate rtts_assert to TypeScript.
2015-06-03 18:12:08 -07:00
d53c898499 chore(release): releases alpha.26 2015-06-03 17:36:12 -07:00
552985e305 fix(types): parametrize QueryList. 2015-06-03 17:08:55 -07:00
20e874d3c6 chore(deps): bumps up deps on tsd and ts2dart. 2015-06-03 15:53:03 -07:00
471a1b6d12 fix: format a file that slipped in. 2015-06-03 15:50:45 -07:00
f999d5a156 chore: move to clang-format 1.0.17.
clang-format 1.0.17 substantially improves formatting for fat arrow functions
and array literal detection. It also fixes a number of minor formatting issues.
2015-06-03 15:27:27 -07:00
f74d7727ca fix(build): remove nonexistant dart format task from gulpfile 2015-06-03 15:03:29 -07:00
3baf815d76 feat(forms): added support for status classes 2015-06-03 14:43:46 -07:00
96cadcc29e refactor(forms): handle dirty/pristine explicitly 2015-06-03 14:43:46 -07:00
31b6687894 fix(build): make dart formatter errors more readable
Truncates the output to just the interesting parts
2015-06-03 14:42:24 -07:00
381d4cb30a fix(gulp): prevent duplicate error messages
Closes #2021
2015-06-03 14:42:24 -07:00
5030ffb01c feat(view): introduce free embedded views
Free embedded views are view instances that are created
logically in the same was as views of a ViewContainer,
but their dom nodes are not attached.

BREAKING CHANGE:

- `Renderer.detachFreeHostView` was renamed to
  `Renderer.detachFreeView`
- `DomRenderer.getHostElement()` was generalized into
  `DomRenderer.getRootNodes()`
2015-06-03 14:42:00 -07:00
9ce0870f6c chore(process): document triage process for angular 2 2015-06-03 13:04:52 -07:00
246151b2f9 test(dart/transform): More change detector unit tests
Port some change detector unit tests which formerly ran only on dynamic
& JIT change detection to run for pre-generated Dart change detectors as
well.
2015-06-03 10:37:34 -07:00
83f1856d6a feat(dart/transform): Add support for the safe navigation operator
Adds support for ?. to pregenerated Dart Change Detectors.

Closes #791
2015-06-03 10:37:34 -07:00
c280fe816c fix(benchpress): support nested intervals
Chrome sometimes reports nested `FunctionCall` intervals in the timeline,
which should be ignored for measuring the `script` metric.

Might solve #2116
2015-06-03 10:28:27 -07:00
b071b66b45 fix(tests): disable mobile emulation so benchmarks run on current chrome
Workaround for #2309
2015-06-03 10:28:27 -07:00
fde65c7e88 refactor(angular2/view): Ts'ify view.js
Translates angular2/view to TypeScript.
2015-06-03 09:52:37 -07:00
bae6b91e7d refactor(angular2/angular2_sfx): Allows no-module integration of Angular2
Translates angular2/angular2_sfx to TypeScript in order to allow Angular2 integration without modules.
2015-06-03 09:52:37 -07:00
2b714df64e refactor(test/mock): Ts'ify angular2/test/mock
Translates the last test directory -- angular2/test/mock -- to TypeScript.
2015-06-03 09:52:37 -07:00
c7572ac1f9 feat(fakeAsync): flush the microtasks before returning
fixes #2269
2015-06-03 06:48:08 +02:00
ec3a78289f feat(forms): added touched and untouched to Control 2015-06-02 17:32:41 -07:00
f303f0c17a chore(docs): remove private members from angular2.d.ts 2015-06-02 17:15:49 -07:00
f543834be9 feat(forms): renamed control, control-group into ng-control and ng-control-group 2015-06-02 16:24:08 -07:00
6bef1c4169 feat(forms): changed the selector of TemplatdrivenFormDirective to match <form> 2015-06-02 16:24:08 -07:00
652ed0cf6d feat(form): implemented an imperative way of updating the view by updating the value of a control 2015-06-02 16:24:07 -07:00
559f54e92b feat(forms): added ng-model 2015-06-02 16:24:07 -07:00
17e1d7f117 fix(dartdocs): Hide duplicate exports from guinness.
Duplicate exports were breaking dartdoc builds.

Closes https://github.com/angular/angular/issues/2072.
2015-06-02 16:01:46 -07:00
5fa54a92bc chore(benchpress): add ff extension test to ci
Closes #2229
2015-06-02 15:36:02 -07:00
ba7956f521 fix(render): only look for content tags in views that might have them.
Largetable benchmark with `interpolationAttr` and 200 rows / 20 columns:
Time for destroy/create pair dropped from about 1260ms to about 150ms.

Related to #2298, but does not really fix it as we are still slow
if people are using `<content>`.

Closes #2297
2015-06-02 15:31:07 -07:00
c2fa4b7191 docs(chore): missing reformats to make clang-format 1.0.15 2015-06-02 15:30:04 -07:00
d32f58926d docs(ng-if): fix some missed occurrences of if, for, switch in docs 2015-06-02 15:30:04 -07:00
6a0fe93ba9 chore(docs): fix another link broken by clang-format 2015-06-02 15:30:03 -07:00
1fae8d6377 chore(doc-gen): add template for const docTypes 2015-06-02 15:30:03 -07:00
dc060e8b64 docs(clang): format updates 2015-06-02 15:30:03 -07:00
b746e0c9f0 docs(docgen): tell dgeni to use ts files and fix some bad links 2015-06-02 15:30:03 -07:00
e67b7e87b2 chore(docs): Improve whitespace and semicolons in angular2.d.ts 2015-06-02 15:29:07 -07:00
0a0b84a07d fix(docs): generate d.ts file only for angular2/angular2. 2015-06-02 15:14:45 -07:00
927b4d01a9 chore(travis): update firefox to 38.0 in travis CI
Closes #2295
2015-06-02 14:45:04 -07:00
5035a42287 refactor(examples/e2e_test): Ts'ifying examples/e2_test
Translate AtScript in examples/e2e_test to TypeScript.

Closes #2294
2015-06-02 14:14:46 -07:00
40150379ae fix(Tools): Moves files out of dart2js/**/web.
Fixes bug that only allowed src and packages to be moved out of dart2js/**/web. Globs all files in dart2js/**/web and moves them one directory up.
2015-06-02 13:11:31 -07:00
1d24e2cf23 fix(Global && src/facade && Protractor): Allows List to be imported.
Allows the List type to be imported from 'angular2/src/facade/collection'
2015-06-02 13:11:31 -07:00
9e36539052 fix(src/reflection && src/test_lib): Fixes bugs that caused benchmarks to fail.
Adjusts src/test_lib files to adhere to common TS module practices. Fixes bug with all files that causes benchmarks to fail.
2015-06-02 13:11:30 -07:00
0602f68ae3 refactor (angular2/test_lib): ts'ifying last of test_lib
Translates last .es6 files in angular2/src/test_lib to TypeScript.
2015-06-02 13:11:30 -07:00
2b60d1bae1 refactor (benchmarks/): Ts'ifying benchmarks/
Translating AtScript in benchmarks/ to TypeScript.
2015-06-02 13:11:30 -07:00
0b43e3cf32 refactor(lang_spec): Add missing ;s and clang-format 2015-06-02 21:09:38 +02:00
c9d636aa11 chore(dartanalyzer): Show source for analyzer errors
When showing analyzer feedback, display the source line that caused the
feedback to be generated.

Closes #1192
2015-06-02 12:06:33 -07:00
be88cc7697 chore(build): watch logger should honor ignoreInitial option
It was confusing because the test.unit.dart task does ignore the initial, and
the logger was hardcoded to always ignore the first task, leading to the appearance
that a run was happening twice for no reason.

Also, fixed the "fake ignoreInitial" handling to not rely on a fake event, which
is not necessary.

Closes #2101
2015-06-02 14:07:36 -04:00
ba07f39347 refactor(router): convert to typescript
Fixes #2001
2015-06-02 11:06:44 -07:00
4c8e11a577 fix(ShadowCss): keyframes tests failing in Safari
Closes #2283
2015-06-02 19:23:06 +02:00
3d6c44e2a7 test(KeyEvents): workaround a bug in chrome driver
closes #2253

see https://code.google.com/p/chromedriver/issues/detail?id=553
2015-06-02 14:37:57 +02:00
c60091b949 refactor(Compiler): improve the error message on component load error
by adding the fetched url.

relates to #1460
2015-06-02 12:59:50 +02:00
a504fa835e chore(doc-gen): improve github links to point to the correct tagged URL
Closes #1994
2015-06-02 10:56:23 +01:00
8811337622 refactor(ElementInjector): add interfaces for strategies 2015-06-02 10:09:39 +02:00
921fb9f2ce refactor(Injector): use TS iodioms 2015-06-02 09:53:11 +02:00
e93b5a1d5b refactor(Injector): add an interface for strategies 2015-06-02 09:53:11 +02:00
db7a1f19ba feat(render/dom_renderer): DocumentToken use OpaqueToken
BREAKING CHANGE:

No longer a `const` string. Now a const OpaqueToken
2015-06-01 16:24:36 -07:00
ef27919f7f feat(core/compiler): AppViewPool use OpaqueToken
BREAKING CHANGE:

No longer a `const` string. Now a const OpaqueToken
2015-06-01 16:24:36 -07:00
c571b2693e feat(OpaqueToken): now a const constructor
BREAKING CHANGE:

now a `const` constructor
2015-06-01 16:24:36 -07:00
8bcfb2d465 chore(dart/change_detect): Fix test.unit.dart gulp target
Include Change Detector generation in the `test.unit.dart` gulp task to
fix the change detection unit tests.

Closes #2236
2015-06-01 16:15:53 -07:00
93f464a145 feat(change_detection.ts): export PipeFactory
Closes #2245
2015-06-01 16:14:02 -07:00
95b7896d9b chore: cache Dart .pub-cache directory
Closes #2255
2015-06-01 16:10:07 -07:00
ad26bed0ed chore(shrinkwrap): add shrinkwrap for firefox-profile/jpm
and update package.json for benchpress

closes #2264
2015-06-01 16:04:38 -07:00
62a95823e0 fix(selector): support multiple :not clauses
Fixes #2243
2015-06-01 14:24:19 -07:00
c8d83dba7d chore(tsconfig.json): fix invalid json 2015-06-01 18:56:14 +02:00
22f5925202 fix(facade): Make PromiseWrapper#all semantics equivalent
The semantics between ES6 `Promise#all` and Dart's `Future#wait` are
different for values that are not `Promise`/`Future`s. In ES6,
non-`Promise` values are immediately completed to their current value.
In Dart, non-`Future` values cause an error.

Updated Dart's `PromiseWrapper#all` implementation to conform to the ES6
spec.
2015-06-01 07:26:46 -07:00
cd52d8a3be fix(forms): disabled form tests on cjs until fakeAsync is fixed 2015-05-30 11:56:38 -07:00
a9d6fd9afa feat(forms): implemented template-driven forms 2015-05-30 11:56:00 -07:00
5c53cf6486 fix(fake_async): fixed fakeAsync to throw instead of crashing on cjs 2015-05-30 11:55:17 -07:00
74882c6c38 feat(test): added not.toBeNull 2015-05-30 11:54:10 -07:00
c8947d77bf chore(material): move dialog to TypeScript. 2015-05-29 17:19:44 -07:00
4f3acdb004 docs(shrinkwrap): correct directory path 2015-05-29 17:04:05 -07:00
6404dd8293 refactor (angular2/src/dom): tsifying angular2/src/dom
translates parse5_adapter.cjs to typescript

Closes #2230
2015-05-29 17:01:05 -07:00
f19970a481 feat(transformers): added support for lifecycle events 2015-05-29 16:40:34 -07:00
6f0631c978 build(gulp): remove unnecessary stream merging in build.tools
Also remove the reporter config which is wrong and has no effect.

Closes #2209
2015-05-29 16:11:43 -07:00
e5d06e479a feat(broccoli): add incremental dartfmt plugin
Closes #2211
2015-05-29 18:55:37 -04:00
d523613329 test(di): added a test verifying hierarchical injection 2015-05-29 15:52:46 -07:00
cfcae6b293 Update CONTRIBUTING.md 2015-05-29 15:32:31 -07:00
000a8e25a2 fix(dart/transform): Fix DirectiveMetadata read tests 2015-05-29 14:56:42 -07:00
8a3b0b366f feat(dart/transform): Generate ChangeDetector classes
Use the `ProtoViewDto` created by the render `Compiler` to create a
`ChangeDetectorDefinition`.

From there, generate a subclass of `AbstractChangeDetector` for each
`ChangeDetectorDefinition`.

Run some basic unit tests for the dynamic and JIT change detectors on
pre-generated change detectors.
2015-05-29 14:48:53 -07:00
383f0a1f30 fix(benchpress): add index to root of module
This is necessary when using require('benchpress') in node.
2015-05-29 14:38:29 -07:00
e323c07ab9 refactor(benchpress): convert src and test to typescript
Fixes #2007
2015-05-29 14:02:58 -07:00
f9908cd436 feat(test): add element probe
Usage: bootstrap the app with the special binding
`ELEMENT_PROBE_CONFIG` from `angular2/debug`.
This will provide a global method `ngProbe(element)` that
will expose a `DebugElement` with directive instances, ... on it.

During tests that use Angular's test injector, the probe is
enabled by default. The `DebugElement ` can be retrieved via the
function `inspectDomElement` of `angular2/debug`. Note
that the `TestComponentBuilder` already returns `DebugElement `s.

Closes #1992
2015-05-29 12:44:21 -07:00
24bc4b66d0 fix(render): don’t store a document fragment as bound element
When a template contains bound text nodes as root nodes,
we used to store the document fragment that we got from
cloning `template.content`. However, this fragment will be
empty as soon as the view gets attached. Now we store
`null` instead of the document fragment in this case.

Also groups the 3 cases in `_createView` so they are easier to
understand.
2015-05-29 11:33:23 -07:00
2351896cc0 fix(dom): allow to correctly clone document fragments 2015-05-29 11:33:23 -07:00
307011a96c fix(dom): querySelectorAll should only query child nodes 2015-05-29 11:33:22 -07:00
6f3368ef16 feat(dom): add setData() method. 2015-05-29 11:33:22 -07:00
cdf791f0c5 feat(facade): add read/write access to global variables 2015-05-29 11:33:22 -07:00
75578f41e7 feat(view): add AppViewListener interface
Basic functionality how element probe is hooked into
the system.
2015-05-29 11:33:22 -07:00
ffb219fb91 style(dart): Format Dart source with dart_style 0.1.8 2015-05-29 10:42:47 -07:00
eb2784eb81 refactor(core.js): export NgZone
Export NgZone so it can be used in applications where large data streams should be processed outside of Angular.
2015-05-29 17:58:32 +02:00
28ee0612cb feat(router.js): export router injectables
Exporting: `RootRouter`, `RouteRegistry`, `BrowserLocation`,
`Location`,  and `Pipeline`.
2015-05-29 17:56:00 +02:00
a80921b45d fix(binding): unbalanced curly brackets in documentation 2015-05-29 17:54:51 +02:00
0db88f34b8 refactor(annotations): stricter types 2015-05-29 11:44:45 +02:00
35f0ee510a refactor(transformer): updates in properties syntax 2015-05-29 11:44:44 +02:00
d7df853bde feat(Directive): convert properties to an array
fixes #2013

BREAKING CHANGE:

Before

    @Directive(properties: {
      'sameName': 'sameName',
      'directiveProp': 'elProp | pipe'
    })

After

    @Directive(properties: [
      'sameName',
      'directiveProp: elProp | pipe'
    ])
2015-05-29 11:44:43 +02:00
0387221da8 fix(ast): fix the size of a list in _evalListCache 2015-05-29 08:07:43 +02:00
c39c8ebcd0 feat(change_detection): added onInit and onCheck hooks 2015-05-28 16:46:22 -07:00
5d2af54730 feat(dart/transform): Improve constant evaluation
Use `package:analyzer`'s `ConstantEvaluator` to read from the AST.
This cleanly builds values for us from adjacent strings, interpolations,
etc.
2015-05-28 15:18:22 -07:00
a9be2ebf1b feat: add support for the safe navigation (aka Elvis) operator
fixes #791
2015-05-28 23:03:30 +02:00
ec2d8cc2c8 feat(binding): throw on binding to a blank alias
fixes #2068
2015-05-28 22:37:29 +02:00
05d66bba3f fix(test): clang formatting errors 2015-05-28 13:30:45 -07:00
b14417498a build(broccoli): reorder tree-differ specs 2015-05-28 11:44:37 -07:00
05becf8431 style(build): reorder imports 2015-05-28 11:44:37 -07:00
160c38b5ca build(broccoli): improve error messaging from TreeDiffer 2015-05-28 11:44:37 -07:00
9b0fa0dedc build(broccoli): TreeDiffer should log associated plugin name rather than inputPath
Usually we don't care what we are diffing, but why we are diffing it. With this change we see what is causing build slowdown
due to diffing.
2015-05-28 11:44:37 -07:00
533c64d4ea build(gulp): remove obsolete watch.js.dev build task 2015-05-28 11:44:37 -07:00
c1157d62a8 build(broccoli): update broccoli.d.ts docs 2015-05-28 11:44:37 -07:00
7b1e9286d8 build(broccoli): add tree-stabilizer plugin to deal with unstable trees
Previously we assumed that all input and ouput paths for broccoli trees are immutable, that turned out to be
incorrect.

By adding a tree stabilizer plugin in front of each diffing plugin, we ensure that the input trees
are stable. The stabilization is done via symlinks which is super cheap on platforms that support
symlinks. On Windows we currently copy the whole input directory, which is far from ideal. We should
investagate if using move operation on Windows is ok in the future to improve performance.

Closes #2051
2015-05-28 11:44:36 -07:00
01fb8e6635 fix: fix clang errors 2015-05-28 11:08:26 -07:00
9d90128463 refactor(ChangeDetection): convert change detection tests to typescript 2015-05-28 10:01:30 -07:00
34cfc9f474 feat(di): added optional self parameter to Parent, Ancestor, and Unbounded 2015-05-28 09:53:06 -07:00
ebe1e73b1a refactor (test/test_lib): Ts'ifying test/test_lib
Translates AtScript files in test/test_lib to TypeScript.

Closes #2183
2015-05-28 09:50:59 -07:00
8ce0a67c81 refactor (test/services): Ts'ifying test/services
Translates AtScript files in test/services to TypeScript

Closes #2193
2015-05-28 09:48:38 -07:00
c065fb1422 feat(dart/transform): Remove unnecessary .ng_deps.dart files
Removes `.ng_deps.dart` files which

1. Do not register any `@Injectable` classes
2. Do not call `initReflector` on any other `.ng_deps.dart` files.

Closes #1929
2015-05-28 07:51:10 -07:00
cda35101df fix(facade): Fix bug in TS indexOf
startIndex defaults to -1, which in Chrome results in returning -1
regardless of the other parameters.

Added regression tests.
2015-05-28 06:56:24 -07:00
c32dbad747 feat(tests): add TestComponentBuilder
Adds a TestComponentBuilder for use in component level tests.
For usage examples, see test_component_builder_spec

Closes #1812
2015-05-27 17:15:13 -07:00
30b6542fc8 feat(core): added support for detecting lifecycle events based on interfaces 2015-05-27 16:23:42 -07:00
2b6a653050 feat(core): added missing interfaces for onDestroy and onAllChangesDone lifecycle events 2015-05-27 15:50:08 -07:00
34d75e8918 feat(reflector): added a method to get type's interfaces 2015-05-27 15:50:08 -07:00
2c25055828 chore: reformat the code base using the clang-format 1.0.15. 2015-05-27 15:28:22 -07:00
96f629d441 chore: upgrade clang-format to 1.0.15. 2015-05-27 15:28:22 -07:00
a2770c8a52 refactor(change_detect): Flatten Js change detector template
Update the `ChangeDetectionJITGenerator` for clarity and similarity with
the upcoming Dart generated `ChangeDetector` classes.
2015-05-27 11:50:25 -07:00
4a3fd5e855 fix(di): allow @Inject(…) to work in dart2js and dynamic reflection
Note: We can’t write a unit test for this as our unit tests
are running in Dartium, where the error does not occur.
However, we previously had a failure in our e2e tests
in `hello_world/index_dynamic.html`
when removing the TODOs in `application.ts`.

Closes #2185
2015-05-27 10:33:30 -07:00
608017776e fix(package.json): add reflect-metadata to package.json
Fixes #2170
2015-05-27 10:32:38 -07:00
0c7f05f56a fix(injectable): add missing @Injectables annotations
Closes #2173
2015-05-27 10:31:20 -07:00
c6335c128e feat(test_lib): add method to compare stringified DOM element
Closes #2106
2015-05-27 16:19:39 +02:00
fb42d5908e fix(test): solve CSS discrepancies across browsers
Closes #2177
2015-05-27 14:54:00 +02:00
8609543ad0 refactor (test/facade): Ts'ify test/facade
Translate AtScript in test/facade to TypeScript
2015-05-27 08:10:11 +02:00
f83f1ee0ce fix(example): unused event 2015-05-27 08:09:55 +02:00
1db6870a81 docs(ng_for.ts): For => NgFor 2015-05-27 08:09:42 +02:00
c19c69f336 refactor(forms): remove self closing wrap <label>s
html5 doesn't have self closing tags
breaks `stringifyElement` from
https://github.com/angular/angular/pull/2106

also an error with submit form and wrap with <label>s
2015-05-27 08:09:26 +02:00
b390f441a1 feat(benchpress): Add extension for ff metrics reporting
Closes #1976
2015-05-26 17:30:41 -07:00
79f564be46 refactor(core): ts’ify tests 2015-05-26 17:01:31 -07:00
23d59df81a feat(test_lib): add containsRegex 2015-05-26 17:01:31 -07:00
ef3e12e803 refactor (test/directives): ts'ify test/directives
Translate all of the AtScript code in .../test/directives to TypeScript.

Closes #2167
2015-05-26 16:51:38 -07:00
5fe88d63ef chore: support the latest release of Dart logging package 2015-05-26 13:51:54 -07:00
0f3a8f369a chore(material): migrate most components to TypeScript. 2015-05-26 13:35:44 -07:00
26d5d17ebe style: fix clang-format glitches 2015-05-26 21:00:44 +02:00
bb7ffce7eb test(ShadowCss): add tests for keyframe rules 2015-05-26 19:42:17 +02:00
551586ced0 feat(RegExpWrapper): implement a test method 2015-05-26 19:42:17 +02:00
1dc8ba6920 refactor(render): ts’ify tests 2015-05-26 09:38:26 -07:00
d773b6a00a fixed(spy): support SpyObject in Typescript as well
- allow `@IMPLEMENTS` as a decorator
- implement empty `noSuchMethod`
2015-05-26 09:25:16 -07:00
f6cd26b0a6 docs(docgen): fixed a typo that was breaking dgeni 2015-05-22 21:47:34 -07:00
5a52c0b71d docs(di): fix missing export for dgeni docgen 2015-05-22 21:47:34 -07:00
662da0d728 feat(render): re-export render and export DirectiveResolver
Closes #2026
2015-05-22 17:38:00 -07:00
df59e969cf chore(di): moved tests to typescript 2015-05-22 17:32:21 -07:00
d27e5512c0 chore(reflection): tsfy tests 2015-05-22 17:03:40 -07:00
d48fae3566 fix(core): resurrect OnChange interface 2015-05-22 16:48:00 -07:00
3525c9c074 chore(forms): moved tests/forms to typescript 2015-05-22 14:44:57 -07:00
05774f6c8a fix(build): also run ts tests in node. 2015-05-22 13:19:58 -07:00
16447ce75c chore(build): improve messaging when using clang-format 2015-05-22 10:10:22 -07:00
15f1eb28a2 fix(deps): Update clang-format to 1.0.14. 2015-05-22 09:39:15 -07:00
e50f537667 build(gulp): turn off dartfmt logs by default
Closes #2105
2015-05-22 12:18:42 -04:00
ed8364741b refactor(form example): TSify 2015-05-22 17:45:57 +02:00
6c1cb089b5 refactor(examples): ts’ify
relates to #2008
2015-05-22 16:48:29 +02:00
4b98ed114e fix(collection): iterator on Map keys is not supported (Safari)
Closes #2096
2015-05-22 15:41:01 +02:00
d308e55e12 fix(collection): new Map(iterable) is not supported (Safari) 2015-05-22 15:40:44 +02:00
10bc7e948c feat(key_event): alias esc to escape
fixes #2010
2015-05-22 15:39:21 +02:00
9988471fb8 test(fakeAsync): renable a test blocked on jasmine 2.3.3 2015-05-22 15:36:12 +02:00
05fa9bc9fb feat(router): add the router bundle to the bundle task. 2015-05-22 15:31:09 +02:00
57b88ec2d6 fix(collection): new Set(iterable) is not supported (IE11, Safari)
Closes #2063
2015-05-22 15:16:49 +02:00
b1c9bf14b2 feat(ElementInjector): support an arbitrary number of bindings
fixes #1853
2015-05-22 13:42:53 +02:00
588fbfd848 fix(test): use a not expandable CSS rule in ShadowCSS spec (Firefox)
Closes #2061
2015-05-22 13:32:24 +02:00
b2a24e021f fix(browser_adapter): HTMLStyleElement.innerText does not trigger creation of CSS rules (Firefox) 2015-05-22 13:32:07 +02:00
661a04798e fix(test): adds longer timers for NgZone and PromisePipe tests (IE11)
Closes #2055
2015-05-22 13:30:49 +02:00
665ccafd73 fix(browser_adapter): event creation fails (IE11, Firefox) 2015-05-22 13:30:48 +02:00
f35dbb99b5 fix(browser_adapter): element.getBoundingClientRect fails when element not in DOM (IE11) 2015-05-22 13:30:47 +02:00
a393f84fa4 fix(browser_adapter): element.matches only available with prefix (IE11) 2015-05-22 13:30:47 +02:00
92c2c33a84 fix(browser_adapter): assigning null to document.title sets the title to "null" (IE11, Firefox) 2015-05-22 13:30:46 +02:00
9802debf71 fix(test): native shadow DOM is required (IE11, Firefox) 2015-05-22 13:30:45 +02:00
2287938f5a fix(router): event.defaultPrevented is not reliable (IE11) 2015-05-22 13:30:44 +02:00
5103f080e9 fix(test): function.name is not available (IE11) 2015-05-22 13:30:44 +02:00
1f20ef9787 feat(router.js): export routerDirectives 2015-05-22 12:45:26 +02:00
1ad6558229 fix(examples): update form example to use NgIf 2015-05-22 12:32:13 +02:00
d61a0dfa22 test(ObservablePipe): onDestroy shouldn't throw 2015-05-22 12:31:46 +02:00
ac510b67cc chore(docs): update npm-shrinkwrap.readme.md instructions
Closes #2043
2015-05-22 00:13:20 -07:00
5ed091e260 build(gulp): fix test.unit.dart
- format code for the first run
- don't run tests if first build fails

Closes #1647
2015-05-21 23:50:56 -07:00
cc2c8f6b00 refactor(test): ts’if compiler integration tests. 2015-05-21 17:53:53 -07:00
c28952c707 chore(release): bump version to alpha.25 2015-05-21 17:37:45 -07:00
30c3e5a84e fix(forms): changed forms to create only one value accessor instead of always creating DefaultValueAccessor 2015-05-21 17:31:25 -07:00
2ff3873881 chore(transformers): remove bindProperty hack 2015-05-21 16:58:32 -07:00
aec51d616b refactor(ts'ify): ts’ify mocks, directives and test_lib
Also cleans up global types.
2015-05-21 15:33:37 -07:00
c5996529c3 chore(expressions): add explicit test for map vs property access 2015-05-21 14:41:26 -07:00
00c3693daa feat(forms): migrated forms to typescript 2015-05-21 13:55:15 -07:00
fed86fc8ac feat(injector): support forwardRef in toAlias 2015-05-21 09:52:43 -07:00
705ee46f31 fix(di): changed host and view injector to respect visibility 2015-05-21 09:17:56 -07:00
f210c41c1f feat(di): changed toFactory to support dependency annotations 2015-05-21 08:34:48 -07:00
863eb3c559 chore(testing): update karma-jasmine and jasmine
Jasmine to jasmine-core 2.3.4.
Update tools tests using minijasminenode to directly use jasmine.

See #1860
2015-05-20 21:34:56 -07:00
b6b52e62b2 fix(element_injector): fixed element injector to inject view dependencies into its components 2015-05-20 17:48:04 -07:00
dd9b08cce8 chore(testing): update protractor to version 2.1.0 2015-05-20 17:28:23 -07:00
e61d82b9be refactor(core): ts’ify core 2015-05-20 16:30:41 -07:00
aabc898f3b chore: fix race condition during build. 2015-05-20 16:21:38 -07:00
bdeac30a96 chore: bump ts2dart to 0.5.6 2015-05-20 16:07:27 -07:00
4afd2b4138 feat(PromisePipe): remove ref onDestroy 2015-05-20 14:00:57 -07:00
dee4ecbb3f build(gulp): fix typo in the npm version warning message 2015-05-20 11:32:46 -07:00
4210b0e66a build(broccoli-typescript): refactor output removal
this is just to make the code a bit more easier to follow
2015-05-20 11:30:45 -07:00
2d6c44b54a build(broccoli-typescript): do full rebuild after we recover from incremental failures
this is to ensure that we are not reporting success if unchanged files still contain errors.
2015-05-20 11:30:44 -07:00
c45283216f fix(router): router link should navigate to non-base Url.
While still displaying full base + custom part of url in the href.
2015-05-20 11:01:09 -07:00
826af401a9 fix(test_lib): fixes nested beforeEach. 2015-05-20 11:01:09 -07:00
28c2b8f432 fix(element_injector): fixed element injector to resolve dependencies of regular services 2015-05-20 10:56:33 -07:00
c9ab8e4be8 fix(browser): template elements should have content imported instead of the element itself. 2015-05-20 10:31:12 -07:00
1054f6a9ab build(gulp): watcher should not trigger more than once during init
Closes #2037
2015-05-20 09:33:29 -07:00
f6eeb9aa66 chore(doc-gen): dgenerate the type definition file for angular2
Closes #2017
Closes #1966
2015-05-20 12:23:59 +01:00
91ccc9af98 fix(XHRImpl): fix errors, add a spec
fixes #1715
2015-05-20 08:31:50 +02:00
ec90fcd290 build(test): remove unecessary require in karma.conf 2015-05-20 08:28:38 +02:00
a664f5a6de fix: don't call onAllChangesDone on checkNoChanges 2015-05-20 08:27:48 +02:00
7643d979c7 docs(annotations): fixes 2015-05-20 08:23:35 +02:00
d18463dcdc build(gulp): exec karma run in a new process to avoid duplicate output
This is not an ideal solution, but I couldn't find another way to supress the output from the runner.

Closes #1813
2015-05-19 23:15:53 -07:00
f9f917bfa4 build(gulp): fix cleanup.builder task
- wait for the cleanup to finish (it's async) before exiting on ctrl+c
- wait for the cleanup to finish (it's async) onBeforeExit
- remove tmp directory during onBeforeExit to cleanup past leaks

Closes #1919
2015-05-19 23:15:53 -07:00
e89bf01c2b build(gulp): don't throw exceptions on exit when angularBuilder was not initialized 2015-05-19 23:15:53 -07:00
d04a515eb0 build(gulp): refactor existing cleanup tasks
the current complexity is unjustified necessary
2015-05-19 23:15:53 -07:00
0ae89ac096 feat(CD): add support for === and !==
relates to #1500
2015-05-20 07:50:43 +02:00
6ec5d5daaf refactor(async): extract timer related functions into a TimerWrapper 2015-05-20 07:47:46 +02:00
62b1a08f06 refactor(reflection): improved error message 2015-05-19 21:17:52 -07:00
c54f5e0ba2 build(broccoli-typescript): do a global emit during the first run
reduces the time spent in TSC for the initial build to 1 sec (down from 23sec).
2015-05-19 17:41:50 -07:00
37a8f1037e build(broccoli-typescript): add missing semicolon 2015-05-19 17:41:50 -07:00
4ba81bf3eb build(node_tree): fix broken test.unit.cjs task which breaks on rebuild 2015-05-19 17:40:50 -07:00
c204835969 style(nodeTree): fix formatting
the formatting was messed up due to https://github.com/angular/clang-format/issues/7.

I replaced the fat arrow function with regular function expression to resolve the formatting issue
2015-05-19 17:39:57 -07:00
ac28ac324d fix(gulp): continue watching when tasks throw
Closes #1915
2015-05-19 16:15:34 -07:00
8aa3fcfb63 chore(build): don’t include export var __esModule = true in every file
But do it during the build process for cjs.
Right now we only need this when we transpile from ts
directly to es5. This is only the case in our
cis build, as for our browser build we only transpile
from ts to es6 via ts and then use traceur to do
the rest.
2015-05-19 15:12:59 -07:00
1beadb8607 refactor(render): ts’ify render api 2015-05-19 15:12:59 -07:00
bd8724e652 chore(build): bump ts2dart version to 0.5.5 2015-05-19 15:12:58 -07:00
73d15edef5 chore(build): add tsconfig.json to modules/angular2
This allows to use `tsc` directly on Angular2, e.g.
```
./node_modules/.bin/tsc -w -p modules/angular2/
```
2015-05-19 15:12:58 -07:00
adaa157317 chore(packaging): bump version to 2.0.0-alpha.24 2015-05-19 14:47:59 -07:00
791caf0037 fix(router): use appRootComponentToken to get root route configs
Closes #1947
2015-05-19 14:36:45 -07:00
8ab773538b fix(errors): require passing stack traces explicitly in ng2 own code 2015-05-19 12:48:00 -07:00
5c88f662cd chore(deps): bump ts2dart version 2015-05-19 10:43:18 -07:00
cd7aef2139 chore(doc-gen): fix up tests to work on linux 2015-05-19 14:38:11 +01:00
50c6efa187 chore(doc-gen): fix paths for links to modules and exports 2015-05-19 14:38:10 +01:00
302c5d5005 chore(doc-gen): paths now start with a slash 2015-05-19 14:38:10 +01:00
b6b9ede425 chore(doc-gen): include interfaces in the possible exports from a module 2015-05-19 14:38:10 +01:00
118f0520a2 chore(doc-gen): get CompilerHost to return the SourceFiles with the correct fileName
Now that we are not changing the working directory, we needed to update how
getSourceFiles works to ensure that it worked relative to the baseDir.
2015-05-19 14:38:10 +01:00
ba80bd43ad chore(doc-gen): fix text mock code 2015-05-19 14:38:10 +01:00
ed6298c33f chore(doc-gen): speed up class member sorting 2015-05-19 14:38:10 +01:00
db5486a347 chore(doc-gen): use actual TypeScript SymbolFlags enum rather than magic number 2015-05-19 14:38:10 +01:00
b9b58f7ed9 chore(doc-gen): speed up class member sorting 2015-05-19 14:38:10 +01:00
33f5aafd6c chore(doc-gen): formatting 2015-05-19 14:38:09 +01:00
4b34ef9036 chore(doc-gen): remove unused signature 2015-05-19 14:38:09 +01:00
8c409e9251 chore(doc-gen): improve error handling for missing declaration params 2015-05-19 14:38:09 +01:00
398e70ad39 chore(doc-gen): allow class member sorting to be configured 2015-05-19 14:38:09 +01:00
9407c12923 chore(doc-gen): clarify and improve matching of exports to ignore
Previously this was a bit cryptic as we just had a `hideSpecialExports` flag.
Now it ignores exports that match an array of regexes, with the default case
being those exports called `___esModule`.
2015-05-19 14:38:09 +01:00
a4693ef679 squash-me: remove unnecessary (and very naughty) chdir() call 2015-05-19 14:38:09 +01:00
9d5f760597 chore(doc-gen): chore(doc-gen): add TypeScript parsing 2015-05-19 14:38:09 +01:00
8bebcfb844 chore(doc-gen): relax link matching 2015-05-19 14:38:09 +01:00
8a0eb08745 chore(doc-gen): relax link matching 2015-05-19 14:38:08 +01:00
1dce4699de chore(doc-gen): relax link matching 2015-05-19 14:38:08 +01:00
7bff919782 chore(doc-gen): add TypeScript parsing 2015-05-19 14:38:08 +01:00
c6dc78183d chore(doc-gen): relax link matching 2015-05-19 14:38:08 +01:00
9a72f19b97 chore(doc-gen): add TypeScript parsing 2015-05-19 14:38:08 +01:00
25a952755e chore(doc-gen): remove Traceur bits 2015-05-19 14:38:08 +01:00
b2da2978ee chore(doc-gen): move inline link matching to dgeni-package 2015-05-19 14:38:07 +01:00
8b9400ad92 docs(di/injector): remove invalid tab chars
These tabs were breaking the jade syntax generation
2015-05-19 14:38:07 +01:00
3571450b42 docs(directives.js): remove invalid asterisk
This character was breaking the doc-gen
2015-05-19 14:38:07 +01:00
72bb5bdd5a chore(doc-gen): fix path to modules on angular.io 2015-05-19 14:38:07 +01:00
04a9eb8820 fix(build): npm shrinkwrap to pick up changed SHA1.
ts2dart's node-source-map-support dependency was updated to match the main
line patch, but this changed the SHA in the existing repo, breaking Angular's
shrink wrapped dependency.

This update changes the dependency back to an existing SHA.
2015-05-19 11:17:13 +02:00
0f002a5b18 feat(fakeAsync): allow simulating the passage of time 2015-05-19 06:51:15 +02:00
b066b8d15a feat(di): added hostInjector and viewInjector to the Directive annotation 2015-05-18 18:30:53 -07:00
7b511462af refactor(core): renamed injectables into appInjector
BREAKING CHANGES

Before:

@Component({injectables: [Type]} class MyCmp{}

After:

@Component({appInjector: [Type]} class MyCmp{}
2015-05-18 18:30:52 -07:00
3a53f67911 feat(di): removed publishAs
BREAKING CHANGES

Removes the publishAs property from the Component annotation.
2015-05-18 18:30:52 -07:00
155b1e2b35 feat(pipe): reexported pipes to genereate docs 2015-05-18 18:24:26 -07:00
aad5795408 fix(tree-differ): treat symlinks to deleted paths as removals
Previously, tree-differ would not correctly handle symlinks to deleted files, resulting in
an ENOENT errno being tossed by libuv.

This change fixes this to ensure that symlinks are safely handled, performantly.

Closes #1961
2015-05-18 20:36:29 -04:00
83b97c485b refactor(router): use DynamicComponentLoader instead of ViewContainer 2015-05-18 15:57:08 -07:00
5db89071d4 fix(router): improve route matching priorities 2015-05-18 15:57:08 -07:00
c29ab86d85 refactor(router): improve control flow of descendant route activation 2015-05-18 15:57:08 -07:00
6b02cb9b44 test(router): rename helpers in test 2015-05-18 15:57:08 -07:00
88c607da03 chore: update README with badges 2015-05-18 15:29:08 -07:00
f9fd4926ef docs(pipes): fix @View
we all copy/pasta ObservablePipe which had the typo

Closes #1958
2015-05-18 14:34:37 -07:00
986038242a feat(change_detection): json pipe
Closes #1957
2015-05-18 14:34:37 -07:00
8e84f8a1c4 chore: don't throw if paramTypes is undefined.
Closes #1955
2015-05-18 14:34:37 -07:00
edfbc25768 style(change detect): Fix typo unitialized => uninitialized
Closes #1928
2015-05-18 14:34:37 -07:00
05a1c6c183 perf(compiler): Avoid unnecessary List concats
Update `BindingRecordsCreator#getBindingRecords` and `ProtoRecordBuilder#addAst`
to avoid unnecessary calls to `ListWrapper.concat`.

Closes #1905
2015-05-18 14:34:36 -07:00
534cbb4bf5 refactor(benchmarks): Update compile benchmarks
Update the compile benchmark to allow the Dart transformer to properly
generate the getters, setters, & methods needed.

This also improves the method of duplicating the source templates,
further decreasing runtime from ~5s to ~2s.
2015-05-18 14:34:36 -07:00
d9ceb42bfe chore(gulp): log message when tasks triggered by watch
Closes #1882

Closes #1893
2015-05-18 14:34:36 -07:00
8d6943227d chore(material): add e2e smoke tests for a few more components.
Closes #1884
2015-05-18 14:34:36 -07:00
3011cd86bd feat(compiler): special-case class attribute in hostAttributes
Closes #1774

Closes #1841
2015-05-18 14:34:36 -07:00
cfba38b462 chore: Visual Studio Code project settings for excluding directories 2015-05-18 14:34:36 -07:00
11e4385173 feat(forms): improved error messages
Closes #1839
2015-05-18 14:34:36 -07:00
ad29b12cde doc(NgFor): fix inline doc 2015-05-18 23:12:41 +02:00
842459aa46 doc: fix & sync with latest updates 2015-05-18 23:11:45 +02:00
b033416a45 doc(DI): fix inline doc in binding.ts
fixes #1894
2015-05-18 23:10:41 +02:00
7310b09a1a doc(UrlResolver): inline doc
fixes #1732
2015-05-18 23:09:35 +02:00
bb2eda2d15 feat(element_injector): allow @Optional for ProtoViewRef 2015-05-18 12:48:33 -07:00
0114cd97b6 refactor(RouteRegistry): optimize recognize() 2015-05-18 19:32:33 +02:00
fc13cdab3a refactor(router): add types 2015-05-18 19:32:33 +02:00
3644036693 refactor(proto_view_factory): Move getChangeDetectorDefinitions out of ProtoViewFactory
Move `getChangeDetectorDefinitions` out of `ProtoViewFactory` since it
does not depend on any state in that object.
2015-05-18 08:45:59 -07:00
c397297eef chore(build): fix build.js and test.unit.cjs on Windows
Closes #1873
2015-05-16 22:44:11 +02:00
1eea2b254e feat: allow for forward references in injection
It is possible for a class defined first to be referencing a class defined later,
and as a result at the time of the definition it is not possible to access the later's
class reference. This allows to refer to the later defined class through
a closure.Closes #1891
2015-05-15 21:12:57 -07:00
0e04467b8a docs(bench press): Added link to Chromedriver bug for reference
Closes #1923
2015-05-15 16:51:18 -07:00
9fbb3adbe2 build(travis): bump npm version to 0.9.1
this is to remove the warning in logs and align the ci with our local environment
2015-05-15 16:18:01 -07:00
b6f29b4448 feat(errors): preserve stack traces of user exceptions in Dart 2015-05-15 15:03:31 -07:00
421d8916a6 refactor(view_manager): split inPlace views into root and free host views.
BREAKING CHANGE:
`AppViewManager.createInPlaceHostView` is replaced by
`AppViewManager.createRootHostView` (for bootstrap) and
`AppViewManager.createFreeHostView` (for imperative components).

The later creates new host elements that are not attached anywhere.
To attach them, use `DomRenderer.getHostElement(hostviewRef)`
to get the host element.

Closes #1920
2015-05-15 13:24:53 -07:00
a38a0d6f87 Merge pull request #1909 from angular/view-ref-return-types
Update view_ref.js
2015-05-15 12:32:22 -07:00
7a4a635399 feat(change_detection): uppercase and lowercase pipes
because the world needs more uppercase madness

[✔] clang-format
[✔] tests
2015-05-15 19:46:52 +02:00
557d54b3de feat(facade): toUpperCase and toLowerCase 2015-05-15 19:46:52 +02:00
c47902a471 refactor(reflector): improve types 2015-05-15 19:26:06 +02:00
25cd6e4321 fix(Compiler): add an error when a directive is null or undefined
fixes #1908
2015-05-15 19:26:06 +02:00
6ad5fa0d9d Update view_ref.js
Add return types.
2015-05-14 12:36:16 -07:00
666336be1a build(trees): remove unused imports 2015-05-14 10:01:37 -07:00
77bf90dff1 build(gulp): don't print stack from jasmine handler failures in ci mode
jasmine already logs all the test failures so that stack is redundant.
2015-05-14 10:01:07 -07:00
8ad0205948 docs(promise_pipe.ts): correct "async" pipe
the syntax is now combined with `|async` rather than separate `|promise`
2015-05-14 17:25:46 +02:00
7ff17db113 docs(CONTRIBUTING.md) : fix grammatical error in refactor description
Grammar:
- Consistency using "neither" with "nor"
2015-05-14 17:25:06 +02:00
1d11fdecdc docs(annotations): correct List for directives for Component
@Component takes a List of directives

https://github.com/angular/angular/blob/master/modules/angular2/src/core
/annotations_impl/annotations.js#L867
2015-05-14 08:13:54 -07:00
b1ef30aa20 test(watch): add some test coverage for watch build plugin
Closes #1890
2015-05-14 04:44:38 -04:00
28659efa69 chore(traceur-jasmine): accept multiple specfile globs 2015-05-14 02:48:37 -04:00
6c59894a29 chore(package.json): add rewire devDependency 2015-05-14 02:48:37 -04:00
47b8b48ee7 build(gulp): log test errors but suppress error handling within gulp while in watch mode
if any tasks executed by gulp results in an error, gulp will try hard to show errors. these are usually irelevant in the
watch mode. this is why it's ok to supress them except when running in the ci test mode, in which case failing tasks and logging
exceptions is helpful.

Closes #1881
2015-05-13 22:25:15 -07:00
3969009fe7 build(brocolli): convert brocolli-ts2dart to use TreeDiffer
Closes #1720
Closes #1733
2015-05-13 21:04:51 -04:00
ecb068019b refactor(proto_view_factory): expose data for generating change detectors
Also consolidates metadata handling in `ElementInjector`

BREAKING CHANGE:
- renames `DirectiveMetadataReader` into `DirectiveResolver`
  and removes `src/core/compiler/directive_metadata`.

Fixes #1712
Fixes #1713
2015-05-13 17:11:59 -07:00
5114411749 perf(dart): Improve Dart ListWrapper#concat
Improve implementation of `ListWrapper#concat` to take advantage of our
knowledge of input list sizes.
2015-05-13 16:30:50 -07:00
08f21dbf51 feat(change_detection): implemented change detection that can be configured with pregenerated change detectors 2015-05-13 16:23:22 -07:00
d8c7c274e4 refactor(change_detector): extracted ChangeDetectorDefinition 2015-05-13 16:23:22 -07:00
fadabf79e3 chore(package.json): update run-sequence to v1.1.0
v1.1.0 includes a patch to prevent manipulating arguments passed as arrays
2015-05-13 19:21:35 -04:00
23cec1e8e2 build(gulp): use chokidar alone instead of gulp-watch
Closes #1759
2015-05-13 19:21:35 -04:00
c36ea0221e chore(package.json): uninstall gulp-watch, install chokidar@^1.0.1 2015-05-13 19:21:35 -04:00
685a6507b6 feat(compiler): added support for [()] syntax 2015-05-13 16:08:59 -07:00
846354473d chore(cleanup): Remove some unused files. 2015-05-13 13:56:54 -07:00
390cfb793b fix(router): generate links for router-link with baseHref 2015-05-13 12:22:45 -07:00
17392f663f fix(router): sort possible routes by cost 2015-05-13 11:57:57 -07:00
8b6fa1cf19 doc: fix inline docs 2015-05-13 11:56:51 +02:00
909233f724 fix(ng1 benchmarks): revert *ng-if to ng-if 2015-05-13 11:56:50 +02:00
0e82970a29 fix(examples): prefix directives with Ng 2015-05-13 11:56:50 +02:00
cdbb2473bb fix(benchmark): change If for NgIf 2015-05-13 11:56:50 +02:00
c20060d259 fix(directives): fix import path 2015-05-13 11:56:50 +02:00
38926f7123 fix(benchmark): fixes ng-if ng-for renaming for templates. 2015-05-13 11:56:50 +02:00
0efd89ae5d docs(npm-shrinkwrap.readme.md): add info about from property changes
Closes #1834
2015-05-13 01:02:20 -07:00
718d2ae2ee build(gulp): run beforeExit hook only once
this prevents inifinite loops when cleanup task registers an additional task, that triggers a new beforeExit event

Fixes #1833
2015-05-13 00:57:13 -07:00
af9dcad8e3 fix(facade): MapWrapper.createFromPairs
Closes #1640
2015-05-12 16:10:00 -07:00
772b529a8e build(gulp): bump the required node version to 0.12.2
We ran across fatal issues with npm shrinkwrap on node 0.10.x which don't go away even with npm 2.9.x.

Upgrading node to 0.12 fixed the shrinkwrap issues. Since now we run node 0.12 on ci as well, there
is no reason for anyone to use node 0.10 during development.
2015-05-12 16:05:48 -07:00
111fa60a93 chore: rename for to ng-for
Closes #1598
Closes #1295
Closes #1827

Closes #1827
2015-05-12 15:32:44 -07:00
e9f236b70f chore: rename switch to ng-switch 2015-05-12 15:32:44 -07:00
78d3f62b6a chore: rename non-bindable to ng-non-bindable 2015-05-12 15:32:44 -07:00
d310a9c0b4 chore: rename if to ng-if 2015-05-12 15:32:44 -07:00
7dc524ed58 chore(publishing): fix pubspec authors field 2015-05-12 15:06:00 -07:00
032f8b7840 fix(test): fixed a test 2015-05-12 14:40:20 -07:00
4f2b9a4c28 chore: fail travis on failed ‘test.unit.cjs/ci’ 2015-05-12 14:11:12 -07:00
1ac7bb3bb8 chore(packaging): bump version to 2.0.0-alpha.23 2015-05-12 13:48:54 -07:00
f302f70330 chore: convert dom module to typescript 2015-05-12 12:59:53 -07:00
555dd93ed9 chore: change gulp test.unit.js to use dots reporter 2015-05-12 12:59:53 -07:00
96b0a1c75e refactor(PromisePipe): use lexical this inside of transform 2015-05-12 12:40:13 -07:00
c8a0ed40bd refactor(NgZone): use zone.js v0.5 from npm 2015-05-12 21:07:25 +02:00
e11c20541a refactor(VmTurnZone): renamed to NgZone
BREAKING CHANGE:

VmTurnZone has been renamed to NgZone.

- The public API has not chnanged,
- The "outer" zone is now named "mount" zone (private to NgZone).
2015-05-12 21:03:24 +02:00
c75e216871 refactor(VmTurnZone): outer zone = root zone 2015-05-12 21:03:24 +02:00
fd1d60f03b refactor(VmTurnZone): use the browser microtask queue for JS 2015-05-12 21:03:24 +02:00
e8a6c95e2a feat(VmTurnZone): Rework the implementation to minimize change detection runs
Before this PR there were only 2 zones: root zone = outer zone > inner
zone.
This PR creates the outer zone as a fork of the root zone: root > outer
> inner.

By doing this it is possible to detected microtasks scheduling in the
outer zone and run the change detection less often (no more than one
time per VM turn).

The PR also introduce a Promise monkey patch for the JS implementation.
It makes Promises aware of microtasks and again allow running the change
detection only once per turn.
2015-05-12 21:03:24 +02:00
358a6750ed feat(di): support type literals in DI 2015-05-12 10:57:53 -07:00
4320859e1b chore(dart): Copy css resources in build
Include css resources in the files copied to the dist/dart directory.
This fixes 404s occuring when testing the todo/ app.
2015-05-12 10:02:00 -07:00
98e7a38e50 chore: use SDK dartfmt 2015-05-12 09:56:38 -07:00
229e770a1d refactor(forms): rename FormDirectives to formDirectives
BREAKING CHANGE:

A collection of all the form directives is exported
under `formDirectives`
while those were previously available
under `FormDirectives`.

Closes #1804
2015-05-12 18:44:25 +02:00
5036086fb3 fix(forms): export directives as const in Dart
Fixes #1283
2015-05-12 18:44:25 +02:00
97d24563f4 feat(dart/transform): Inline templateUrl values
Modify DirectiveProcessor to inline `templateUrl` values to avoid making
additional browser requests.

Closes #1035
2015-05-12 09:08:56 -07:00
655ed851f0 refactor(facade/lang): remove unneded semicolons
Those were previously enforced incorrectly by clang-format

Closes #1816
2015-05-12 08:50:44 +02:00
f8f79dc76c chore(package.json): update gulp-clang-format 2015-05-12 08:50:44 +02:00
a574154108 fix(router): add baseUrl to relative paths, but not absolute.
Closes #1783
2015-05-11 18:55:24 -07:00
7f976381d5 fix(view): fixed ProtoViewFactory to get all property bindings 2015-05-11 17:38:34 -07:00
ac80df0959 fix(router): reuse common parent components 2015-05-11 15:49:40 -07:00
aff85b5037 feat(facade): add equals method to StringMapWrapper 2015-05-11 15:49:40 -07:00
5691063ba0 refactor(ChangeDetection): rename AsyncPipe to ObservablePipe
The async pipe in templates will now delegate to both Observable pipe or Promise pipe,
whichever first says it can support the input. Therefore, it's beneficial to disambiguate
the name of the AsyncPipe/AsyncPipeFactory constructors to reflect that these actually
support only Observables.
2015-05-11 14:25:27 -07:00
7498758584 feat(PromisePipe): add pipe for promises 2015-05-11 14:23:46 -07:00
92d6aa1f32 fix(gulpfile): fixed test.unit.dart to format dart code before running test 2015-05-11 13:28:20 -07:00
3256ff1c73 feat(gulpfuile): added watch.js.dev 2015-05-11 13:28:19 -07:00
f9c1de46b3 feat(compiler): added support for host actions 2015-05-11 13:28:19 -07:00
a9ce0f7afb cleanup(di): use typescript initialization idioms 2015-05-11 12:34:22 -07:00
1a4ab2c57a build(gulp): remove the check-format step from test.unit.js task 2015-05-11 12:08:27 -07:00
77d1fc149a fix(router): router-link works without params
Router-link attaches a listener to prevent default behavior and
navigate.

Closes: 1689
2015-05-11 11:58:38 -07:00
c2a42d5d2b fix(location): dartium does not like pushState with null.
According to
https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Manipulating_the_browser_history
the value of the title parameter is irrelevant anyways.
2015-05-11 11:48:45 -07:00
01d5c29513 fix(transformer): remove classDefParser in favor of hardcoded strings to speed up build 2015-05-11 10:45:02 -07:00
7844e3a275 chore: dartfmt Dart code in the repo 2015-05-11 09:50:33 -07:00
a5638a940c feat(directives): export collection of core directives
Closes #1524
2015-05-11 16:47:45 +02:00
4665726f48 feat(lang): support const expressions in TS/JS and Dart
Closes #1796
2015-05-11 12:11:24 +02:00
e8ad0d1776 chore(package.json): update ts2dart to 0.5.2 2015-05-10 18:44:51 +02:00
28022f472d docs(DEVELOPER.md): Update Dart SDK Version
Minimal Version set to 1.10.0-dev.1.10

Closes #1771
2015-05-10 12:08:48 +02:00
4f3433b5bd feat(view): allow to transplant a view into a ViewContainer at another place.
Closes #1492.
2015-05-08 21:35:01 -07:00
2185e7cee9 feat(di): expose parent injector 2015-05-08 17:11:27 -07:00
c82cc47767 build(gulp): watch and incrementally compile files for server.js.dev task
Closes #1770
2015-05-08 16:42:40 -07:00
66f5e30d7c chore(dart): use --trust-type-annotations and --trust-primitives 2015-05-08 16:13:53 -07:00
1a0da11e55 feat(di): components can self-publish via publishAs 2015-05-08 16:13:00 -07:00
abc8878547 feat(dart/transform): Reuse readDirectiveMetadata in plugin
Share code for parsing `DirectiveMetadata` values between the
transformer and the analyzer plugin.
2015-05-08 14:34:16 -07:00
75e9d3f634 chore(ci): bump node version to 0.12
See #1396

Closes #1408
2015-05-08 13:58:03 -07:00
248caefb7e docs(npm-shrinkwrap.readme.md): update npm update instructions 2015-05-08 13:57:50 -07:00
853d1de6ec fix(router): strip base href from URLs when navigating 2015-05-08 13:51:43 -07:00
84dc6ae76b fix(test_lib): spy funcs should match null arguments 2015-05-08 13:51:43 -07:00
05219a54cd feat(dom): add getBaseHref method 2015-05-08 13:51:42 -07:00
4b62a722f0 feat(change_detection.js): export null pipes
rather then having developers creating their own null pipes

Closes #1624
2015-05-08 13:50:17 -07:00
61b69c63ed docs(modules_dart): add README.md
Closes #1628
2015-05-08 13:45:26 -07:00
09b39bf77a docs(core): fix Formatters -> Pipes
long overdue update

Closes #1629
2015-05-08 13:45:13 -07:00
42f6baeaec Fix documentation for toFactory and toAsyncFactory
The bound String classes should have a dependency on Number, not String.

Closes #1654
2015-05-08 13:40:12 -07:00
8ef183b593 feat(material): add early version of md-grid-list.
Closes #1683
2015-05-08 13:29:24 -07:00
2cb066215a Add correct type to TestBed.createView
Closes #1727
2015-05-08 13:17:42 -07:00
200e190f70 fix(dart/transform): Handle hostAttributes in DirectiveMetadata
Handle `hostAttributes` in the transformer.
`hostAttributes` was introduced in 51839ca677

Closes #1742
2015-05-08 11:19:11 -07:00
44f829dbc6 feat(dart/transform): Use the render Compiler and the DirectiveParser
Update the `TemplateCompile` step to use the full render `Compiler`.

Provide `DirectiveMetadata` for `ViewDefinition` objects and use it to
run the `DirectiveParser` step of the render compile pipeline.
2015-05-08 11:18:40 -07:00
401c9efad7 chore(build): update shrinkwrap docs
Closes #1748
2015-05-08 11:18:00 -07:00
900bf8e483 Update DEVELOPER.md
Closes #1755
2015-05-08 11:17:44 -07:00
271ced8ac4 Update DEVELOPER.md
add some info about clang-format
2015-05-08 11:17:43 -07:00
c5bd3f0773 Update README.md
Don't tell people to build angular from source themselves. Our examples are not well-constructed for users to try them out.

Closes #1756
2015-05-08 11:17:29 -07:00
ad23921814 feat(material): early version of md-input
Closes #1753
2015-05-08 11:16:18 -07:00
31cbec0857 build(gulp): check node and npm version and log a warning if incompatible
Closes #1758
2015-05-08 11:04:10 -07:00
d717529e9a fix(change_detection): updated dynamic change detector not to mutate when throwing
Closes #1762
2015-05-08 10:46:08 -07:00
c68fa27444 refactor(render): remove recursion from renderer
The goal is to make implementing a renderer straight forward.

BREAKING_CHANGE:

- Renderer interface was redone / simplified.
- `DirectDomRenderer` was replaced by `DomRenderer`.
- `DirectDomRenderer.setImperativeComponentRootNodes` is replaced
  by the following 2 steps:
    1. `ViewManager.getComponentView(elementRef) -> ViewRef`
    2. `DomRenderer.setComponentViewRootNodes(viewRef, rootNodes)`
- all `@View` annotations need to have a template, but the template
  may be empty. Previously views that had a `renderer` property did
  not have to have a `template`.
- `dynamicComponentLoader.loadIntoNewLocation` does no more allow
  to pass an element, but requires a css selector.
  Special syntax: `:document` can be used as prefix to search globally
  on the document instead of in the provided parent view.

Part of #1675
2015-05-08 09:37:41 -07:00
d2507ac760 Add full example to FormBuilder docs 2015-05-08 16:35:25 +02:00
4ce0d5e024 fix(dart): Remove unused imports.
These imports cause dart analyze errors once ts2dart removes the
IMPLEMENTS import.
2015-05-08 15:24:37 +02:00
5d9e573b3e docs(annotations): differentiate between component definitions and component instances
Closes #1661
2015-05-08 14:50:33 +02:00
51839ca677 feat(compiler): allow setting attributes on a host element
Closes #1402
2015-05-08 14:22:07 +02:00
7225416661 chore(npm): bump angular version in the shrinkwrap after today's release 2015-05-07 22:27:36 -07:00
5e4fa5cf07 build(gulp): use gulp-watch instead of gulp.watch for watching files
gulp-watch uses chokidar which uses fsevents which is much better than fs polling or relying on fs.watch.

fsevents use only one FD per watch invocation as opposed to one FD per watched directory and any subdirectory.

this should improve the situation with EMFILE errors (caused by lack of available file descriptors)

----

I also tried the following:

gulp-sane: requires watchman installation via brew so I didn't want to request that everyone goes throught that yet
gulp-chokidar: didn't work, seems to be obsolete
2015-05-07 22:27:36 -07:00
fa28b28d0a build(typescript): Migrated change detection to typescript 2015-05-07 17:18:04 -07:00
f0ef72d6cc chore(release): releases alpha.22 2015-05-07 16:04:06 -07:00
a58c9f83bd fix(brocolli): escape special regexp characters when building regexps
Special regexp tokens were allowed unchanged previously, which incorrectly broke
the include/exclude behaviour. Now, they're escaped first.

Closes #1721
Closes #1752
2015-05-07 19:01:12 -04:00
624a33f7f8 chore(package.json): bump zone to 0.4.4 2015-05-07 15:58:28 -07:00
20a033e4c9 chore(material): add simple e2e smoke tests for components. 2015-05-07 15:13:30 -07:00
93c331d103 fix(decorators.es6): export Directive decorator
Closes #1688
2015-05-07 15:12:22 -07:00
51c477925a fix(formatter): point to the newest clang-format
The prior version allowed for an older clang-format binary which has bugs
2015-05-07 14:33:24 -07:00
1daa8aa3a1 chore(shrinkwrap): update dependencies to latest
Also, our package.json was out-of-sync with npm-shrinkwrap.json; see https://github.com/angular/angular/issues/1737
This includes a fix for the shrinkwrapping of ts2dart; see https://github.com/angular/ts2dart/issues/138
2015-05-07 14:29:43 -07:00
62bf777ef1 fix(docs): fix broken docs test after addition of .ts extension to dgeni
regex.
2015-05-07 14:05:57 -07:00
aaf3edd131 build(brocolli): move filename filtering into DiffingPluginWrapper
Closes #1719
2015-05-07 17:00:35 -04:00
6bba289a3c fix(build): build the broccoli tools with correct typescript version.
By default, gulp-typescript currently depends on typescript 1.4, which doesn't work for us.
For example, it doesn't allow `let` when emitting ES5, along with lots of other errors.
It so happens that npm sometimes makes this work, as seen by the warning
```npm WARN unmet dependency /Users/alexeagle/Projects/angular/node_modules/gulp-typescript requires typescript@'1.4.1' but will load
npm WARN unmet dependency /Users/alexeagle/Projects/angular/node_modules/typescript,
npm WARN unmet dependency which is version 1.5.0```
but when we update our node_modules in a certain way, we lose this setup and it breaks.

We should be explicit about using a different version of typescript than gulp-typescript depends on.
2015-05-07 13:37:40 -07:00
b0c735f72c fix(decorators): incorrect annotation to decorator adapter 2015-05-07 12:30:18 -07:00
0e2047f9ca chore(benchmarks): add transform benchmark runner and clean up benchmark output 2015-05-07 10:36:04 -07:00
e30ad2ec2c chore(doc-gen): include TypeScript files in the doc generation 2015-05-07 10:26:23 +01:00
c509057f65 chore(doc-gen): log comments as silly() rather than info() 2015-05-07 10:25:41 +01:00
e138add584 chore(doc-gen): provide aliases for jade-data docs 2015-05-07 10:25:02 +01:00
49777648b3 fix(decorators): fixed decorators 2015-05-06 21:08:55 -07:00
cb87fa0970 chore(build): migrated di to TypeScript 2015-05-06 19:00:56 -07:00
649e276610 chore: support last dev build of Dart at 1.10.0-dev.1.10
Can revert once 1.11 is available
2015-05-06 18:21:46 -07:00
5ef11774c2 chore: update pubspec files
Allow latest analyzer version
Add an upper constraint to the Dart SDK
2015-05-06 17:55:03 -07:00
75db2c5241 chore: add more types to a number of top-level properties and methods 2015-05-06 17:53:44 -07:00
c8ebd11d63 feat(dart/transform): Generate DirectiveMetadata for exports
For all files that export another library, include `DirectiveMetadata`
for the exported library in that file's associated `ng_meta.json` file.
2015-05-06 17:17:04 -07:00
6651aa1e1d chore(build): update to TypeScript @head
We need to pick up some bugfixes for decorator emit. This still has our patch to make Error a class.
2015-05-06 16:34:24 -07:00
3f28d08778 build bug fix 2015-05-06 15:53:58 -07:00
ab28676d02 more comments 2015-05-06 15:36:02 -07:00
577a80371f fixed build process by adding comment 2015-05-06 15:27:25 -07:00
01fdb4afc6 chore(build): remove karma preprocessors
Custom karma preprocessors are no longer being used after 1676 and 1597
2015-05-06 14:06:40 -07:00
be7504d451 fix(decorators): fixes decorator reflection.
The bug appears when there are only type annotations without parameter
annotations.
2015-05-06 13:44:44 -07:00
169e4e862d refactor(dart/transform): Use render Compiler concepts
Update `TemplateCompiler` transform step to use abstractions used by the
render `Compiler`. For example, template code is now loaded via an
instance of `TemplateLoader` and external resources are fetched via an
instance of `XHR`.
2015-05-06 12:51:49 -07:00
abc3de7efe refactor(render): rename RenderView and RenderProtoView
Part of #1675
Closes #1705
2015-05-06 11:46:52 -07:00
0b1bb172c9 feat(dart/analysis): Build DirectiveMetadata for LibrarySpecificUnit
initial commit for the dart analyzer task
2015-05-06 11:00:44 -07:00
0856516ae9 refactor(renderer): separate compiler from renderer
Part of #1675
Closes #1702
2015-05-06 10:50:15 -07:00
705d3aacff build(gulp): fix concurrency and caching issues in test.unit.js and test.unit.dart tasks
previously there was a chance of race conditions that could sporadically fail the build.

additionally runing a task via gulp.start or runSequence always reruns its dependencies, which meant that we were blowing away
the build.tools build and rebuilding everything from scratch even during the interactive/watch mode. This meant that the build
pipeline cache was destroyed on every change and we never got the benefit of incremental compilation
2015-05-06 08:46:03 -07:00
1d0078415f build(broccoli): refactor typescript plugin to be incremental via DiffingBroccoliPlugin 2015-05-06 07:45:46 -07:00
9d1df21d91 build(gulp): do no rebuild tools during test.unit.cjs
This introduces private !build.js.cjs task that is to be executed only from other public tasks.
2015-05-06 07:45:46 -07:00
3f36a3c119 build(broccoli): traceur plugin should react only to .js/.es6/.cjs file removal 2015-05-06 07:45:46 -07:00
8c15ccecd1 build(broccoli): add DiffingBroccoliPlugin and refactor existing plugins to use it
tree-differ:
 - export both TreeDiffer and DiffResult  interface

 diffing-broccoli-plugin:
 - factory class for wrapping DiffingBroccoliPlugins and turning them into BroccoliTrees

 broccoli-dest-copy:
 - refactor into DiffingBroccoliPlugin

 broccoli-traceur:
 - refactor into DiffingBroccoliPlugin
2015-05-06 07:45:45 -07:00
e966869744 build(broccoli.d.ts): add tree.description signature 2015-05-06 07:45:45 -07:00
6b017fb388 build(gulp): create private build.tools task and use it instead of magic variable
This way when gulp prints out that it's running build/clean.tools it really means
that it's cleaning up the build directory.
2015-05-06 07:45:45 -07:00
bb6f59e423 chore(build): make karma watch broccoli output for dart unit tests
Previously, karma used a custom preprocessor. Instead, have karma
run built dart from the `dist` folder and use gulp and broccoli
to watch for changes.
2015-05-05 19:24:20 -07:00
c9cec60007 fix(router): fix for leading slash in dart
Using string1 === string2 translates to identical(string1, string2) in
dart, which is incorrect as it is possilbe for dart strings to have
different reference.
2015-05-05 15:19:06 -07:00
f356d03362 feat(dom): add location and history as DOM-like APIs.
Instead of global access methods.
2015-05-05 14:50:53 -07:00
0520ca68b4 feat(dart/transform): Add DirectiveMetadataExtractor transform step
Add a step that reads `DirectiveMetadata` object off annotated classes
into `.ng_meta.dart` files. These will be used by the `TemplateCompiler`
step as inputs to the Angular 2 render compiler.

Update one test to avoid unsupported functionality, format others.
2015-05-05 12:07:50 -07:00
8e1d53b5e9 feat(router): adds the router to the self-executing bundle.
Due to limitation of system build, the router cannot have its own sfx
bundle.

Fixes an issue with RouteConfig decorator by moving it into its own
file.
2015-05-05 10:55:23 -07:00
f5b56c627b refactor: add types to top-level fields in change_detection
Also introduced an abstract PipeFactory base class
2015-05-05 10:21:56 -07:00
740d85cad8 chore(build): change TS Error type to a class.
This will be in the next upstream release.
2015-05-05 09:03:56 -07:00
33bba094d2 chore(build): fix package.json warning
Nit: the contributors field is defined as an array, see
https://docs.npmjs.com/files/package.json#people-fields-author-contributors
2015-05-05 09:02:57 -07:00
f88c4b77ca feat(material): add prototype dialog component w/ demo. 2015-05-04 16:43:15 -07:00
75da6e4c4a feat(router): export decorator version of RouteConfig 2015-05-04 15:44:16 -07:00
1864f60afb feat(benchmarks): Add basic dart transformer benchmarks.
Adds simple benchmarks for various transformation phases, as well as hello_world.
Does not integrate these into any benchmark frameworks yet.
2015-05-04 14:03:58 -07:00
457c15cd6c feat(decorators): adds decorator versions of DI annotations.
In 'angular2/di' the symbol:
- Inject is a decorator
- InjectAnnotation is an annotation

Internally one an get a hold of annotations without *Annotations appened
(to make ts2dart work without workarounds) by importing from
'angular2/src/di/annotations_impl' instead of 'angular2/di'. This is
needed only for users that transpile through TS and through ts2dart.
2015-05-04 13:35:09 -07:00
28feac9411 refactor(router): rename "alias" to "as" 2015-05-03 20:37:00 -07:00
9153331303 feat(router): route redirects 2015-05-03 20:37:00 -07:00
9d5c33f9dd feat(router): sibling outlets 2015-05-03 20:26:47 -07:00
2713b7877b fix(router): navigate on popstate event 2015-05-03 20:26:22 -07:00
2f0fef8ee1 chore(router): add router bundle to gulpfile 2015-05-01 16:43:19 -07:00
259f872cea fix(router): throw if config does not contain required fields 2015-05-01 16:41:25 -07:00
68ed8f1b6b refactor(router): rename LocationMock to LocationSpy 2015-05-01 16:41:25 -07:00
ef7014fe19 feat(router): export routerInjectables 2015-05-01 16:41:25 -07:00
46ad3552c7 fix(router): infer top-level routing from app component
Closes #1600
2015-05-01 16:41:25 -07:00
4965226f3f fix(router): use lists for RouteConfig annotations 2015-05-01 15:55:53 -07:00
ea546f5069 feat(router): add location service 2015-05-01 15:55:53 -07:00
cf32213079 fix(bundle): update the bundle config to point to rx.js 2015-05-01 15:01:18 -07:00
ce6a2ba836 refactor(view): moved the logic from ProtoView to ProtoViewFactory 2015-05-01 13:35:17 -07:00
0f4a089c32 chore(packaging): switch to conventional changelog 2015-05-01 13:10:14 -07:00
3c77855b39 chore(build): Remove .es6 files which shadow .ts files.
This removes .es6 files which are pure duplicates of a
.ts file in the same folder.
Next we need to remove .js files as well, and remove karma preprocessors for dart.
2015-05-01 09:51:03 -07:00
c1579222bd fix(view): changed view manager to hydrate change detector after creating directives 2015-04-30 22:01:55 -07:00
f863ea0db5 feat(decorators): adds support for parameter decorators.
Paramater decorators expect to be called as currently implemented by TS.
2015-04-30 18:42:40 -07:00
e4342743c0 feat(benchmark): added an implementation of the tree benchmark in React 2015-04-30 18:12:21 -07:00
9e8d31d532 fix(compiler): clone templates before compiling them
This is needed as the compiler changes templates during compilation
and we are caching templates in the `TemplateLoader`.

Closes #1058
2015-04-30 16:40:57 -07:00
f75a50c1dd refactor(compiler): rename decorator directives into directive
BREAKING CHANGE:
Previously, `Directive` was the abstract base class of several directives.
Now, `Directive` is the former `Decorator`, and `Component` inherits from it.
2015-04-30 13:38:40 -07:00
c671706518 refactor(benchpress): report forced gc metric separately 2015-04-30 12:15:30 -07:00
ead21c91a4 fix(exception_handler): log errors via console.error
This is e.g. needed as we use this to test for errors
in our examples.
2015-04-30 11:45:34 -07:00
87dcd5eb6f fix(decorators): updates missing benchmark and fixes typo. 2015-04-30 10:22:30 -07:00
8faf6364dc refactor(core): remove DynamicComponent
BREAKING CHANGE:
A dynamic component is just a component that has no @View annotation…
2015-04-30 09:17:25 -07:00
b71fe311fc chore(build): update clang-format to 1.0.10
Closes #1593
2015-04-30 15:54:08 +02:00
bb50fc131b chore(build): update TypeScript version to unreleased beta
Also fixup the typings which were broken by changes in typescript's lib.d.ts.
Second attempt to merge this, now that bugfix for tsd is in.
2015-04-29 17:03:02 -07:00
3aac2fefd7 refactor(compiler): remove Viewport directives, use Decorator instead
BREAKING_CHANGE:
- The special type of `Viewport` directives is removed
  in favor of a more general `Decorator` directive
- `ViewContainerRef` now no more has a default `ProtoViewRef`
  but requires an explicit one when creating views.

Closes #1536
2015-04-29 15:59:55 -07:00
fb67e37339 feat(decorators): adds decorators to be used by TS and Babel transpiled apps. 2015-04-29 15:13:25 -07:00
648c514c28 feat(dart/transform): Add directiveMetadata{To,From}Map
Add utility methods to convert `render.dom.DirectiveMetadata` to and
from maps. This will allow saving and restoring `DirectiveMetadata` in
the Angular 2 Transformer.

We discussed adding this as a member on `DirectiveMetadata`. Since this
is not necessary for anything except the Transformer, we decided to put
it into a separate file to avoid shipping it with the Angular 2 core
code.
2015-04-29 14:22:08 -07:00
511e832ee2 chore(build): Karma watches broccoli output.
This is a prerequisite for switching to TypeScript. We need to remove the Traceur preprocessor
from Karma, so we have the build specified in a single place (broccoli tree def'n).
2015-04-29 14:15:45 -07:00
09f8d8f7ba refactor(core): introduce ViewRef and ProtoViewRef
BREAKING CHANGES:
- `NgElement` merged into `ElementRef`
- `Compiler.compile…` returns `ProtoViewRef`
- `ViewContainer` uses `ProtoViewRef`s and `ViewRef`s.
- `ViewRef`/`ProtoViewRef` in renderer were renamed to
  `RenderViewRef`/`RenderProtoViewRef`.

Related to #1477
Closes #1592
2015-04-29 14:03:38 -07:00
1205f54d01 fix(build): use correct tsd command to get typings at requested versions 2015-04-29 11:43:28 -07:00
b5032fd374 fix(build): revert typescript upgrade which broke the build.
This reverts commit a7a9463624.
This reverts commit 59824e40e8.
2015-04-29 10:49:54 -07:00
a7a9463624 fix(build): refer to newest version of hammerjs typings 2015-04-29 10:13:30 -07:00
59824e40e8 chore(build): update TypeScript version to unreleased beta
Also fixup the typings which were broken by changes in typescript's lib.d.ts
2015-04-29 10:09:32 -07:00
a51a5c2968 chore(build): run forms tests in Node
Closes #1565
2015-04-29 13:58:07 +02:00
e3c11045bf fix(compiler): changed the compiler to set up event listeners and host properties on host view elements
Closes #1584
2015-04-29 05:27:45 +00:00
414e58edb5 chore(publishing): put malformed commit messages to "other"; do not output empty sections
Closes #1557
2015-04-29 04:10:12 +00:00
3bb3bff1f2 chore(packaging): copy changelog.js from angularjs 2015-04-29 04:10:12 +00:00
d2d4e7d783 refactor(parser): remove unused variables
Closes #1553
2015-04-29 04:08:42 +00:00
ee1b574baf fix(di): improve error messages for invalid bindings
Fixes #1515

Closes #1573
2015-04-28 23:42:36 +00:00
c0f3778dda docs(For): fix example to use for-of syntax
Closes #1572
2015-04-28 23:42:24 +00:00
d4925b61ff fix(change_detector): ensure that locals are only used when implicit receiver
closes #1542
2015-04-28 23:40:22 +00:00
5b104936ae chore(build): Add a tsconfig.json file, simply to allow Atom editor's Typescript plugin to
work without dropping tsconfig.json files and generated .js files in the
source directory.

Closes #1538
2015-04-28 23:39:39 +00:00
14988d4415 docs(core): updating some errors in 01_templates
Signed-off-by: Josh Kurz <jkurz25@gmail.com>

Closes #1529
2015-04-28 23:39:20 +00:00
cd953ceb48 docs(core): update core directives document
Signed-off-by: Josh Kurz <jkurz25@gmail.com>
2015-04-28 23:39:20 +00:00
726fecbfb6 feat(dart/transform): Turn on transform for examples/todo
- Tag services with `@Injectable()`
- Update `pubspec.yaml` to transform examples/todo.

Closes #1527
2015-04-28 23:38:08 +00:00
818bb9b697 test: changed test bed to run change detection twice to make sure there are no changes second time
Closes #1517
2015-04-28 23:37:09 +00:00
e4586249fa refactor(change_detection): removed NO_CHANGED and replaced it with WrappedValue 2015-04-28 23:37:09 +00:00
4c1e978536 cleanup(build): remove traceur-based Dart transpiler 2015-04-28 16:25:10 -07:00
3d62546314 fix(compiler): only sets viewDefinition absUrl if the view has either a template or templateUrl
fixes #1326
closes #1327
2015-04-28 15:40:07 -07:00
b9eab463f7 chore(): fix host properties for MD components. 2015-04-28 10:48:03 -07:00
dff4795e49 docs(README): update for linguistic consistency
Closes #1537
2015-04-28 19:06:02 +02:00
ab74e1ed4e docs(CHANGELOG.md): fix correct links to angular2
Closes #1577
2015-04-28 19:03:09 +02:00
902984cc10 chore(doc-gen): only generate angular.io module and _data docs for public modules 2015-04-28 14:54:47 +01:00
ce431f279e chore(doc-gen): don't show private class members in jade templates
Closes #1366
2015-04-28 14:47:38 +01:00
7fb2f2069c docs(Injector): remove unwanted tab characters in the examples
These mess up the jade templates that use tabs for structuring the output.
2015-04-28 14:31:35 +01:00
c269bd5d3c chore(doc-gen): generate docs for angular.io
You can generate docs for comsumption by the angular.io website by running:

```bash
gulp docs/angular.io
```

The generated docs can be found in `dist/angular.io`
2015-04-28 14:31:34 +01:00
b72eb0783b chore(packaging): bump version to 2.0.0-alpha.21; add changelog 2015-04-27 22:15:48 -07:00
a801da6f7c fix(ViewManager): dehydrate views recursively over ViewContainers
Closes #1560
2015-04-27 17:39:20 -07:00
6fcd3709cf fix(render): return views when destroyed in ViewContainer
Closes #1316
2015-04-27 17:39:09 -07:00
1b2754dacd feat(router): add initial implementation 2015-04-27 17:15:58 -07:00
e617ca6323 feat(facade): add isType method 2015-04-27 17:15:58 -07:00
15376a6d24 feat(dart/transform): Dedup getters, setters, & methods
Dedup the getters, setters, and methods generated by the transformer
when compiling a template.

Run `dartformat` over the transform code.
2015-04-27 17:04:31 -07:00
867705bd2c chore: put everything in the _analyze.dart file
6x faster dart analyze
2015-04-27 16:13:20 -07:00
6ab19dd095 docs(change_detection): document JitChangeDetection and DynamicChangeDetection
closes #1446
2015-04-27 15:34:40 -07:00
99fdb9ac41 fix(dart/transform): Use var instead of bool in generated files
If a source file hides `bool` (explicitly or implicitly via `show`), a
generated file using `bool` may not resolve.

Closes #1455
2015-04-27 14:23:24 -07:00
2827ca1559 build(broccoli): add a tree-differ workaround to browser trees 2015-04-27 10:50:59 -07:00
8ea03d0380 build(gulp): fix incremental compilation by reusing angularBuilder across watch re-reruns 2015-04-27 10:47:52 -07:00
d1ec2e18cd build(gulp): add test.unit.tools to test.js task 2015-04-27 10:47:52 -07:00
aa58e4bba5 build(gulp): add build/clean.tools task prevent test.unit.tools/ci from building
on our CI server we currently split each build into the building phase and testing phase, this change aligns test.unit.tools/ci
with the rest of ci test taskswq
2015-04-27 10:47:52 -07:00
0a97f0b645 build(js.cjs): re-enable tests that now pass in cjs
previously these tests were failing but now they pass on master
2015-04-27 10:47:52 -07:00
8a5cf896d0 build(gulp): remove obsolete config 2015-04-27 10:47:51 -07:00
22c79df98d build(gulp): remove gulp-jasmine, run tests in a new process instead
otherwise we see occasional failures due to require.cache and other global state collisions
2015-04-27 10:47:51 -07:00
a52798543a build(gulp): rename tasks build.broccoli.tools => build.tools + test.unit.broccoli => test.unit.tools 2015-04-27 10:47:51 -07:00
1cbdb9cd17 refactor(build): introduce AngularBuilder facade and clean up many things 2015-04-27 10:47:51 -07:00
4c9b8ebb0c build(gulp): remove obsolete gulp transformer 2015-04-27 10:47:51 -07:00
6aea629cd3 build(gulp): use strict mode for gulpfile
- a variable `public` was renamed since it is a reserved keyword in the strict mode
2015-04-27 10:47:51 -07:00
649fd5a7a9 chore(build): exclude tree-differ.ts from format-checking due to a bug in clang-format
see https://github.com/angular/clang-format/issues/4
2015-04-27 10:47:50 -07:00
40c4eb7240 build(gulp): refactor test.unit.broccoli to use task dependencies and not die when a compilation error occurs
With this change we also stop gulp task queue when an error in build.broccoli.tools occurs, that way we
don't bother testing when transpilation fails.
2015-04-27 10:47:50 -07:00
cd05ed8de9 docs(npm-shrinkwrap.readme.md): update instructions 2015-04-27 10:47:50 -07:00
42e7fc5252 build(broccoli): add source-maps to our broccoli tools 2015-04-27 10:47:50 -07:00
7740fc071c build(broccoli): convert traceur and broccoli-dest-copy plugins to use tree-differ
Also adding symlink-or-copy to our npm dependencies since our plugins now use it.
2015-04-27 10:47:50 -07:00
bdf6af9bd6 build(broccoli): add custom broccoli.d.ts file 2015-04-27 10:47:50 -07:00
2f83efaac8 build(broccoli): add tree-differ for diffing broccoli trees 2015-04-27 10:47:49 -07:00
32c5ab956c build(broccoli): add testing infrastructure for our build plugins
components:
- gulp test.unit.broccoli task
- mock-fs for mocking our FS in unit tests
- jasmine d.ts file for type checking

jasmine lib is provided by minijasmine2 so we don't need to include it explicitly
2015-04-27 10:47:49 -07:00
b111ca9471 chore(build): add tsd.cached.json to our .gitignore 2015-04-27 10:47:49 -07:00
725f909ff8 chore(build): refactor test.unit.cjs to use the broccoli pipeline
This change solves several problems:
- the broccoli pipeline is used to compile the node/cjs tree upon any change to the modules/ directory
- jasmine tests run in a new process removing the need to clean up environment after each test
- since we transpile only those test files that are actually needed for node/cjs build, we transpile less and don't need to filter out tests
2015-04-27 10:47:49 -07:00
427f0d021c perf(benchmarks): benchmark that measure cost of dynamic components 2015-04-27 10:16:53 -07:00
9fc9d53566 perf(benchmarks): benchmark measuring cost of decorators (fixes #1479) 2015-04-27 10:16:52 -07:00
6dece68bb8 refactor(core): rename ViewContainer to ViewContainerRef
This also renames InternalAppViewContainer into AppViewContainer

Related to #1477
Closes #1554
2015-04-27 10:12:21 -07:00
0676fef61f docs(directives): CSS selectors are used for directives
Closes #1544
2015-04-27 15:32:26 +02:00
1d52cfba13 chore(query_list.js): fix minor typos
Typos fixed

Closes #1549
2015-04-27 15:30:17 +02:00
bfa381b35a refactor(view): introduce AppViewManager to consolidate logic
AppViewManager is the single entry point to changing the view hierarchy.
It is split between the manager itself which does coordination and
helper methods, so both are easily testable in isolation.

Also, ViewContainer is now only a pure reference to a bound element
with the previous functionality but does not contain the list of views
any more.

Part of #1477
2015-04-24 20:26:18 -07:00
f78406392b fix(test_lib): support multi matches with deep equality for function calls 2015-04-24 17:53:41 -07:00
623edcd2d8 Copy a second package to TypeScript. 2015-04-24 15:49:04 -07:00
b5e350b18c cleanup(forms): do not export AbstractControl
Closes #1299
2015-04-24 13:57:03 -07:00
87cf434929 chore(sources): intro modules_dart; move analyzer code there
We have Dart code in `angular2` module that ought to be in its own
package. Examples include Dart analysis plugins, and potentially the
transformers (although transformers cannot be moved out just yet).
However, this code is Dart-only and it doesn’t make sense to use JS
directory layout for it. This commit introduces a sub-directory called
`modules_dart`. All modules in this directory are pure Dart packages
using standard pub directory layout. The code in these packages never
gets transpiled. It is directly copied to `dist` unmodified, except an
adjustment in relative paths in `pubspec.yaml` files.
2015-04-24 13:29:18 -07:00
4bab25b366 feat: alllow specifying directives as bindings
Related to #709
Closes #1498
2015-04-24 11:02:17 -07:00
6896305e34 fix: export ShadowDom strategies
Fixes #1510
Closes #1511
2015-04-24 08:41:37 +02:00
8ccafb0524 feat(view): reimplemented property setters using change detection 2015-04-23 11:55:27 -07:00
8a92a1f13e fix(angular2): export QueryList in angular2/core
Closes #1502
2015-04-23 11:04:30 -07:00
d0059b5d75 refactor(PipeRegistry): improve error messages
Closes #1504
2015-04-23 11:04:30 -07:00
fa8e059f28 refacor(lexer): remove unused ~/ operator
Closes #1509
2015-04-23 11:04:30 -07:00
8e18d6c6cf docs(annotations): fix casing in view annotation
- Fix the casing to match key name exposed for `templateUrl` in `View`
  annotation

Closes #1495
2015-04-23 11:04:30 -07:00
afe0e45453 feat(parser): support === and !== operators
Closes #1496

Closes #1500
2015-04-23 20:01:31 +02:00
2e3e41ba64 fix(ListWrapper): follow JS semantics 2015-04-23 09:46:09 +02:00
d74dd1126b cleanup(di): removed dead code 2015-04-22 14:48:53 -07:00
0ff99081bd DEVELOPER.md copyedit
Closes #1275
2015-04-21 17:10:15 -07:00
6f4b6783c0 docs(02_directives): TemplateConfig -> @View
for #1224

Closes #1325
2015-04-21 16:31:25 -07:00
b1bc792b56 BUG FIX: without specification, certain versions of bower install ./app/bower_components...
Closes #1409
2015-04-21 16:31:20 -07:00
d4b8a86509 Updating DEVELOPER.md with nits and grammar fixes.
These are mostly trivial, but I thought I'd fix them while reading through the doc.

Closes #1438
2015-04-21 16:31:16 -07:00
642e7e5c46 fix(benchpress): only print the CV when it is meaningful
When the mean is 0, the coefficient of variation is calculated to be
NaN, which is not meaningful, so instead of printing "+-NaN%", just
don't print the CV at all.

Closes #908

Closes #1444
2015-04-21 16:31:12 -07:00
4650d25a53 chore(package.json): upgrade zone.js to v0.4.3
Closes #1457
2015-04-21 16:30:40 -07:00
7551a28f1a chore: show dart2js package warnings for angular2, benchmarks, examples
Closes #1468
2015-04-21 16:22:49 -07:00
e51a48fe4c Fixed example for EventEmitter
I didn't get a full trace back for my evidence I got from making this example work. EventEmitter was instantiated and assigned to wrong property. Also the mapping should be done using the component property name as it will be obtained via accessor and exposed on the directive (as far as I understood).
2015-04-21 16:22:10 -07:00
22c6c09daf chore(build): run event tests in Node
Closes #1476
2015-04-21 16:21:39 -07:00
e70a2f21dd fix(dom): remove methods is allowed on text nodes as well
Fixes #1473
Closes #1478
2015-04-21 11:56:11 -07:00
97e6fb6835 fix(benchmarks): wait for end of benchmarks 2015-04-21 11:25:07 -07:00
14a7b9f794 fix(jsserve): serve empty favicon to prevent errors in benchmarks
Background: our benchmarks check whether there were errors
in the browser log after they executed.
2015-04-21 11:25:07 -07:00
fa1ec48549 chore(example): fix TODO example on dart
Reflection for Dart was not set up properly for the TODO example,
so it was failing when served on dartium via
gulp serve/examples.dart
2015-04-21 10:17:26 -07:00
f7f06c5ad4 chore: add more type annotations 2015-04-21 08:49:05 -07:00
e23004df52 fix(di): capture original exception in InvalidBindingError
Fixes #1406

Closes #1459
2015-04-21 10:59:44 +02:00
fe70c2647a chore(packaging): bump version to 2.0.0-alpha.20 2015-04-20 17:53:29 -07:00
ada1e642c5 feat(view): add imperative views 2015-04-20 17:18:44 -07:00
817c79ca77 refactor(testability): rename function to get testability
Previously, getting testability was `window.angular2.getTestability`
This was because the plan was to export the API to the window as
angular2. However, the decision was changed to make this just `angular`
in 3177576ad6

To decouple testability from the rest of the Angular API, just make it
one function, `window.getAngularTestability`.
2015-04-20 15:13:09 -07:00
a97a2266d3 feat(change_detection): added async pipe 2015-04-20 14:50:23 -07:00
8b3c808cb0 cleanup: remove an unused type 2015-04-20 14:24:16 -07:00
2d929e73ec cleanup(change_detection): moved pipes-related tests to the pipes dir 2015-04-20 14:24:15 -07:00
681d06386d feat(view): implemented loading component next to existing location 2015-04-20 13:41:10 -07:00
77b31ab42f feat(dart/transform): Add debug transform parameters
Add two transform parameters to aid in debugging the transformer
- `mirror_mode`, with values {`debug`, `none`, and `verbose`}
- `init_reflector`, with values {`true`, `false`}

`mirror_mode`:
- `debug`: Allow reflective access, but log a message if it is used
- `none`: Remove reflective access, `throw` if it is used. Default value
- `verbose`: Allow reflective access, log a stack trace if it is used

`init_reflector`: Whether to generate calls to our generated
`initReflector` code.

These will be useful to reveal areas where the transformer is not generating
appropriate code and to quickly see where reflective accesses occur.

When the pub mode is `transform_dynamic`, we run in MirrorMode.debug
with `init_reflector = false`. This is used for testing purposes.
2015-04-20 12:32:04 -07:00
5b4eb0c6d7 style(dart/transform): Format Dart files in reflection
Run the formatter on some Dart-specific reflection files.
2015-04-20 12:32:04 -07:00
5c25248582 docs(x-ref links): Change links to use dgeni syntax
Closes #1440
2015-04-20 18:45:04 +00:00
64ad74acbe fix(shadowdom): remove unused nodes on redistribute
Previously, light dom nodes that were not used by any content tag
were not removed from a view on redistribute. This lead
to a bug when reusing a view from the view pool, as it
still contained stale reprojected nodes.

Fixes #1416
2015-04-20 11:36:39 -07:00
02997f473a fix(viewFactory): allow empty view cache 2015-04-20 11:36:39 -07:00
abda569b55 docs(dart/transform): Link to the Transform wiki page
Add a link to the Dart Transform wiki page to DEVELOPER.md
2015-04-20 10:14:24 -07:00
447018b54b docs: change primordial injector to platform injector 2015-04-20 16:45:23 +00:00
0a200aff70 chore(doc-gen): fix atScript file reader test
Closes #1458
2015-04-20 17:43:46 +02:00
883e1c1541 feat(events): support preventdefault
Fixes #1039
Closes #1397
2015-04-20 15:20:52 +02:00
aabe83cf63 chore(build): run application tests in Node
Closes #1423
2015-04-20 14:45:18 +02:00
fbd6851860 chore(doc-gen): add ids to members to allow direct linking
You can now write a link to a member of a class by appending the member name
to the class name joined by a hash sign:

```
{@link ControlGroupDirective#addDirective `addDirective`}
```

By default the link will contain the text of the class rather than the member
so you must add it as an inline code text snippet in the link tag.

Closes #1432
2015-04-18 22:06:49 +01:00
d6dae0cc85 Tweak .gitignore file to ignore also packages symlinks. 2015-04-18 12:13:10 -07:00
376d508934 chore(doc-gen): read .es6 files as well as .js when generating docs
Closes #1429
2015-04-18 08:35:38 +01:00
a00cb1de50 feat(Compiler): Make Compiler.buildRenderDirective() static. 2015-04-17 21:57:25 -07:00
56f3429cc9 fix(view): chagned view factory to keep AstWithSource 2015-04-17 17:40:43 -07:00
4943c0f887 fix(view): fixed hydrator to pass the right element index when attaching an event listener 2015-04-17 17:27:12 -07:00
00e2d70f05 refactor(dart/transform): Remove index_static from hello_world
index_static.js & index_static.html are unnecessary in Js and are now
essentially generated via the Dart transformer. The angular
transformer is specified in examples/pubspec.yaml; use pub build to
create a transformed application that does not use dart:mirrors.

Create index_dynamic.js & index_dynamic.html, which are used to test
that the app runs equally well with mirrors and without.

Closes #495
2015-04-17 16:11:48 -07:00
e52d71060f chore(analysis): fix analyzer warning in index_static 2015-04-17 14:01:42 -07:00
01869f9fa8 chore(format): format a TS file 2015-04-17 13:56:13 -07:00
526c51d1a6 fix(facades): fix splice semantics; add test 2015-04-17 13:52:03 -07:00
2b4d30d931 chore(analysis): analyze everything in lib folders recursively; fix existing warnings 2015-04-17 13:52:02 -07:00
3dc4df2ffa chore(analysis): analyze web folders; fix existing warnings 2015-04-17 13:52:02 -07:00
f830cfca12 refactor(view): provide ViewContainers dynamically on any element 2015-04-17 12:35:59 -07:00
eac5c88893 fix(view): fixed hydrator to export the dom element instead of ng element 2015-04-17 12:32:33 -07:00
abfe175c9e doc(VmTurnZone): inline doc
Closes #1427
2015-04-17 18:19:59 +00:00
0fc66daef6 fix(core): typo ComponetRef -> ComponentRef
Closes #1426
2015-04-17 18:19:58 +00:00
5a095bb257 refactor(di): rename ProviderError to BindingError
Closes #1428
2015-04-17 20:17:51 +02:00
de31aca7a7 docs(di): Edits to DI.
Closes #1420
2015-04-17 17:49:12 +00:00
97220dd2ba docs(life_cycle): mark registerWith as @private 2015-04-17 16:25:13 +01:00
e1b0bab9a6 chore(doc-gen): ignore members marked with @private 2015-04-17 16:24:07 +01:00
66a2f9b23a docs(angular2/annotations): convert [...] links to use {@link ...} style inline tags
This is an example of how to link to other code components using the `link`
inline tag.
2015-04-17 14:02:03 +01:00
a8533b2133 chore(doc-gen): add link inline tags
This commit enables links to other docs, such as classes and modules,
via the `{@link CodeIdentifier}` style inline tag.

Dgeni identifies what you are linking to by comparing the identifier to the
aliases for each doc. If no alias matches the identifier then the dgeni
run exits with a missing doc in link error. If more than one alias matches
the identifier then dgeni exits with an ambiguous link error.

In the future we could build in some heuristics for choosing a preferred
doc when the link is ambiguous, such as choosing a public doc over a
non-public doc; and choosing a code component that is in the same module as
the doc where the link is found.

Currently there are two aliases for each API component: its name and its
identier. For example, if the `Directive` class is exported from
`angular2/annotations`, so its aliases are 'Directive' and
`angular2/annotations.Directive`.

There is an issue in the non-public doc generation, which means that it
does not yet have `{@link}` tags implemented. This is that when we re-export
a code component, it gets cloned into another module. This means that a
simple reference to the code component's name will always produce an
ambiguous link. This can be fixed with a heuristic as described above.
Meanwhile you can avoid this by always using the full id of the code
component if it is being re-exported.

Closes #1371
Closes #1421
2015-04-17 14:02:03 +01:00
87ac100c66 docs: add DI to public docs 2015-04-17 03:56:17 +00:00
487c4d23c1 chore: enable chrome browser tests on c9.io 2015-04-17 03:44:32 +00:00
8906cdbab8 chore(build): trigger npm postinstall when npm install is skipped
we temporarily need this because some of our dependencies are being installed via npm postinstall
2015-04-16 16:58:28 -07:00
88963b438f chore(travis): pin npm used to v2.7.4
Since we are currently stuck on node 0.10 (see #1396), this will at least help us avoid
some of the npm bugs present in older version that comes with 0.10.
2015-04-16 16:58:28 -07:00
4fd4a1d15c chore(travis): turn on travis cache for npm dependencies 2015-04-16 16:58:28 -07:00
371c8b8a1c chore(travis): add npm/install-dependencies.sh step in preparation for caching 2015-04-16 16:58:28 -07:00
eb87f5f851 chore(npm): add shrinkwrap to our project 2015-04-16 16:58:28 -07:00
27d227283c chore(npm): remove duplicate fs-extra dependency 2015-04-16 16:58:28 -07:00
ea9d24be31 chore(npm): move tsd update to post install and add tsd version to devDependencies 2015-04-16 16:58:27 -07:00
5408abca68 refactor(change_detection): removed global change detection objects so it is possible to override pipe registry 2015-04-16 15:57:45 -07:00
233cb0f96a feat(view): changed event emitters to be observables 2015-04-16 14:44:14 -07:00
8b28e99373 fix(benchpress): explicitly require navigation to finish before continuing 2015-04-16 14:04:41 -07:00
923d90bce8 refactor(views): clean up creating views in place and extract view_hydrator
Major changes:
- `compiler.compileRoot(el, type)`
  -> `compiler.compileInHost(type) + viewHydrator.hydrateHostViewInPlace(el, view)`
- move all `hydrate`/`dehydrate` methods out of `View` and `ViewContainer` into
  a standalone class `view_hydrator` as private methods and provide new public
  methods dedicated to the individual use cases.

Note: This PR does not change the current functionality, only moves it
into different places.

See design discussion in #1351, in preparation for imperative views.
2015-04-16 11:58:01 -07:00
97fc248e00 cleanup(di): changed an error message to be more descriptive 2015-04-16 11:06:20 -07:00
7bd682bb27 feat(parser): changed parser to parse pipes in the middle of a binding 2015-04-16 10:39:03 -07:00
e927342e58 Read only a single DirectiveMetadata (will be squashed) 2015-04-16 09:11:03 -07:00
ae84eb7462 refactor(dart/transform): Correct Dart analyzer warnings 2015-04-16 09:11:03 -07:00
f89bb8eaf3 Address code review comments 2015-04-16 09:11:03 -07:00
0d0b3a35da test(dart/transform): Add unit tests for DirectiveMetadataReader 2015-04-16 09:11:03 -07:00
cf7bef58b0 feat(dart/transform): Add the DirectiveMetadataReader
Add a class that parses and reads Directive metadata to prepare for
running the Render compiler in the Dart transformer.
2015-04-16 09:11:02 -07:00
c65fd31e86 feat(dart/transform): Detect annotations which extend Injectable or Template.
Create a method that recursively walks imports from an entry point and
determines where classes are registered.

Use this information to determine if a particular annotation implements or
extends Injectable or Template.
2015-04-16 07:17:24 -07:00
6600ac7031 chore: Fix missing analysis for lib and web directories
Pending issue to fix analyzer items in web: https://github.com/angular/angular/issues/1392
2015-04-15 20:58:29 -07:00
957384ceeb fix: Fix issues found by Dart analyzer 2015-04-15 20:58:29 -07:00
d3e391d176 chore(build): run render tests in Node
Closes #1358
2015-04-15 19:51:11 -07:00
0658d5602e chore(doc-gen): ignore exports marked as @private
Closes #1363
2015-04-15 19:50:01 -07:00
458213d055 docs(DEVELOPER.md): mention building JS or Dart selectively
Closes #1375
2015-04-15 19:48:38 -07:00
cd1295a823 Update 01_templates.md
Closes #1373
2015-04-15 19:48:34 -07:00
5d302c504e Update 02_directives.md
Closes #1374
2015-04-15 19:48:31 -07:00
68faddbf5c feat(change_detection): updated handling ON_PUSH detectors so they get notified when their bindings change 2015-04-15 16:21:21 -07:00
dc9c614da2 chore: break out warnings vs hints in build/analyze.dart
give a better report of errors
2015-04-15 15:46:16 -07:00
8c1adabe1c refactor(change_detection): renamed BindingPropagationConfig to ChangeDetectorRef 2015-04-15 12:58:58 -07:00
213dabdceb fix(view): remove dynamic components when the parent view is dehydrated
Also adds a bunch of unit tests for affected parts.

Fixes #1201
2015-04-15 12:53:21 -07:00
6ecaa9aebb feat(change detection): add removeShadowDomChild 2015-04-15 12:53:21 -07:00
cb2e646332 fix(tests): create default spys for all methods on a class 2015-04-15 12:53:20 -07:00
fef1dee7aa fix(dart/transform): Ensure consistent ordering of generated imports
- Linked imports are generated in a consistent order.
- Linked imports are generated immediately after their associated files.
2015-04-15 12:09:51 -07:00
e14543498c fix(build): remove import of gulp-traceur which pulls in a different version of traceur
This lead to build fails.
2015-04-15 11:17:42 -07:00
c25478380c docs(benchpress): add details about normalized mobile environment. 2015-04-15 10:12:13 -07:00
e819e97f9a docs: expose more API to public, document QueryList 2015-04-15 05:10:26 +00:00
f149ae79c6 feat(material): first ng2 material design components 2015-04-14 16:15:35 -07:00
ffe13078e5 feat(bundle): add script to push bundles to code.angularjs.org
Copied over from angular js 1.x.
2015-04-14 14:50:53 -07:00
f0d0fe0801 refactor(change_detection): cleaned up change_detection.js 2015-04-14 14:34:57 -07:00
d630d5baa5 docs(change_detection): document LifeCycle 2015-04-14 14:16:14 -07:00
7cac7c5157 refactor(dart/transform): Correct Dart analyzer warnings
- Fix numerous Dart analyzer warnings we had been ignoring.
- Delete unused `in_progress` dir
2015-04-14 13:41:22 -07:00
aba61f22a6 chore(build): Remove even more obsolete build config values. 2015-04-14 13:38:41 -07:00
8475c63a6a misc(docs): Edits and additions for Forms and Change Detection 2015-04-14 13:34:29 -07:00
2d09f84182 fix(build): Fail the build for certain TS errors. 2015-04-14 11:54:36 -07:00
ef6e0d8eb8 chore(build): remove obsolete html.js, copy.js, srcFolderInsertion. 2015-04-14 11:54:36 -07:00
db97d73c3b feat(build): Move HTML copying into the broccoli task.
This includes all tasks to construct a Dart tree, except for formatting, and
reverse engineers/refactors the various copy tools for added more sanity.
2015-04-14 11:54:31 -07:00
0e3d0fbec6 docs(change_detection): don't annotate exports that are already in public modules
Since `DynamicChangeDetection` and `JitChangeDetection` classes are alreadt in the
public module, they do not need to be annotated with a `@exportAs` tag

Closes #1353
2015-04-14 13:22:41 +01:00
896a1564ef chore(doc-gen): only clone docs that are actually being re-exported to a new module
Closes #1353
2015-04-14 13:20:49 +01:00
8b97cf1479 cleanup(view): changed ComponentRef to contain ElementRef instead of extending it 2015-04-13 19:30:00 -07:00
b5c9f9ed9b cleanup(element_injector): added a missing test 2015-04-13 19:30:00 -07:00
bda120d862 chore(pub): run build/pubspec.dart before build/analyzer.dart 2015-04-13 18:34:34 -07:00
3177576ad6 feat(bundle): adds a self-executing dev bundle (SFX). 2015-04-13 18:05:53 -07:00
896a0457f8 refactor(build): Better encapsulate the broccoli builder. 2015-04-13 17:28:00 -07:00
caf8e2723d chore(build): remove obsolte gulp tasks 2015-04-13 16:52:08 -07:00
0107543a33 chore(build): move build/transformCJSTests task to broccoli 2015-04-13 16:52:08 -07:00
7d29636087 chore(packaging): bump version to 2.0.0-alpha.19 2015-04-13 16:15:12 -07:00
70433e6b73 chore(build): use a Filter plugin to write the dest folder.
This lets broccoli keep the dest folder up-to-date in 'watch' mode,
so we should be able to use that for Karma.
2015-04-13 15:51:33 -07:00
3667854a8f refactor(di): move all binding resolution logic into injector.js 2015-04-13 15:06:44 -07:00
c5c1c9e38e feat(docs): more docs on binding resolution 2015-04-13 15:06:44 -07:00
308823b6ea perf(view): use pre-resolved bindings for child injector init
Creating a child injector from pre-resolved bindings (if any) is an
order of magnitude faster.
2015-04-13 15:06:44 -07:00
c05bad381c perf(benchmark): measure Injector init from resolved bindings 2015-04-13 15:06:44 -07:00
4a961f4ecb feat(di): provide two ways to create an injector, resolved and unresolved
Add two factory static functions to Injector: resolveAndCreate and
fromResolvedBindings.

We want to avoid resolution and flattening every time we create a new
injector. This commit allows the user to cache resolved bindings and
reuse them.
2015-04-13 15:06:43 -07:00
6c8398df9b fix(di): refactor bindings to support Dart annotations 2015-04-13 15:06:43 -07:00
ff6e7754ae chore(build): gulp test.unit.cjs broken the second run
Fixes #1311

Closes #1333
2015-04-13 21:44:54 +00:00
28ba179e31 feat: intiial commit for angular 2 dart analysis
Initial commit for analysis support to Angular 2 Dart
2015-04-13 13:50:29 -07:00
b96e560c8d feat(events): add support for global events
Fixes #1098
Closes #1255
2015-04-13 22:35:36 +02:00
7c95cea3a8 chore(bundle): avoid imports in "global" format
If an "empty" file (like angular2/template.js) is imported
it is auto-detected as the one using "global" format by the
system builder. This is incorrect as the entire angular2 build
output is in the ES6 format.

Removing empty import till it has some content.

Closes #1329
2015-04-13 21:24:56 +02:00
34501aaae6 chore(build): move more broccoli support inside the TypeScript boundary 2015-04-13 12:24:28 -07:00
dbfc4c1c16 chore(build): inline Traceur options just like we do everywhere 2015-04-13 11:37:18 -07:00
301863b105 chore(build): transpile only e2e test code into cjs 2015-04-13 11:31:14 -07:00
ef8dc40492 chore(build): correct comment 2015-04-13 11:31:14 -07:00
6dbd4d969b chore(build): create es5build.js only for files that will become es6 npm packages 2015-04-13 11:31:14 -07:00
3dd0ac1f0a chore(build): move dart broccoli tree to make-broccoli-tree 2015-04-13 11:20:59 -07:00
5b42272365 docs(DEVELOPER.md): add bower install info
Closes #1310
2015-04-13 20:15:29 +02:00
1f6c6dbf2f chore(build): refactor broccoli trees to generate them in order to reduce duplication 2015-04-13 10:07:31 -07:00
0012caa4d5 perf(benchmarks): measure cost of Injector init with a variety of bindings 2015-04-13 10:02:13 -07:00
8499cf84c3 fix(shadow_dom): redistribute light dom when a dynamic component is attached.
Fixes #1077
Closes #1315
2015-04-13 09:23:52 -07:00
daf0f472b3 feat(build): enforce formatting of some files.
Our style guide includes formatting conventions. Instead of wasting time in reviewing PRs discussing things like indenting, and to avoid later deltas to fix bad formatting in earlier commits, we want to enforce these in the build.
The intent in this change is to fail the build as quickly as possible in travis, so those sending a PR immediately know they should run clang-format and update their commit. When running locally, we want users to know about formatting, but they may not want to act on it immediately, until they are done working. For this reason, it is only a warning outside of the continuous build.
This is done by having a check-format task which should run on most local builds, and an enforce-format task only run by travis.
2015-04-11 18:39:28 -07:00
a3decad4c2 feat(build): Use broccoli for ts2dart transpilation. 2015-04-11 16:26:44 -07:00
7b790a3369 chore(build): fix check-format 2015-04-11 12:40:05 -07:00
e18920884e chore(DEVELOPER.md): Update Dart SDK Version
Package angular requires SDK version >=1.9.0 <2.0.0

Closes #1318
2015-04-11 12:06:50 +02:00
6f8fef4f13 feat(bootstrap): changed bootstrap to return ComponentRef 2015-04-10 18:14:59 -07:00
e295940833 cleanup(docs): Edited API docs 2015-04-10 18:02:10 -07:00
2ed7622239 chore(build): compile the .ts broccoli tools.
This avoids having to check in the compiled .js files.
2015-04-10 17:29:32 -07:00
6ce085a21a feat(benchmark): make view cache a parameter to the tree benchmark 2015-04-10 16:57:46 -07:00
e34146fc14 fix(view_factory): fix caching of views
Previous implementation had bugs, and did not cache per ProtoView.
2015-04-10 16:57:45 -07:00
4e2316c742 feat(build): Add rudimentary TS typings for broccoli. 2015-04-10 16:37:24 -07:00
785900f722 DEVELOPER.md copyedit 2015-04-10 23:34:06 +00:00
5ce5a87abe style: add more type info to Dart BrowserAdapter 2015-04-10 23:34:06 +00:00
afe5465862 add return types for indexOf and lastIndexOf
closes #1277
2015-04-10 23:34:05 +00:00
678d541da7 refactor(compiler): add control.ignoreCurrentElement() to skip the current element
relates to #808
2015-04-10 23:34:05 +00:00
f0477e164a chore(build): add typescript to the cjs build.
Refactor the file extension logic in traceur plugin to simplify
2015-04-10 15:22:03 -07:00
b5002fb46b docs(test_lib/test_injector): fix invalid jsdoc type
chore(doc-gen): capture docs for modules from comments

Closes #1258

docs(*): add module description jsdoc tags
docs(*): add @public tag to public modules
chore(doc-gen): fix overview-dump template
The template was referencing an invalid property
chore(doc-gen): use `@exportedAs` and `@public` rather than `@publicModule`

This commit refactors how we describe components that are re-exported in another
module. For example the "public" modules like `angular/angular` and `angular/annotations`
are public but they only re-export components from "private" modules.

Previously, you must apply the `@publicModule` tag to a component that was to be
re-exported. Applying this tag caused the destination module to become public.

Now, you specify that a module is public by applying the `@public` tag and then
you can "re-export" components to other modules by applying the `@exportedAs`
giving the name of the module from which the component will be re-exported.
tag. This tag can be used multiple times on a single component, allowing the
component to be exported on multiple modules.

docs(*): rename `@publicModule` to `@exportedAs`

The `@publicModule` dgeni tag has been replaced by the `@exportedAs`
dgeni tag on components that are to be re-exported on another module.

Closes #1290
2015-04-10 22:00:41 +00:00
82127571b5 feat(dart/transform): Use the Dart transformer for benchmarks
Remove explicit generation of reflection information in benchmark code
and generate it with the transformer.
2015-04-10 14:01:55 -07:00
f6e9d1f857 feat(dart/transform): Fix handling of Dart keywords
Use `package:analyzer`'s list of Dart keywords to ensure we are properly
reporting usages of Dart keywords as runtime errors.
2015-04-10 13:43:11 -07:00
2cab7c79c3 feat(dart/transform): Allow multiple transformer entry points
- Allow the user to specify multiple entry points to an app.
- Allow the Angular 2 transformer to run without explicit entry points to
generate necessary setters & getters on built-in directives like `For`
and `If`.

Closes #1246
2015-04-10 13:41:26 -07:00
bba849909c fix(dart/transform): Gracefully handle log calls before init
- Lazily create and use a logger that prints instead of `throw`ing.
- Use this logger in unit tests.
2015-04-10 13:41:26 -07:00
cac74c73e1 feat(dart/transform): Add stub implementations to Html5LibAdapter
Stub out some methods used in the `CompilerPipeline`.
2015-04-10 13:41:26 -07:00
f375dbd013 feat(dart/transform): Mark Compiler as Injectable
Necessary to allow runtime access via the `Injector`
2015-04-10 13:41:26 -07:00
ea58ef85fc chore(build): move the js.prod build over to broccoli 2015-04-10 13:11:58 -07:00
bf7933714a chore(rename): rename View and Template concepts for #1244 2015-04-10 12:00:37 -07:00
564477b8a0 chore(build): migrate build.js.cjs to broccoli.
This doesn't do the typescript part of the build yet. Also there is a bit
of hackiness left to resolve in a follow-up change.
2015-04-10 11:39:48 -07:00
7e2c04e805 feat: add class directive to a list of directives
Closes #1292
2015-04-10 18:33:51 +02:00
8fa1539bac feat(keyEvents): support for <div (keyup.enter)="callback()">
This commit adds a plugin for the event manager, to allow a key name to
be appended to the event name (for keyup and keydown events), so that
the callback is only called for that key.

Here are some examples:
 (keydown.shift.enter)
 (keyup.space)
 (keydown.control.shift.a)
 (keyup.f1)

Key names mostly follow the DOM Level 3 event key values:
http://www.w3.org/TR/DOM-Level-3-Events-key/#key-value-tables

There are some limitations to be worked on (cf details
in https://github.com/angular/angular/pull/1136) but for now, this
implementation is reliable for the following keys (by "reliable" I mean
compatible with Chrome and Firefox and not depending on the keyboard
layout):
- alt, control, shift, meta (those keys can be combined with other keys)
- tab, enter, backspace, pause, scrolllock, capslock, numlock
- insert, delete, home, end, pageup, pagedown
- arrowup, arrowdown, arrowleft, arrowright
- latin letters (a-z), function keys (f1-f12)
- numbers on the numeric keypad (but those keys are not correctly simulated
by Chromedriver)

There is a sample to play with in examples/src/key_events/.

close #523
close #1136
2015-04-10 13:29:27 +02:00
f45281a10a feat(view): generalized loading of dynamic components 2015-04-09 22:15:42 -07:00
e9f70293ac feat(query): adds initial implementation of the query api.
Queries allow a directive to inject a live list of directives of a given
type from its LightDom. The injected list is Iterable (in JS and Dart).
It will be Observable when Observables are support in JS, for now it
maintains a simple list of onChange callbacks API.

To support queries, element injectors now maintain a list of
child injectors in the correct DOM order (dynamically updated by
viewports).

For performance reasons we allow only 3 active queries in an injector
subtree. The feature adds no overhead to the application when not
used. Queries walk the injector tree only during dynamic view
addition/removal as triggered by viewport directives.

Syncs changes between viewContainer on the render and logic sides.

Closes #792
2015-04-09 19:07:19 -07:00
61cb99ea42 refactor(change_detection): removed directive and binding mementos 2015-04-09 18:56:19 -07:00
5408a9a72d cleanup(change_detection): removed dead code 2015-04-09 18:56:19 -07:00
22c1a0d030 fix(benchmarks): Stop working around a Traceur bug. 2015-04-09 18:03:27 -07:00
8c3007e4b5 fix(build): Remove unused done function arguments.
gulp only requires receiving a done argument if a task is not returning
a stream. Doing both is unnecessary and confusing.
2015-04-09 18:03:27 -07:00
838aa2aaa9 fix(ts2dart): Adjust to new ts2dart API. 2015-04-09 18:03:27 -07:00
3285ffba16 fix(traceur): Fix a couple of unsupported or incorrect tests. 2015-04-09 18:03:27 -07:00
17e8857efc feat(dart): Use ts2dart for transpilation in Karma Dart. 2015-04-09 18:03:27 -07:00
226cbc7db3 feat(dart): Use ts2dart for transpilation.
This switches all transpilation over from using Traceur to using ts2dart, based
on the TypeScript tool chain. Transpilation is a bit slow due to issues with
the gulp integration, but that should be easily fixable once we move to
broccoli.
2015-04-09 18:03:27 -07:00
cc7c7b3321 fix(build): Don't include rtts in the dart build.
The module name actually does not include a trailing slash, so the
folder would show up and be included in the dart pubbuild.
2015-04-09 18:03:26 -07:00
70cea03b4b fix(build): Only return directories from subDirs() 2015-04-09 18:03:26 -07:00
a027912891 cleanup(change_detection): fixed ChangeDetector interface 2015-04-09 17:30:04 -07:00
3bdf669ddf cleanup(change_detection): removed dead code 2015-04-09 17:30:04 -07:00
b94b04c074 chore(build): Migrate remaining tasks under build.js.dev to broccoli. 2015-04-09 14:09:38 -07:00
cfc5dd830c perf(build): use patched broccoli-funnel version
see: https://github.com/broccolijs/broccoli-funnel/pull/22
2015-04-09 12:48:51 -07:00
a3097aaf05 chore(build): Migrate build.js.dev fully to broccoli.
The previous change did the ES6 transpile, now we add ES5.
The sourcemaps are broken, but were also broken previously. We'll address that separately.
2015-04-09 11:00:47 -07:00
69c3bff086 feat(change_detection): updated change detection to update directive directly, without the dispatcher 2015-04-08 22:14:50 -07:00
50098767fc refactor(render): use render layer fully
Introduces angular2/src/core/compiler/ViewFactory which
extracts ProtoView.instantiate and replaces ViewPool.

Note: This is a work in progress commit to unblock other commits.
There will be follow ups to add unit tests, remove TODOs, …
2015-04-08 20:51:31 -07:00
de581ea8b3 chore(build): Move broccoli support to own module.
Add support for multiple pipelines in different Brocfile's.
2015-04-08 10:41:42 -07:00
9f8a9c6fc7 chore(doc-gen): ensure all public exports are rendered in public_docs
Closes #1222
2015-04-08 18:58:44 +02:00
ad083ed28f fix(repo): .gitignore the broccoli tmp dir 2015-04-08 09:57:24 -07:00
105ba30ce9 chore(doc-gen): improve method signature formatting
Re-use the preformatting from the source code to layout method signatures
more cleanly.
2015-04-08 17:11:34 +02:00
ee8bf0b3c0 chore(doc-gen): HTML escape method signatures
Closes #1249
Closes #1257
2015-04-08 17:11:34 +02:00
41262f4265 feat(Ruler): introduce Ruler service
Closes #1089

Closes #1253
2015-04-08 11:04:42 +02:00
c349eb4fa4 fix(bundles): remove work-around rx.js module detection.
Updates rx to the newest version, because a fix is needed.

Closes #1245
2015-04-08 11:01:01 +02:00
ca958464c4 refactor(render): create and store render ProtoViewRef in every app ProtoView
Needed to change Renderer.mergeChildComponentProtoViews to not create
new ProtoViews to be able to deal with cyclic references.

This commit is part of using the new render layer in Angular.
2015-04-07 20:27:25 -07:00
d6003ee0ab chore(build): Add traceur transpiler for broccoli.
This exactly reproduces the output tree from one of the gulp tasks, which is now removed.
Next step is to migrate another sibling task to broccoli.
2015-04-07 16:38:02 -07:00
bc248e9a15 fix(build) use relative path in file property inside sourcemap 2015-04-07 12:53:06 -07:00
42c0171b40 chore(dart/transform): Create targets for serving transformed Dart code
- Allow pub (build|serve) to specify mode
- Update pubbuild.js & pubserve.js to allow the caller to provide a `mode` value.
- Update settings to allow the di benchmark to be transformed to run statically.
2015-04-07 10:57:01 -07:00
1a99090b45 chore(doc-gen): don't show Members heading if no members
Closes #1248
2015-04-07 09:23:19 +02:00
b7eea4f577 docs(directives): add # to for directive microsyntax example 2015-04-07 08:44:32 +02:00
9c62b5867e benchmark(change_detection): added a new set of benchmarks measuring updating properties 2015-04-06 18:13:20 -07:00
2560af731a refactor(dart): use Map instead of HashMap
Closes #1202
2015-04-06 17:16:54 +00:00
86211eb5f0 doc(directives): add inline documentation
Closes #1240
2015-04-06 17:11:23 +00:00
a3387b7f48 fix(di): allow injecting static attrs without type annotations
Closes #1226
2015-04-06 12:33:37 +02:00
94a48e8640 test(VmTurnZone): provide a stub VmTurnZone for CJS tests 2015-04-06 10:30:17 +02:00
d8aeb40b49 reafactor(XHR): rename XHRMock to MockXHR for consistency 2015-04-06 10:30:16 +02:00
52c55d0ee8 test: convert to using TestBed 2015-04-06 10:30:16 +02:00
438c2b31e4 test(TestBed): initial implementation 2015-04-06 10:30:16 +02:00
57e308dd46 test(MockTemplateResolver): allow directive overriding 2015-04-06 10:07:50 +02:00
c922b5a112 docs(annotations): fix some typos, align docs with code
Closes #1227
2015-04-04 12:23:01 +02:00
d552303cd5 docs(02_directives.md): foreach -> for
Closes #1235
2015-04-04 10:32:53 +02:00
1d4d18d9db refactor(render): user render compiler 2015-04-03 23:41:00 -07:00
069bbf3ed0 docs(02_directives.md): Fixes variable name for visibility in Components example 2015-04-03 14:18:15 -07:00
a4a2d4e56d chore: allow latest stack_track package 2015-04-03 14:18:14 -07:00
d77f409093 chore: analyzer fixes for Dart transformer 2015-04-03 14:18:14 -07:00
25c709c58e fix(angular2): export PrivateComponent{Loader,Location} in angular2/core 2015-04-03 14:18:14 -07:00
bc909d1d0f refactor(dart/transform): Minor renames
Rename `setupReflection` => `initReflector`
Rename `TemplateComplier` => `TemplateCompiler`

Closes #1180
2015-04-03 13:16:24 -07:00
a6736ff9f2 perf(change detection): Assign this.locals in change detector ctor
Set `this.locals = null;` in the ctor of generated change detector
classes to prevent the class "shape" from changing on `hydrate`.
2015-04-03 12:23:47 -07:00
894a0f0ee5 chore(ts): duplicate the .es6 files in the facade directory to TypeScript.
Adds a gulp task which builds the .ts files (in the cjs build only).
The new files have extension .ts since they are now valid typescript.
Unfortunately until Typescript can emit System.require, we have to keep the old .es6 version
so traceur works inside the Karma preprocessor. This should be fixed soon.
2015-04-03 09:35:06 -07:00
abea92af59 refactor(change_detection): call onChange from the change detector 2015-04-02 21:22:42 -07:00
bcbed2812d feat(bundle): work-around rx.all.js bundle issue.
Adds long-stack-trace-zone into the dev build. Turn off source maps
until proper concatination of them is added.
2015-04-02 19:54:07 -07:00
c0b04ca0bc feat(gulp): adds System.register bundle task. 2015-04-02 19:54:06 -07:00
86dc3e5b07 docs: create public API surface
Closes #1181
2015-04-02 23:23:39 +00:00
c1aa65239e refactor(render): move services to render folder
property_setter_factory
selector
style_inliner
style_url_resolver
shadow_css
2015-04-02 14:40:49 -07:00
be5ccf6957 refactor(render): delete copies files so we add them via moves 2015-04-02 14:24:55 -07:00
09067ebdc5 fix(build): Require gulp-ts2dart at least at 1.0.6.
This fixes the build by pulling in a later version that correctly ignores the .es6 files.
2015-04-02 13:13:47 -07:00
08697e71fa chore(package.json): update madge to v0.5.0
Closes #1211
2015-04-02 22:08:04 +02:00
90d9a1df3f fix(IE11): first fixes
Closes #1179
2015-04-02 22:06:21 +02:00
a96c149793 chore(gulp): Stop copying .cjs files to the dist folder
They're already transpiled by the build/transpile.js.cjs task
2015-04-02 20:51:16 +02:00
1037cef22e refactor(render): misc minor fixes 2015-04-02 20:50:05 +02:00
09948f4403 feat(dart/transform): Add a di transformer
Add a transformer for `di` which generates `.ng_deps.dart` files for all
`.dart` files it is run on. These `.ng_deps.dart` files register
metadata for any `@Injectable` classes.

Fix unit tests for changes introduced by the di transformer.

When using `pub (build|serve) --mode=ngstatic`, we will also generate
getters and setters, parse templates, and remove import of `dart:mirrors`
in the Angular transform. Because this is still relatively immature, we
use the mode to keep it opt-in for now.

Closes #700
2015-04-02 11:06:33 -07:00
788461b7e2 feat(di): Mark objects @Injectable
Allow `PrivateComponentLoader`, `Testability`, and `TestabilityRegistry` to be injected.
2015-04-02 11:02:26 -07:00
4f56628566 refactor(render): move services to right location
core/compiler/events -> render/dom/events
core/compiler/url_resolver -> services/url_resolver
core/compiler/xhr/* -> services/*
2015-04-02 10:35:27 -07:00
bcbf1ccc68 refactor(render): remove duplicate files to prepare for move
Remove first so Github shows the files as being moved instead of copied and deleted.
2015-04-02 10:35:27 -07:00
ae30d7ba40 fix(di): allow injecting event emitter fns without specifying type annotation
Fixes #965

Closes #1155
2015-04-02 19:07:49 +02:00
9adf41ca2d fix(build) Add a .tsdrc file for github rate limiting.
See https://github.com/DefinitelyTyped/tsd#tsdrc
2015-04-02 10:05:37 -07:00
1d79d534d9 test(selector): add tests with multiple attributes
Fixes #1025
Closes #1117
2015-04-02 18:06:44 +02:00
60e4197026 feat(tooling): Add a .clang-format for automated JavaScript formatting. 2015-04-02 08:44:34 -07:00
2fabca77b9 test(Travis): use test.dart for Dart tests 2015-04-02 13:12:59 +02:00
47542b0cb0 fix(build): don’t read out chrome perflogs during e2e tests
We do this as we are seeing flakes in Chrome with ECONNREFUSED.

Also reuses the same browser window.

Also reenables the infinite scroll benchmark

Closes #1137
2015-04-01 17:09:26 -07:00
6c60c3e547 feat(render): add initial implementation of render layer 2015-04-01 16:50:22 -07:00
814d389b6e chore(gulp): add typescript transpilation tasks 2015-04-01 15:01:27 -07:00
e81e5fb2b9 feat(testability): add an initial scaffold for the testability api
Make each application component register itself onto the testability
API and exports the API onto the window object.
2015-04-01 13:54:06 -07:00
f68cdf3878 chore(ts): introduce some TypeScript type declarations.
This uses tsd to fetch the typings from another git repo. I've forked the DefinitelyTyped repo because some typings we use are not available upstream.
We should probably fork it in the Angular org, so everyone on the team has commit access to our DefinitelyTyped fork.
2015-04-01 12:01:45 -07:00
91e0e9e1dd chore(ts): Patch traceur's type module only when targetting es6 output. 2015-04-01 10:39:06 -07:00
59c1299168 fix(tests): add missing ;s 2015-04-01 15:30:46 +02:00
27c6afbeb4 chore(doc-gen): add temporary dump of all API docs
Remove unwanted < character
2015-04-01 10:24:33 +01:00
514ba54282 feat(change_detection): added changeDetection to Component 2015-03-31 20:54:44 -07:00
a11f683e7b chore(ts): Don't mask the Regexp builtin.
Doing so makes it impossible to compile with TypeScript, since it conflicts with the shape of the Regexp global var defined in the standard lib.
2015-03-31 19:20:21 -07:00
b65b145122 refactor(view): refactored DirectiveMemento to expose properties in a consistent way 2015-03-31 18:26:58 -07:00
982bb8b01d fix(forms): fixed a directive selector 2015-03-31 17:45:38 -07:00
eb7b7581ca fix(build): Actually code in the subset of JS that Traceur-Dart supports. 2015-03-31 16:08:49 -07:00
adab6c0728 chore(doc-gen): add temporary dump of all API docs
Accessible at `angular/dist/public_docs/overview-dump.html`
2015-03-31 22:12:41 +01:00
609201e109 chore(doc-gen): add method signatures to members and functions
Closes https://github.com/angular/dgeni/issues/124
2015-03-31 22:12:41 +01:00
54a4e4a67c fix(dart): The Traceur dart transpiler doesn't support shorthand syntax. 2015-03-31 13:17:56 -07:00
aca4604879 feat(CSSClass): support binding to classList
Closes #876
2015-03-31 21:53:24 +02:00
48811cd805 doc(lifecycle): minor fixes 2015-03-31 21:12:37 +02:00
136f64f4ac fix(dart): don't instantiate abstract directive.
Directive is an abstract class, so it should not
be instantiated directly in tests.
2015-03-31 11:38:59 -07:00
123ee8e06f feat(dom): add replaceChild to DOM adapter 2015-03-31 09:54:41 -07:00
a55efbd8b8 feat(perf): add Angular2 implementation of largetable benchmark from AngularJS 1.x 2015-03-31 09:54:41 -07:00
7bf9525353 fix(benchmark_util): remove strict equality check from getStringParameter
Transpiled dart code was using identical() method to compare, which checks reference
equality, even for strings.
2015-03-31 09:54:41 -07:00
3915e1b242 docs(annotations): Added new text 2015-03-30 17:19:58 -07:00
ed5975d3e5 test(dart/transform): Add unit tests for url-linked templates
Test expression and method generation from url-linked templates.
2015-03-30 14:49:31 -07:00
1a788e6b0d feat(dart/transform): Parse url values in Templates
When a `Template` annotation declares a `url` value, parse it to
generate `getter`s, `setter`s, and `method`s which will it needs to
access reflectively.
2015-03-30 14:49:31 -07:00
d822793229 fix(test): add a test for @PropertySetter on a class with a dash
Closes #1113
Fixes #1099
2015-03-28 16:17:43 +01:00
b46d0bc48c docs(annotations): fix typo, align docs with code
Closes #1045
2015-03-28 15:39:50 +01:00
65320126c2 docs(directives): fix HTML in an example
Closes #1115
2015-03-28 15:37:11 +01:00
c63b3164bd fix(build): add package.json again to the copy files for js 2015-03-27 17:34:26 -07:00
dbffa88dc2 chore(release): bump version to 2.0.0-alpha.18
For docs
2015-03-27 17:16:22 -07:00
8c5d9d372f fix(build): publish docs as well and correct bench press docs 2015-03-27 16:47:52 -07:00
1887 changed files with 173906 additions and 52907 deletions

3
.bowerrc Normal file
View File

@ -0,0 +1,3 @@
{
"directory" : "bower_components"
}

3
.clang-format Normal file
View File

@ -0,0 +1,3 @@
Language: JavaScript
BasedOnStyle: Google
ColumnLimit: 100

6
.gitattributes vendored
View File

@ -1,5 +1,9 @@
# Auto detect text files and perform LF normalization
* text=auto
# JS files must always use LF for tools to work
# JS and TS files must always use LF for tools to work
*.js eol=lf
*.ts eol=lf
# Must keep Windows line ending to be parsed correctly
scripts/windows/packages.txt eol=crlf

39
.github/ISSUE_TEMPLATE.md vendored Normal file
View File

@ -0,0 +1,39 @@
<!--
IF YOU DON'T FILL OUT THE FOLLOWING INFORMATION WE MIGHT CLOSE YOUR ISSUE WITHOUT INVESTIGATING
-->
**I'm submitting a ...** (check one with "x")
```
[ ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
```
**Current behavior**
<!-- Describe how the bug manifests. -->
**Expected behavior**
<!-- Describe what the behavior would be without the bug. -->
**Minimal reproduction of the problem with instructions**
<!--
If the current behavior is a bug or you can illustrate your feature request better with an example,
please provide the *STEPS TO REPRODUCE* and if possible a *MINIMAL DEMO* of the problem via
https://plnkr.co or similar (you can use this template as a starting point: http://plnkr.co/edit/tpl:AvJOMERrnz94ekVua0u5).
-->
**What is the motivation / use case for changing the behavior?**
<!-- Describe the motivation or the concrete use case -->
**Please tell us about your environment:**
<!-- Operating system, IDE, package manager, HTTP server, ... -->
* **Angular version:** 2.0.X
<!-- Check whether this is still an issue in the most recent Angular version -->
* **Browser:** [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
<!-- All browsers where this could be reproduced -->
* **Language:** [all | TypeScript X.X | ES6/7 | ES5]
* **Node (for AoT issues):** `node --version` =

36
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@ -0,0 +1,36 @@
**Please check if the PR fulfills these requirements**
- [ ] The commit message follows our guidelines: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit
- [ ] Tests for the changes have been added (for bug fixes / features)
- [ ] Docs have been added / updated (for bug fixes / features)
**What kind of change does this PR introduce?** (check one with "x")
```
[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:
```
**What is the current behavior?** (You can also link to an open issue here)
**What is the new behavior?**
**Does this PR introduce a breaking change?** (check one with "x")
```
[ ] Yes
[ ] No
```
If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...
**Other information**:

29
.gitignore vendored
View File

@ -1,26 +1,27 @@
# Dont commit the following directories created by pub.
/dist/
packages/
.buildlog
node_modules
bower_components
.pub
.DS_STORE
# Or the files created by dart2js.
*.dart.js
*.dart.precompiled.js
*.js_
*.js.deps
*.js.map
/dist/
node_modules
bower_components
# Include when developing application packages.
pubspec.lock
.c9
.idea/
.settings/
*.swo
modules/.settings
.vscode
modules/.vscode
# Don't check in secret files
*secret.js
/docs/bower_components/
# Ignore npm debug log
npm-debug.log
# build-analytics
.build-analytics
# rollup-test output
/modules/rollup-test/dist/

1
.nvmrc Normal file
View File

@ -0,0 +1 @@
6.6.0

View File

@ -1,37 +1,51 @@
language: node_js
sudo: false
node_js:
- '0.10'
- '6.6.0'
addons:
# firefox: "38.0"
apt:
sources:
# needed to install g++ that is used by npms's native modules
- ubuntu-toolchain-r-test
packages:
- g++-4.8
branches:
except:
- g3_v2_0
cache:
directories:
- ./node_modules
- ./.chrome/chromium
env:
global:
- KARMA_BROWSERS=DartiumWithWebPlatform
- E2E_BROWSERS=Dartium
- LOGS_DIR=/tmp/angular-build/logs
- ARCH=linux-x64
# GITHUB_TOKEN_ANGULAR
# This is needed for the e2e Travis matrix task to publish packages to github for continuous packages delivery.
- secure: "fq/U7VDMWO8O8SnAQkdbkoSe2X92PVqg4d044HmRYVmcf6YbO48+xeGJ8yOk0pCBwl3ISO4Q2ot0x546kxfiYBuHkZetlngZxZCtQiFT9kyId8ZKcYdXaIW9OVdw3Gh3tQyUwDucfkVhqcs52D6NZjyE2aWZ4/d1V4kWRO/LMgo="
matrix:
- MODE=js DART_CHANNEL=dev
- MODE=dart DART_CHANNEL=stable
- MODE=dart DART_CHANNEL=dev
# Order: a slower build first, so that we don't occupy an idle travis worker waiting for others to complete.
- CI_MODE=js
- CI_MODE=e2e
- CI_MODE=saucelabs_required
- CI_MODE=browserstack_required
- CI_MODE=saucelabs_optional
- CI_MODE=browserstack_optional
matrix:
fast_finish: true
allow_failures:
- env: "CI_MODE=saucelabs_optional"
- env: "CI_MODE=browserstack_optional"
install:
- ./scripts/ci-lite/install.sh
before_install:
- export DISPLAY=:99.0
- export GIT_SHA=$(git rev-parse HEAD)
- ./scripts/ci/init_android.sh
- ./scripts/ci/install_dart.sh ${DART_CHANNEL} ${ARCH}
- sh -e /etc/init.d/xvfb start
- if [[ -e SKIP_TRAVIS_TESTS ]]; then { cat SKIP_TRAVIS_TESTS ; exit 0; } fi
before_script:
- mkdir -p $LOGS_DIR
script:
- ./scripts/ci/build_and_test.sh ${MODE}
- ./scripts/ci-lite/build.sh && ./scripts/ci-lite/test.sh
after_script:
- ./scripts/ci/print-logs.sh
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/1ef62e23078036f9cee4
on_success: change # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: false # default: false
slack:
secure: EP4MzZ8JMyNQJ4S3cd5LEPWSMjC7ZRdzt3veelDiOeorJ6GwZfCDHncR+4BahDzQAuqyE/yNpZqaLbwRWloDi15qIUsm09vgl/1IyNky1Sqc6lEknhzIXpWSalo4/T9ZP8w870EoDvM/UO+LCV99R3wS8Nm9o99eLoWVb2HIUu0=
- ./scripts/ci-lite/cleanup.sh

4223
CHANGELOG.md Normal file

File diff suppressed because it is too large Load Diff

34
COMMITTER.md Normal file
View File

@ -0,0 +1,34 @@
# Pushing changes into the Angular 2 tree
Please see [Using git with Angular repositories](https://docs.google.com/document/d/1h8nijFSaa1jG_UE8v4WP7glh5qOUXnYtAtJh_gwOQHI/edit)
for details about how we maintain a linear commit history, and the rules for committing.
As a contributor, just read the instructions in [CONTRIBUTING.md](CONTRIBUTING.md) and send a pull request.
Someone with committer access will do the rest.
## The `PR: merge` label and `presubmit-*` branches
We have automated the process for merging pull requests into master. Our goal is to minimize the disruption for
Angular committers and also prevent breakages on master.
When a PR has `pr_state: LGTM` and is ready to merge, you should add the `pr_action: merge` label.
Currently (late 2015), we need to ensure that each PR will cleanly merge into the Google-internal version control,
so the caretaker reviews the changes manually.
After this review, the caretaker adds `zomg_admin: do_merge` which is restricted to admins only.
A robot running as [mary-poppins](https://github.com/mary-poppins)
is notified that the label was added by an authorized person,
and will create a new branch in the angular project, using the convention `presubmit-{username}-pr-{number}`.
(Note: if the automation fails, committers can instead push the commits to a branch following this naming scheme.)
When a Travis build succeeds for a presubmit branch named following the convention,
Travis will re-base the commits, merge to master, and close the PR automatically.
Finally, after merge `mary-poppins` removes the presubmit branch.
## Administration
The list of users who can trigger a merge by adding the `zomg_admin: do_merge` label is stored in our appengine app datastore.
Edit the contents of the [CoreTeamMember Table](
https://console.developers.google.com/project/angular2-automation/datastore/query?queryType=KindQuery&namespace=&kind=CoreTeamMember)

View File

@ -1,6 +1,6 @@
# Contributing to Angular 2
# Contributing to Angular
We would love for you to contribute to Angular 2 and help make it even better than it is
We would love for you to contribute to Angular and help make it even better than it is
today! As a contributor, here are the guidelines we would like you to follow:
- [Code of Conduct](#coc)
@ -17,61 +17,59 @@ Help us keep Angular open and inclusive. Please read and follow our [Code of Con
## <a name="question"></a> Got a Question or Problem?
If you have questions about how to *use* Angular, please direct them to the [Google Group][angular-group]
discussion list or [StackOverflow][stackoverflow]. We are also available on [Gitter][gitter].
Please, do not open issues for the general support questions as we want to keep GitHub issues for bug reports and feature requests. You've got much better chances of getting your question answered on [StackOverflow](stackoverflow.com/questions/tagged/angular) where the questions should be tagged with tag `angular`.
## <a name="issue"></a> Found an Issue?
If you find a bug in the source code or a mistake in the documentation, you can help us by
StackOverflow is a much better place to ask questions since:
- there are thousands of people willing to help on StackOverflow
- questions and answers stay available for public viewing so your question / answer might help someone else
- StackOverflow's voting system assures that the best answers are prominently visible.
To save your and our time we will be systematically closing all the issues that are requests for general support and redirecting people to StackOverflow.
If you would like to chat about the question in real-time, you can reach out via [our gitter channel][gitter].
## <a name="issue"></a> Found a Bug?
If you find a bug in the source code, you can help us by
[submitting an issue](#submit-issue) to our [GitHub Repository][github]. Even better, you can
[submit a Pull Request](#submit-pr) with a fix.
## <a name="feature"></a> Want a Feature?
You can *request* a new feature by [submitting an issue](#submit-issue) to our [GitHub
Repository][github]. If you would like to *implement* a new feature then consider what kind of
change it is:
## <a name="feature"></a> Missing a Feature?
You can *request* a new feature by [submitting an issue](#submit-issue) to our GitHub
Repository. If you would like to *implement* a new feature, please submit an issue with
a proposal for your work first, to be sure that we can use it.
Please consider what kind of change it is:
* For a **Major Feature**, first open an issue and outline your proposal so that it can be
discussed. This will also allow us to better coordinate our efforts, prevent duplication of work,
and help you to craft the change so that it is successfully accepted into the project.
* **Small Features** can be crafted and directly [submitted as a Pull Request](#submit-pr).
## <a name="docs"></a> Want a Doc Fix?
If you want to help improve the docs, then consider what kind of improvement it is:
* For **Major Changes**, it's a good idea to let others know what you're working on to
minimize duplication of effort. Before starting, check out the issue queue for
issues labeled [#docs](https://github.com/angular/angular/labels/%23docs).
Comment on an issue to let others know what you're working on, or [create a new issue](#submit-issue)
if your work doesn't fit within the scope of any of the existing doc issues.
Please build and test the documentation before [submitting the Pull Request](#submit-pr), to be sure
you haven't accidentally introduced any layout or formatting issues. Also ensure that your commit
message is labeled "docs" and follows the [Commit Message Guidelines](#commit) given below.
* For **Small Changes**, there is no need to file an issue first. Simply [submit a Pull Request](#submit-pr).
## <a name="submit"></a> Submission Guidelines
### <a name="submit-issue"></a> Submitting an Issue
Before you submit an issue, search the archive, maybe your question was already answered.
If your issue appears to be a bug, and hasn't been reported, open a new issue.
Help us to maximize the effort we can spend fixing issues and adding new
features, by not reporting duplicate issues. Providing the following information will increase the
chances of your issue being dealt with quickly:
Before you submit an issue, please search the issue tracker, maybe an issue for your problem already exists and the discussion might inform you of workarounds readily available.
We want to fix all the issues as soon as possible, but before fixing a bug we need to reproduce and confirm it. In order to reproduce bugs we will systematically ask you to provide a minimal reproduction scenario using http://plnkr.co. Having a live, reproducible scenario gives us wealth of important information without going back & forth to you with additional questions like:
- version of Angular used
- 3rd-party libraries and their versions
- and most importantly - a use-case that fails
A minimal reproduce scenario using http://plnkr.co/ allows us to quickly confirm a bug (or point out coding problem) as well as confirm that we are fixing the right problem. If plunker is not a suitable way to demostrate the problem (for example for issues related to our npm packaging), please create a standalone git repository demostrating the problem.
We will be insisting on a minimal reproduce scenario in order to save maintainers time and ultimately be able to fix more bugs. Interestingly, from our experience users often find coding problems themselves while preparing a minimal plunk. We understand that sometimes it might be hard to extract essentials bits of code from a larger code-base but we really need to isolate the problem before we can fix it.
Unfortunately we are not able to investigate / fix bugs without a minimal reproduction, so if we don't hear back from you we are going to close an issue that don't have enough info to be reproduced.
You can file new issues by filling out our [new issue form](https://github.com/angular/angular/issues/new).
* **Overview of the Issue** - if an error is being thrown a non-minified stack trace helps
* **Motivation for or Use Case** - explain why this is a bug for you
* **Angular Version(s)** - is it a regression?
* **Browsers and Operating System** - is this a problem with all browsers?
* **Reproduce the Error** - provide a live example (using [Plunker][plunker],
[JSFiddle][jsfiddle] or [Runnable][runnable]) or a unambiguous set of steps.
* **Related Issues** - has a similar issue been reported before?
* **Suggest a Fix** - if you can't fix the bug yourself, perhaps you can point to what might be
causing the problem (line of code or commit)
### <a name="submit-pr"></a> Submitting a Pull Request (PR)
Before you submit your Pull Request (PR) consider the following guidelines:
* Search [GitHub](https://github.com/angular/angular.dart/pulls) for an open or closed PR
* Search [GitHub](https://github.com/angular/angular/pulls) for an open or closed PR
that relates to your submission. You don't want to duplicate effort.
* Please sign our [Contributor License Agreement (CLA)](#cla) before sending PRs.
We cannot accept code without this.
@ -103,7 +101,7 @@ Before you submit your Pull Request (PR) consider the following guidelines:
* In GitHub, send a pull request to `angular:master`.
* If we suggest changes then:
* Make the required updates.
* Re-run the Angular 2 test suites for JS and Dart to ensure tests are still passing.
* Re-run the Angular test suites to ensure tests are still passing.
* Rebase your branch and force push to your GitHub repository (this will update your Pull Request):
```shell
@ -147,9 +145,9 @@ To ensure consistency throughout the source code, keep these rules in mind as yo
* All features or bug fixes **must be tested** by one or more specs (unit-tests).
* All public API methods **must be documented**. (Details TBC).
* With the exceptions listed below, we follow the rules contained in
[Google's JavaScript Style Guide][js-style-guide]:
* Wrap all code at **100 characters**.
* We follow [Google's JavaScript Style Guide][js-style-guide], but wrap all code at
**100 characters**. An automated formatter is available, see
[DEVELOPER.md](DEVELOPER.md#clang-format).
## <a name="commit"></a> Commit Message Guidelines
@ -169,9 +167,27 @@ format that includes a **type**, a **scope** and a **subject**:
<footer>
```
The **header** is mandatory and the **scope** of the header is optional.
Any line of the commit message cannot be longer 100 characters! This allows the message to be easier
to read on GitHub as well as in various git tools.
Footer should contain a [closing reference to an issue](https://help.github.com/articles/closing-issues-via-commit-messages/) if any.
Samples: (even more [samples](https://github.com/angular/angular/commits/master))
```
docs(changelog): update change log to beta.5
```
```
fix(release): need to depend on latest rxjs and zone.js
The version in our package.json gets copied to the one we publish, and users need the latest of these.
```
### Revert
If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit. In the body it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.
### Type
Must be one of the following:
@ -180,14 +196,15 @@ Must be one of the following:
* **docs**: Documentation only changes
* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing
semi-colons, etc)
* **refactor**: A code change that neither fixes a bug or adds a feature
* **refactor**: A code change that neither fixes a bug nor adds a feature
* **perf**: A code change that improves performance
* **test**: Adding missing tests
* **chore**: Changes to the build process or auxiliary tools and libraries such as documentation
generation
* **test**: Adding missing tests or correcting existing tests
* **build**: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
* **ci**: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
* **chore**: Other changes that don't modify `src` or `test` files
### Scope
The scope could be anything specifying place of the commit change. For example
The scope could be anything specifying place of the commit change. For example
`Compiler`, `ElementInjector`, etc.
### Subject
@ -205,6 +222,7 @@ The body should include the motivation for the change and contrast this with pre
The footer should contain any information about **Breaking Changes** and is also the place to
reference GitHub issues that this commit **Closes**.
**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this.
A detailed explanation can be found in this [document][commit-message-format].
@ -226,8 +244,8 @@ changes to be accepted, the CLA must be signed. It's a quick process, we promise
[github]: https://github.com/angular/angular
[gitter]: https://gitter.im/angular/angular
[individual-cla]: http://code.google.com/legal/individual-cla-v1.0.html
[js-style-guide]: http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml
[jsfiddle]: http://jsfiddle.net/
[js-style-guide]: https://google.github.io/styleguide/javascriptguide.xml
[jsfiddle]: http://jsfiddle.net
[plunker]: http://plnkr.co/edit
[runnable]: http://runnable.com/
[runnable]: http://runnable.com
[stackoverflow]: http://stackoverflow.com/questions/tagged/angular

View File

@ -1,58 +1,47 @@
# Building and Testing Angular 2 for JS and Dart
# Building and Testing Angular 2 for JS
This document describes how to set up your development environment to build and test Angular, both
JS and Dart versions. It also explains the basic mechanics of using `git`, `node`, and `npm`.
This document describes how to set up your development environment to build and test Angular 2 JS version.
It also explains the basic mechanics of using `git`, `node`, and `npm`.
See the [contributing guidelines](https://github.com/angular/angular/blob/master/CONTRIBUTING.md)
for how to contribute your own code to
* [Prerequisite Software](#prerequisite-software)
* [Getting the Sources](#getting-the-sources)
* [Installing NPM Modules](#installing-npm-modules)
* [Building](#building)
* [Running Tests Locally](#running-tests-locally)
1. [Prerequisite Software](#prerequisite-software)
2. [Getting the Sources](#getting-the-sources)
3. [Environment Variable Setup](#environment-variable-setup)
4. [Installing NPM Modules and Dart Packages](#installing-npm-modules-and-dart-packages)
5. [Running Tests Locally](#running-tests-locally)
6. [Project Information](#project-information)
7. [CI using Travis](#ci-using-travis)
8. [Debugging](#debugging)
See the [contribution guidelines](https://github.com/angular/angular/blob/master/CONTRIBUTING.md)
if you'd like to contribute to Angular.
## Prerequisite Software
Before you can build and test Angular, you must install and configure the
following products on your development machine:
* [Dart](https://www.dartlang.org) (version `>=1.9.0-dev.8.0`), specifically the Dart-SDK and
Dartium (a version of [Chromium](http://www.chromium.org) with native support for Dart through
the Dart VM). One of the **simplest** ways to get both is to install the **Dart Editor bundle**,
which includes the editor, SDK and Dartium. See the [Dart tools](https://www.dartlang.org/tools)
download [page for instructions](https://www.dartlang.org/tools/download.html); note that you can
download both **stable** and **dev** channel versions from the [download
archive](https://www.dartlang.org/tools/download-archive).
* [Git](http://git-scm.com) and/or the **Github app** (for [Mac](http://mac.github.com) or
[Windows](http://windows.github.com)): the [Github Guide to Installing
* [Git](http://git-scm.com) and/or the **GitHub app** (for [Mac](http://mac.github.com) or
[Windows](http://windows.github.com)); [GitHub's Guide to Installing
Git](https://help.github.com/articles/set-up-git) is a good source of information.
* [Node.js](http://nodejs.org) which is used to run a development web server, run tests, and
generate distributable files. We also use Node's Package Manager (`npm`). Depending on your
system, you can install Node either from source or as a pre-packaged bundle.
* [Chrome Canary](https://www.google.com/chrome/browser/canary.html), a version of Chrome with
bleeding edge functionality, built especially for developers (and early adopters).
* [Node.js](http://nodejs.org), (version `>=5.4.1 <6`) which is used to run a development web server,
run tests, and generate distributable files. We also use Node's Package Manager, `npm`
(version `>=3.5.3 <4.0`), which comes with Node. Depending on your system, you can install Node either from
source or as a pre-packaged bundle.
* [Java Development Kit](http://www.oracle.com/technetwork/es/java/javase/downloads/index.html) which is used
to execute the selenium standalone server for e2e testing.
## Getting the Sources
Forking and cloning the Angular repository:
Fork and clone the Angular repository:
1. Login to your Github account or create one by following the instructions given
1. Login to your GitHub account or create one by following the instructions given
[here](https://github.com/signup/free).
2. [Fork](http://help.github.com/forking) the [main Angular
repository](https://github.com/angular/angular).
3. Clone your fork of the Angular repository and define an `upstream` remote pointing back to
the Angular repository that you forked in the first place:
the Angular repository that you forked in the first place.
```shell
# Clone your Github repository:
# Clone your GitHub repository:
git clone git@github.com:<github username>/angular.git
# Go to the Angular directory:
@ -61,36 +50,9 @@ cd angular
# Add the main Angular repository as an upstream remote to your repository:
git remote add upstream https://github.com/angular/angular.git
```
## Installing NPM Modules
## Environment Variable Setup
Define the environment variables listed below. These are mainly needed for the testing. The
notation shown here is for [`bash`](http://www.gnu.org/software/bash); adapt as appropriate for
your favorite shell.
Examples given below of possible values for initializing the environment variables assume **Mac OS
X** and that you have installed the Dart Editor in the directory named by
`DART_EDITOR_DIR=/Applications/dart`. This is only for illustrative purposes.
```shell
# DARTIUM_BIN: path to a Dartium browser executable; used by Karma to run Dart tests
export DARTIUM_BIN="$DART_EDITOR_DIR/chromium/Chromium.app/Contents/MacOS/Chromium"
```
Add the Dart SDK `bin` directory to your path and/or define `DART_SDK` (this is also detailed
[here](https://www.dartlang.org/tools/pub/installing.html)):
```shell
# DART_SDK: path to a Dart SDK directory
export DART_SDK="$DART_EDITOR_DIR/dart-sdk"
# Update PATH to include the Dart SDK bin directory
PATH+=":$DART_SDK/bin"
```
## Installing NPM Modules and Dart Packages
Next, install the modules and packages needed to build Angular and run tests:
Next, install the JavaScript modules needed to build and test Angular:
```shell
# Install Angular project dependencies (package.json)
@ -112,135 +74,67 @@ use in these instructions.
*Option 2*: defining a bash alias like `alias nbin='PATH=$(npm bin):$PATH'` as detailed in this
[Stackoverflow answer](http://stackoverflow.com/questions/9679932/how-to-use-package-installed-locally-in-node-modules/15157360#15157360) and used like this: e.g., `nbin gulp build`.
## Build commands
To build Angular and prepare tests run
## Windows only
In order to create the right symlinks, run **as administrator**:
```shell
$(npm bin)/gulp build
./scripts/windows/create-symlinks.sh
```
Notes:
* Results are put in the `dist` folder.
* This will also run `pub get` for the subfolders in `modules` and run `dartanalyzer` for
every file that matches `<module>/src/<module>.dart`, e.g. `di/src/di.dart`
To clean out the `dist` folder use:
Before submitting a PR, do not forget to remove them:
```shell
$(npm bin)/gulp clean
./scripts/windows/remove-symlinks.sh
```
## Building
To build Angular run:
```shell
./build.sh
```
* Results are put in the dist folder.
## Running Tests Locally
### Full test suite
To run tests:
* `npm test`: full test suite for both JS and Dart versions of Angular. These are the same tests as
those run on Travis.
```shell
$ ./test.sh node # Run all angular tests on node
You can selectively run either the JS or Dart versions as follows:
$ ./test.sh browser # Run all angular tests in browser
$ ./test.sh browserNoRouter # Optionally run all angular tests without router in browser
* `$(npm bin)/gulp test.all.js`
* `$(npm bin)/gulp test.all.dart`
$ ./test.sh tools # Run angular tooling (not framework) tests
```
### Unit tests
You should execute the 3 test suites before submitting a PR to github.
You can run just the unit tests as follows:
All the tests are executed on our Continuous Integration infrastructure and a PR could only be merged once the tests pass.
* `$(npm bin)/gulp test.unit.js`: JS tests in a browser; runs in **watch mode** (i.e. karma
watches the test files for changes and re-runs tests when files are updated).
* `$(npm bin)/gulp test.unit.cjs`: JS tests in NodeJS; runs in **watch mode**.
* `$(npm bin)/gulp test.unit.dart`: Dart tests in Dartium; runs in **watch mode**.
- CircleCI fails if your code is not formatted properly,
- Travis CI fails if any of the test suites described above fails.
If you prefer running tests in "single-run" mode rather than watch mode use
## Update the public API tests
* `$(npm bin)/gulp test.unit.js/ci`
* `$(npm bin)/gulp test.unit.cjs/ci`
* `$(npm bin)/gulp test.unit.dart/ci`
If you happen to modify the public API of Angular, API golden files must be updated using:
**Note**: If you want to only run a single test you can alter the test you wish to run by changing
`it` to `iit` or `describe` to `ddescribe`. This will only run that individual test and make it
much easier to debug. `xit` and `xdescribe` can also be useful to exclude a test and a group of
tests respectively.
``` shell
$ gulp public-api:update
```
**Note** for transpiler tests: The karma preprocessor is setup in a way so that after every test
run the transpiler is reloaded. With that it is possible to make changes to the preprocessor and
run the tests without exiting karma (just touch a test file that you would like to run).
Note: The command `./test.sh tools` fails when the API doesn't match the golden files.
### E2e tests
## Formatting your source code
1. `$(npm bin)/gulp build.js.cjs` (builds benchpress and tests into `dist/js/cjs` folder).
2. `$(npm bin)/gulp serve.js.prod serve.js.dart2js` (runs local webserver).
3. `$(npm bin)/protractor protractor-js.conf.js`: JS e2e tests.
4. `$(npm bin)/protractor protractor-dart2js.conf.js`: Dart2JS e2e tests.
Angular uses [clang-format](http://clang.llvm.org/docs/ClangFormat.html) to format the source code. If the source code
is not properly formatted, the CI will fail and the PR can not be merged.
Angular specific command line options when running protractor:
- `$(npm bin)/protractor protractor-{js|dart2js}-conf.js --ng-help`
You can automatically format your code by running:
### Performance tests
``` shell
$ gulp format
```
1. `$(npm bin)/gulp build.js.cjs` (builds benchpress and tests into `dist/js/cjs` folder)
2. `$(npm bin)/gulp serve.js.prod serve.js.dart2js` (runs local webserver)
3. `$(npm bin)/protractor protractor-js.conf.js --benchmark`: JS performance tests
4. `$(npm bin)/protractor protractor-dart2js.conf.js --benchmark`: Dart2JS performance tests
Angular specific command line options when running protractor (e.g. force gc, ...):
`$(npm bin)/protractor protractor-{js|dart2js}-conf.js --ng-help`
## Project Information
### Folder structure
* `modules/*`: modules that will be loaded in the browser
* `tools/*`: tools that are needed to build Angular
* `dist/*`: build files are placed here.
### File suffixes
* `*.js`: javascript files that get transpiled to Dart and EcmaScript 5
* `*.es6`: javascript files that get transpiled only to EcmaScript 5
* `*.es5`: javascript files that don't get transpiled
* `*.dart`: dart files that don't get transpiled
## CI using Travis
For instructions on setting up Continuous Integration using Travis, see the instructions given
[here](https://github.com/angular/angular.dart/blob/master/travis.md).
## Debugging
### Debug the transpiler
If you need to debug the transpiler:
- add a `debugger;` statement in the transpiler code,
- from the root folder, execute `node debug $(npm bin)/gulp build` to enter the node
debugger
- press "c" to execute the program until you reach the `debugger;` statement,
- you can then type "repl" to enter the REPL and inspect variables in the context.
See the [Node.js manual](http://nodejs.org/api/debugger.html) for more information.
Notes:
- You can also execute `node $(npm bin)/karma start karma-dart.conf.js` depending on which
code you want to debug (the former will process the "modules" folder while the later processes
the transpiler specs).
- You can also add `debugger;` statements in the specs (JavaScript). The execution will halt when
the developer tools are opened in the browser running Karma.
### Debug the tests
If you need to debug the tests:
- add a `debugger;` statement to the test you want to debug (oe the source code),
- execute karma `$(npm bin)/gulp test.js`,
- press the top right "DEBUG" button,
- open the dev tools and press F5,
- the execution halt at the `debugger;` statement
**Note (WebStorm users)**:
You can create a Karma run config from WebStorm.
Then in the "Run" menu, press "Debug 'karma-js.conf.js'", WebStorm will stop in the generated code
on the `debugger;` statement.
You can then step into the code and add watches.
The `debugger;` statement is needed because WebStorm will stop in a transpiled file. Breakpoints in
the original source files are not supported at the moment.

215
LICENSE
View File

@ -1,202 +1,21 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
The MIT License
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
Copyright (c) 2014-2016 Google, Inc. http://angular.io
1. Definitions.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

32
NAMING.md Normal file
View File

@ -0,0 +1,32 @@
Naming Conventions in Angular2
---
In general Angular2 should follow TypeScript naming conventions.
See: https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines
Classes:
- Example: `Compiler`, `ApplicationMetadata`
- Camel case with first letter upper-case
- In general prefer single words. (This is so that when appending `Proto` or `Factory` the class
is still reasonable to work with.)
- Should not end with `Impl` or any other word which describes a specific implementation of an
interface.
Interfaces:
- Follow the same rules as Classes
- Should not have `I` or `Interface` in the name or any other way of identifying it as an interface.
Methods and functions:
- Example: `bootstrap`, `someMethod`
- Should be camel case with first lower case
Constants
- Example: `CORE_DIRECTIVES`
- Should be all uppercase with SNAKE_CASE

View File

@ -1,53 +1,37 @@
Angular [![Build Status](https://travis-ci.org/angular/angular.svg?branch=master)](https://travis-ci.org/angular/angular) [![Join the chat at https://gitter.im/angular/angular](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/angular/angular?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://travis-ci.org/angular/angular.svg?branch=master)](https://travis-ci.org/angular/angular)
[![CircleCI](https://circleci.com/gh/angular/angular/tree/master.svg?style=shield)](https://circleci.com/gh/angular/angular/tree/master)
[![Join the chat at https://gitter.im/angular/angular](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/angular/angular?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Issue Stats](http://issuestats.com/github/angular/angular/badge/pr?style=flat)](http://issuestats.com/github/angular/angular)
[![Issue Stats](http://issuestats.com/github/angular/angular/badge/issue?style=flat)](http://issuestats.com/github/angular/angular)
[![npm version](https://badge.fury.io/js/%40angular%2Fcore.svg)](https://badge.fury.io/js/%40angular%2Fcore)
[![Sauce Test Status](https://saucelabs.com/browser-matrix/angular2-ci.svg)](https://saucelabs.com/u/angular2-ci)
*Safari (7+), iOS (7+), Edge (14) and IE mobile (11) are tested on [BrowserStack][browserstack].*
Angular
=========
Angular is a development platform for building mobile and desktop web applications. This is the
repository for [Angular 2][ng2], both the JavaScript (JS) and [Dart][dart] versions.
Angular 2 is currently in **Alpha Preview**. We recommend using Angular 1.X for production
applications:
* [AngularJS][ngJS]: [angular/angular.js](http://github.com/angular/angular.js).
* [AngularDart][ngDart]: [angular/angular.dart](http://github.com/angular/angular.dart).
repository for [Angular 2][ng2] Typescript/JavaScript (JS).
Angular2 for [Dart][dart] can be found at [dart-lang/angular2][ng2dart].
## Setup & Install Angular 2
## Quickstart
Follow the instructions given on the [Angular download page][download].
[Get started in 5 minutes][quickstart].
## Want to help?
Want to file a bug, or contribute some code or improve documentation? Excellent! Read up on our
guidelines for [contributing][contributing].
## Examples
To see the examples, first build the project as described
[here](http://github.com/angular/angular/blob/master/DEVELOPER.md).
### Hello World Example
This example consists of three basic pieces - a component, a decorator and a
service. They are all constructed via injection. For more information see the
comments in the source `modules/examples/src/hello_world/index.js`.
You can build this example as either JS or Dart app:
* JS:
* `$(npm bin)/gulp build.js.dev`, and
* `$(npm bin)/gulp serve.js.dev`, and
* open `localhost:8000/examples/src/hello_world/` in Chrome.
* Dart:
* `$(npm bin)/gulp serve/examples.dart`, and
* open `localhost:8080/src/hello_world` in Chrome (for dart2js) or
[Dartium][dartium] (for Dart VM).
Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our
guidelines for [contributing][contributing] and then check out one of our issues in the [hotlist: community-help](https://github.com/angular/angular/labels/hotlist%3A%20community-help).
[browserstack]: https://www.browserstack.com/
[contributing]: http://github.com/angular/angular/blob/master/CONTRIBUTING.md
[dart]: http://www.dartlang.org
[dartium]: http://www.dartlang.org/tools/dartium
[download]: http://angular.io/download
[quickstart]: https://angular.io/docs/ts/latest/quickstart.html
[ng2]: http://angular.io
[ngDart]: http://angulardart.org
[ngJS]: http://angularjs.org
[ng2dart]: https://github.com/dart-lang/angular2

62
SAVED_REPLIES.md Normal file
View File

@ -0,0 +1,62 @@
# Saved Responses for Angular's Issue Tracker
The following are canned responses that the Angular team should use to close issues on our issue tracker that fall into the listed resolution categories.
Since GitHub currently doesn't allow us to have a repository-wide or organization-wide list of [saved replies](https://help.github.com/articles/working-with-saved-replies/), these replies need to be maintained by individual team members. Since the responses can be modified in the future, all responses are versioned to simplify the process of keeping the responses up to date.
## Angular: Already Fixed (v1)
```
Thanks for reporting this issue. Luckily it has already been fixed in one of the recent releases. Please update to the most recent version to resolve the problem.
If after upgrade the problem still exists in your application please open a new issue and provide a plunker reproducing the problem and describing the difference between the expected and current behavior. You can use this plunker template: http://plnkr.co/edit/tpl:AvJOMERrnz94ekVua0u5?p=catalogue
```
## Angular: Don't Understand (v1)
```
I'm sorry but we don't understand the problem you are reporting.
If the problem still exists please open a new issue and provide a plunker reproducing the problem and describing the difference between the expected and current behavior. You can use this plunker template: http://plnkr.co/edit/tpl:AvJOMERrnz94ekVua0u5?p=catalogue
```
## Angular: Duplicate (v1)
```
Thanks for reporting this issue. However this issue is a duplicate of an existing issue #<ISSUE_NUMBER>. Please subscribe to that issue for future updates.
```
## Angular: Insufficient Information Provided (v1)
```
Thanks for reporting this issue. However, you didn't provide sufficient information for us to understand and reproduce the problem. Please check out [our submission guidelines](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-submitting-an-issue) to understand why we can't act on issues that are lacking important information.
If the problem still persists, please file a new issue and ensure you provide all of the required information when filling out the issue template.
```
## Angular: Issue Outside of Angular (v1)
```
I'm sorry but this issue is not caused by Angular. Please contact the author(s) of project <PROJECT NAME> or file issue on their issue tracker.
```
## Angular: Non-reproducible (v1)
```
I'm sorry but we can't reproduce the problem following the instructions you provided.
If the problem still exists please open a new issue following [our submission guidelines](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-submitting-an-issue).
```
## Angular: Obsolete (v1)
```
Thanks for reporting this issue. This issue is now obsolete due to changes in the recent releases. Please update to the most recent Angular version.
If the problem still persists, please file a new issue and ensure you provide the version of Angular affected and include the steps to reproduce the problem when filling out the issue template.
```
## Angular: Support Request (v1)
```
Hello, we reviewed this issue and determined that it doesn't fall into the bug report or feature request category. This issue tracker is not suitable for support requests, please repost your issue on [StackOverflow](http://stackoverflow.com/) using tag `angular`.
If you are wondering why we don't resolve support issues via the issue tracker, please [check out this explanation](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-got-a-question-or-problem).
```

140
TOOLS.md Normal file
View File

@ -0,0 +1,140 @@
# Developer Tools for Angular 2
Here you will find a collection of tools and tips for keeping your application
perform well and contain fewer bugs.
## Angular debug tools in the dev console
Angular provides a set of debug tools that are accessible from any browser's
developer console. In Chrome the dev console can be accessed by pressing
Ctrl + Shift + j.
### Enabling debug tools
By default the debug tools are disabled. You can enable debug tools as follows:
```typescript
import {enableDebugTools} from '@angular/platform-browser';
bootstrap(Application).then((appRef) => {
enableDebugTools(appRef);
});
```
### Using debug tools
In the browser open the developer console (Ctrl + Shift + j in Chrome). The
top level object is called `ng` and contains more specific tools inside it.
Example:
```javascript
ng.profiler.timeChangeDetection();
```
## Performance
### Change detection profiler
If your application is janky (it misses frames) or is slow according to other
metrics it is important to find the root cause of the issue. Change detection
is a phase in Angular's lifecycle that detects changes in values that are
bound to UI, and if it finds a change it performs the corresponding UI update.
However, sometimes it is hard to tell if the slowness is due to the act of
computing the changes being slow, or due to the act of applying those changes
to the UI. For your application to be performant it is important that the
process of computing changes is very fast. For best results it should be under
3 milliseconds in order to leave room for the application logic, the UI updates
and browser's rendering pipeline to fit withing the 16 millisecond frame
(assuming the 60 FPS target frame rate).
Change detection profiler repeatedly performs change detection without invoking
any user actions, such as clicking buttons or entering text in input fields. It
then computes the average amount of time it took to perform a single cycle of
change detection in milliseconds and prints it to the console. This number
depends on the current state of the UI. You will likely see different numbers
as you go from one screen in your application to another.
#### Running the profiler
Enable debug tools (see above), then in the dev console enter the following:
```javascript
ng.profiler.timeChangeDetection();
```
The results will be printed to the console.
#### Recording CPU profile
Pass `{record: true}` an argument:
```javascript
ng.profiler.timeChangeDetection({record: true});
```
Then open the "Profiles" tab. You will see the recorded profile titled
"Change Detection". In Chrome, if you record the profile repeatedly, all the
profiles will be nested under "Change Detection".
#### Interpreting the numbers
In a properly-designed application repeated attempts to detect changes without
any user actions should result in no changes to be applied on the UI. It is
also desirable to have the cost of a user action be proportional to the amount
of UI changes required. For example, popping up a menu with 5 items should be
vastly faster than rendering a table of 500 rows and 10 columns. Therefore,
change detection with no UI updates should be as fast as possible. Ideally the
number printed by the profiler should be well below the length of a single
animation frame (16ms). A good rule of thumb is to keep it under 3ms.
#### Investigating slow change detection
So you found a screen in your application on which the profiler reports a very
high number (i.e. >3ms). This is where a recorded CPU profile can help. Enable
recording while profiling:
```javascript
ng.profiler.timeChangeDetection({record: true});
```
Then look for hot spots using
[Chrome CPU profiler](https://developer.chrome.com/devtools/docs/cpu-profiling).
#### Reducing change detection cost
There are many reasons for slow change detection. To gain intuition about
possible causes it would help to understand how change detection works. Such a
discussion is outside the scope of this document (TODO link to docs), but here
are some key concepts in brief.
By default Angular uses "dirty checking" mechanism for finding model changes.
This mechanism involves evaluating every bound expression that's active on the
UI. These usually include text interpolation via `{{expression}}` and property
bindings via `[prop]="expression"`. If any of the evaluated expressions are
costly to compute they could contribute to slow change detection. A good way to
speed things up is to use plain class fields in your expressions and avoid any
kinds of computation. Example:
```typescript
@Component({
template: '<button [enabled]="isEnabled">{{title}}</button>'
})
class FancyButton {
// GOOD: no computation, just return the value
isEnabled: boolean;
// BAD: computes the final value upon request
_title: String;
get title(): String { return this._title.trim().toUpperCase(); }
}
```
Most cases like these could be solved by precomputing the value and storing the
final value in a field.
Angular also supports a second type of change detection - the "push" model. In
this model Angular does not poll your component for changes. Instead, the
component "tells" Angular when it changes and only then does Angular perform
the update. This model is suitable in situations when your data model uses
observable or immutable objects (also a discussion for another time).

157
TRIAGE_AND_LABELS.md Normal file
View File

@ -0,0 +1,157 @@
# Triage Process and Github Labels for Angular 2
This document describes how the Angular team uses labels and milestones
to triage issues on github. The basic idea of the process is that
caretaker only assigns a component and type (bug, feature) label. The
owner of the component than is in full control of how the issues should
be triaged further.
Once this process is implemented and in use, we will revisit it to see
if further labeling is needed.
## Components
A caretaker should be able to determine which component the issue
belongs to. The components have a clear piece of source code associated
with it.
* `comp: animations`: `@matsko`
* `comp: benchpress`: `@tbosch`
* `comp: build & ci`: `@IgorMinar` -- All build and CI scripts
* `comp: common`: `@mhevery` -- This includes core components / pipes.
* `comp: core & compiler`: `@tbosch` -- Because core and compiler are very
intertwined, we will be treating them as one.
* `comp: forms`: `@kara`
* `comp: http`: `@jeffbcross`
* `comp: i18n`: `@vicb`
* `comp: metadata-extractor`: `@chuckjaz`
* `comp: router`: `@vsavkin`
* `comp: testing`: `@juliemr`
* `comp: upgrade`: `@mhevery`
* `comp: web-worker`: `@vicb`
* `comp: zones`: `@mhevery`
There are few components which are cross-cutting. They don't have
a clear location in the source tree. We will treat them as a component
even thought no specific source tree is associated with them.
* `comp: docs`: `@naomiblack`
* `comp: packaging`: `@IgorMinar`
* `comp: performance`: `@tbosch`
* `comp: security`: `@IgorMinar`
## Type
What kind of problem is this?
* `type: RFC / discussion / question`
* `type: bug`
* `type: chore`
* `type: feature`
* `type: performance`
* `type: refactor`
## Caretaker Triage Process
It is the caretaker's responsibility to assign `comp: *` to each new
issue as they come in. The reason why we limit the responsibility of the
caretaker to this one label is that it is likely that without domain
knowledge the caretaker could mislabel issues or lack knowledge of
duplicate issues.
## Component's owner Triage Process
At this point we are leaving each component owner to determine their own
process for their component.
It will be up to the component owner to determine the order in which the
issues within the component will be resolved.
Several owners have adopted the issue categorization based on
[user pain](http://www.lostgarden.com/2008/05/improving-bug-triage-with-user-pain.html)
used by Angular 1. In this system every issue is assigned frequency and
severity based on which the total user pain score is calculated.
Following is the definition of various frequency and severity levels:
1. `freq(score): *` How often does this issue come up? How many developers does this affect?
* low (1) - obscure issue affecting a handful of developers
* moderate (2) - impacts auxiliary usage patterns, only small number of applications are affected
* high (3) - impacts primary usage patterns, affecting most Angular apps
* critical (4) - impacts all Angular apps
1. `severity(score): *` - How bad is the issue?
* inconvenience (1) - causes ugly/boilerplate code in apps
* confusing (2) - unexpected or inconsistent behavior; hard-to-debug
* broken expected use (3) - it's hard or impossible for a developer using Angular to accomplish something that Angular should be able to do
* memory leak (4)
* regression (5) - functionality that used to work no longer works in a new release due to an unintentional change
* security issue (6)
These criteria are then used to calculate a "user pain" score as follows:
`pain = severity × frequency`
### Assigning Issues to Milestones
Any issue that is being worked on must have:
* An `Assignee`: The person doing the work.
* A `Milestone`: When we expect to complete this work.
We aim to only have at most three milestones open at a time:
* Closing Milestone: A milestone with a very small number of issues, about to release.
* Current Milestone: Work that we plan to complete within one week.
* Next Milestone: Work that is > 1 week but current for the team.
The [backlog](https://github.com/angular/angular/issues?q=is%3Aopen+is%3Aissue+no%3Amilestone)
consists of all issues that have been triaged but do not have an assignee or milestone.
## Triaged vs Untrained PRs
PRs should also be label with a `comp: *` so that it is clear which
primary area the PR effects.
Because of the cumulative pain associated with rebasing PRs, we triage PRs daily, and
closing or reviewing PRs is a top priority ahead of other ongoing work.
Every triaged PR must have a `pr_action` label assigned to it and an assignee:
* `pr_action: review` -- work is complete and comment is needed from the assignee.
* `pr_action: cleanup` -- more work is needed from the current assignee.
* `pr_action: discuss` -- discussion is needed, to be led by the current assignee.
* `pr_action: merge` -- the PR should be merged. Add this to a PR when you would like to
trigger automatic merging following a successful build. This is described in [COMMITTER.md](COMMITTER.md).
In addition, PRs can have the following states:
* `pr_state: LGTM` -- PR may have outstanding changes but does not require further review.
* `pr_state: WIP` -- PR is experimental or rapidly changing. Not ready for review or triage.
* `pr_state: blocked` -- PR is blocked on an issue or other PR. Not ready for review or triage.
Note that an LGTM state does not mean a PR is ready to merge: for example, a reviewer might set the
LGTM state but request a minor tweak that doesn't need further review, e.g., a rebase or small
uncontroversial change.
PRs do not need to be assigned to milestones, unless a milestone release should be held for that
PR to land.
## Special Labels
### action:design
More active discussion is needed before the issue can be worked on further. Typically used for
`type: feature` or `type: RFC/discussion/question`
[See all issues that need discussion](https://github.com/angular/angular/labels/action:%20Design)
### cla
Managed by googlebot. Indicates whether a PR has a CLA on file for its author(s). Only issues with
`cla:yes` should be merged into master.
### WORKS_AS_INTENDED
Only used on closed issues, to indicate to the reporter why we closed it.

View File

@ -1,7 +1,6 @@
{
"name": "angular2",
"version": "0.0.0",
"dependencies": {
"polymer": "dart-lang/polymer_js#0.8.0-preview"
"polymer": "Polymer/polymer#^1.6.0"
}
}
}

177
browser-providers.conf.js Normal file
View File

@ -0,0 +1,177 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
// Unique place to configure the browsers which are used in the different CI jobs in Sauce Labs (SL)
// and BrowserStack (BS).
// If the target is set to null, then the browser is not run anywhere during CI.
// If a category becomes empty (e.g. BS and required), then the corresponding job must be commented
// out in Travis configuration.
var CIconfiguration = {
'Chrome': {unitTest: {target: 'SL', required: true}, e2e: {target: null, required: true}},
'Firefox': {unitTest: {target: 'SL', required: true}, e2e: {target: null, required: true}},
// FirefoxBeta and ChromeBeta should be target:'BS' or target:'SL', and required:true
// Currently deactivated due to https://github.com/angular/angular/issues/7560
'ChromeBeta': {unitTest: {target: null, required: true}, e2e: {target: null, required: false}},
'FirefoxBeta': {unitTest: {target: null, required: false}, e2e: {target: null, required: false}},
'ChromeDev': {unitTest: {target: null, required: true}, e2e: {target: null, required: true}},
'FirefoxDev': {unitTest: {target: null, required: true}, e2e: {target: null, required: true}},
'IE9': {unitTest: {target: 'SL', required: false}, e2e: {target: null, required: true}},
'IE10': {unitTest: {target: 'SL', required: true}, e2e: {target: null, required: true}},
'IE11': {unitTest: {target: 'SL', required: true}, e2e: {target: null, required: true}},
'Edge': {unitTest: {target: 'BS', required: false}, e2e: {target: null, required: true}},
'Android4.1': {unitTest: {target: 'SL', required: false}, e2e: {target: null, required: true}},
'Android4.2': {unitTest: {target: 'SL', required: false}, e2e: {target: null, required: true}},
'Android4.3': {unitTest: {target: 'SL', required: false}, e2e: {target: null, required: true}},
'Android4.4': {unitTest: {target: 'SL', required: false}, e2e: {target: null, required: true}},
'Android5': {unitTest: {target: 'SL', required: false}, e2e: {target: null, required: true}},
'Safari7': {unitTest: {target: 'BS', required: false}, e2e: {target: null, required: true}},
'Safari8': {unitTest: {target: 'BS', required: false}, e2e: {target: null, required: true}},
'Safari9': {unitTest: {target: 'BS', required: false}, e2e: {target: null, required: true}},
'Safari10': {unitTest: {target: 'BS', required: false}, e2e: {target: null, required: true}},
'iOS7': {unitTest: {target: 'BS', required: true}, e2e: {target: null, required: true}},
'iOS8': {unitTest: {target: 'BS', required: false}, e2e: {target: null, required: true}},
'iOS9': {unitTest: {target: 'BS', required: false}, e2e: {target: null, required: true}},
'iOS10': {unitTest: {target: 'BS', required: false}, e2e: {target: null, required: true}},
'WindowsPhone': {unitTest: {target: 'BS', required: false}, e2e: {target: null, required: true}}
};
var customLaunchers = {
'DartiumWithWebPlatform':
{base: 'Dartium', flags: ['--enable-experimental-web-platform-features']},
'ChromeNoSandbox': {base: 'Chrome', flags: ['--no-sandbox']},
'SL_CHROME': {base: 'SauceLabs', browserName: 'chrome', version: '52'},
'SL_CHROMEBETA': {base: 'SauceLabs', browserName: 'chrome', version: 'beta'},
'SL_CHROMEDEV': {base: 'SauceLabs', browserName: 'chrome', version: 'dev'},
'SL_FIREFOX': {base: 'SauceLabs', browserName: 'firefox', version: '46'},
'SL_FIREFOXBETA': {base: 'SauceLabs', browserName: 'firefox', version: 'beta'},
'SL_FIREFOXDEV': {base: 'SauceLabs', browserName: 'firefox', version: 'dev'},
'SL_SAFARI7': {base: 'SauceLabs', browserName: 'safari', platform: 'OS X 10.9', version: '7.0'},
'SL_SAFARI8': {base: 'SauceLabs', browserName: 'safari', platform: 'OS X 10.10', version: '8.0'},
'SL_SAFARI9': {base: 'SauceLabs', browserName: 'safari', platform: 'OS X 10.11', version: '9.0'},
'SL_SAFARI10':
{base: 'SauceLabs', browserName: 'safari', platform: 'OS X 10.12', version: '10.0'},
'SL_IOS7': {base: 'SauceLabs', browserName: 'iphone', platform: 'OS X 10.10', version: '7.1'},
'SL_IOS8': {base: 'SauceLabs', browserName: 'iphone', platform: 'OS X 10.10', version: '8.4'},
'SL_IOS9': {base: 'SauceLabs', browserName: 'iphone', platform: 'OS X 10.10', version: '9.3'},
'SL_IOS10': {base: 'SauceLabs', browserName: 'iphone', platform: 'OS X 10.10', version: '10.0'},
'SL_IE9':
{base: 'SauceLabs', browserName: 'internet explorer', platform: 'Windows 2008', version: '9'},
'SL_IE10': {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 2012',
version: '10'
},
'SL_IE11':
{base: 'SauceLabs', browserName: 'internet explorer', platform: 'Windows 8.1', version: '11'},
'SL_EDGE': {
base: 'SauceLabs',
browserName: 'MicrosoftEdge',
platform: 'Windows 10',
version: '13.10586'
},
'SL_ANDROID4.1': {base: 'SauceLabs', browserName: 'android', platform: 'Linux', version: '4.1'},
'SL_ANDROID4.2': {base: 'SauceLabs', browserName: 'android', platform: 'Linux', version: '4.2'},
'SL_ANDROID4.3': {base: 'SauceLabs', browserName: 'android', platform: 'Linux', version: '4.3'},
'SL_ANDROID4.4': {base: 'SauceLabs', browserName: 'android', platform: 'Linux', version: '4.4'},
'SL_ANDROID5': {base: 'SauceLabs', browserName: 'android', platform: 'Linux', version: '5.1'},
'BS_CHROME': {base: 'BrowserStack', browser: 'chrome', os: 'OS X', os_version: 'Yosemite'},
'BS_FIREFOX': {base: 'BrowserStack', browser: 'firefox', os: 'Windows', os_version: '10'},
'BS_SAFARI7': {base: 'BrowserStack', browser: 'safari', os: 'OS X', os_version: 'Mavericks'},
'BS_SAFARI8': {base: 'BrowserStack', browser: 'safari', os: 'OS X', os_version: 'Yosemite'},
'BS_SAFARI9': {base: 'BrowserStack', browser: 'safari', os: 'OS X', os_version: 'El Capitan'},
'BS_SAFARI10': {base: 'BrowserStack', browser: 'safari', os: 'OS X', os_version: 'Sierra'},
'BS_IOS7': {base: 'BrowserStack', device: 'iPhone 5S', os: 'ios', os_version: '7.0'},
'BS_IOS8': {base: 'BrowserStack', device: 'iPhone 6', os: 'ios', os_version: '8.3'},
'BS_IOS9': {base: 'BrowserStack', device: 'iPhone 6S', os: 'ios', os_version: '9.1'},
'BS_IOS10': {base: 'BrowserStack', device: 'iPhone SE', os: 'ios', os_version: '10.0'},
'BS_IE9':
{base: 'BrowserStack', browser: 'ie', browser_version: '9.0', os: 'Windows', os_version: '7'},
'BS_IE10': {
base: 'BrowserStack',
browser: 'ie',
browser_version: '10.0',
os: 'Windows',
os_version: '8'
},
'BS_IE11': {
base: 'BrowserStack',
browser: 'ie',
browser_version: '11.0',
os: 'Windows',
os_version: '10'
},
'BS_EDGE': {base: 'BrowserStack', browser: 'edge', os: 'Windows', os_version: '10'},
'BS_WINDOWSPHONE':
{base: 'BrowserStack', device: 'Nokia Lumia 930', os: 'winphone', os_version: '8.1'},
'BS_ANDROID5': {base: 'BrowserStack', device: 'Google Nexus 5', os: 'android', os_version: '5.0'},
'BS_ANDROID4.4': {base: 'BrowserStack', device: 'HTC One M8', os: 'android', os_version: '4.4'},
'BS_ANDROID4.3':
{base: 'BrowserStack', device: 'Samsung Galaxy S4', os: 'android', os_version: '4.3'},
'BS_ANDROID4.2':
{base: 'BrowserStack', device: 'Google Nexus 4', os: 'android', os_version: '4.2'},
'BS_ANDROID4.1':
{base: 'BrowserStack', device: 'Google Nexus 7', os: 'android', os_version: '4.1'}
};
var sauceAliases = {
'ALL': Object.keys(customLaunchers).filter(function(item) {
return customLaunchers[item].base == 'SauceLabs';
}),
'DESKTOP': [
'SL_CHROME', 'SL_FIREFOX', 'SL_IE9', 'SL_IE10', 'SL_IE11', 'SL_EDGE', 'SL_SAFARI7',
'SL_SAFARI8', 'SL_SAFARI9', 'SL_SAFARI10'
],
'MOBILE': [
'SL_ANDROID4.1', 'SL_ANDROID4.2', 'SL_ANDROID4.3', 'SL_ANDROID4.4', 'SL_ANDROID5', 'SL_IOS7',
'SL_IOS8', 'SL_IOS9', 'SL_IOS10'
],
'ANDROID': ['SL_ANDROID4.1', 'SL_ANDROID4.2', 'SL_ANDROID4.3', 'SL_ANDROID4.4', 'SL_ANDROID5'],
'IE': ['SL_IE9', 'SL_IE10', 'SL_IE11'],
'IOS': ['SL_IOS7', 'SL_IOS8', 'SL_IOS9', 'SL_IOS10'],
'SAFARI': ['SL_SAFARI7', 'SL_SAFARI8', 'SL_SAFARI9', 'SL_SAFARI10'],
'BETA': ['SL_CHROMEBETA', 'SL_FIREFOXBETA'],
'DEV': ['SL_CHROMEDEV', 'SL_FIREFOXDEV'],
'CI_REQUIRED': buildConfiguration('unitTest', 'SL', true),
'CI_OPTIONAL': buildConfiguration('unitTest', 'SL', false)
};
var browserstackAliases = {
'ALL': Object.keys(customLaunchers).filter(function(item) {
return customLaunchers[item].base == 'BrowserStack';
}),
'DESKTOP': [
'BS_CHROME', 'BS_FIREFOX', 'BS_IE9', 'BS_IE10', 'BS_IE11', 'BS_EDGE', 'BS_SAFARI7',
'BS_SAFARI8', 'BS_SAFARI9', 'BS_SAFARI10'
],
'MOBILE': [
'BS_ANDROID4.3', 'BS_ANDROID4.4', 'BS_IOS7', 'BS_IOS8', 'BS_IOS9', 'BS_IOS10', 'BS_WINDOWSPHONE'
],
'ANDROID': ['BS_ANDROID4.3', 'BS_ANDROID4.4'],
'IE': ['BS_IE9', 'BS_IE10', 'BS_IE11'],
'IOS': ['BS_IOS7', 'BS_IOS8', 'BS_IOS9', 'BS_IOS10'],
'SAFARI': ['BS_SAFARI7', 'BS_SAFARI8', 'BS_SAFARI9', 'BS_SAFARI10'],
'CI_REQUIRED': buildConfiguration('unitTest', 'BS', true),
'CI_OPTIONAL': buildConfiguration('unitTest', 'BS', false)
};
module.exports = {
customLaunchers: customLaunchers,
sauceAliases: sauceAliases,
browserstackAliases: browserstackAliases
};
function buildConfiguration(type, target, required) {
return Object.keys(CIconfiguration)
.filter((item) => {
var conf = CIconfiguration[item][type];
return conf.required === required && conf.target === target;
})
.map((item) => target + '_' + item.toUpperCase());
}

165
build.sh Executable file
View File

@ -0,0 +1,165 @@
#!/usr/bin/env bash
set -e -o pipefail
cd `dirname $0`
PACKAGES=(core
compiler
common
forms
platform-browser
platform-browser-dynamic
platform-server
platform-webworker
platform-webworker-dynamic
http
router
upgrade
compiler-cli
benchpress)
BUILD_ALL=true
BUNDLE=true
for ARG in "$@"; do
case "$ARG" in
--packages=*)
PACKAGES_STR=${ARG#--packages=}
PACKAGES=( ${PACKAGES_STR//,/ } )
BUILD_ALL=false
;;
--bundle=*)
BUNDLE=( "${ARG#--bundle=}" )
;;
*)
echo "Unknown option $ARG."
exit 1
;;
esac
done
export NODE_PATH=${NODE_PATH}:$(pwd)/dist/all:$(pwd)/dist/tools
TSC="node --max-old-space-size=3000 dist/tools/@angular/tsc-wrapped/src/main"
UGLIFYJS=`pwd`/node_modules/.bin/uglifyjs
TSCONFIG=./tools/tsconfig.json
echo "====== (tools)COMPILING: \$(npm bin)/tsc -p ${TSCONFIG} ====="
rm -rf ./dist/tools/
mkdir -p ./dist/tools/
$(npm bin)/tsc -p ${TSCONFIG}
cp ./tools/@angular/tsc-wrapped/package.json ./dist/tools/@angular/tsc-wrapped
if [[ ${BUILD_ALL} == true ]]; then
rm -rf ./dist/all/
mkdir -p ./dist/all/
echo "====== Copying files needed for e2e tests ====="
cp -r ./modules/playground ./dist/all/
cp -r ./modules/playground/favicon.ico ./dist/
#rsync -aP ./modules/playground/* ./dist/all/playground/
mkdir ./dist/all/playground/vendor
cd ./dist/all/playground/vendor
ln -s ../../../../node_modules/core-js/client/core.js .
ln -s ../../../../node_modules/zone.js/dist/zone.js .
ln -s ../../../../node_modules/zone.js/dist/long-stack-trace-zone.js .
ln -s ../../../../node_modules/systemjs/dist/system.src.js .
ln -s ../../../../node_modules/base64-js/lib/b64.js .
ln -s ../../../../node_modules/reflect-metadata/Reflect.js .
ln -s ../../../../node_modules/rxjs .
ln -s ../../../../node_modules/angular/angular.js .
cd -
echo "====== Copying files needed for benchmarks ====="
cp -r ./modules/benchmarks ./dist/all/
cp -r ./modules/benchmarks/favicon.ico ./dist/
mkdir ./dist/all/benchmarks/vendor
cd ./dist/all/benchmarks/vendor
ln -s ../../../../node_modules/core-js/client/core.js .
ln -s ../../../../node_modules/zone.js/dist/zone.js .
ln -s ../../../../node_modules/zone.js/dist/long-stack-trace-zone.js .
ln -s ../../../../node_modules/systemjs/dist/system.src.js .
ln -s ../../../../node_modules/base64-js/lib/b64.js .
ln -s ../../../../node_modules/reflect-metadata/Reflect.js .
ln -s ../../../../node_modules/rxjs .
ln -s ../../../../node_modules/angular/angular.js .
ln -s ../../../../bower_components/polymer .
ln -s ../../../../node_modules/incremental-dom/dist/incremental-dom-cjs.js
cd -
TSCONFIG=./modules/tsconfig.json
echo "====== (all)COMPILING: \$(npm bin)/tsc -p ${TSCONFIG} ====="
# compile ts code
$TSC -p modules/tsconfig.json
rm -rf ./dist/packages-dist
fi
for PACKAGE in ${PACKAGES[@]}
do
PWD=`pwd`
SRCDIR=${PWD}/modules/@angular/${PACKAGE}
DESTDIR=${PWD}/dist/packages-dist/${PACKAGE}
UMD_ES5_PATH=${DESTDIR}/bundles/${PACKAGE}.umd.js
UMD_TESTING_ES5_PATH=${DESTDIR}/bundles/${PACKAGE}-testing.umd.js
UMD_ES5_MIN_PATH=${DESTDIR}/bundles/${PACKAGE}.umd.min.js
LICENSE_BANNER=${PWD}/modules/@angular/license-banner.txt
rm -rf ${DESTDIR}
echo "====== COMPILING: ${TSC} -p ${SRCDIR}/tsconfig-build.json ====="
$TSC -p ${SRCDIR}/tsconfig-build.json
cp ${SRCDIR}/package.json ${DESTDIR}/
cp ${PWD}/modules/@angular/README.md ${DESTDIR}/
if [[ -e ${SRCDIR}/tsconfig-testing.json ]]; then
echo "====== COMPILING TESTING: ${TSC} -p ${SRCDIR}/tsconfig-testing.json"
$TSC -p ${SRCDIR}/tsconfig-testing.json
fi
echo "====== TSC 1.8 d.ts compat for ${DESTDIR} ====="
# safely strips 'readonly' specifier from d.ts files to make them compatible with tsc 1.8
if [ "$(uname)" == "Darwin" ]; then
find ${DESTDIR} -type f -name '*.d.ts' -print0 | xargs -0 sed -i '' -e 's/\(^ *(static |private )*\)*readonly */\1/g'
find ${DESTDIR} -type f -name '*.d.ts' -print0 | xargs -0 sed -i '' -e 's/\/\/\/ <reference types="node" \/>//g'
find ${DESTDIR} -type f -name '*.d.ts' -print0 | xargs -0 sed -i '' -E 's/^( +)abstract ([[:alnum:]]+\:)/\1\2/g'
else
find ${DESTDIR} -type f -name '*.d.ts' -print0 | xargs -0 sed -i -e 's/\(^ *(static |private )*\)*readonly */\1/g'
find ${DESTDIR} -type f -name '*.d.ts' -print0 | xargs -0 sed -i -e 's/\/\/\/ <reference types="node" \/>//g'
find ${DESTDIR} -type f -name '*.d.ts' -print0 | xargs -0 sed -i -E 's/^( +)abstract ([[:alnum:]]+\:)/\1\2/g'
fi
if [[ ${PACKAGE} == benchpress ]]; then
cp ${SRCDIR}/*.md ${DESTDIR}
cp -r ${SRCDIR}/docs ${DESTDIR}
fi
if [[ ${BUNDLE} == true && ${PACKAGE} != compiler-cli && ${PACKAGE} != benchpress ]]; then
echo "====== BUNDLING: ${SRCDIR} ====="
mkdir ${DESTDIR}/bundles
(
cd ${SRCDIR}
echo "====== Rollup ${PACKAGE} index"
../../../node_modules/.bin/rollup -c rollup.config.js
cat ${LICENSE_BANNER} > ${UMD_ES5_PATH}.tmp
cat ${UMD_ES5_PATH} >> ${UMD_ES5_PATH}.tmp
mv ${UMD_ES5_PATH}.tmp ${UMD_ES5_PATH}
$UGLIFYJS -c --screw-ie8 --comments -o ${UMD_ES5_MIN_PATH} ${UMD_ES5_PATH}
if [[ -e rollup-testing.config.js ]]; then
echo "====== Rollup ${PACKAGE} testing"
../../../node_modules/.bin/rollup -c rollup-testing.config.js
echo "{\"main\": \"../bundles/${PACKAGE}-testing.umd.js\"}" > ${DESTDIR}/testing/package.json
cat ${LICENSE_BANNER} > ${UMD_TESTING_ES5_PATH}.tmp
cat ${UMD_TESTING_ES5_PATH} >> ${UMD_TESTING_ES5_PATH}.tmp
mv ${UMD_TESTING_ES5_PATH}.tmp ${UMD_TESTING_ES5_PATH}
fi
) 2>&1 | grep -v "as external dependency"
fi
done
./modules/@angular/examples/build.sh

11
circle.yml Normal file
View File

@ -0,0 +1,11 @@
machine:
node:
version: 5.4.1
dependencies:
pre:
- npm install -g npm
test:
override:
- gulp lint

40
docs/PUBLIC_API.md Normal file
View File

@ -0,0 +1,40 @@
# Supported Public API Surface of Angular
Our SemVer, timed-release cycle and deprecation policy currently applies to these npm packages:
- `@angular/core`
- `@angular/common`
- `@angular/platform-browser`
- `@angular/platform-browser-dynamic`
- `@angular/platform-server`
- `@angular/platform-webworker`
- `@angular/platform-webworker-dynamic`
- `@angular/upgrade`
- `@angular/router`
- `@angular/forms`
- `@angular/http`
One intentional omission from this list is `@angular/compiler`, which is currently considered a low level api and is subject to internal changes. These changes will not affect any applications or libraries using the higher-level apis (the command line interface or JIT compilation via `@angular/platform-browser-dynamic`). Only very specific use-cases require direct access to the compiler API (mostly tooling integration for IDEs, linters, etc). If you are working on this kind of integration, please reach out to us first.
Additionally only the command line usage (not direct use of APIs) of `@angular/compiler-cli` is covered.
Other projects developed by the Angular team like angular-cli, Angular Material, benchpress, will be covered by these or similar guarantees in the future as they mature.
Within the supported packages, we provide guarantees for:
- symbols exported via the main entry point (e.g. `@angular/core`) and testing entry point (e.g. `@angular/core/testing`). This applies to both runtime/JavaScript values and TypeScript types.
- symbols exported via global namespace `ng` (e.g. `ng.core`)
- bundles located in the `bundles/` directory of our npm packages (e.g. `@angular/core/bundles/core.umd.js`)
We explicitly don't consider the following to be our public API surface:
- any file/import paths within our package except for the `/`, `/testing` and `/bundles/*`
- constructors of injectable classes (services and directives) - please use DI to obtain instances of these classes
- any class members or symbols marked as `private` or prefixed with underscore
- extending any of our classes unless the support for this is specifically documented in the API docs
- the contents and API surface of the code generated by Angular's compiler (with one notable exception: the existence and name of `NgModuleFactory` instances exported from generated code is guaranteed)
Our peer dependencies (e.g. typescript, zone.js, or rxjs) are not considered part of our API surface, but they are included in our SemVer policies. We might update the required version of any of these dependencies in minor releases if the update doesn't cause breaking changes for Angular applications. Peer dependency updates that result in non-trivial breaking changes must be deferred to major Angular releases.

View File

@ -1,366 +0,0 @@
.hide { display: none !important; }
body {
overflow: hidden;
max-width: 100%;
max-height: 100%;
font-size: 14px;
}
a {
color: #3f51b5;
}
table {
margin-bottom: 20px;
max-width: 100%;
width: 100%;
border-spacing: 0;
border-collapse: collapse;
background-color: transparent;
}
td,
th {
padding: $baseline-grid ($baseline-grid * 2);
border-top: 1px solid #ddd;
vertical-align: top;
}
th {
border-bottom: 2px solid #ddd;
vertical-align: bottom;
}
pre {
white-space: pre;
white-space: pre-wrap;
word-wrap: break-word;
}
.md-sidenav-inner {
background: #fff;
}
.layout-content,
.doc-content {
max-width: 864px;
margin: auto;
}
.layout-label {
width: 120px;
}
.layout-content code.highlight {
margin-bottom: 15px;
}
.menu-item {
background: none;
border-width: 0;
cursor: pointer;
display: block;
color: #333;
font-size: inherit;
line-height: 40px;
max-height: 40px;
opacity: 1;
margin: 0;
outline: none;
padding: 0px 28px;
position: relative;
text-align: left;
text-decoration: none;
width: 100%;
z-index: 1;
-webkit-transition: 0.45s cubic-bezier(0.35, 0, 0.25, 1);
-webkit-transition-property: max-height, background-color, opacity;
-moz-transition: 0.45s cubic-bezier(0.35, 0, 0.25, 1);
-moz-transition-property: max-height, background-color, opacity;
transition: 0.45s cubic-bezier(0.35, 0, 0.25, 1);
transition-property: max-height, background-color, opacity;
}
.menu-item.ng-hide {
max-height: 0;
opacity: 0;
}
.menu-item:hover {
color: #999;
}
.menu-item:focus {
font-weight: bold;
}
.menu-item.menu-title {
color: #888;
font-size: 14px;
padding-left: 16px;
text-align: left;
text-transform: uppercase;
transition: color 0.35s cubic-bezier(0.35, 0, 0.25, 1);
}
.menu-item.menu-title:hover,
.menu-item.menu-title.active {
color: #1976d2;
}
.menu-icon {
background: none;
border: none;
}
.app-toolbar .md-toolbar-tools h3 {
-webkit-margin-before: 0;
-webkit-margin-after: 0;
}
.demo-container {
border-radius: 4px;
margin-top: 16px;
-webkit-transition: 0.02s padding cubic-bezier(0.35, 0, 0.25, 1);
transition: 0.02s padding cubic-bezier(0.35, 0, 0.25, 1);
position: relative;
padding-bottom: 0;
}
.demo-source-tabs {
z-index: 1;
-webkit-transition: all 0.45s cubic-bezier(0.35, 0, 0.25, 1);
transition: all 0.45s cubic-bezier(0.35, 0, 0.25, 1);
max-height: 448px;
min-height: 448px;
background: #fff;
overflow: hidden;
}
md-tabs.demo-source-tabs md-tab,
md-tabs.demo-source-tabs .md-header {
background-color: #444444 !important;
}
md-tabs.demo-source-tabs md-tab-label {
color: #ccc !important;
}
md-tabs.demo-source-tabs .active md-tab-label {
color: #fff !important;
}
.demo-source-tabs.ng-hide {
max-height: 0px;
min-height: 0px;
}
.demo-source-tabs {
position: relative;
width: 100%;
z-index: 0;
}
.demo-content {
position: relative;
overflow:hidden;
min-height: 448px;
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -moz-flex;
display: -ms-flexbox;
display: flex;
}
.small-demo .demo-source-tabs:not(.ng-hide) {
min-height: 224px;
max-height: 224px;
}
.small-demo .demo-content {
min-height: 128px;
}
.demo-content > * {
-webkit-box-flex: 1;
-webkit-flex: 1;
-moz-box-flex: 1;
-moz-flex: 1;
-ms-flex: 1;
flex: 1;
}
.demo-content > div[layout-fill] {
min-height: 448px;
}
.small-demo .demo-content > div[layout-fill] {
min-height: 224px;
}
.small-demo .demo-toolbar,
.small-demo .md-toolbar-tools {
min-height: 48px;
max-height: 48px;
font-size: 20px;
}
.show-source md-toolbar.demo-toolbar {
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.36);
}
.demo-toolbar .md-button {
color: #616161;
}
md-toolbar.demo-toolbar,
.demo-source-tabs md-tab,
.demo-source-tabs .tabs-header {
background: #E0E0E0 !important;
color: #616161;
}
md-toolbar.demo-toolbar md-tab-label {
color: #99E4EE
}
md-toolbar.demo-toolbar .md-button:hover,
md-toolbar.demo-toolbar .md-button:focus,
md-toolbar.demo-toolbar .md-button.active {
background: rgba(0,0,0,0.1);
}
md-toolbar.demo-toolbar .md-button {
-webkit-transition: all 0.3s linear;
-moz-transition: all 0.3s linear;
transition: all 0.3s linear;
}
.demo-source-container {
display: block;
border: 1px solid #ddd;
background-color: #f6f6f6;
height: 400px;
}
.demo-source-content {
height: 400px;
}
.demo-source-content,
.demo-source-content pre,
.demo-source-content code {
background: #f6f6f6;
font-family: monospace;
}
.demo-source-content pre {
max-width: 100%;
overflow-wrap: break-word;
}
.show-source div[demo-include] {
border-top: #ddd solid 2px;
}
.menu-separator-icon {
margin: 0;
}
.menu-module-name {
opacity: 0.6;
font-size: 18px;
}
/************
* DOCS
************/
.api-options-bar .md-button {
margin: 4px;
padding: 4px;
}
.api-options-bar .md-button:hover,
.api-options-bar .md-button:focus {
background: rgba(0, 0, 0, 0.2);
}
.api-options-bar.with-icon md-icon {
position: absolute;
top: -3px;
left: 2px;
}
.api-options-bar.with-icon .md-button span {
margin-left: 22px;
}
.api-params-item {
min-height: 72px;
border-bottom: 1px solid #ddd;
}
.api-params-label {
margin-right: 8px;
text-align: center;
margin-top: 14px;
-webkit-align-self: flex-start;
-moz-align-self: flex-start;
-ms-flex-item-align: start;
align-self: flex-start;
}
.api-params-title {
color: #888;
}
code.api-type {
font-weight: bold;
}
ul {
margin: 0;
}
ul li {
margin-top: 3px;
list-style-position: inside;
}
ul li:first-child {
margin-top: 0;
}
.layout-title {
color: #999999;
font-size: 14px;
font-weight: bold;
text-transform: uppercase;
}
.api-params-content ul {
padding-left: 4px;
}
ul.methods > li {
margin-bottom: 48px;
}
ul.methods .method-function-syntax {
font-weight: normal;
font-size: 20px;
margin: 0;
-webkit-margin-before: 0;
-webkit-margin-after: 0;
}
ul.methods li h3 {
/* border-bottom: 1px solid #eee; */
}
@media (max-width: 600px) {
ul.methods > li {
padding-left: 0;
border-left: none;
list-style: default;
}
ul.methods .method-function-syntax {
font-size: 14px;
}
}
.version {
padding-left: 10px;
text-decoration: underline;
font-size: 0.95em;
}
.demo-source-container pre,
.demo-source-container code {
min-height: 100%;
}
md-content.demo-source-container > hljs > pre > code.highlight {
position : absolute;
top : 0px;
left: 0px;
right: 0px;
}
.extraPad {
padding-left:32px !important;
padding-right:32px !important;
}

View File

@ -1,142 +0,0 @@
/* GitHub Theme */
.prettyprint {
background: white;
font-family: Menlo, 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', Monaco, Consolas, monospace;
font-size: 12px;
line-height: 1.5;
}
.lang-text * {
color: #333333!important;
}
.pln {
color: #333333;
}
@media screen {
.str {
color: #dd1144;
}
.kwd {
color: #333333;
}
.com {
color: #999988;
}
.typ {
color: #445588;
}
.lit {
color: #445588;
}
.pun {
color: #333333;
}
.opn {
color: #333333;
}
.clo {
color: #333333;
}
.tag {
color: navy;
}
.atn {
color: teal;
}
.atv {
color: #dd1144;
}
.dec {
color: #333333;
}
.var {
color: teal;
}
.fun {
color: #990000;
}
}
@media print, projection {
.str {
color: #006600;
}
.kwd {
color: #006;
font-weight: bold;
}
.com {
color: #600;
font-style: italic;
}
.typ {
color: #404;
font-weight: bold;
}
.lit {
color: #004444;
}
.pun, .opn, .clo {
color: #444400;
}
.tag {
color: #006;
font-weight: bold;
}
.atn {
color: #440044;
}
.atv {
color: #006600;
}
}
/* Specify class=linenums on a pre to get line numbering */
ol.linenums {
margin-top: 0;
margin-bottom: 0;
}
/* IE indents via margin-left */
li.L0,
li.L1,
li.L2,
li.L3,
li.L4,
li.L5,
li.L6,
li.L7,
li.L8,
li.L9 {
/* */
}
/* Alternate shading for lines */
li.L1,
li.L3,
li.L5,
li.L7,
li.L9 {
/* */
}

View File

@ -1,55 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Angular 2 Docs</title>
<base href="/">
<link rel="stylesheet" type="text/css" href="/lib/angular-material/angular-material.css">
<link rel="stylesheet" type="text/css" href="/css/prettify-theme.css">
<link rel="stylesheet" type="text/css" href="/css/app.css">
<script src="/lib/hammerjs/hammer.js"></script>
<script src="/lib/google-code-prettify/src/prettify.js"></script>
<script src="/lib/google-code-prettify/src/lang-css.js"></script>
<script src="/lib/angular/angular.js"></script>
<script src="/lib/angular-animate/angular-animate.js"></script>
<script src="/lib/angular-aria/angular-aria.js"></script>
<script src="/lib/angular-material/angular-material.js"></script>
<script src="/js/navigation-modules.js"></script>
<script src="/js/navigation-guides.js"></script>
<script src="/js/app.js"></script>
<script src="/js/code.js"></script>
</head>
<body ng-app="app" ng-controller="NavController as nav" layout="column">
<md-toolbar md-scroll-shrink>
<h1 class="md-toolbar-tools">Angular V2</h1>
</md-toolbar>
<section layout="row">
<md-content>
<h2>Navigation</h2>
<section ng-repeat="area in nav.areas">
<h3>{{ area.name }}</h3>
<md-list>
<md-item ng-repeat="section in area.sections">
<h3><a href="{{section.path}}">{{section.name}}</a></h3>
<ul>
<li ng-repeat="page in section.pages">
<a href="{{page.path}}">{{ page.name }}</a>
</li>
</ul>
</md-item>
</md-list>
</section>
</md-content>
<md-content class="md-padding">
<ng-include src="nav.currentPage.partial"></ng-include>
</md-content>
</section>
</body>
</html>

View File

@ -1,47 +0,0 @@
angular.module('app', ['ngMaterial', 'navigation-modules', 'navigation-guides', 'code'])
.config(function($locationProvider) {
$locationProvider.html5Mode(true);
})
.controller('NavController', ['$scope', '$location', 'MODULES', 'GUIDES',
function($scope, $location, MODULES, GUIDES) {
var that = this;
this.areas = [
{ name: 'Guides', sections: [ { pages: GUIDES.pages } ] },
{ name: 'Modules', sections: MODULES.sections }
];
this.updateCurrentPage = function(path) {
path = path.replace(/^\//, '');
console.log('path', path);
this.currentPage = null;
this.areas.forEach(function(area) {
area.sections.forEach(function(section) {
// Short-circuit out if the page has been found
if ( that.currentPage ) {
return;
}
if (section.path === path) {
console.log('found!');
that.currentPage = section;
} else {
section.pages.forEach(function(page) {
if (page.path === path) {
that.currentPage = page;
}
});
}
});
});
};
$scope.$watch(
function getLocationPath() { return $location.path(); },
function handleLocationPathChange(path) { that.updateCurrentPage(path); }
);
}]);

View File

@ -1,15 +0,0 @@
angular.module('code', [])
.directive('code', function() {
return {
restrict: 'E',
terminal: true,
compile: function(element) {
var linenums = element.hasClass('linenum');
var match = /lang-(\S+)/.exec(element[0].className);
var lang = match && match[1];
var html = element.html();
element.html(window.prettyPrintOne(html, lang, linenums));
}
};
});

View File

@ -1,20 +0,0 @@
{
"name": "angular-docs",
"main": "index.js",
"version": "0.0.0",
"homepage": "https://github.com/angular/angular",
"authors": [],
"license": "Apache-2.0",
"private": true,
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"angular-material": "~0.6.0",
"google-code-prettify": "~1.0.3"
}
}

View File

@ -1,151 +0,0 @@
require('../../tools/transpiler/index.js').init();
var Package = require('dgeni').Package;
var jsdocPackage = require('dgeni-packages/jsdoc');
var nunjucksPackage = require('dgeni-packages/nunjucks');
var path = require('canonical-path');
var PARTIAL_PATH = 'partials';
var MODULES_DOCS_PATH = PARTIAL_PATH + '/modules';
var GUIDES_PATH = PARTIAL_PATH + '/guides';
// Define the dgeni package for generating the docs
module.exports = new Package('angular', [jsdocPackage, nunjucksPackage])
// Register the services and file readers
.factory(require('./services/modules'))
.factory(require('./services/atParser'))
.factory(require('./services/getJSDocComment'))
.factory(require('./services/SourceFile'))
.factory(require('./services/TraceurParser'))
.factory(require('./services/traceurOptions'))
.factory(require('./services/ParseTreeVisitor'))
.factory(require('./services/AttachCommentTreeVisitor'))
.factory(require('./services/ExportTreeVisitor'))
.factory(require('./readers/atScript'))
.factory(require('./readers/ngdoc'))
.factory('EXPORT_DOC_TYPES', function() {
return [
'class',
'function',
'var',
'const'
];
})
// Register the processors
.processor(require('./processors/generateDocsFromComments'))
.processor(require('./processors/processModuleDocs'))
.processor(require('./processors/processClassDocs'))
.processor(require('./processors/generateNavigationDoc'))
.processor(require('./processors/extractTitleFromGuides'))
// Configure the log service
.config(function(log) {
log.level = 'warning';
})
// Configure file reading
.config(function(readFilesProcessor, atScriptFileReader, ngdocFileReader) {
readFilesProcessor.fileReaders = [atScriptFileReader, ngdocFileReader];
readFilesProcessor.basePath = path.resolve(__dirname, '../..');
readFilesProcessor.sourceFiles = [
{ include: 'modules/*/*.js', basePath: 'modules' },
{ include: 'modules/*/src/**/*.js', basePath: 'modules' },
{ include: 'modules/*/docs/**/*.md', basePath: 'modules' },
{ include: 'docs/content/**/*.md', basePath: 'docs/content' }
];
})
// Configure file writing
.config(function(writeFilesProcessor) {
writeFilesProcessor.outputFolder = 'dist/docs';
})
// Configure rendering
.config(function(templateFinder, templateEngine) {
// Nunjucks and Angular conflict in their template bindings so change Nunjucks
templateEngine.config.tags = {
variableStart: '{$',
variableEnd: '$}'
};
templateFinder.templateFolders
.unshift(path.resolve(__dirname, 'templates'));
templateFinder.templatePatterns = [
'${ doc.template }',
'${ doc.id }.${ doc.docType }.template.html',
'${ doc.id }.template.html',
'${ doc.docType }.template.html',
'common.template.html'
];
})
// Add in a custom tag that we use when generating public docs
.config(function(parseTagsProcessor) {
parseTagsProcessor.tagDefinitions.push({ name: 'publicModule' });
})
// Configure ids and paths
.config(function(computeIdsProcessor, computePathsProcessor, EXPORT_DOC_TYPES) {
computeIdsProcessor.idTemplates.push({
docTypes: EXPORT_DOC_TYPES,
idTemplate: '${moduleDoc.id}.${name}',
getAliases: function(doc) { return [doc.id]; }
});
computeIdsProcessor.idTemplates.push({
docTypes: ['member'],
idTemplate: '${classDoc.id}.${name}',
getAliases: function(doc) { return [doc.id]; }
});
computeIdsProcessor.idTemplates.push({
docTypes: ['guide'],
getId: function(doc) {
return doc.fileInfo.relativePath
// path should be relative to `modules` folder
.replace(/.*\/?modules\//, '')
// path should not include `/docs/`
.replace(/\/docs\//, '/')
// path should not have a suffix
.replace(/\.\w*$/, '');
},
getAliases: function(doc) { return [doc.id]; }
});
computePathsProcessor.pathTemplates.push({
docTypes: ['module'],
pathTemplate: '${id}',
outputPathTemplate: MODULES_DOCS_PATH + '/${id}/index.html'
});
computePathsProcessor.pathTemplates.push({
docTypes: EXPORT_DOC_TYPES,
pathTemplate: '${moduleDoc.path}/${name}',
outputPathTemplate: MODULES_DOCS_PATH + '/${path}/index.html'
});
computePathsProcessor.pathTemplates.push({
docTypes: ['member'],
pathTemplate: '${classDoc.path}/${name}',
getOutputPath: function() {} // These docs are not written to their own file, instead they are part of their class doc
});
computePathsProcessor.pathTemplates.push({
docTypes: ['guide'],
pathTemplate: '${id}',
outputPathTemplate: GUIDES_PATH + '/${id}.html'
});
});

View File

@ -1,10 +0,0 @@
var Package = require('dgeni').Package;
module.exports = function mockPackage() {
return new Package('mockPackage', [require('../')])
// provide a mock log service
.factory('log', function() { return require('dgeni/lib/mocks/log')(false); });
};

View File

@ -1,24 +0,0 @@
var _ = require('lodash');
module.exports = function extractTitleFromGuides() {
return {
$runAfter: ['processing-docs'],
$runBefore: ['docs-processed'],
$process: function(docs) {
_(docs).forEach(function(doc) {
if (doc.docType === 'guide') {
doc.name = doc.name || getNameFromHeading(doc.description);
}
});
}
};
};
function getNameFromHeading(text) {
var match = /^\s*#\s*(.*)/.exec(text);
if (match) {
return match[1];
}
}

View File

@ -1,34 +0,0 @@
var _ = require('lodash');
module.exports = function generateDocsFromComments(log) {
return {
$runAfter: ['files-read'],
$runBefore: ['parsing-tags'],
$process: function(docs) {
var commentDocs = [];
docs = _.filter(docs, function(doc) {
if (doc.docType !== 'atScriptFile') {
return true;
} else {
_.forEach(doc.fileInfo.comments, function(comment) {
// we need to check for `/**` at the start of the comment to find all the jsdoc style comments
comment.range.toString().replace(/^\/\*\*([\w\W]*)\*\/$/g, function(match, commentBody) {
// Create a doc from this comment
commentDocs.push({
fileInfo: doc.fileInfo,
startingLine: comment.range.start.line,
endingLine: comment.range.end.line,
content: commentBody,
codeTree: comment.treeAfter,
docType: 'atScriptDoc'
});
});
});
}
});
return docs.concat(commentDocs);
}
};
};

View File

@ -1,66 +0,0 @@
var _ = require('lodash');
module.exports = function generateNavigationDoc() {
return {
$runAfter: ['docs-processed'],
$runBefore: ['rendering-docs'],
$process: function(docs) {
var modulesDoc = {
value: { sections: [] },
moduleName: 'navigation-modules',
serviceName: 'MODULES',
template: 'data-module.template.js',
outputPath: 'js/navigation-modules.js'
};
_.forEach(docs, function(doc) {
if ( doc.docType === 'module' ) {
var moduleNavItem = {
path: doc.path,
partial: doc.outputPath,
name: doc.id,
type: 'module',
pages: []
};
modulesDoc.value.sections.push(moduleNavItem);
_.forEach(doc.exports, function(exportDoc) {
var exportNavItem = {
path: exportDoc.path,
partial: exportDoc.outputPath,
name: exportDoc.name,
type: exportDoc.docType
};
moduleNavItem.pages.push(exportNavItem);
});
}
});
docs.push(modulesDoc);
var guidesDoc = {
value: { pages: [] },
moduleName: 'navigation-guides',
serviceName: 'GUIDES',
template: 'data-module.template.js',
outputPath: 'js/navigation-guides.js'
};
_.forEach(docs, function(doc) {
if ( doc.docType === 'guide' ) {
var guideDoc = {
path: doc.path,
partial: doc.outputPath,
name: doc.name,
type: 'guide'
};
guidesDoc.value.pages.push(guideDoc);
}
});
docs.push(guidesDoc);
}
};
};

View File

@ -1,47 +0,0 @@
var _ = require('lodash');
module.exports = function processClassDocs(log, getJSDocComment) {
return {
$runAfter: ['processModuleDocs'],
$runBefore: ['parsing-tags', 'generateDocsFromComments'],
ignorePrivateMembers: false,
$process: function(docs) {
var memberDocs = [];
var ignorePrivateMembers = this.ignorePrivateMembers;
_.forEach(docs, function(classDoc) {
if ( classDoc.docType === 'class' ) {
classDoc.members = [];
// Create a new doc for each member of the class
_.forEach(classDoc.elements, function(memberDoc) {
if (ignorePrivateMembers && memberDoc.name.literalToken.value.charAt(0) === '_') return;
classDoc.members.push(memberDoc);
memberDocs.push(memberDoc);
memberDoc.docType = 'member';
memberDoc.classDoc = classDoc;
memberDoc.name = memberDoc.name.literalToken.value;
if (memberDoc.commentBefore ) {
// If this export has a comment, remove it from the list of
// comments collected in the module
var index = classDoc.moduleDoc.comments.indexOf(memberDoc.commentBefore);
if ( index !== -1 ) {
classDoc.moduleDoc.comments.splice(index, 1);
}
_.assign(memberDoc, getJSDocComment(memberDoc.commentBefore));
}
});
}
});
return docs.concat(memberDocs);
}
};
};

View File

@ -1,46 +0,0 @@
var _ = require('lodash');
module.exports = function processModuleDocs(log, ExportTreeVisitor, getJSDocComment) {
return {
$runAfter: ['files-read'],
$runBefore: ['parsing-tags', 'generateDocsFromComments'],
$process: function(docs) {
var exportDocs = [];
_.forEach(docs, function(doc) {
if ( doc.docType === 'module' ) {
log.debug('processing', doc.moduleTree.moduleName);
doc.exports = [];
if ( doc.moduleTree.visit ) {
var visitor = new ExportTreeVisitor();
visitor.visit(doc.moduleTree);
_.forEach(visitor.exports, function(exportDoc) {
doc.exports.push(exportDoc);
exportDocs.push(exportDoc);
exportDoc.moduleDoc = doc;
if (exportDoc.comment) {
// If this export has a comment, remove it from the list of
// comments collected in the module
var index = doc.comments.indexOf(exportDoc.comment);
if ( index !== -1 ) {
doc.comments.splice(index, 1);
}
_.assign(exportDoc, getJSDocComment(exportDoc.comment));
}
});
}
}
});
return docs.concat(exportDocs);
}
};
};

View File

@ -1,32 +0,0 @@
var path = require('canonical-path');
/**
* @dgService atScriptFileReader
* @description
* This file reader will create a simple doc for each
* file including a code AST of the AtScript in the file.
*/
module.exports = function atScriptFileReader(log, atParser, modules) {
var reader = {
name: 'atScriptFileReader',
defaultPattern: /\.js$/,
getDocs: function(fileInfo) {
var moduleDoc = atParser.parseModule(fileInfo);
moduleDoc.docType = 'module';
moduleDoc.id = moduleDoc.moduleTree.moduleName;
moduleDoc.aliases = [moduleDoc.id];
modules[moduleDoc.id] = moduleDoc;
// Readers return a collection of docs read from the file
// but in this read there is only one document (module) to return
return [moduleDoc];
}
};
return reader;
};

View File

@ -1,55 +0,0 @@
var mockPackage = require('../mocks/mockPackage');
var Dgeni = require('dgeni');
describe('atScript file reader', function() {
var dgeni, injector, reader;
var fileContent =
'import {CONST} from "facade/lang";\n' +
'\n' +
'/**\n' +
'* A parameter annotation that creates a synchronous eager dependency.\n' +
'*\n' +
'* class AComponent {\n' +
'* constructor(@Inject("aServiceToken") aService) {}\n' +
'* }\n' +
'*\n' +
'*/\n' +
'export class Inject {\n' +
'token;\n' +
'@CONST()\n' +
'constructor(token) {\n' +
'this.token = token;\n' +
'}\n' +
'}';
beforeEach(function() {
dgeni = new Dgeni([mockPackage()]);
injector = dgeni.configureInjector();
reader = injector.get('atScriptFileReader');
});
it('should provide a default pattern', function() {
expect(reader.defaultPattern).toEqual(/\.js$/);
});
it('should parse the file using the atParser and return a single doc', function() {
var atParser = injector.get('atParser');
spyOn(atParser, 'parseModule').and.callThrough();
var docs = reader.getDocs({
content: fileContent,
relativePath: 'di/src/annotations.js'
});
expect(atParser.parseModule).toHaveBeenCalled();
expect(docs.length).toEqual(1);
expect(docs[0].docType).toEqual('module');
});
});

View File

@ -1,32 +0,0 @@
var path = require('canonical-path');
/**
* @dgService ngdocFileReader
* @description
* This file reader will pull the contents from a text file (by default .ngdoc)
*
* The doc will initially have the form:
* ```
* {
* content: 'the content of the file',
* startingLine: 1
* }
* ```
*/
module.exports = function ngdocFileReader() {
var reader = {
name: 'ngdocFileReader',
defaultPattern: /\.md$/,
getDocs: function(fileInfo) {
// We return a single element array because ngdoc files only contain one document
return [{
docType: 'guide',
content: fileInfo.content,
startingLine: 1
}];
}
};
return reader;
};

View File

@ -1,45 +0,0 @@
var ngdocFileReaderFactory = require('./ngdoc');
var path = require('canonical-path');
describe('ngdocFileReader', function() {
var fileReader;
var createFileInfo = function(file, content, basePath) {
return {
fileReader: fileReader.name,
filePath: file,
baseName: path.basename(file, path.extname(file)),
extension: path.extname(file).replace(/^\./, ''),
basePath: basePath,
relativePath: path.relative(basePath, file),
content: content
};
};
beforeEach(function() {
fileReader = ngdocFileReaderFactory();
});
describe('defaultPattern', function() {
it('should match .md files', function() {
expect(fileReader.defaultPattern.test('abc.md')).toBeTruthy();
expect(fileReader.defaultPattern.test('abc.js')).toBeFalsy();
});
});
describe('getDocs', function() {
it('should return an object containing info about the file and its contents', function() {
var fileInfo = createFileInfo('project/path/modules/someModule/foo/docs/subfolder/bar.ngdoc', 'A load of content', 'project/path');
expect(fileReader.getDocs(fileInfo)).toEqual([{
docType: 'guide',
content: 'A load of content',
startingLine: 1
}]);
});
});
});

View File

@ -1,54 +0,0 @@
module.exports = function AttachCommentTreeVisitor(ParseTreeVisitor, log) {
function AttachCommentTreeVisitorImpl() {
ParseTreeVisitor.call(this);
}
AttachCommentTreeVisitorImpl.prototype = {
__proto__: ParseTreeVisitor.prototype,
visit: function(tree, comments) {
this.comments = comments;
this.index = 0;
this.currentComment = this.comments[this.index];
if (this.currentComment) log.silly('comment: ' +
this.currentComment.range.start.line + ' - ' +
this.currentComment.range.end.line + ' : ' +
this.currentComment.range.toString());
ParseTreeVisitor.prototype.visit.call(this, tree);
},
// Really we ought to subclass ParseTreeVisitor but this is fiddly in ES5 so
// it is easier to simply override the prototype's method on the instance
visitAny: function(tree) {
if (tree && tree.location && tree.location.start && this.currentComment &&
this.currentComment.range.end.offset < tree.location.start.offset) {
log.silly('tree: ' + tree.constructor.name + ' - ' + tree.location.start.line);
while (this.currentComment &&
this.currentComment.range.end.offset < tree.location.start.offset) {
var commentText = this.currentComment.range.toString();
// Only store the comment if it is JSDOC style (e.g. /** some comment */)
if (/^\/\*\*([\w\W]*)\*\/$/.test(commentText)) {
log.info('comment: ' + this.currentComment.range.start.line + ' - ' +
this.currentComment.range.end.line + ' : ' +
commentText);
tree.commentBefore = this.currentComment;
this.currentComment.treeAfter = tree;
}
this.index++;
this.currentComment = this.comments[this.index];
}
}
return ParseTreeVisitor.prototype.visitAny.call(this, tree);
}
};
return AttachCommentTreeVisitorImpl;
};

View File

@ -1,103 +0,0 @@
module.exports = function ExportTreeVisitor(ParseTreeVisitor, log) {
function ExportTreeVisitorImpl() {
ParseTreeVisitor.call(this);
}
ExportTreeVisitorImpl.prototype = {
__proto__: ParseTreeVisitor.prototype,
visitExportDeclaration: function(tree) {
// We are entering an export declaration - create an object to track it
this.currentExport = {
comment: tree.commentBefore,
location: tree.location
};
log.silly('enter', tree.type, tree.commentBefore ? 'has comment' : '');
ParseTreeVisitor.prototype.visitExportDeclaration.call(this, tree);
log.silly('exit', this.currentExport);
if(this.currentExport) {
// We are exiting the export declaration - store the export object
this.exports.push(this.currentExport);
}
this.currentExport = null;
},
visitVariableDeclaration: function(tree) {
if ( this.currentExport ) {
this.updateExport(tree);
this.currentExport.docType = 'var';
this.currentExport.name = tree.lvalue.identifierToken.value;
this.currentExport.variableDeclaration = tree;
}
},
visitFunctionDeclaration: function(tree) {
if ( this.currentExport ) {
this.updateExport(tree);
this.currentExport.name = tree.name.identifierToken.value;
this.currentExport.functionKind = tree.functionKind;
this.currentExport.parameters = tree.parameterList.parameters;
this.currentExport.typeAnnotation = tree.typeAnnotation;
this.currentExport.annotations = tree.annotations;
this.currentExport.docType = 'function';
log.silly(tree.type, tree.commentBefore ? 'has comment' : '');
}
},
visitClassDeclaration: function(tree) {
if ( this.currentExport ) {
this.updateExport(tree);
this.currentExport.name = tree.name.identifierToken.value;
this.currentExport.superClass = tree.superClass;
this.currentExport.annotations = tree.annotations;
this.currentExport.elements = tree.elements;
this.currentExport.docType = 'class';
}
},
visitAsyncFunctionDeclaration: function(tree) {
if ( this.currentExport ) {
this.updateExport(tree);
}
},
visitExportDefault: function(tree) {
if ( this.currentExport ) {
this.updateExport(tree);
this.currentExport.name = 'DEFAULT';
this.currentExport.defaultExport = tree;
// Default exports are either classes, functions or expressions
// So we let the super class continue down...
ParseTreeVisitor.prototype.visitExportDefault.call(this, tree);
}
},
visitNamedExport: function(tree) {
this.currentExport = null;
// if ( this.currentExport ) {
// this.updateExport(tree);
// this.currentExport.namedExport = tree;
// this.currentExport.name = 'NAMED_EXPORT';
// // TODO: work out this bit!!
// // We need to cope with any export specifiers in the named export
// }
},
// TODO - if the export is an expression, find the thing that is being
// exported and use it and its comments for docs
updateExport: function(tree) {
this.currentExport.comment = this.currentExport.comment || tree.commentBefore;
this.currentExport.docType = tree.type;
},
visit: function(tree) {
this.exports = [];
ParseTreeVisitor.prototype.visit.call(this, tree);
}
};
return ExportTreeVisitorImpl;
};

View File

@ -1,6 +0,0 @@
var traceur = require('traceur/src/node/traceur.js');
module.exports = function ParseTreeVisitor() {
console.log(System.map.traceur);
return System.get(System.map.traceur + '/src/syntax/ParseTreeVisitor.js').ParseTreeVisitor;
};

View File

@ -1,5 +0,0 @@
var traceur = require('traceur/src/node/traceur.js');
module.exports = function SourceFile() {
return System.get(System.map.traceur + '/src/syntax/SourceFile.js').SourceFile;
};

View File

@ -1,3 +0,0 @@
module.exports = function TraceurParser() {
return System.get('transpiler/src/parser').Parser;
};

View File

@ -1,79 +0,0 @@
var file2modulename = require('../../../tools/build/file2modulename');
/**
* Wrapper around traceur that can parse the contents of a file
*/
module.exports = function atParser(AttachCommentTreeVisitor, SourceFile, TraceurParser, traceurOptions, log) {
var service = {
/**
* The options to pass to traceur
*/
traceurOptions: {
annotations: true, // parse annotations
types: true, // parse types
memberVariables: true, // parse class fields
commentCallback: true // handle comments
},
/**
* Parse a module AST from the contents of a file.
* @param {Object} fileInfo information about the file to parse
* @return { { moduleTree: Object, comments: Array } } An object containing the parsed module
* AST and an array of all the comments found in the file
*/
parseModule: parseModule
};
return service;
// Parse the contents of the file using traceur
function parseModule(fileInfo) {
var moduleName = file2modulename(fileInfo.relativePath);
var sourceFile = new SourceFile(moduleName, fileInfo.content);
var comments = [];
var moduleTree;
var errorReporter = {
reportError: function(position, message) {
}
};
traceurOptions.setFromObject(service.traceurOptions);
var parser = new TraceurParser(sourceFile, errorReporter, traceurOptions);
// Configure the parser
parser.handleComment = function(range) {
comments.push({ range: range });
};
try {
// Parse the file as a module, attaching the comments
moduleTree = parser.parseModule();
attachComments(moduleTree, comments);
} catch(ex) {
// HACK: sometime traceur crashes for various reasons including
// Not Yet Implemented (NYI)!
log.error(ex.stack);
moduleTree = {};
}
log.debug(moduleName);
moduleTree.moduleName = moduleName;
// We return the module AST but also a collection of all the comments
// since it can be helpful to iterate through them without having to
// traverse the AST again
return {
moduleTree: moduleTree,
comments: comments
};
}
// attach the comments to their nearest code tree
function attachComments(tree, comments) {
var visitor = new AttachCommentTreeVisitor();
// Visit every node of the tree using our custom method
visitor.visit(tree, comments);
}
};

View File

@ -1,80 +0,0 @@
var mockPackage = require('../mocks/mockPackage');
var Dgeni = require('dgeni');
describe('atParser service', function() {
var dgeni, injector, parser;
var fileContent =
'import {CONST} from "facade/lang";\n' +
'\n' +
'/**\n' +
'* A parameter annotation that creates a synchronous eager dependency.\n' +
'*\n' +
'* class AComponent {\n' +
'* constructor(@Inject("aServiceToken") aService) {}\n' +
'* }\n' +
'*\n' +
'*/\n' +
'export class Inject {\n' +
'token;\n' +
'@CONST()\n' +
'constructor({a,b}:{a:string, b:string}) {\n' +
'this.token = a;\n' +
'}\n' +
'}';
beforeEach(function() {
dgeni = new Dgeni([mockPackage()]);
injector = dgeni.configureInjector();
parser = injector.get('atParser');
});
it('should extract the comments from the file', function() {
var result = parser.parseModule({
content: fileContent,
relativePath: 'di/src/annotations.js'
});
expect(result.comments[0].range.toString()).toEqual(
'/**\n' +
'* A parameter annotation that creates a synchronous eager dependency.\n' +
'*\n' +
'* class AComponent {\n' +
'* constructor(@Inject("aServiceToken") aService) {}\n' +
'* }\n' +
'*\n' +
'*/'
);
});
it('should extract a module AST from the file', function() {
var result = parser.parseModule({
content: fileContent,
relativePath: 'di/src/annotations.js'
});
expect(result.moduleTree.moduleName).toEqual('di/src/annotations');
expect(result.moduleTree.scriptItemList[0].type).toEqual('IMPORT_DECLARATION');
expect(result.moduleTree.scriptItemList[1].type).toEqual('EXPORT_DECLARATION');
});
it('should attach comments to their following AST', function() {
var result = parser.parseModule({
content: fileContent,
relativePath: 'di/src/annotations.js'
});
expect(result.moduleTree.scriptItemList[1].commentBefore.range.toString()).toEqual(
'/**\n' +
'* A parameter annotation that creates a synchronous eager dependency.\n' +
'*\n' +
'* class AComponent {\n' +
'* constructor(@Inject("aServiceToken") aService) {}\n' +
'* }\n' +
'*\n' +
'*/'
);
});
});

View File

@ -1,28 +0,0 @@
var LEADING_STAR = /^[^\S\r\n]*\*[^\S\n\r]?/gm;
/**
* Extact comment info from a comment object
* @param {Object} comment object to process
* @return { {startingLine, endingLine, content, codeTree}= } a comment info object
* or undefined if the comment is not a jsdoc style comment
*/
module.exports = function getJSDocComment() {
return function(comment) {
var commentInfo;
// we need to check for `/**` at the start of the comment to find all the jsdoc style comments
comment.range.toString().replace(/^\/\*\*([\w\W]*)\*\/$/g, function(match, commentBody) {
commentBody = commentBody.replace(LEADING_STAR, '').trim();
commentInfo = {
startingLine: comment.range.start.line,
endingLine: comment.range.end.line,
content: commentBody,
codeTree: comment.treeAfter
};
});
return commentInfo;
};
};

View File

@ -1,67 +0,0 @@
var mockPackage = require('../mocks/mockPackage');
var Dgeni = require('dgeni');
describe('getJSDocComment service', function() {
var dgeni, injector, getJSDocComment;
function createComment(commentString, start, end, codeTree) {
return {
range: {
toString: function() { return commentString; },
start: { line: start },
end: { line: end },
},
treeAfter: codeTree
};
}
beforeEach(function() {
dgeni = new Dgeni([mockPackage()]);
injector = dgeni.configureInjector();
getJSDocComment = injector.get('getJSDocComment');
});
it('should only return an object if the comment starts with /** and ends with */', function() {
var result = getJSDocComment(createComment('/** this is a jsdoc comment */'));
expect(result).toBeDefined();
result = getJSDocComment(createComment('/* this is a normal comment */'));
expect(result).toBeUndefined();
result = getJSDocComment(createComment('this is not a valid comment */'));
expect(result).toBeUndefined();
result = getJSDocComment(createComment('nor is this'));
expect(result).toBeUndefined();
result = getJSDocComment(createComment('/* or even this'));
expect(result).toBeUndefined();
result = getJSDocComment(createComment('/** and this'));
expect(result).toBeUndefined();
});
it('should return a result that contains info about the comment', function() {
var codeTree = {};
var result = getJSDocComment(createComment('/** this is a comment */', 10, 20, codeTree));
expect(result.startingLine).toEqual(10);
expect(result.endingLine).toEqual(20);
expect(result.codeTree).toBe(codeTree);
});
it('should strip off leading stars from each line', function() {
var result = getJSDocComment(createComment(
'/** this is a jsdoc comment */\n' +
' *\n' +
' * some content\n' +
' */'
));
expect(result.content).toEqual(
'this is a jsdoc comment */\n' +
'\n' +
'some content'
);
});
});

View File

@ -1,3 +0,0 @@
module.exports = function modules() {
return {};
};

View File

@ -1,4 +0,0 @@
module.exports = function traceurOptions() {
var Options = System.get(System.map.traceur + "/src/Options.js").Options;
return new Options();
};

View File

@ -1,14 +0,0 @@
{% extends 'layout/base.template.html' %}
{% block body %}
<h1>{$ doc.name $} <span class="type">class</span></h1>
<p class="module">exported from <a href="/{$ doc.moduleDoc.path $}">{$ doc.moduleDoc.id $}</a></p>
<p>{$ doc.description | marked $}</p>
<h2>Members</h2>
{% for member in doc.members %}
<h3>{$ member.name $}</h3>
<p>{$ member.description | marked $}</p>
{% endfor %}
{% endblock %}

View File

@ -1,9 +0,0 @@
{% extends 'layout/base.template.html' %}
{% block body %}
<h1>{$ doc.id $}</h1>
<h2>({$ doc.docType $})</h2>
<div>
{$ doc.description | marked $}
</div>
{% endblock %}

View File

@ -1,3 +0,0 @@
angular.module('{$ doc.moduleName $}', [])
.value('{$ doc.serviceName $}', {$ doc.value | json $});

View File

@ -1,5 +0,0 @@
{% extends 'layout/base.template.html' %}
{% block body %}
{$ doc.description | marked $}
{% endblock %}

View File

@ -1 +0,0 @@
{% block body %}{% endblock %}

View File

@ -1,16 +0,0 @@
{% extends 'layout/base.template.html' %}
{% block body %}
<h1 class="id">{$ doc.id $} <span class="type">module</span></h1>
<p>{$ doc.description | marked $}</p>
{% if doc.exports.length %}
<h2>Exports</h2>
<ul>
{%- for exportDoc in doc.exports %}
<li><a href="/{$ exportDoc.path $}">{$ exportDoc.name $} {$ exportDoc.docType $}</a></li>
{%- endfor %}
</ul>
{% endif %}
{% endblock %}

View File

@ -1,8 +0,0 @@
{% extends 'layout/base.template.html' %}
{% block body %}
<h1>{$ doc.name $} <span class="type">variable</span></h1>
<p class="module">exported from <a href="/{$ doc.moduleDoc.path $}">{$ doc.moduleDoc.id $}</a></p>
<p>{$ doc.description | marked $}</p>
{% endblock %}

View File

@ -1,17 +0,0 @@
var Package = require('dgeni').Package;
var basePackage = require('../dgeni-package');
module.exports = new Package('angular-public', [basePackage])
.processor(require('./processors/filterPublicDocs'))
.config(function(processClassDocs, filterPublicDocs, EXPORT_DOC_TYPES) {
processClassDocs.ignorePrivateMembers = true;
filterPublicDocs.docTypes = EXPORT_DOC_TYPES;
})
// Configure file writing
.config(function(writeFilesProcessor) {
writeFilesProcessor.outputFolder = 'dist/public_docs';
});

View File

@ -1,51 +0,0 @@
var _ = require('lodash');
module.exports = function filterPublicDocs(modules) {
return {
$runAfter: ['tags-parsed'],
$runBefore: ['computing-ids'],
docTypes: [],
$validate: {
docTypes: { presence: true }
},
$process: function(docs) {
docTypes = this.docTypes;
docs = _.filter(docs, function(doc) {
if (docTypes.indexOf(doc.docType) === -1) return true;
if (!doc.publicModule) return false;
updateModule(doc);
return true;
});
docs = _.filter(docs, function(doc) {
return doc.docType !== 'module' || doc.isPublic;
});
return docs;
}
};
function updateModule(classDoc) {
var originalModule = classDoc.moduleDoc;
var publicModule = modules[classDoc.publicModule];
if (!publicModule) {
throw new Error('Missing module definition: "' + classDoc.publicModule + '"\n' +
'Referenced in class: "' + classDoc.moduleDoc.id + '/' + classDoc.name + '"');
}
publicModule.isPublic = true;
_.remove(classDoc.moduleDoc.exports, function(doc) { return doc === classDoc; });
classDoc.moduleDoc = publicModule;
publicModule.exports.push(classDoc);
}
};

View File

@ -1,767 +1,240 @@
var gulp = require('gulp');
var gulpPlugins = require('gulp-load-plugins')();
var shell = require('gulp-shell');
var runSequence = require('run-sequence');
var madge = require('madge');
var merge = require('merge');
var path = require('path');
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var gulpTraceur = require('./tools/transpiler/gulp-traceur');
'use strict';
var clean = require('./tools/build/clean');
var transpile = require('./tools/build/transpile');
var html = require('./tools/build/html');
var pubget = require('./tools/build/pubget');
var linknodemodules = require('./tools/build/linknodemodules');
var pubbuild = require('./tools/build/pubbuild');
var dartanalyzer = require('./tools/build/dartanalyzer');
var jsserve = require('./tools/build/jsserve');
var pubserve = require('./tools/build/pubserve');
var rundartpackage = require('./tools/build/rundartpackage');
var copy = require('./tools/build/copy');
var file2moduleName = require('./tools/build/file2modulename');
var karma = require('karma').server;
var minimist = require('minimist');
var es5build = require('./tools/build/es5build');
var runServerDartTests = require('./tools/build/run_server_dart_tests');
var transformCJSTests = require('./tools/build/transformCJSTests');
var ts2dart = require('gulp-ts2dart');
var util = require('./tools/build/util');
// THIS CHECK SHOULD BE THE FIRST THING IN THIS FILE
// This is to ensure that we catch env issues before we error while requiring other dependencies.
require('./tools/check-environment')({
requiredNpmVersion: '>=3.5.3 <4.0.0',
requiredNodeVersion: '>=5.4.1 <7.0.0',
});
// Note: when DART_SDK is not found, all gulp tasks ending with `.dart` will be skipped.
var DART_SDK = require('./tools/build/dartdetect')(gulp);
// -----------------------
// configuration
const gulp = require('gulp');
const path = require('path');
const os = require('os');
var _COMPILER_CONFIG_JS_DEFAULT = {
sourceMaps: true,
annotations: true, // parse annotations
types: true, // parse types
script: false, // parse as a module
memberVariables: true, // parse class fields
modules: 'instantiate'
};
var _HTML_DEFAULT_SCRIPTS_JS = [
{src: gulpTraceur.RUNTIME_PATH, mimeType: 'text/javascript', copy: true},
{src: 'node_modules/es6-module-loader/dist/es6-module-loader-sans-promises.src.js',
mimeType: 'text/javascript', copy: true},
{src: 'node_modules/zone.js/zone.js', mimeType: 'text/javascript', copy: true},
{src: 'node_modules/zone.js/long-stack-trace-zone.js', mimeType: 'text/javascript', copy: true},
{src: 'node_modules/systemjs/dist/system.src.js', mimeType: 'text/javascript', copy: true},
{src: 'node_modules/systemjs/lib/extension-register.js', mimeType: 'text/javascript', copy: true},
{src: 'node_modules/systemjs/lib/extension-cjs.js', mimeType: 'text/javascript', copy: true},
{src: 'node_modules/rx/dist/rx.all.js', mimeType: 'text/javascript', copy: true},
{src: 'tools/build/snippets/runtime_paths.js', mimeType: 'text/javascript', copy: true},
{
inline: 'System.import(\'$MODULENAME$\').then(function(m) { m.main(); }, console.error.bind(console))',
mimeType: 'text/javascript'
}
// clang-format entry points
const srcsToFmt = [
'modules/@angular/**/*.{js,ts}',
'modules/benchmarks/**/*.{js,ts}',
'modules/e2e_util/**/*.{js,ts}',
'modules/playground/**/*.{js,ts}',
'tools/**/*.{js,ts}',
'!tools/public_api_guard/**/*.d.ts',
'./*.{js,ts}',
'!shims_for_IE.js',
];
var _HTML_DEFAULT_SCRIPTS_DART = [
{src: '$MODULENAME_WITHOUT_PATH$.dart', mimeType: 'application/dart'},
{src: 'packages/browser/dart.js', mimeType: 'text/javascript'}
// Check source code for formatting errors (clang-format)
gulp.task('format:enforce', () => {
const format = require('gulp-clang-format');
const clangFormat = require('clang-format');
return gulp.src(srcsToFmt).pipe(
format.checkFormat('file', clangFormat, {verbose: true, fail: true}));
});
// Format the source code with clang-format (see .clang-format)
gulp.task('format', () => {
const format = require('gulp-clang-format');
const clangFormat = require('clang-format');
return gulp.src(srcsToFmt, {base: '.'})
.pipe(format.format('file', clangFormat))
.pipe(gulp.dest('.'));
});
const entrypoints = [
'dist/packages-dist/core/index.d.ts',
'dist/packages-dist/core/testing/index.d.ts',
'dist/packages-dist/common/index.d.ts',
'dist/packages-dist/common/testing/index.d.ts',
// The API surface of the compiler is currently unstable - all of the important APIs are exposed
// via @angular/core, @angular/platform-browser or @angular/platform-browser-dynamic instead.
//'dist/packages-dist/compiler/index.d.ts',
//'dist/packages-dist/compiler/testing.d.ts',
'dist/packages-dist/upgrade/index.d.ts',
'dist/packages-dist/platform-browser/index.d.ts',
'dist/packages-dist/platform-browser/testing/index.d.ts',
'dist/packages-dist/platform-browser-dynamic/index.d.ts',
'dist/packages-dist/platform-browser-dynamic/testing/index.d.ts',
'dist/packages-dist/platform-webworker/index.d.ts',
'dist/packages-dist/platform-webworker-dynamic/index.d.ts',
'dist/packages-dist/platform-server/index.d.ts',
'dist/packages-dist/platform-server/testing/index.d.ts',
'dist/packages-dist/http/index.d.ts',
'dist/packages-dist/http/testing/index.d.ts',
'dist/packages-dist/forms/index.d.ts',
'dist/packages-dist/router/index.d.ts',
];
const publicApiDir = path.normalize('tools/public_api_guard');
const publicApiArgs = [
'--rootDir',
'dist/packages-dist',
'--stripExportPattern',
'^__',
'--allowModuleIdentifiers',
'jasmine',
'--allowModuleIdentifiers',
'protractor',
'--allowModuleIdentifiers',
'angular',
'--onStabilityMissing',
'error',
].concat(entrypoints);
var BASE_PACKAGE_JSON = require('./package.json');
var COMMON_PACKAGE_JSON = {
version: BASE_PACKAGE_JSON.version,
homepage: BASE_PACKAGE_JSON.homepage,
bugs: BASE_PACKAGE_JSON.bugs,
license: BASE_PACKAGE_JSON.license,
contributors: BASE_PACKAGE_JSON.contributors,
dependencies: BASE_PACKAGE_JSON.dependencies,
devDependencies: {
"yargs": BASE_PACKAGE_JSON.devDependencies['yargs'],
"gulp-sourcemaps": BASE_PACKAGE_JSON.devDependencies['gulp-sourcemaps'],
"gulp-traceur": BASE_PACKAGE_JSON.devDependencies['gulp-traceur'],
"gulp": BASE_PACKAGE_JSON.devDependencies['gulp'],
"gulp-rename": BASE_PACKAGE_JSON.devDependencies['gulp-rename'],
"through2": BASE_PACKAGE_JSON.devDependencies['through2']
}
};
// Build angular
gulp.task('build.sh', (done) => {
const childProcess = require('child_process');
var SRC_FOLDER_INSERTION = {
js: {
'**': ''
},
dart: {
'**': 'lib',
'*/test/**': '',
'benchmarks/**': 'web',
'benchmarks/test/**': '',
'benchmarks_external/**': 'web',
'benchmarks_external/test/**': '',
'example*/**': 'web',
'example*/test/**': ''
}
};
childProcess.exec(path.join(__dirname, 'build.sh'), done);
});
var CONFIG = {
dest: {
js: {
all: 'dist/js',
dev: {
es6: 'dist/js/dev/es6',
es5: 'dist/js/dev/es5'
},
prod: {
es6: 'dist/js/prod/es6',
es5: 'dist/js/prod/es5'
},
cjs: 'dist/js/cjs',
dart2js: 'dist/js/dart2js'
},
dart: 'dist/dart',
docs: 'dist/docs'
},
srcFolderInsertion: SRC_FOLDER_INSERTION,
transpile: {
src: {
js: ['modules/**/*.js', 'modules/**/*.es6'],
dart: ['modules/**/*.js']
},
options: {
js: {
dev: merge(true, _COMPILER_CONFIG_JS_DEFAULT, {
typeAssertionModule: 'rtts_assert/rtts_assert',
typeAssertions: true,
outputLanguage: 'es6'
}),
prod: merge(true, _COMPILER_CONFIG_JS_DEFAULT, {
typeAssertions: false,
outputLanguage: 'es6'
}),
cjs: merge(true, _COMPILER_CONFIG_JS_DEFAULT, {
typeAssertionModule: 'rtts_assert/rtts_assert',
typeAssertions: true,
modules: 'commonjs'
})
},
dart: {
sourceMaps: true,
annotations: true, // parse annotations
types: true, // parse types
script: false, // parse as a module
memberVariables: true, // parse class fields
outputLanguage: 'dart'
}
}
},
copy: {
js: {
cjs: {
src: ['modules/**/README.js.md', 'modules/**/package.json', 'modules/**/*.cjs'],
pipes: {
'**/*.cjs': gulpPlugins.rename({extname: '.js'}),
'**/*.js.md': gulpPlugins.rename(function(file) {
file.basename = file.basename.substring(0, file.basename.lastIndexOf('.'));
}),
'**/package.json': gulpPlugins.template({ 'packageJson': COMMON_PACKAGE_JSON })
// Enforce that the public API matches the golden files
// Note that these two commands work on built d.ts files instead of the source
gulp.task('public-api:enforce', (done) => {
const childProcess = require('child_process');
childProcess
.spawn(
path.join(__dirname, platformScriptPath(`/node_modules/.bin/ts-api-guardian`)),
['--verifyDir', publicApiDir].concat(publicApiArgs), {stdio: 'inherit'})
.on('close', (errorCode) => {
if (errorCode !== 0) {
done(new Error(
'Public API differs from golden file. Please run `gulp public-api:update`.'));
} else {
done();
}
},
dev: {
src: ['modules/**/*.css'],
pipes: {}
},
prod: {
src: ['modules/**/*.css'],
pipes: {}
}
},
dart: {
src: ['modules/**/README.dart.md', 'modules/**/*.dart', 'modules/*/pubspec.yaml', 'modules/**/*.css', '!modules/**/e2e_test/**'],
pipes: {
'**/*.dart': util.insertSrcFolder(gulpPlugins, SRC_FOLDER_INSERTION.dart),
'**/*.dart.md': gulpPlugins.rename(function(file) {
file.basename = file.basename.substring(0, file.basename.lastIndexOf('.'));
}),
'**/pubspec.yaml': gulpPlugins.template({ 'packageJson': COMMON_PACKAGE_JSON })
}
}
},
multicopy: {
js: {
cjs: {
src: [
'LICENSE'
],
pipes: {}
},
dev: {
es6: {
src: ['tools/build/es5build.js'],
pipes: {}
}
},
prod: {
es6: {
src: ['tools/build/es5build.js'],
pipes: {}
}
}
},
dart: {
src: ['LICENSE'],
exclude: ['rtts_assert/'],
pipes: {}
}
},
html: {
src: {
js: ['modules/*/src/**/*.html'],
dart: ['modules/*/src/**/*.html']
},
scriptsPerFolder: {
js: {
'**': _HTML_DEFAULT_SCRIPTS_JS,
'benchmarks/**':
[
{ src: 'tools/build/snippets/url_params_to_form.js', mimeType: 'text/javascript', copy: true }
].concat(_HTML_DEFAULT_SCRIPTS_JS),
'benchmarks_external/**':
[
{ src: 'node_modules/angular/angular.js', mimeType: 'text/javascript', copy: true },
{ src: 'tools/build/snippets/url_params_to_form.js', mimeType: 'text/javascript', copy: true }
].concat(_HTML_DEFAULT_SCRIPTS_JS),
'benchmarks_external/**/*polymer*/**':
[
{ src: 'bower_components/polymer/lib/polymer.html', copyOnly: true },
{ src: 'tools/build/snippets/url_params_to_form.js', mimeType: 'text/javascript', copy: true }
]
},
dart: {
'**': _HTML_DEFAULT_SCRIPTS_DART,
'benchmarks*/**':
[
{ src: 'tools/build/snippets/url_params_to_form.js', mimeType: 'text/javascript', copy: true }
].concat(_HTML_DEFAULT_SCRIPTS_DART)
}
}
},
formatDart: {
packageName: 'dart_style',
args: ['dart_style:format', '-w', 'dist/dart']
},
test: {
js: {
cjs: [
'/angular2/test/change_detection/**/*_spec.js',
'/angular2/test/core/annotations/**/*_spec.js',
'/angular2/test/core/compiler/**/*_spec.js',
'/angular2/test/di/**/*_spec.js',
'/angular2/test/directives/**/*_spec.js',
'/angular2/test/facade/**/*_spec.js',
'/angular2/test/forms/**/*_spec.js',
'/angular2/test/mock/**/*_spec.js',
'/angular2/test/reflection/**/*_spec.js',
'/angular2/test/services/**/*_spec.js',
'/angular2/test/test_lib/**/*_spec.js'
]
}
}
};
CONFIG.test.js.cjs = CONFIG.test.js.cjs.map(function(s) {return CONFIG.dest.js.cjs + s});
});
});
// ------------
// clean
// Generate the public API golden files
gulp.task('public-api:update', ['build.sh'], (done) => {
const childProcess = require('child_process');
gulp.task('build/clean.js', clean(gulp, gulpPlugins, {
path: CONFIG.dest.js.all
}));
childProcess
.spawn(
path.join(__dirname, platformScriptPath(`/node_modules/.bin/ts-api-guardian`)),
['--outDir', publicApiDir].concat(publicApiArgs), {stdio: 'inherit'})
.on('close', done);
});
gulp.task('build/clean.dart', clean(gulp, gulpPlugins, {
path: CONFIG.dest.dart
}));
// Checks tests for presence of ddescribe, fdescribe, fit, iit and fails the build if one of the
// focused tests is found.
// Currently xdescribe and xit are _not_ reported as errors since there are a couple of excluded
// tests in our code base.
gulp.task('check-tests', function() {
const ddescribeIit = require('gulp-ddescribe-iit');
return gulp
.src([
'modules/**/*.spec.ts',
'modules/**/*_spec.ts',
])
.pipe(ddescribeIit({allowDisabledTests: true}));
});
gulp.task('build/clean.docs', clean(gulp, gulpPlugins, {
path: CONFIG.dest.docs
}));
// Check the coding standards and programming errors
gulp.task('lint', ['check-tests', 'format:enforce', 'tools:build'], () => {
const tslint = require('gulp-tslint');
// Built-in rules are at
// https://github.com/palantir/tslint#supported-rules
const tslintConfig = require('./tslint.json');
return gulp
.src([
// todo(vicb): add .js files when supported
// see https://github.com/palantir/tslint/pull/1515
'modules/@angular/**/*.ts',
'modules/benchpress/**/*.ts',
'./*.ts',
])
.pipe(tslint({
tslint: require('tslint').default,
configuration: tslintConfig,
rulesDirectory: 'dist/tools/tslint',
formatter: 'prose',
}))
.pipe(tslint.report({emitError: true}));
});
gulp.task('tools:build', (done) => { tsc('tools/', done); });
// ------------
// transpile
// Check for circular dependency in the source code
gulp.task('check-cycle', (done) => {
const madge = require('madge');
gulp.task('build/transpile.js.dev.es6', transpile(gulp, gulpPlugins, {
src: CONFIG.transpile.src.js,
dest: CONFIG.dest.js.dev.es6,
outputExt: 'es6',
options: CONFIG.transpile.options.js.dev,
srcFolderInsertion: CONFIG.srcFolderInsertion.js
}));
gulp.task('build/transpile.js.dev.es5', function() {
return es5build({
src: CONFIG.dest.js.dev.es6,
dest: CONFIG.dest.js.dev.es5,
modules: 'instantiate'
const dependencyObject = madge(['dist/all/'], {
format: 'cjs',
extensions: ['.js'],
onParseFile: function(data) { data.src = data.src.replace(/\/\* circular \*\//g, '//'); }
});
});
gulp.task('build/transpile.js.dev', function(done) {
runSequence(
'build/transpile.js.dev.es6',
'build/transpile.js.dev.es5',
done
);
});
gulp.task('build/transpile.js.prod.es6', transpile(gulp, gulpPlugins, {
src: CONFIG.transpile.src.js,
dest: CONFIG.dest.js.prod.es6,
outputExt: 'es6',
options: CONFIG.transpile.options.js.prod,
srcFolderInsertion: CONFIG.srcFolderInsertion.js
}));
gulp.task('build/transpile.js.prod.es5', function() {
return es5build({
src: CONFIG.dest.js.prod.es6,
dest: CONFIG.dest.js.prod.es5,
modules: 'instantiate'
});
});
gulp.task('build/transpile.js.prod', function(done) {
runSequence(
'build/transpile.js.prod.es6',
'build/transpile.js.prod.es5',
done
);
});
gulp.task('build/transpile.js.cjs', transpile(gulp, gulpPlugins, {
src: CONFIG.transpile.src.js.concat(['modules/**/*.cjs']),
dest: CONFIG.dest.js.cjs,
outputExt: 'js',
options: CONFIG.transpile.options.js.cjs,
srcFolderInsertion: CONFIG.srcFolderInsertion.js
}));
gulp.task('build/transformCJSTests', function() {
return gulp.src(CONFIG.dest.js.cjs + '/angular2/test/**/*_spec.js').pipe(transformCJSTests()).pipe(gulp.dest(CONFIG.dest.js.cjs + '/angular2/test/'));
});
gulp.task('build/transpile.dart', transpile(gulp, gulpPlugins, {
src: CONFIG.transpile.src.dart,
dest: CONFIG.dest.dart,
outputExt: 'dart',
options: CONFIG.transpile.options.dart,
srcFolderInsertion: CONFIG.srcFolderInsertion.dart
}));
gulp.task('build/transpile.dart.ts2dart', function() {
return gulp.src(CONFIG.transpile.src.dart)
.pipe(ts2dart.transpile())
.pipe(gulp.dest('dist/dart.ts2dart'))
});
gulp.task('build/format.dart.ts2dart', rundartpackage(gulp, gulpPlugins, {
pub: DART_SDK.PUB,
packageName: CONFIG.formatDart.packageName,
args: ['dart_style:format', '-w', 'dist/dart.ts2dart']
}));
// Temporary tasks for development on ts2dart. Will likely fail.
gulp.task('build/transpile.dart.ts2dart.all', function() {
return gulp.src(CONFIG.transpile.src.js)
.pipe(ts2dart.transpile())
.pipe(util.insertSrcFolder(gulpPlugins, CONFIG.srcFolderInsertion.dart))
.pipe(gulp.dest('dist/dart.ts2dart'));
});
gulp.task('ts2dart', function(done) {
runSequence('build/transpile.dart.ts2dart.all', 'build/format.dart.ts2dart', done);
});
// ------------
// html
gulp.task('build/html.js.dev', html(gulp, gulpPlugins, {
src: CONFIG.html.src.js,
dest: CONFIG.dest.js.dev.es5,
srcFolderInsertion: CONFIG.srcFolderInsertion.js,
scriptsPerFolder: CONFIG.html.scriptsPerFolder.js
}));
gulp.task('build/html.js.prod', html(gulp, gulpPlugins, {
src: CONFIG.html.src.js,
dest: CONFIG.dest.js.prod.es5,
srcFolderInsertion: CONFIG.srcFolderInsertion.js,
scriptsPerFolder: CONFIG.html.scriptsPerFolder.js
}));
gulp.task('build/html.dart', html(gulp, gulpPlugins, {
src: CONFIG.html.src.dart,
dest: CONFIG.dest.dart,
srcFolderInsertion: CONFIG.srcFolderInsertion.dart,
scriptsPerFolder: CONFIG.html.scriptsPerFolder.dart
}));
// ------------
// copy
gulp.task('build/copy.js.cjs', copy.copy(gulp, gulpPlugins, {
src: CONFIG.copy.js.cjs.src,
pipes: CONFIG.copy.js.cjs.pipes,
dest: CONFIG.dest.js.cjs
}));
gulp.task('build/copy.js.dev', copy.copy(gulp, gulpPlugins, {
src: CONFIG.copy.js.dev.src,
pipes: CONFIG.copy.js.dev.pipes,
dest: CONFIG.dest.js.dev.es5
}));
gulp.task('build/copy.js.prod', copy.copy(gulp, gulpPlugins, {
src: CONFIG.copy.js.prod.src,
pipes: CONFIG.copy.js.prod.pipes,
dest: CONFIG.dest.js.prod.es5
}));
gulp.task('build/copy.dart', copy.copy(gulp, gulpPlugins, {
src: CONFIG.copy.dart.src,
pipes: CONFIG.copy.dart.pipes,
dest: CONFIG.dest.dart
}));
// ------------
// multicopy
gulp.task('build/multicopy.js.cjs', copy.multicopy(gulp, gulpPlugins, {
src: CONFIG.multicopy.js.cjs.src,
pipes: CONFIG.multicopy.js.cjs.pipes,
exclude: CONFIG.multicopy.js.cjs.exclude,
dest: CONFIG.dest.js.cjs
}));
gulp.task('build/multicopy.js.dev.es6', copy.multicopy(gulp, gulpPlugins, {
src: CONFIG.multicopy.js.dev.es6.src,
pipes: CONFIG.multicopy.js.dev.es6.pipes,
exclude: CONFIG.multicopy.js.dev.es6.exclude,
dest: CONFIG.dest.js.dev.es6
}));
gulp.task('build/multicopy.js.prod.es6', copy.multicopy(gulp, gulpPlugins, {
src: CONFIG.multicopy.js.prod.es6.src,
pipes: CONFIG.multicopy.js.prod.es6.pipes,
exclude: CONFIG.multicopy.js.prod.es6.exclude,
dest: CONFIG.dest.js.prod.es6
}));
gulp.task('build/multicopy.dart', copy.multicopy(gulp, gulpPlugins, {
src: CONFIG.multicopy.dart.src,
pipes: CONFIG.multicopy.dart.pipes,
exclude: CONFIG.multicopy.dart.exclude,
dest: CONFIG.dest.dart
}));
// ------------
// pubspec
// Run a top-level `pub get` for this project.
gulp.task('pubget.dart', pubget.dir(gulp, gulpPlugins, { dir: '.', command: DART_SDK.PUB }));
// Run `pub get` over CONFIG.dest.dart
gulp.task('build/pubspec.dart', pubget.subDir(gulp, gulpPlugins, {
dir: CONFIG.dest.dart,
command: DART_SDK.PUB
}));
// ------------
// linknodemodules
gulp.task('build/linknodemodules.js.cjs', linknodemodules(gulp, gulpPlugins, {
dir: CONFIG.dest.js.cjs
}));
// ------------
// dartanalyzer
gulp.task('build/analyze.dart', dartanalyzer(gulp, gulpPlugins, {
dest: CONFIG.dest.dart,
command: DART_SDK.ANALYZER
}));
// ------------
// pubbuild
gulp.task('build/pubbuild.dart', pubbuild(gulp, gulpPlugins, {
src: CONFIG.dest.dart,
dest: CONFIG.dest.js.dart2js,
command: DART_SDK.PUB
}));
// ------------
// format dart
gulp.task('build/format.dart', rundartpackage(gulp, gulpPlugins, {
pub: DART_SDK.PUB,
packageName: CONFIG.formatDart.packageName,
args: CONFIG.formatDart.args
}));
// ------------
// check circular dependencies in Node.js context
gulp.task('build/checkCircularDependencies', function (done) {
var dependencyObject = madge(CONFIG.dest.js.dev.es6, {
format: 'es6',
paths: [CONFIG.dest.js.dev.es6],
extensions: ['.js', '.es6'],
onParseFile: function(data) {
data.src = data.src.replace(/import \* as/g, "//import * as");
}
});
var circularDependencies = dependencyObject.circular().getArray();
const circularDependencies = dependencyObject.circular().getArray();
if (circularDependencies.length > 0) {
console.log('Found circular dependencies!');
console.log(circularDependencies);
process.exit(1);
}
done();
});
// ------------------
// web servers
gulp.task('serve.js.dev', jsserve(gulp, gulpPlugins, {
path: CONFIG.dest.js.dev.es5,
port: 8000
}));
// Serve the built files
gulp.task('serve', () => {
const connect = require('gulp-connect');
const cors = require('cors');
gulp.task('serve.js.prod', jsserve(gulp, gulpPlugins, {
path: CONFIG.dest.js.prod.es5,
port: 8001
}));
gulp.task('serve.js.dart2js', jsserve(gulp, gulpPlugins, {
path: CONFIG.dest.js.dart2js,
port: 8002
}));
gulp.task('serve/examples.dart', pubserve(gulp, gulpPlugins, {
command: DART_SDK.PUB,
path: CONFIG.dest.dart + '/examples'
}));
gulp.task('serve/benchmarks.dart', pubserve(gulp, gulpPlugins, {
command: DART_SDK.PUB,
path: CONFIG.dest.dart + '/benchmarks'
}));
gulp.task('serve/benchmarks_external.dart', pubserve(gulp, gulpPlugins, {
command: DART_SDK.PUB,
path: CONFIG.dest.dart + '/benchmarks_external'
}));
// --------------
// doc generation
var Dgeni = require('dgeni');
var bower = require('bower');
var jasmine = require('gulp-jasmine');
var webserver = require('gulp-webserver');
gulp.task('docs/bower', function() {
var bowerTask = bower.commands.install(undefined, undefined, { cwd: 'docs' });
bowerTask.on('log', function (result) {
console.log('bower:', result.id, result.data.endpoint.name);
connect.server({
root: `${__dirname}/dist`,
port: 8000,
livereload: false,
open: false,
middleware: (connect, opt) => [cors()],
});
bowerTask.on('error', function(error) {
console.log(error);
});
// Serve the examples
gulp.task('serve-examples', () => {
const connect = require('gulp-connect');
const cors = require('cors');
connect.server({
root: `${__dirname}/dist/examples`,
port: 8001,
livereload: false,
open: false,
middleware: (connect, opt) => [cors()],
});
return bowerTask;
});
function createDocsTasks(public) {
var dgeniPackage = public ? './docs/public-docs-package' : './docs/dgeni-package';
var distDocsPath = public ? 'dist/public_docs' : 'dist/docs';
var taskPrefix = public ? 'public_docs' : 'docs';
// Update the changelog with the latest changes
gulp.task('changelog', () => {
const conventionalChangelog = require('gulp-conventional-changelog');
gulp.task(taskPrefix + '/dgeni', function() {
try {
var dgeni = new Dgeni([require(dgeniPackage)]);
return dgeni.generate();
} catch(x) {
console.log(x.stack);
throw x;
}
});
gulp.task(taskPrefix + '/assets', ['docs/bower'], function() {
return gulp.src('docs/bower_components/**/*')
.pipe(gulp.dest(distDocsPath + '/lib'));
});
gulp.task(taskPrefix + '/app', function() {
return gulp.src('docs/app/**/*')
.pipe(gulp.dest(distDocsPath));
});
gulp.task(taskPrefix, [taskPrefix + '/assets', taskPrefix + '/app', taskPrefix + '/dgeni']);
gulp.task(taskPrefix + '/watch', function() {
return gulp.watch('docs/app/**/*', [taskPrefix + '/app']);
});
gulp.task(taskPrefix + '/test', function () {
return gulp.src('docs/**/*.spec.js')
.pipe(jasmine({
includeStackTrace: true
}));
});
gulp.task(taskPrefix + '/serve', function() {
gulp.src(distDocsPath + '/')
.pipe(webserver({
fallback: 'index.html'
}));
});
}
createDocsTasks(true);
createDocsTasks(false);
// ------------------
// CI tests suites
gulp.task('test.js', function(done) {
runSequence('test.transpiler.unittest', 'docs/test', 'test.unit.js/ci',
'test.unit.cjs/ci', done);
});
gulp.task('test.dart', function(done) {
runSequence('test.transpiler.unittest', 'docs/test', 'test.unit.dart/ci', done);
});
// Reuse the Travis scripts
// TODO: rename test_*.sh to test_all_*.sh
gulp.task('test.all.js', shell.task(['./scripts/ci/test_js.sh']))
gulp.task('test.all.dart', shell.task(['./scripts/ci/test_dart.sh']))
// karma tests
// These tests run in the browser and are allowed to access
// HTML DOM APIs.
function getBrowsersFromCLI() {
var args = minimist(process.argv.slice(2));
return [args.browsers?args.browsers:'DartiumWithWebPlatform']
}
gulp.task('test.unit.js', function (done) {
karma.start({configFile: __dirname + '/karma-js.conf.js'}, done);
});
gulp.task('test.unit.dart', function (done) {
karma.start({configFile: __dirname + '/karma-dart.conf.js'}, done);
});
gulp.task('test.unit.js/ci', function (done) {
karma.start({configFile: __dirname + '/karma-js.conf.js',
singleRun: true, reporters: ['dots'], browsers: getBrowsersFromCLI()}, done);
});
gulp.task('test.unit.dart/ci', function (done) {
karma.start({configFile: __dirname + '/karma-dart.conf.js',
singleRun: true, reporters: ['dots'], browsers: getBrowsersFromCLI()}, done);
});
gulp.task('test.unit.cjs/ci', function () {
return gulp.src(CONFIG.test.js.cjs).pipe(jasmine({includeStackTrace: true, timeout: 1000}));
});
gulp.task('test.unit.cjs', ['build.js.cjs'], function () {
//Run tests once
runSequence('test.unit.cjs/ci', function() {});
//Watcher to transpile file changed
gulp.watch(CONFIG.transpile.src.js.concat(['modules/**/*.cjs']), function(event) {
var relPath = path.relative(__dirname, event.path).replace(/\\/g, "/");
gulp.src(relPath)
.pipe(gulpPlugins.rename({extname: '.'+ 'js'}))
.pipe(util.insertSrcFolder(gulpPlugins, CONFIG.srcFolderInsertion.js))
.pipe(gulpTraceur(CONFIG.transpile.options.js.cjs, file2moduleName))
.pipe(transformCJSTests())
.pipe(gulp.dest(CONFIG.dest.js.cjs + path.dirname(relPath.replace("modules", ""))));
});
//Watcher to run tests when dist/js/cjs/angular2 is updated by the first watcher (after clearing the node cache)
gulp.watch(CONFIG.dest.js.cjs + '/angular2/**/*.js', function(event) {
for (var id in require.cache) {
if (id.replace(/\\/g, "/").indexOf(CONFIG.dest.js.cjs) > -1) {
delete require.cache[id];
}
}
runSequence('test.unit.cjs/ci', function() {});
});
});
// ------------------
// server tests
// These tests run on the VM on the command-line and are
// allowed to access the file system and network.
gulp.task('test.server.dart', runServerDartTests(gulp, gulpPlugins, {
dest: 'dist/dart'
}));
// -----------------
// test builders
gulp.task('test.transpiler.unittest', function (done) {
return gulp.src('tools/transpiler/unittest/**/*.js')
.pipe(jasmine({
includeStackTrace: true
return gulp.src('CHANGELOG.md')
.pipe(conventionalChangelog({preset: 'angular', releaseCount: 1}, {
// Conventional Changelog Context
// We have to manually set version number so it doesn't get prefixed with `v`
// See https://github.com/conventional-changelog/conventional-changelog-core/issues/10
currentTag: require('./package.json').version
}))
.pipe(gulp.dest('./'));
});
// Copy test resources to dist
gulp.task('tests/transform.dart', function() {
return gulp.src('modules/angular2/test/transform/**')
.pipe(gulp.dest('dist/dart/angular2/test/transform'));
});
function tsc(projectPath, done) {
const childProcess = require('child_process');
childProcess
.spawn(
path.normalize(platformScriptPath(`${__dirname}/node_modules/.bin/tsc`)),
['-p', path.join(__dirname, projectPath)], {stdio: 'inherit'})
.on('close', done);
}
// -----------------
// orchestrated targets
// Builds all Dart packages, but does not compile them
gulp.task('build/packages.dart', function(done) {
runSequence(
['build/transpile.dart.ts2dart', 'build/transpile.dart', 'build/html.dart', 'build/copy.dart', 'build/multicopy.dart'],
'tests/transform.dart',
// the two format steps don't need to be sequential, but we have seen flakiness in
// dartstyle:format with connecting to localhost.
'build/format.dart.ts2dart',
'build/format.dart',
'build/pubspec.dart',
done
);
});
// Builds and compiles all Dart packages
gulp.task('build.dart', function(done) {
runSequence(
'build/packages.dart',
'build/analyze.dart',
'build/pubbuild.dart',
done
);
});
gulp.task('build.js.dev', function(done) {
runSequence(
['build/transpile.js.dev', 'build/html.js.dev', 'build/copy.js.dev', 'build/multicopy.js.dev.es6'],
'build/checkCircularDependencies',
done
);
});
gulp.task('build.js.prod', function(done) {
runSequence(
['build/transpile.js.prod', 'build/html.js.prod', 'build/copy.js.prod', 'build/multicopy.js.prod.es6'],
done
);
});
gulp.task('build.js.cjs', function(done) {
runSequence(
['build/transpile.js.cjs', 'build/copy.js.cjs', 'build/multicopy.js.cjs'],
['build/linknodemodules.js.cjs'],
'build/transformCJSTests',
done
);
});
gulp.task('build.js', ['build.js.dev', 'build.js.prod', 'build.js.cjs']);
gulp.task('clean', ['build/clean.js', 'build/clean.dart', 'build/clean.docs']);
gulp.task('build', ['build.js', 'build.dart']);
// returns the script path for the current platform
function platformScriptPath(path) {
return /^win/.test(os.platform()) ? `${path}.cmd` : path;
}

View File

@ -1,93 +0,0 @@
// Karma configuration
// Generated on Thu Sep 25 2014 11:52:02 GMT-0700 (PDT)
var file2moduleName = require('./tools/build/file2modulename');
module.exports = function(config) {
config.set({
frameworks: ['dart-unittest'],
files: [
// Unit test files needs to be included.
// Karma-dart generates `__adapter_unittest.dart` that imports these files.
{pattern: 'modules/*/test/**/*_spec.js', included: true},
{pattern: 'tools/transpiler/spec/**/*_spec.js', included: true},
// These files are not included, they are imported by the unit tests above.
{pattern: 'modules/**', included: false},
{pattern: 'tools/transpiler/spec/**/*', included: false},
// Dependencies, installed with `pub install`.
{pattern: 'packages/**/*.dart', included: false, watched: false},
// Init and configure guiness.
{pattern: 'test-main.dart', included: true}
],
karmaDartImports: {
guinness: 'package:guinness/guinness_html.dart'
},
// TODO(vojta): Remove the localhost:9877 from urls, once the proxy fix is merged:
// https://github.com/karma-runner/karma/pull/1207
//
// Map packages to the correct urls where Karma serves them.
proxies: {
// Dependencies installed with `pub install`.
'/packages/unittest': 'http://localhost:9877/base/packages/unittest',
'/packages/guinness': 'http://localhost:9877/base/packages/guinness',
'/packages/matcher': 'http://localhost:9877/base/packages/matcher',
'/packages/stack_trace': 'http://localhost:9877/base/packages/stack_trace',
'/packages/collection': 'http://localhost:9877/base/packages/collection',
'/packages/path': 'http://localhost:9877/base/packages/path',
// Local dependencies, transpiled from the source.
'/packages/angular': 'http://localhost:9877/base/modules/angular',
'/packages/benchpress': 'http://localhost:9877/base/modules/benchpress',
'/packages/core': 'http://localhost:9877/base/modules/core',
'/packages/change_detection': 'http://localhost:9877/base/modules/change_detection',
'/packages/reflection': 'http://localhost:9877/base/modules/reflection',
'/packages/di': 'http://localhost:9877/base/modules/di',
'/packages/directives': 'http://localhost:9877/base/modules/directives',
'/packages/facade': 'http://localhost:9877/base/modules/facade',
'/packages/forms': 'http://localhost:9877/base/modules/forms',
'/packages/test_lib': 'http://localhost:9877/base/modules/test_lib',
'/packages/mock': 'http://localhost:9877/base/modules/mock',
},
preprocessors: {
'modules/**/*.js': ['traceur'],
'tools/**/*.js': ['traceur']
},
traceurPreprocessor: {
options: {
outputLanguage: 'dart',
sourceMaps: true,
script: false,
modules: 'register',
memberVariables: true,
types: true,
// typeAssertions: true,
// typeAssertionModule: 'assert',
annotations: true
},
resolveModuleName: file2moduleName,
transformPath: function(fileName) {
return fileName.replace('.js', '.dart');
}
},
customLaunchers: {
DartiumWithWebPlatform: {
base: 'Dartium',
flags: ['--enable-experimental-web-platform-features'] }
},
browsers: ['DartiumWithWebPlatform'],
port: 9877
});
config.plugins.push(require('./tools/transpiler/karma-traceur-preprocessor'));
};

View File

@ -1,7 +1,16 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var browserProvidersConf = require('./browser-providers.conf.js');
var internalAngularReporter = require('./tools/karma/reporter.js');
// Karma configuration
// Generated on Thu Sep 25 2014 11:52:02 GMT-0700 (PDT)
var file2moduleName = require('./tools/build/file2modulename');
module.exports = function(config) {
config.set({
@ -9,62 +18,107 @@ module.exports = function(config) {
files: [
// Sources and specs.
// Loaded through the es6-module-loader, in `test-main.js`.
{pattern: 'modules/**', included: false},
{pattern: 'tools/transpiler/spec/**', included: false},
// Loaded through the System loader, in `test-main.js`.
{pattern: 'dist/all/@angular/**/*.js', included: false, watched: true},
'node_modules/core-js/client/core.js',
// include Angular v1 for upgrade module testing
'node_modules/angular/angular.min.js',
'node_modules/zone.js/dist/zone.js', 'node_modules/zone.js/dist/long-stack-trace-zone.js',
'node_modules/zone.js/dist/proxy.js', 'node_modules/zone.js/dist/sync-test.js',
'node_modules/zone.js/dist/jasmine-patch.js', 'node_modules/zone.js/dist/async-test.js',
'node_modules/zone.js/dist/fake-async-test.js',
'node_modules/traceur/bin/traceur-runtime.js',
'node_modules/es6-module-loader/dist/es6-module-loader-sans-promises.src.js',
// Including systemjs because it defines `__eval`, which produces correct stack traces.
'node_modules/systemjs/dist/system.src.js',
'node_modules/systemjs/lib/extension-register.js',
'node_modules/systemjs/lib/extension-cjs.js',
'node_modules/rx/dist/rx.all.js',
'node_modules/zone.js/zone.js',
'node_modules/zone.js/long-stack-trace-zone.js',
'tools/build/file2modulename.js',
'test-main.js'
'shims_for_IE.js', 'node_modules/systemjs/dist/system.src.js',
{pattern: 'node_modules/rxjs/**', included: false, watched: false, served: true},
'node_modules/reflect-metadata/Reflect.js', 'tools/build/file2modulename.js', 'test-main.js',
{pattern: 'dist/all/empty.*', included: false, watched: false}, {
pattern: 'modules/@angular/platform-browser/test/static_assets/**',
included: false,
watched: false
},
{
pattern: 'modules/@angular/platform-browser/test/browser/static_assets/**',
included: false,
watched: false,
}
],
exclude: [
'modules/**/e2e_test/**'
'dist/all/@angular/**/e2e_test/**',
'dist/all/@angular/router/**',
'dist/all/@angular/compiler-cli/**',
'dist/all/@angular/benchpress/**',
'dist/all/angular1_router.js',
'dist/all/@angular/platform-browser/testing/e2e_util.js',
'dist/examples/**/e2e_test/**',
],
customLaunchers: browserProvidersConf.customLaunchers,
plugins: [
'karma-jasmine',
'karma-browserstack-launcher',
'karma-sauce-launcher',
'karma-chrome-launcher',
'karma-sourcemap-loader',
internalAngularReporter,
],
preprocessors: {
'modules/**/*.js': ['traceur'],
'modules/**/*.es6': ['traceur'],
'tools/transpiler/spec/**/*.js': ['traceur'],
'tools/transpiler/spec/**/*.es6': ['traceur'],
'**/*.js': ['sourcemap'],
},
traceurPreprocessor: {
reporters: ['internal-angular'],
sauceLabs: {
testName: 'Angular2',
retryLimit: 3,
startConnect: false,
recordVideo: false,
recordScreenshots: false,
options: {
outputLanguage: 'es5',
sourceMaps: true,
script: false,
memberVariables: true,
modules: 'instantiate',
types: true,
typeAssertions: true,
typeAssertionModule: 'rtts_assert/rtts_assert',
annotations: true
},
resolveModuleName: file2moduleName,
transformPath: function(fileName) {
return fileName.replace(/\.es6$/, '.js');
'selenium-version': '2.53.0',
'command-timeout': 600,
'idle-timeout': 600,
'max-duration': 5400,
}
},
customLaunchers: {
DartiumWithWebPlatform: {
base: 'Dartium',
flags: ['--enable-experimental-web-platform-features'] }
browserStack: {
project: 'Angular2',
startTunnel: false,
retryLimit: 3,
timeout: 600,
pollingTimeout: 10000,
},
browsers: ['ChromeCanary'],
port: 9876
browsers: ['Chrome'],
port: 9876,
captureTimeout: 60000,
browserDisconnectTimeout: 60000,
browserDisconnectTolerance: 3,
browserNoActivityTimeout: 60000,
});
config.plugins.push(require('./tools/transpiler/karma-traceur-preprocessor'));
if (process.env.TRAVIS) {
var buildId =
'TRAVIS #' + process.env.TRAVIS_BUILD_NUMBER + ' (' + process.env.TRAVIS_BUILD_ID + ')';
if (process.env.CI_MODE.startsWith('saucelabs')) {
config.sauceLabs.build = buildId;
config.sauceLabs.tunnelIdentifier = process.env.TRAVIS_JOB_NUMBER;
// TODO(mlaval): remove once SauceLabs supports websockets.
// This speeds up the capturing a bit, as browsers don't even try to use websocket.
console.log('>>>> setting socket.io transport to polling <<<<');
config.transports = ['polling'];
}
if (process.env.CI_MODE.startsWith('browserstack')) {
config.browserStack.build = buildId;
config.browserStack.tunnelIdentifier = process.env.TRAVIS_JOB_NUMBER;
}
}
};

View File

@ -1 +0,0 @@
karma-js.conf.js

View File

@ -0,0 +1,6 @@
Angular
=======
The sources for this package are in the main [Angular](https://github.com/angular/angular) repo. Please file issues and pull requests against that repo.
License: MIT

View File

@ -1,10 +1,15 @@
# Benchpress
Benchpress is a framework for e2e performance tests.
See [here for an example project](https://github.com/angular/benchpress-tree).
The sources for this package are in the main [Angular2](https://github.com/angular/angular) repo. Please file issues and pull requests against that repo.
License: MIT
# Why?
There are so called "micro benchmarks" that esentially use a stop watch in the browser to measure time
There are so called "micro benchmarks" that essentially use a stop watch in the browser to measure time
(e.g. via `performance.now()`). This approach is limited to time, and in some cases memory
(Chrome with special flags), as metric. It does not allow to measure:
@ -16,6 +21,7 @@ There are so called "micro benchmarks" that esentially use a stop watch in the b
as the garbage collection amount directly affects garbage collection time.
- distinguish script execution time from waiting: e.g. to measure the client side only time that is spent
in a complex user interaction, ignoring backend calls.
- measure fps to assert the smoothness of scrolling and animations.
This kind of data is already available in the DevTools of modern browsers. However, there is no standard way to
use those tools in an automated way to measure web app performance, especially not across platforms.
@ -79,7 +85,7 @@ index.html:
var container = document.getElementById('container');
var complexHtmlString = '...'; // TODO
function reset() { cotainer.innerHTML = ''; }
function reset() { container.innerHTML = ''; }
function fill() {
container.innerHTML = complexHtmlString;
@ -156,13 +162,82 @@ runner.sample({
````
When looking into the DevTools Timeline, we see a marker as well:
![Marked Timeline](marked_timeline.png)
![Marked Timeline](docs/marked_timeline.png)
### Custom Metrics Without Using `console.time`
It's also possible to measure any "user metric" within the browser
by setting a numeric value on the `window` object. For example:
```js
bootstrap(App)
.then(() => {
window.timeToBootstrap = Date.now() - performance.timing.navigationStart;
});
```
A test driver for this user metric could be written as follows:
```js
describe('home page load', function() {
it('should log load time for a 2G connection', done => {
runner.sample({
execute: () => {
browser.get(`http://localhost:8080`);
},
userMetrics: {
timeToBootstrap: 'The time in milliseconds to bootstrap'
},
providers: [
{provide: RegressionSlopeValidator.METRIC, useValue: 'timeToBootstrap'}
]
}).then(done);
});
});
```
Using this strategy, benchpress will wait until the specified property name,
`timeToBootstrap` in this case, is defined as a number on the `window` object
inside the application under test.
# Smoothness Metrics
Benchpress can also measure the "smoothness" of scrolling and animations. In order to do that, the following set of metrics can be collected by benchpress:
- `frameTime.mean`: mean frame time in ms (target: 16.6ms for 60fps)
- `frameTime.worst`: worst frame time in ms
- `frameTime.best`: best frame time in ms
- `frameTime.smooth`: percentage of frames that hit 60fps
To collect these metrics, you need to execute `console.time('frameCapture')` and `console.timeEnd('frameCapture')` either in your benchmark application or in you benchmark driver via webdriver. The metrics mentioned above will only be collected between those two calls and it is recommended to wrap the time/timeEnd calls as closely as possible around the action you want to evaluate to get accurate measurements.
In addition to that, one extra provider needs to be passed to benchpress in tests that want to collect these metrics:
benchpress.sample(providers: [{provide: bp.Options.CAPTURE_FRAMES, useValue: true}], ... )
# Requests Metrics
Benchpress can also record the number of requests sent and count the received "encoded" bytes since [window.performance.timing.navigationStart](http://www.w3.org/TR/navigation-timing/#dom-performancetiming-navigationstart):
- `receivedData`: number of bytes received since the last navigation start
- `requestCount`: number of requests sent since the last navigation start
To collect these metrics, you need the following corresponding extra providers:
benchpress.sample(providers: [
{provide: bp.Options.RECEIVED_DATA, useValue: true},
{provide: bp.Options.REQUEST_COUNT, useValue: true}
], ... )
# Best practices
* Use normalized environments
- metrics that are dependent on the performance of the execution environment must be executed on a normalized machine
- e.g. a real mobile device whose cpu frequency is set to a fixed value
- e.g. a real mobile device whose cpu frequency is set to a fixed value.
* see our [build script](https://github.com/angular/angular/blob/master/scripts/ci/android_cpu.sh)
* this requires root access, e.g. via a userdebug build of Android on a Google Nexus device
(see [here](https://source.android.com/source/building-running.html) and [here](https://source.android.com/source/building-devices.html#obtaining-proprietary-binaries))
- e.g. a calibrated machine that does not run background jobs, has a fixed cpu frequency, ...
* Use relative comparisons
@ -185,7 +260,7 @@ When looking into the DevTools Timeline, we see a marker as well:
# Detailed overview
![Overview](overview.svg)
![Overview](docs/overview.png)
Definitions:

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -0,0 +1,34 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
// Must be imported first, because angular2 decorators throws on load.
import 'reflect-metadata';
export {Injector, OpaqueToken, Provider, ReflectiveInjector} from '@angular/core';
export {Options} from './src/common_options';
export {MeasureValues} from './src/measure_values';
export {Metric} from './src/metric';
export {MultiMetric} from './src/metric/multi_metric';
export {PerflogMetric} from './src/metric/perflog_metric';
export {UserMetric} from './src/metric/user_metric';
export {Reporter} from './src/reporter';
export {ConsoleReporter} from './src/reporter/console_reporter';
export {JsonFileReporter} from './src/reporter/json_file_reporter';
export {MultiReporter} from './src/reporter/multi_reporter';
export {Runner} from './src/runner';
export {SampleDescription} from './src/sample_description';
export {SampleState, Sampler} from './src/sampler';
export {Validator} from './src/validator';
export {RegressionSlopeValidator} from './src/validator/regression_slope_validator';
export {SizeValidator} from './src/validator/size_validator';
export {WebDriverAdapter} from './src/web_driver_adapter';
export {PerfLogEvent, PerfLogFeatures, WebDriverExtension} from './src/web_driver_extension';
export {ChromeDriverExtension} from './src/webdriver/chrome_driver_extension';
export {FirefoxDriverExtension} from './src/webdriver/firefox_driver_extension';
export {IOsDriverExtension} from './src/webdriver/ios_driver_extension';
export {SeleniumWebDriverAdapter} from './src/webdriver/selenium_webdriver_adapter';

View File

@ -0,0 +1,31 @@
{
"name": "@angular/benchpress",
"version": "0.1.0",
"description": "Benchpress - a framework for e2e performance tests",
"main": "index.js",
"typings": "index.d.ts",
"dependencies": {
"@angular/core": "^2.0.0-rc.7",
"reflect-metadata": "^0.1.2",
"rxjs": "5.0.0-beta.12",
"jpm": "1.1.4",
"firefox-profile": "0.4.0",
"selenium-webdriver": "^2.53.3"
},
"repository": {
"type": "git",
"url": "https://github.com/angular/angular.git"
},
"keywords": [
"angular",
"benchmarks"
],
"contributors": [
"Tobias Bosch <tbosch@google.com> (https://angular.io/)"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/angular/angular/issues"
},
"homepage": "https://github.com/angular/angular/tree/master/modules/@angular/compiler-cli"
}

View File

@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -ex
cd $(dirname $0)/../../..
ROOTDIR=$(pwd)
SRCDIR=${ROOTDIR}/modules/@angular/benchpress
DESTDIR=${ROOTDIR}/dist/packages-dist/benchpress
rm -fr ${DESTDIR}
echo "====== BUILDING... ====="
./build.sh --packages=core,benchpress --bundle=false
echo "====== PUBLISHING: ${DESTDIR} ====="
npm publish ${DESTDIR} --access public

View File

@ -0,0 +1,53 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {OpaqueToken} from '@angular/core';
import * as fs from 'fs';
export class Options {
static SAMPLE_ID = new OpaqueToken('Options.sampleId');
static DEFAULT_DESCRIPTION = new OpaqueToken('Options.defaultDescription');
static SAMPLE_DESCRIPTION = new OpaqueToken('Options.sampleDescription');
static FORCE_GC = new OpaqueToken('Options.forceGc');
static NO_PREPARE = () => true;
static PREPARE = new OpaqueToken('Options.prepare');
static EXECUTE = new OpaqueToken('Options.execute');
static CAPABILITIES = new OpaqueToken('Options.capabilities');
static USER_AGENT = new OpaqueToken('Options.userAgent');
static MICRO_METRICS = new OpaqueToken('Options.microMetrics');
static USER_METRICS = new OpaqueToken('Options.userMetrics');
static NOW = new OpaqueToken('Options.now');
static WRITE_FILE = new OpaqueToken('Options.writeFile');
static RECEIVED_DATA = new OpaqueToken('Options.receivedData');
static REQUEST_COUNT = new OpaqueToken('Options.requestCount');
static CAPTURE_FRAMES = new OpaqueToken('Options.frameCapture');
static DEFAULT_PROVIDERS = [
{provide: Options.DEFAULT_DESCRIPTION, useValue: {}},
{provide: Options.SAMPLE_DESCRIPTION, useValue: {}},
{provide: Options.FORCE_GC, useValue: false},
{provide: Options.PREPARE, useValue: Options.NO_PREPARE},
{provide: Options.MICRO_METRICS, useValue: {}}, {provide: Options.USER_METRICS, useValue: {}},
{provide: Options.NOW, useValue: () => new Date()},
{provide: Options.RECEIVED_DATA, useValue: false},
{provide: Options.REQUEST_COUNT, useValue: false},
{provide: Options.CAPTURE_FRAMES, useValue: false},
{provide: Options.WRITE_FILE, useValue: writeFile}
];
}
function writeFile(filename: string, content: string): Promise<any> {
return new Promise(function(resolve, reject) {
fs.writeFile(filename, content, (error) => {
if (error) {
reject(error);
} else {
resolve();
}
});
});
}

View File

@ -0,0 +1 @@
../../facade/src

View File

@ -0,0 +1,2 @@
*.xpi
addon-sdk*

View File

@ -0,0 +1,38 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
declare var exportFunction: any;
declare var unsafeWindow: any;
exportFunction(function() {
var curTime = unsafeWindow.performance.now();
(<any>self).port.emit('startProfiler', curTime);
}, unsafeWindow, {defineAs: 'startProfiler'});
exportFunction(function() {
(<any>self).port.emit('stopProfiler');
}, unsafeWindow, {defineAs: 'stopProfiler'});
exportFunction(function(cb: Function) {
(<any>self).port.once('perfProfile', cb);
(<any>self).port.emit('getProfile');
}, unsafeWindow, {defineAs: 'getProfile'});
exportFunction(function() {
(<any>self).port.emit('forceGC');
}, unsafeWindow, {defineAs: 'forceGC'});
exportFunction(function(name: string) {
var curTime = unsafeWindow.performance.now();
(<any>self).port.emit('markStart', name, curTime);
}, unsafeWindow, {defineAs: 'markStart'});
exportFunction(function(name: string) {
var curTime = unsafeWindow.performance.now();
(<any>self).port.emit('markEnd', name, curTime);
}, unsafeWindow, {defineAs: 'markEnd'});

View File

@ -0,0 +1,78 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var {Cc, Ci, Cu} = require('chrome');
var os = Cc['@mozilla.org/observer-service;1'].getService(Ci.nsIObserverService);
var ParserUtil = require('./parser_util');
class Profiler {
private _profiler: any;
private _markerEvents: any[];
private _profilerStartTime: number;
constructor() { this._profiler = Cc['@mozilla.org/tools/profiler;1'].getService(Ci.nsIProfiler); }
start(entries: any, interval: any, features: any, timeStarted: any) {
this._profiler.StartProfiler(entries, interval, features, features.length);
this._profilerStartTime = timeStarted;
this._markerEvents = [];
}
stop() { this._profiler.StopProfiler(); }
getProfilePerfEvents() {
var profileData = this._profiler.getProfileData();
var perfEvents = ParserUtil.convertPerfProfileToEvents(profileData);
perfEvents = this._mergeMarkerEvents(perfEvents);
perfEvents.sort(function(event1: any, event2: any) {
return event1.ts - event2.ts;
}); // Sort by ts
return perfEvents;
}
/** @internal */
private _mergeMarkerEvents(perfEvents: any[]): any[] {
this._markerEvents.forEach(function(markerEvent) { perfEvents.push(markerEvent); });
return perfEvents;
}
addStartEvent(name: string, timeStarted: number) {
this._markerEvents.push({ph: 'B', ts: timeStarted - this._profilerStartTime, name: name});
}
addEndEvent(name: string, timeEnded: number) {
this._markerEvents.push({ph: 'E', ts: timeEnded - this._profilerStartTime, name: name});
}
}
function forceGC() {
Cu.forceGC();
os.notifyObservers(null, 'child-gc-request', null);
};
var mod = require('sdk/page-mod');
var data = require('sdk/self').data;
var profiler = new Profiler();
mod.PageMod({
include: ['*'],
contentScriptFile: data.url('installed_script.js'),
onAttach: (worker: any) => {
worker.port.on(
'startProfiler',
(timeStarted: any) => profiler.start(
/* = profiler memory */ 3000000, 0.1, ['leaf', 'js', 'stackwalk', 'gc'], timeStarted));
worker.port.on('stopProfiler', () => profiler.stop());
worker.port.on(
'getProfile', () => worker.port.emit('perfProfile', profiler.getProfilePerfEvents()));
worker.port.on('forceGC', forceGC);
worker.port.on(
'markStart', (name: string, timeStarted: any) => profiler.addStartEvent(name, timeStarted));
worker.port.on(
'markEnd', (name: string, timeEnded: any) => profiler.addEndEvent(name, timeEnded));
}
});

View File

@ -0,0 +1,92 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* @param {Object} perfProfile The perf profile JSON object.
* @return {Object[]} An array of recognized events that are captured
* within the perf profile.
*/
export function convertPerfProfileToEvents(perfProfile: any): any[] {
var inProgressEvents = new Map(); // map from event name to start time
var finishedEvents: {[key: string]: any}[] = []; // Event[] finished events
var addFinishedEvent = function(eventName: string, startTime: number, endTime: number) {
var categorizedEventName = categorizeEvent(eventName);
var args: {[key: string]: any} = undefined;
if (categorizedEventName == 'gc') {
// TODO: We cannot measure heap size at the moment
args = {usedHeapSize: 0};
}
if (startTime == endTime) {
// Finished instantly
finishedEvents.push({ph: 'X', ts: startTime, name: categorizedEventName, args: args});
} else {
// Has duration
finishedEvents.push({ph: 'B', ts: startTime, name: categorizedEventName, args: args});
finishedEvents.push({ph: 'E', ts: endTime, name: categorizedEventName, args: args});
}
};
var samples = perfProfile.threads[0].samples;
// In perf profile, firefox samples all the frames in set time intervals. Here
// we go through all the samples and construct the start and end time for each
// event.
for (var i = 0; i < samples.length; ++i) {
var sample = samples[i];
var sampleTime = sample.time;
// Add all the frames into a set so it's easier/faster to find the set
// differences
var sampleFrames = new Set();
sample.frames.forEach(function(frame: {[key: string]: any}) {
sampleFrames.add(frame['location']);
});
// If an event is in the inProgressEvents map, but not in the current sample,
// then it must have just finished. We add this event to the finishedEvents
// array and remove it from the inProgressEvents map.
var previousSampleTime = (i == 0 ? /* not used */ -1 : samples[i - 1].time);
inProgressEvents.forEach(function(startTime, eventName) {
if (!(sampleFrames.has(eventName))) {
addFinishedEvent(eventName, startTime, previousSampleTime);
inProgressEvents.delete(eventName);
}
});
// If an event is in the current sample, but not in the inProgressEvents map,
// then it must have just started. We add this event to the inProgressEvents
// map.
sampleFrames.forEach(function(eventName) {
if (!(inProgressEvents.has(eventName))) {
inProgressEvents.set(eventName, sampleTime);
}
});
}
// If anything is still in progress, we need to included it as a finished event
// since recording ended.
var lastSampleTime = samples[samples.length - 1].time;
inProgressEvents.forEach(function(startTime, eventName) {
addFinishedEvent(eventName, startTime, lastSampleTime);
});
// Remove all the unknown categories.
return finishedEvents.filter(function(event) { return event['name'] != 'unknown'; });
}
// TODO: this is most likely not exhaustive.
export function categorizeEvent(eventName: string): string {
if (eventName.indexOf('PresShell::Paint') > -1) {
return 'render';
} else if (eventName.indexOf('FirefoxDriver.prototype.executeScript') > -1) {
return 'script';
} else if (eventName.indexOf('forceGC') > -1) {
return 'gc';
} else {
return 'unknown';
}
}

View File

@ -0,0 +1,51 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var q = require('q');
var FirefoxProfile = require('firefox-profile');
var jpm = require('jpm/lib/xpi');
var pathUtil = require('path');
var PERF_ADDON_PACKAGE_JSON_DIR = '..';
exports.getAbsolutePath = function(path: string) {
var normalizedPath = pathUtil.normalize(path);
if (pathUtil.resolve(normalizedPath) == normalizedPath) {
// Already absolute path
return normalizedPath;
} else {
return pathUtil.join(__dirname, normalizedPath);
}
};
exports.getFirefoxProfile = function(extensionPath: string) {
var deferred = q.defer();
var firefoxProfile = new FirefoxProfile();
firefoxProfile.addExtensions([extensionPath], () => {
firefoxProfile.encoded((encodedProfile: any) => {
var multiCapabilities = [{browserName: 'firefox', firefox_profile: encodedProfile}];
deferred.resolve(multiCapabilities);
});
});
return deferred.promise;
};
exports.getFirefoxProfileWithExtension = function() {
var absPackageJsonDir = pathUtil.join(__dirname, PERF_ADDON_PACKAGE_JSON_DIR);
var packageJson = require(pathUtil.join(absPackageJsonDir, 'package.json'));
var savedCwd = process.cwd();
process.chdir(absPackageJsonDir);
return jpm(packageJson).then((xpiPath: string) => {
process.chdir(savedCwd);
return exports.getFirefoxProfile(xpiPath);
});
};

View File

@ -0,0 +1 @@
{ "version" : "0.0.1", "main" : "lib/main.js", "name" : "ffperf-addon" }

View File

@ -0,0 +1,20 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export class MeasureValues {
constructor(
public runIndex: number, public timeStamp: Date, public values: {[key: string]: any}) {}
toJson() {
return {
'timeStamp': this.timeStamp.toJSON(),
'runIndex': this.runIndex,
'values': this.values,
};
}
}

View File

@ -0,0 +1,31 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* A metric is measures values
*/
export abstract class Metric {
/**
* Starts measuring
*/
beginMeasure(): Promise<any> { throw new Error('NYI'); }
/**
* Ends measuring and reports the data
* since the begin call.
* @param restart: Whether to restart right after this.
*/
endMeasure(restart: boolean): Promise<{[key: string]: any}> { throw new Error('NYI'); }
/**
* Describes the metrics provided by this metric implementation.
* (e.g. units, ...)
*/
describe(): {[key: string]: string} { throw new Error('NYI'); }
}

View File

@ -0,0 +1,63 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {Injector, OpaqueToken} from '@angular/core';
import {Metric} from '../metric';
export class MultiMetric extends Metric {
static provideWith(childTokens: any[]): any[] {
return [
{
provide: _CHILDREN,
useFactory: (injector: Injector) => childTokens.map(token => injector.get(token)),
deps: [Injector]
},
{
provide: MultiMetric,
useFactory: (children: Metric[]) => new MultiMetric(children),
deps: [_CHILDREN]
}
];
}
constructor(private _metrics: Metric[]) { super(); }
/**
* Starts measuring
*/
beginMeasure(): Promise<any> {
return Promise.all(this._metrics.map(metric => metric.beginMeasure()));
}
/**
* Ends measuring and reports the data
* since the begin call.
* @param restart: Whether to restart right after this.
*/
endMeasure(restart: boolean): Promise<{[key: string]: any}> {
return Promise.all(this._metrics.map(metric => metric.endMeasure(restart)))
.then(values => mergeStringMaps(<any>values));
}
/**
* Describes the metrics provided by this metric implementation.
* (e.g. units, ...)
*/
describe(): {[key: string]: any} {
return mergeStringMaps(this._metrics.map((metric) => metric.describe()));
}
}
function mergeStringMaps(maps: {[key: string]: string}[]): {[key: string]: string} {
var result: {[key: string]: string} = {};
maps.forEach(map => { Object.keys(map).forEach(prop => { result[prop] = map[prop]; }); });
return result;
}
var _CHILDREN = new OpaqueToken('MultiMetric.children');

View File

@ -0,0 +1,371 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {Inject, Injectable, OpaqueToken} from '@angular/core';
import {Options} from '../common_options';
import {Metric} from '../metric';
import {PerfLogEvent, PerfLogFeatures, WebDriverExtension} from '../web_driver_extension';
/**
* A metric that reads out the performance log
*/
@Injectable()
export class PerflogMetric extends Metric {
static SET_TIMEOUT = new OpaqueToken('PerflogMetric.setTimeout');
static PROVIDERS = [
PerflogMetric, {
provide: PerflogMetric.SET_TIMEOUT,
useValue: (fn: Function, millis: number) => <any>setTimeout(fn, millis)
}
];
private _remainingEvents: PerfLogEvent[];
private _measureCount: number;
private _perfLogFeatures: PerfLogFeatures;
/**
* @param driverExtension
* @param setTimeout
* @param microMetrics Name and description of metrics provided via console.time / console.timeEnd
**/
constructor(
private _driverExtension: WebDriverExtension,
@Inject(PerflogMetric.SET_TIMEOUT) private _setTimeout: Function,
@Inject(Options.MICRO_METRICS) private _microMetrics: {[key: string]: string},
@Inject(Options.FORCE_GC) private _forceGc: boolean,
@Inject(Options.CAPTURE_FRAMES) private _captureFrames: boolean,
@Inject(Options.RECEIVED_DATA) private _receivedData: boolean,
@Inject(Options.REQUEST_COUNT) private _requestCount: boolean) {
super();
this._remainingEvents = [];
this._measureCount = 0;
this._perfLogFeatures = _driverExtension.perfLogFeatures();
if (!this._perfLogFeatures.userTiming) {
// User timing is needed for navigationStart.
this._receivedData = false;
this._requestCount = false;
}
}
describe(): {[key: string]: string} {
var res: {[key: string]: any} = {
'scriptTime': 'script execution time in ms, including gc and render',
'pureScriptTime': 'script execution time in ms, without gc nor render'
};
if (this._perfLogFeatures.render) {
res['renderTime'] = 'render time in ms';
}
if (this._perfLogFeatures.gc) {
res['gcTime'] = 'gc time in ms';
res['gcAmount'] = 'gc amount in kbytes';
res['majorGcTime'] = 'time of major gcs in ms';
if (this._forceGc) {
res['forcedGcTime'] = 'forced gc time in ms';
res['forcedGcAmount'] = 'forced gc amount in kbytes';
}
}
if (this._receivedData) {
res['receivedData'] = 'encoded bytes received since navigationStart';
}
if (this._requestCount) {
res['requestCount'] = 'count of requests sent since navigationStart';
}
if (this._captureFrames) {
if (!this._perfLogFeatures.frameCapture) {
var warningMsg = 'WARNING: Metric requested, but not supported by driver';
// using dot syntax for metric name to keep them grouped together in console reporter
res['frameTime.mean'] = warningMsg;
res['frameTime.worst'] = warningMsg;
res['frameTime.best'] = warningMsg;
res['frameTime.smooth'] = warningMsg;
} else {
res['frameTime.mean'] = 'mean frame time in ms (target: 16.6ms for 60fps)';
res['frameTime.worst'] = 'worst frame time in ms';
res['frameTime.best'] = 'best frame time in ms';
res['frameTime.smooth'] = 'percentage of frames that hit 60fps';
}
}
for (let name in this._microMetrics) {
res[name] = this._microMetrics[name];
}
return res;
}
beginMeasure(): Promise<any> {
var resultPromise = Promise.resolve(null);
if (this._forceGc) {
resultPromise = resultPromise.then((_) => this._driverExtension.gc());
}
return resultPromise.then((_) => this._beginMeasure());
}
endMeasure(restart: boolean): Promise<{[key: string]: number}> {
if (this._forceGc) {
return this._endPlainMeasureAndMeasureForceGc(restart);
} else {
return this._endMeasure(restart);
}
}
/** @internal */
private _endPlainMeasureAndMeasureForceGc(restartMeasure: boolean) {
return this._endMeasure(true).then((measureValues) => {
// disable frame capture for measurements during forced gc
var originalFrameCaptureValue = this._captureFrames;
this._captureFrames = false;
return this._driverExtension.gc()
.then((_) => this._endMeasure(restartMeasure))
.then((forceGcMeasureValues) => {
this._captureFrames = originalFrameCaptureValue;
measureValues['forcedGcTime'] = forceGcMeasureValues['gcTime'];
measureValues['forcedGcAmount'] = forceGcMeasureValues['gcAmount'];
return measureValues;
});
});
}
private _beginMeasure(): Promise<any> {
return this._driverExtension.timeBegin(this._markName(this._measureCount++));
}
private _endMeasure(restart: boolean): Promise<{[key: string]: number}> {
var markName = this._markName(this._measureCount - 1);
var nextMarkName = restart ? this._markName(this._measureCount++) : null;
return this._driverExtension.timeEnd(markName, nextMarkName)
.then((_) => this._readUntilEndMark(markName));
}
private _readUntilEndMark(
markName: string, loopCount: number = 0, startEvent: PerfLogEvent = null) {
if (loopCount > _MAX_RETRY_COUNT) {
throw new Error(`Tried too often to get the ending mark: ${loopCount}`);
}
return this._driverExtension.readPerfLog().then((events) => {
this._addEvents(events);
var result = this._aggregateEvents(this._remainingEvents, markName);
if (result) {
this._remainingEvents = events;
return result;
}
var resolve: (result: any) => void;
var promise = new Promise(res => { resolve = res; });
this._setTimeout(() => resolve(this._readUntilEndMark(markName, loopCount + 1)), 100);
return promise;
});
}
private _addEvents(events: PerfLogEvent[]) {
var needSort = false;
events.forEach(event => {
if (event['ph'] === 'X') {
needSort = true;
var startEvent: PerfLogEvent = {};
var endEvent: PerfLogEvent = {};
for (let prop in event) {
startEvent[prop] = event[prop];
endEvent[prop] = event[prop];
}
startEvent['ph'] = 'B';
endEvent['ph'] = 'E';
endEvent['ts'] = startEvent['ts'] + startEvent['dur'];
this._remainingEvents.push(startEvent);
this._remainingEvents.push(endEvent);
} else {
this._remainingEvents.push(event);
}
});
if (needSort) {
// Need to sort because of the ph==='X' events
this._remainingEvents.sort((a, b) => {
var diff = a['ts'] - b['ts'];
return diff > 0 ? 1 : diff < 0 ? -1 : 0;
});
}
}
private _aggregateEvents(events: PerfLogEvent[], markName: string): {[key: string]: number} {
var result: {[key: string]: number} = {'scriptTime': 0, 'pureScriptTime': 0};
if (this._perfLogFeatures.gc) {
result['gcTime'] = 0;
result['majorGcTime'] = 0;
result['gcAmount'] = 0;
}
if (this._perfLogFeatures.render) {
result['renderTime'] = 0;
}
if (this._captureFrames) {
result['frameTime.mean'] = 0;
result['frameTime.best'] = 0;
result['frameTime.worst'] = 0;
result['frameTime.smooth'] = 0;
}
for (let name in this._microMetrics) {
result[name] = 0;
}
if (this._receivedData) {
result['receivedData'] = 0;
}
if (this._requestCount) {
result['requestCount'] = 0;
}
var markStartEvent: PerfLogEvent = null;
var markEndEvent: PerfLogEvent = null;
events.forEach((event) => {
var ph = event['ph'];
var name = event['name'];
if (ph === 'B' && name === markName) {
markStartEvent = event;
} else if (ph === 'I' && name === 'navigationStart') {
// if a benchmark measures reload of a page, use the last
// navigationStart as begin event
markStartEvent = event;
} else if (ph === 'E' && name === markName) {
markEndEvent = event;
}
});
if (!markStartEvent || !markEndEvent) {
// not all events have been received, no further processing for now
return null;
}
var gcTimeInScript = 0;
var renderTimeInScript = 0;
var frameTimestamps: number[] = [];
var frameTimes: number[] = [];
var frameCaptureStartEvent: PerfLogEvent = null;
var frameCaptureEndEvent: PerfLogEvent = null;
var intervalStarts: {[key: string]: PerfLogEvent} = {};
var intervalStartCount: {[key: string]: number} = {};
var inMeasureRange = false;
events.forEach((event) => {
var ph = event['ph'];
var name = event['name'];
var microIterations = 1;
var microIterationsMatch = name.match(_MICRO_ITERATIONS_REGEX);
if (microIterationsMatch) {
name = microIterationsMatch[1];
microIterations = parseInt(microIterationsMatch[2], 10);
}
if (event === markStartEvent) {
inMeasureRange = true;
} else if (event === markEndEvent) {
inMeasureRange = false;
}
if (!inMeasureRange || event['pid'] !== markStartEvent['pid']) {
return;
}
if (this._requestCount && name === 'sendRequest') {
result['requestCount'] += 1;
} else if (this._receivedData && name === 'receivedData' && ph === 'I') {
result['receivedData'] += event['args']['encodedDataLength'];
}
if (ph === 'B' && name === _MARK_NAME_FRAME_CAPUTRE) {
if (frameCaptureStartEvent) {
throw new Error('can capture frames only once per benchmark run');
}
if (!this._captureFrames) {
throw new Error(
'found start event for frame capture, but frame capture was not requested in benchpress');
}
frameCaptureStartEvent = event;
} else if (ph === 'E' && name === _MARK_NAME_FRAME_CAPUTRE) {
if (!frameCaptureStartEvent) {
throw new Error('missing start event for frame capture');
}
frameCaptureEndEvent = event;
}
if (ph === 'I' && frameCaptureStartEvent && !frameCaptureEndEvent && name === 'frame') {
frameTimestamps.push(event['ts']);
if (frameTimestamps.length >= 2) {
frameTimes.push(
frameTimestamps[frameTimestamps.length - 1] -
frameTimestamps[frameTimestamps.length - 2]);
}
}
if (ph === 'B') {
if (!intervalStarts[name]) {
intervalStartCount[name] = 1;
intervalStarts[name] = event;
} else {
intervalStartCount[name]++;
}
} else if ((ph === 'E') && intervalStarts[name]) {
intervalStartCount[name]--;
if (intervalStartCount[name] === 0) {
var startEvent = intervalStarts[name];
var duration = (event['ts'] - startEvent['ts']);
intervalStarts[name] = null;
if (name === 'gc') {
result['gcTime'] += duration;
var amount =
(startEvent['args']['usedHeapSize'] - event['args']['usedHeapSize']) / 1000;
result['gcAmount'] += amount;
var majorGc = event['args']['majorGc'];
if (majorGc && majorGc) {
result['majorGcTime'] += duration;
}
if (intervalStarts['script']) {
gcTimeInScript += duration;
}
} else if (name === 'render') {
result['renderTime'] += duration;
if (intervalStarts['script']) {
renderTimeInScript += duration;
}
} else if (name === 'script') {
result['scriptTime'] += duration;
} else if (this._microMetrics[name]) {
(<any>result)[name] += duration / microIterations;
}
}
}
});
if (frameCaptureStartEvent && !frameCaptureEndEvent) {
throw new Error('missing end event for frame capture');
}
if (this._captureFrames && !frameCaptureStartEvent) {
throw new Error('frame capture requested in benchpress, but no start event was found');
}
if (frameTimes.length > 0) {
this._addFrameMetrics(result, frameTimes);
}
result['pureScriptTime'] = result['scriptTime'] - gcTimeInScript - renderTimeInScript;
return result;
}
private _addFrameMetrics(result: {[key: string]: number}, frameTimes: any[]) {
result['frameTime.mean'] = frameTimes.reduce((a, b) => a + b, 0) / frameTimes.length;
var firstFrame = frameTimes[0];
result['frameTime.worst'] = frameTimes.reduce((a, b) => a > b ? a : b, firstFrame);
result['frameTime.best'] = frameTimes.reduce((a, b) => a < b ? a : b, firstFrame);
result['frameTime.smooth'] =
frameTimes.filter(t => t < _FRAME_TIME_SMOOTH_THRESHOLD).length / frameTimes.length;
}
private _markName(index: number) { return `${_MARK_NAME_PREFIX}${index}`; }
}
var _MICRO_ITERATIONS_REGEX = /(.+)\*(\d+)$/;
var _MAX_RETRY_COUNT = 20;
var _MARK_NAME_PREFIX = 'benchpress';
var _MARK_NAME_FRAME_CAPUTRE = 'frameCapture';
// using 17ms as a somewhat looser threshold, instead of 16.6666ms
var _FRAME_TIME_SMOOTH_THRESHOLD = 17;

View File

@ -0,0 +1,69 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {Inject, Injectable} from '@angular/core';
import {Options} from '../common_options';
import {Metric} from '../metric';
import {WebDriverAdapter} from '../web_driver_adapter';
@Injectable()
export class UserMetric extends Metric {
static PROVIDERS = [UserMetric];
constructor(
@Inject(Options.USER_METRICS) private _userMetrics: {[key: string]: string},
private _wdAdapter: WebDriverAdapter) {
super();
}
/**
* Starts measuring
*/
beginMeasure(): Promise<any> { return Promise.resolve(true); }
/**
* Ends measuring.
*/
endMeasure(restart: boolean): Promise<{[key: string]: any}> {
let resolve: (result: any) => void;
let reject: (error: any) => void;
let promise = new Promise((res, rej) => {
resolve = res;
reject = rej;
});
let adapter = this._wdAdapter;
let names = Object.keys(this._userMetrics);
function getAndClearValues() {
Promise.all(names.map(name => adapter.executeScript(`return window.${name}`)))
.then((values: any[]) => {
if (values.every(v => typeof v === 'number')) {
Promise.all(names.map(name => adapter.executeScript(`delete window.${name}`)))
.then((_: any[]) => {
let map: {[k: string]: any} = {};
for (let i = 0, n = names.length; i < n; i++) {
map[names[i]] = values[i];
}
resolve(map);
}, reject);
} else {
<any>setTimeout(getAndClearValues, 100);
}
}, reject);
}
getAndClearValues();
return promise;
}
/**
* Describes the metrics provided by this metric implementation.
* (e.g. units, ...)
*/
describe(): {[key: string]: any} { return this._userMetrics; }
}

View File

@ -0,0 +1,20 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {MeasureValues} from './measure_values';
/**
* A reporter reports measure values and the valid sample.
*/
export abstract class Reporter {
reportMeasureValues(values: MeasureValues): Promise<any> { throw new Error('NYI'); }
reportSample(completeSample: MeasureValues[], validSample: MeasureValues[]): Promise<any> {
throw new Error('NYI');
}
}

View File

@ -0,0 +1,83 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {Inject, Injectable, OpaqueToken} from '@angular/core';
import {print} from '../facade/lang';
import {MeasureValues} from '../measure_values';
import {Reporter} from '../reporter';
import {SampleDescription} from '../sample_description';
import {formatNum, formatStats, sortedProps} from './util';
/**
* A reporter for the console
*/
@Injectable()
export class ConsoleReporter extends Reporter {
static PRINT = new OpaqueToken('ConsoleReporter.print');
static COLUMN_WIDTH = new OpaqueToken('ConsoleReporter.columnWidth');
static PROVIDERS = [
ConsoleReporter, {provide: ConsoleReporter.COLUMN_WIDTH, useValue: 18},
{provide: ConsoleReporter.PRINT, useValue: print}
];
private static _lpad(value: string, columnWidth: number, fill = ' ') {
var result = '';
for (var i = 0; i < columnWidth - value.length; i++) {
result += fill;
}
return result + value;
}
private _metricNames: string[];
constructor(
@Inject(ConsoleReporter.COLUMN_WIDTH) private _columnWidth: number,
sampleDescription: SampleDescription,
@Inject(ConsoleReporter.PRINT) private _print: Function) {
super();
this._metricNames = sortedProps(sampleDescription.metrics);
this._printDescription(sampleDescription);
}
private _printDescription(sampleDescription: SampleDescription) {
this._print(`BENCHMARK ${sampleDescription.id}`);
this._print('Description:');
var props = sortedProps(sampleDescription.description);
props.forEach((prop) => { this._print(`- ${prop}: ${sampleDescription.description[prop]}`); });
this._print('Metrics:');
this._metricNames.forEach((metricName) => {
this._print(`- ${metricName}: ${sampleDescription.metrics[metricName]}`);
});
this._print('');
this._printStringRow(this._metricNames);
this._printStringRow(this._metricNames.map((_) => ''), '-');
}
reportMeasureValues(measureValues: MeasureValues): Promise<any> {
var formattedValues = this._metricNames.map(metricName => {
var value = measureValues.values[metricName];
return formatNum(value);
});
this._printStringRow(formattedValues);
return Promise.resolve(null);
}
reportSample(completeSample: MeasureValues[], validSamples: MeasureValues[]): Promise<any> {
this._printStringRow(this._metricNames.map((_) => ''), '=');
this._printStringRow(
this._metricNames.map(metricName => formatStats(validSamples, metricName)));
return Promise.resolve(null);
}
private _printStringRow(parts: any[], fill = ' ') {
this._print(
parts.map(part => ConsoleReporter._lpad(part, this._columnWidth, fill)).join(' | '));
}
}

View File

@ -0,0 +1,52 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {Inject, Injectable, OpaqueToken} from '@angular/core';
import {Options} from '../common_options';
import {MeasureValues} from '../measure_values';
import {Reporter} from '../reporter';
import {SampleDescription} from '../sample_description';
import {formatStats, sortedProps} from './util';
/**
* A reporter that writes results into a json file.
*/
@Injectable()
export class JsonFileReporter extends Reporter {
static PATH = new OpaqueToken('JsonFileReporter.path');
static PROVIDERS = [JsonFileReporter, {provide: JsonFileReporter.PATH, useValue: '.'}];
constructor(
private _description: SampleDescription, @Inject(JsonFileReporter.PATH) private _path: string,
@Inject(Options.WRITE_FILE) private _writeFile: Function,
@Inject(Options.NOW) private _now: Function) {
super();
}
reportMeasureValues(measureValues: MeasureValues): Promise<any> { return Promise.resolve(null); }
reportSample(completeSample: MeasureValues[], validSample: MeasureValues[]): Promise<any> {
const stats: {[key: string]: string} = {};
sortedProps(this._description.metrics).forEach((metricName) => {
stats[metricName] = formatStats(validSample, metricName);
});
var content = JSON.stringify(
{
'description': this._description,
'stats': stats,
'completeSample': completeSample,
'validSample': validSample,
},
null, 2);
var filePath = `${this._path}/${this._description.id}_${this._now().getTime()}.json`;
return this._writeFile(filePath, content);
}
}

View File

@ -0,0 +1,42 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {Injector, OpaqueToken} from '@angular/core';
import {MeasureValues} from '../measure_values';
import {Reporter} from '../reporter';
export class MultiReporter extends Reporter {
static provideWith(childTokens: any[]): any[] {
return [
{
provide: _CHILDREN,
useFactory: (injector: Injector) => childTokens.map(token => injector.get(token)),
deps: [Injector],
},
{
provide: MultiReporter,
useFactory: (children: Reporter[]) => new MultiReporter(children),
deps: [_CHILDREN]
}
];
}
constructor(private _reporters: Reporter[]) { super(); }
reportMeasureValues(values: MeasureValues): Promise<any[]> {
return Promise.all(this._reporters.map(reporter => reporter.reportMeasureValues(values)));
}
reportSample(completeSample: MeasureValues[], validSample: MeasureValues[]): Promise<any[]> {
return Promise.all(
this._reporters.map(reporter => reporter.reportSample(completeSample, validSample)));
}
}
var _CHILDREN = new OpaqueToken('MultiReporter.children');

View File

@ -0,0 +1,28 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {MeasureValues} from '../measure_values';
import {Statistic} from '../statistic';
export function formatNum(n: number) {
return n.toFixed(2);
}
export function sortedProps(obj: {[key: string]: any}) {
return Object.keys(obj).sort();
}
export function formatStats(validSamples: MeasureValues[], metricName: string): string {
var samples = validSamples.map(measureValues => measureValues.values[metricName]);
var mean = Statistic.calculateMean(samples);
var cv = Statistic.calculateCoefficientOfVariation(samples, mean);
var formattedMean = formatNum(mean);
// Note: Don't use the unicode character for +- as it might cause
// hickups for consoles...
return isNaN(cv) ? formattedMean : `${formattedMean}+-${Math.floor(cv)}%`;
}

View File

@ -0,0 +1,110 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {Provider, ReflectiveInjector} from '@angular/core';
import {Options} from './common_options';
import {isPresent} from './facade/lang';
import {Metric} from './metric';
import {MultiMetric} from './metric/multi_metric';
import {PerflogMetric} from './metric/perflog_metric';
import {UserMetric} from './metric/user_metric';
import {Reporter} from './reporter';
import {ConsoleReporter} from './reporter/console_reporter';
import {MultiReporter} from './reporter/multi_reporter';
import {SampleDescription} from './sample_description';
import {SampleState, Sampler} from './sampler';
import {Validator} from './validator';
import {RegressionSlopeValidator} from './validator/regression_slope_validator';
import {SizeValidator} from './validator/size_validator';
import {WebDriverAdapter} from './web_driver_adapter';
import {WebDriverExtension} from './web_driver_extension';
import {ChromeDriverExtension} from './webdriver/chrome_driver_extension';
import {FirefoxDriverExtension} from './webdriver/firefox_driver_extension';
import {IOsDriverExtension} from './webdriver/ios_driver_extension';
/**
* The Runner is the main entry point for executing a sample run.
* It provides defaults, creates the injector and calls the sampler.
*/
export class Runner {
constructor(private _defaultProviders: Provider[] = []) {}
sample({id, execute, prepare, microMetrics, providers, userMetrics}: {
id: string,
execute?: Function,
prepare?: Function,
microMetrics?: {[key: string]: string},
providers?: Provider[],
userMetrics?: {[key: string]: string}
}): Promise<SampleState> {
var sampleProviders: Provider[] = [
_DEFAULT_PROVIDERS, this._defaultProviders, {provide: Options.SAMPLE_ID, useValue: id},
{provide: Options.EXECUTE, useValue: execute}
];
if (isPresent(prepare)) {
sampleProviders.push({provide: Options.PREPARE, useValue: prepare});
}
if (isPresent(microMetrics)) {
sampleProviders.push({provide: Options.MICRO_METRICS, useValue: microMetrics});
}
if (isPresent(userMetrics)) {
sampleProviders.push({provide: Options.USER_METRICS, useValue: userMetrics});
}
if (isPresent(providers)) {
sampleProviders.push(providers);
}
var inj = ReflectiveInjector.resolveAndCreate(sampleProviders);
var adapter: WebDriverAdapter = inj.get(WebDriverAdapter);
return Promise
.all([adapter.capabilities(), adapter.executeScript('return window.navigator.userAgent;')])
.then((args) => {
var capabilities = args[0];
var userAgent = args[1];
// This might still create instances twice. We are creating a new injector with all the
// providers.
// Only WebDriverAdapter is reused.
// TODO vsavkin consider changing it when toAsyncFactory is added back or when child
// injectors are handled better.
var injector = ReflectiveInjector.resolveAndCreate([
sampleProviders, {provide: Options.CAPABILITIES, useValue: capabilities},
{provide: Options.USER_AGENT, useValue: userAgent},
{provide: WebDriverAdapter, useValue: adapter}
]);
var sampler = injector.get(Sampler);
return sampler.sample();
});
}
}
var _DEFAULT_PROVIDERS = [
Options.DEFAULT_PROVIDERS,
Sampler.PROVIDERS,
ConsoleReporter.PROVIDERS,
RegressionSlopeValidator.PROVIDERS,
SizeValidator.PROVIDERS,
ChromeDriverExtension.PROVIDERS,
FirefoxDriverExtension.PROVIDERS,
IOsDriverExtension.PROVIDERS,
PerflogMetric.PROVIDERS,
UserMetric.PROVIDERS,
SampleDescription.PROVIDERS,
MultiReporter.provideWith([ConsoleReporter]),
MultiMetric.provideWith([PerflogMetric, UserMetric]),
{provide: Reporter, useExisting: MultiReporter},
{provide: Validator, useExisting: RegressionSlopeValidator},
WebDriverExtension.provideFirstSupported(
[ChromeDriverExtension, FirefoxDriverExtension, IOsDriverExtension]),
{provide: Metric, useExisting: MultiMetric},
];

View File

@ -0,0 +1,49 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {OpaqueToken} from '@angular/core';
import {Options} from './common_options';
import {Metric} from './metric';
import {Validator} from './validator';
/**
* SampleDescription merges all available descriptions about a sample
*/
export class SampleDescription {
static PROVIDERS = [{
provide: SampleDescription,
useFactory:
(metric: Metric, id: string, forceGc: boolean, userAgent: string, validator: Validator,
defaultDesc: {[key: string]: string}, userDesc: {[key: string]: string}) =>
new SampleDescription(
id,
[
{'forceGc': forceGc, 'userAgent': userAgent}, validator.describe(), defaultDesc,
userDesc
],
metric.describe()),
deps: [
Metric, Options.SAMPLE_ID, Options.FORCE_GC, Options.USER_AGENT, Validator,
Options.DEFAULT_DESCRIPTION, Options.SAMPLE_DESCRIPTION
]
}];
description: {[key: string]: any};
constructor(
public id: string, descriptions: Array<{[key: string]: any}>,
public metrics: {[key: string]: any}) {
this.description = {};
descriptions.forEach(description => {
Object.keys(description).forEach(prop => { this.description[prop] = description[prop]; });
});
}
toJson() { return {'id': this.id, 'description': this.description, 'metrics': this.metrics}; }
}

View File

@ -0,0 +1,81 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {Inject, Injectable} from '@angular/core';
import {Options} from './common_options';
import {isPresent} from './facade/lang';
import {MeasureValues} from './measure_values';
import {Metric} from './metric';
import {Reporter} from './reporter';
import {Validator} from './validator';
import {WebDriverAdapter} from './web_driver_adapter';
/**
* The Sampler owns the sample loop:
* 1. calls the prepare/execute callbacks,
* 2. gets data from the metric
* 3. asks the validator for a valid sample
* 4. reports the new data to the reporter
* 5. loop until there is a valid sample
*/
@Injectable()
export class Sampler {
static PROVIDERS = [Sampler];
constructor(
private _driver: WebDriverAdapter, private _metric: Metric, private _reporter: Reporter,
private _validator: Validator, @Inject(Options.PREPARE) private _prepare: Function,
@Inject(Options.EXECUTE) private _execute: Function,
@Inject(Options.NOW) private _now: Function) {}
sample(): Promise<SampleState> {
const loop = (lastState: SampleState): Promise<SampleState> => {
return this._iterate(lastState).then((newState) => {
if (isPresent(newState.validSample)) {
return newState;
} else {
return loop(newState);
}
});
};
return loop(new SampleState([], null));
}
private _iterate(lastState: SampleState): Promise<SampleState> {
var resultPromise: Promise<SampleState>;
if (this._prepare !== Options.NO_PREPARE) {
resultPromise = this._driver.waitFor(this._prepare);
} else {
resultPromise = Promise.resolve(null);
}
if (this._prepare !== Options.NO_PREPARE || lastState.completeSample.length === 0) {
resultPromise = resultPromise.then((_) => this._metric.beginMeasure());
}
return resultPromise.then((_) => this._driver.waitFor(this._execute))
.then((_) => this._metric.endMeasure(this._prepare === Options.NO_PREPARE))
.then((measureValues) => this._report(lastState, measureValues));
}
private _report(state: SampleState, metricValues: {[key: string]: any}): Promise<SampleState> {
var measureValues = new MeasureValues(state.completeSample.length, this._now(), metricValues);
var completeSample = state.completeSample.concat([measureValues]);
var validSample = this._validator.validate(completeSample);
var resultPromise = this._reporter.reportMeasureValues(measureValues);
if (isPresent(validSample)) {
resultPromise =
resultPromise.then((_) => this._reporter.reportSample(completeSample, validSample));
}
return resultPromise.then((_) => new SampleState(completeSample, validSample));
}
}
export class SampleState {
constructor(public completeSample: MeasureValues[], public validSample: MeasureValues[]) {}
}

View File

@ -0,0 +1,41 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export class Statistic {
static calculateCoefficientOfVariation(sample: number[], mean: number) {
return Statistic.calculateStandardDeviation(sample, mean) / mean * 100;
}
static calculateMean(samples: number[]) {
var total = 0;
// TODO: use reduce
samples.forEach(x => total += x);
return total / samples.length;
}
static calculateStandardDeviation(samples: number[], mean: number) {
var deviation = 0;
// TODO: use reduce
samples.forEach(x => deviation += Math.pow(x - mean, 2));
deviation = deviation / (samples.length);
deviation = Math.sqrt(deviation);
return deviation;
}
static calculateRegressionSlope(
xValues: number[], xMean: number, yValues: number[], yMean: number) {
// See http://en.wikipedia.org/wiki/Simple_linear_regression
var dividendSum = 0;
var divisorSum = 0;
for (var i = 0; i < xValues.length; i++) {
dividendSum += (xValues[i] - xMean) * (yValues[i] - yMean);
divisorSum += Math.pow(xValues[i] - xMean, 2);
}
return dividendSum / divisorSum;
}
}

View File

@ -0,0 +1,27 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {MeasureValues} from './measure_values';
/**
* A Validator calculates a valid sample out of the complete sample.
* A valid sample is a sample that represents the population that should be observed
* in the correct way.
*/
export abstract class Validator {
/**
* Calculates a valid sample out of the complete sample
*/
validate(completeSample: MeasureValues[]): MeasureValues[] { throw new Error('NYI'); }
/**
* Returns a Map that describes the properties of the validator
* (e.g. sample size, ...)
*/
describe(): {[key: string]: any} { throw new Error('NYI'); }
}

View File

@ -0,0 +1,60 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {Inject, Injectable, OpaqueToken} from '@angular/core';
import {ListWrapper} from '../facade/collection';
import {MeasureValues} from '../measure_values';
import {Statistic} from '../statistic';
import {Validator} from '../validator';
/**
* A validator that checks the regression slope of a specific metric.
* Waits for the regression slope to be >=0.
*/
@Injectable()
export class RegressionSlopeValidator extends Validator {
static SAMPLE_SIZE = new OpaqueToken('RegressionSlopeValidator.sampleSize');
static METRIC = new OpaqueToken('RegressionSlopeValidator.metric');
static PROVIDERS = [
RegressionSlopeValidator, {provide: RegressionSlopeValidator.SAMPLE_SIZE, useValue: 10},
{provide: RegressionSlopeValidator.METRIC, useValue: 'scriptTime'}
];
constructor(
@Inject(RegressionSlopeValidator.SAMPLE_SIZE) private _sampleSize: number,
@Inject(RegressionSlopeValidator.METRIC) private _metric: string) {
super();
}
describe(): {[key: string]: any} {
return {'sampleSize': this._sampleSize, 'regressionSlopeMetric': this._metric};
}
validate(completeSample: MeasureValues[]): MeasureValues[] {
if (completeSample.length >= this._sampleSize) {
var latestSample = ListWrapper.slice(
completeSample, completeSample.length - this._sampleSize, completeSample.length);
var xValues: number[] = [];
var yValues: number[] = [];
for (var i = 0; i < latestSample.length; i++) {
// For now, we only use the array index as x value.
// TODO(tbosch): think about whether we should use time here instead
xValues.push(i);
yValues.push(latestSample[i].values[this._metric]);
}
var regressionSlope = Statistic.calculateRegressionSlope(
xValues, Statistic.calculateMean(xValues), yValues, Statistic.calculateMean(yValues));
return regressionSlope >= 0 ? latestSample : null;
} else {
return null;
}
}
}

View File

@ -0,0 +1,37 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {Inject, Injectable, OpaqueToken} from '@angular/core';
import {ListWrapper} from '../facade/collection';
import {MeasureValues} from '../measure_values';
import {Validator} from '../validator';
/**
* A validator that waits for the sample to have a certain size.
*/
@Injectable()
export class SizeValidator extends Validator {
static SAMPLE_SIZE = new OpaqueToken('SizeValidator.sampleSize');
static PROVIDERS = [SizeValidator, {provide: SizeValidator.SAMPLE_SIZE, useValue: 10}];
constructor(@Inject(SizeValidator.SAMPLE_SIZE) private _sampleSize: number) { super(); }
describe(): {[key: string]: any} { return {'sampleSize': this._sampleSize}; }
validate(completeSample: MeasureValues[]): MeasureValues[] {
if (completeSample.length >= this._sampleSize) {
return ListWrapper.slice(
completeSample, completeSample.length - this._sampleSize, completeSample.length);
} else {
return null;
}
}
}

View File

@ -0,0 +1,22 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* A WebDriverAdapter bridges API differences between different WebDriver clients,
* e.g. JS vs Dart Async vs Dart Sync webdriver.
* Needs one implementation for every supported WebDriver client.
*/
export abstract class WebDriverAdapter {
waitFor(callback: Function): Promise<any> { throw new Error('NYI'); }
executeScript(script: string): Promise<any> { throw new Error('NYI'); }
executeAsyncScript(script: string): Promise<any> { throw new Error('NYI'); }
capabilities(): Promise<{[key: string]: any}> { throw new Error('NYI'); }
logs(type: string): Promise<any[]> { throw new Error('NYI'); }
}

View File

@ -0,0 +1,104 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {Injector, OpaqueToken} from '@angular/core';
import {Options} from './common_options';
export type PerfLogEvent = {
[key: string]: any
} & {
ph?: 'X' | 'B' | 'E' | 'I',
ts?: number,
dur?: number,
name?: string,
pid?: string,
args?: {
encodedDataLength?: number,
usedHeapSize?: number,
majorGc?: boolean,
url?: string,
method?: string
}
};
/**
* A WebDriverExtension implements extended commands of the webdriver protocol
* for a given browser, independent of the WebDriverAdapter.
* Needs one implementation for every supported Browser.
*/
export abstract class WebDriverExtension {
static provideFirstSupported(childTokens: any[]): any[] {
var res = [
{
provide: _CHILDREN,
useFactory: (injector: Injector) => childTokens.map(token => injector.get(token)),
deps: [Injector]
},
{
provide: WebDriverExtension,
useFactory: (children: WebDriverExtension[], capabilities: {[key: string]: any}) => {
var delegate: WebDriverExtension;
children.forEach(extension => {
if (extension.supports(capabilities)) {
delegate = extension;
}
});
if (!delegate) {
throw new Error('Could not find a delegate for given capabilities!');
}
return delegate;
},
deps: [_CHILDREN, Options.CAPABILITIES]
}
];
return res;
}
gc(): Promise<any> { throw new Error('NYI'); }
timeBegin(name: string): Promise<any> { throw new Error('NYI'); }
timeEnd(name: string, restartName: string): Promise<any> { throw new Error('NYI'); }
/**
* Format:
* - cat: category of the event
* - name: event name: 'script', 'gc', 'render', ...
* - ph: phase: 'B' (begin), 'E' (end), 'X' (Complete event), 'I' (Instant event)
* - ts: timestamp in ms, e.g. 12345
* - pid: process id
* - args: arguments, e.g. {heapSize: 1234}
*
* Based on [Chrome Trace Event
*Format](https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/edit)
**/
readPerfLog(): Promise<PerfLogEvent[]> { throw new Error('NYI'); }
perfLogFeatures(): PerfLogFeatures { throw new Error('NYI'); }
supports(capabilities: {[key: string]: any}): boolean { return true; }
}
export class PerfLogFeatures {
render: boolean;
gc: boolean;
frameCapture: boolean;
userTiming: boolean;
constructor(
{render = false, gc = false, frameCapture = false, userTiming = false}:
{render?: boolean, gc?: boolean, frameCapture?: boolean, userTiming?: boolean} = {}) {
this.render = render;
this.gc = gc;
this.frameCapture = frameCapture;
this.userTiming = userTiming;
}
}
var _CHILDREN = new OpaqueToken('WebDriverExtension.children');

View File

@ -0,0 +1,208 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {Inject, Injectable} from '@angular/core';
import {Options} from '../common_options';
import {WebDriverAdapter} from '../web_driver_adapter';
import {PerfLogEvent, PerfLogFeatures, WebDriverExtension} from '../web_driver_extension';
/**
* Set the following 'traceCategories' to collect metrics in Chrome:
* 'v8,blink.console,disabled-by-default-devtools.timeline,devtools.timeline,blink.user_timing'
*
* In order to collect the frame rate related metrics, add 'benchmark'
* to the list above.
*/
@Injectable()
export class ChromeDriverExtension extends WebDriverExtension {
static PROVIDERS = [ChromeDriverExtension];
private _majorChromeVersion: number;
constructor(private _driver: WebDriverAdapter, @Inject(Options.USER_AGENT) userAgent: string) {
super();
this._majorChromeVersion = this._parseChromeVersion(userAgent);
}
private _parseChromeVersion(userAgent: string): number {
if (!userAgent) {
return -1;
}
var v = userAgent.split(/Chrom(e|ium)\//g)[2];
if (!v) {
return -1;
}
v = v.split('.')[0];
if (!v) {
return -1;
}
return parseInt(v, 10);
}
gc() { return this._driver.executeScript('window.gc()'); }
timeBegin(name: string): Promise<any> {
return this._driver.executeScript(`console.time('${name}');`);
}
timeEnd(name: string, restartName: string = null): Promise<any> {
var script = `console.timeEnd('${name}');`;
if (restartName) {
script += `console.time('${restartName}');`;
}
return this._driver.executeScript(script);
}
// See [Chrome Trace Event
// Format](https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/edit)
readPerfLog(): Promise<PerfLogEvent[]> {
// TODO(tbosch): Chromedriver bug https://code.google.com/p/chromedriver/issues/detail?id=1098
// Need to execute at least one command so that the browser logs can be read out!
return this._driver.executeScript('1+1')
.then((_) => this._driver.logs('performance'))
.then((entries) => {
var events: PerfLogEvent[] = [];
entries.forEach(entry => {
var message = JSON.parse(entry['message'])['message'];
if (message['method'] === 'Tracing.dataCollected') {
events.push(message['params']);
}
if (message['method'] === 'Tracing.bufferUsage') {
throw new Error('The DevTools trace buffer filled during the test!');
}
});
return this._convertPerfRecordsToEvents(events);
});
}
private _convertPerfRecordsToEvents(
chromeEvents: Array<{[key: string]: any}>, normalizedEvents: PerfLogEvent[] = null) {
if (!normalizedEvents) {
normalizedEvents = [];
}
chromeEvents.forEach((event) => {
const categories = this._parseCategories(event['cat']);
const normalizedEvent = this._convertEvent(event, categories);
if (normalizedEvent != null) normalizedEvents.push(normalizedEvent);
});
return normalizedEvents;
}
private _convertEvent(event: {[key: string]: any}, categories: string[]) {
var name = event['name'];
var args = event['args'];
if (this._isEvent(categories, name, ['blink.console'])) {
return normalizeEvent(event, {'name': name});
} else if (this._isEvent(
categories, name, ['benchmark'],
'BenchmarkInstrumentation::ImplThreadRenderingStats')) {
// TODO(goderbauer): Instead of BenchmarkInstrumentation::ImplThreadRenderingStats the
// following events should be used (if available) for more accurate measurments:
// 1st choice: vsync_before - ground truth on Android
// 2nd choice: BenchmarkInstrumentation::DisplayRenderingStats - available on systems with
// new surfaces framework (not broadly enabled yet)
// 3rd choice: BenchmarkInstrumentation::ImplThreadRenderingStats - fallback event that is
// always available if something is rendered
var frameCount = event['args']['data']['frame_count'];
if (frameCount > 1) {
throw new Error('multi-frame render stats not supported');
}
if (frameCount == 1) {
return normalizeEvent(event, {'name': 'frame'});
}
} else if (
this._isEvent(categories, name, ['disabled-by-default-devtools.timeline'], 'Rasterize') ||
this._isEvent(
categories, name, ['disabled-by-default-devtools.timeline'], 'CompositeLayers')) {
return normalizeEvent(event, {'name': 'render'});
} else if (this._isEvent(categories, name, ['devtools.timeline', 'v8'], 'MajorGC')) {
var normArgs = {
'majorGc': true,
'usedHeapSize': args['usedHeapSizeAfter'] !== undefined ? args['usedHeapSizeAfter'] :
args['usedHeapSizeBefore']
};
return normalizeEvent(event, {'name': 'gc', 'args': normArgs});
} else if (this._isEvent(categories, name, ['devtools.timeline', 'v8'], 'MinorGC')) {
var normArgs = {
'majorGc': false,
'usedHeapSize': args['usedHeapSizeAfter'] !== undefined ? args['usedHeapSizeAfter'] :
args['usedHeapSizeBefore']
};
return normalizeEvent(event, {'name': 'gc', 'args': normArgs});
} else if (
this._isEvent(categories, name, ['devtools.timeline'], 'FunctionCall') &&
(!args || !args['data'] ||
(args['data']['scriptName'] !== 'InjectedScript' && args['data']['scriptName'] !== ''))) {
return normalizeEvent(event, {'name': 'script'});
} else if (this._isEvent(categories, name, ['devtools.timeline'], 'EvaluateScript')) {
return normalizeEvent(event, {'name': 'script'});
} else if (this._isEvent(
categories, name, ['devtools.timeline', 'blink'], 'UpdateLayoutTree')) {
return normalizeEvent(event, {'name': 'render'});
} else if (
this._isEvent(categories, name, ['devtools.timeline'], 'UpdateLayerTree') ||
this._isEvent(categories, name, ['devtools.timeline'], 'Layout') ||
this._isEvent(categories, name, ['devtools.timeline'], 'Paint')) {
return normalizeEvent(event, {'name': 'render'});
} else if (this._isEvent(categories, name, ['devtools.timeline'], 'ResourceReceivedData')) {
let normArgs = {'encodedDataLength': args['data']['encodedDataLength']};
return normalizeEvent(event, {'name': 'receivedData', 'args': normArgs});
} else if (this._isEvent(categories, name, ['devtools.timeline'], 'ResourceSendRequest')) {
let data = args['data'];
let normArgs = {'url': data['url'], 'method': data['requestMethod']};
return normalizeEvent(event, {'name': 'sendRequest', 'args': normArgs});
} else if (this._isEvent(categories, name, ['blink.user_timing'], 'navigationStart')) {
return normalizeEvent(event, {'name': 'navigationStart'});
}
return null; // nothing useful in this event
}
private _parseCategories(categories: string): string[] { return categories.split(','); }
private _isEvent(
eventCategories: string[], eventName: string, expectedCategories: string[],
expectedName: string = null): boolean {
var hasCategories = expectedCategories.reduce(
(value, cat) => value && eventCategories.indexOf(cat) !== -1, true);
return !expectedName ? hasCategories : hasCategories && eventName === expectedName;
}
perfLogFeatures(): PerfLogFeatures {
return new PerfLogFeatures({render: true, gc: true, frameCapture: true, userTiming: true});
}
supports(capabilities: {[key: string]: any}): boolean {
return this._majorChromeVersion >= 44 && capabilities['browserName'].toLowerCase() === 'chrome';
}
}
function normalizeEvent(chromeEvent: {[key: string]: any}, data: PerfLogEvent): PerfLogEvent {
var ph = chromeEvent['ph'].toUpperCase();
if (ph === 'S') {
ph = 'B';
} else if (ph === 'F') {
ph = 'E';
} else if (ph === 'R') {
// mark events from navigation timing
ph = 'I';
}
var result: {[key: string]: any} =
{'pid': chromeEvent['pid'], 'ph': ph, 'cat': 'timeline', 'ts': chromeEvent['ts'] / 1000};
if (ph === 'X') {
var dur = chromeEvent['dur'];
if (dur === undefined) {
dur = chromeEvent['tdur'];
}
result['dur'] = !dur ? 0.0 : dur / 1000;
}
for (let prop in data) {
result[prop] = data[prop];
}
return result;
}

View File

@ -0,0 +1,53 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {Injectable} from '@angular/core';
import {isPresent} from '../facade/lang';
import {WebDriverAdapter} from '../web_driver_adapter';
import {PerfLogEvent, PerfLogFeatures, WebDriverExtension} from '../web_driver_extension';
@Injectable()
export class FirefoxDriverExtension extends WebDriverExtension {
static PROVIDERS = [FirefoxDriverExtension];
private _profilerStarted: boolean;
constructor(private _driver: WebDriverAdapter) {
super();
this._profilerStarted = false;
}
gc() { return this._driver.executeScript('window.forceGC()'); }
timeBegin(name: string): Promise<any> {
if (!this._profilerStarted) {
this._profilerStarted = true;
this._driver.executeScript('window.startProfiler();');
}
return this._driver.executeScript('window.markStart("' + name + '");');
}
timeEnd(name: string, restartName: string = null): Promise<any> {
var script = 'window.markEnd("' + name + '");';
if (isPresent(restartName)) {
script += 'window.markStart("' + restartName + '");';
}
return this._driver.executeScript(script);
}
readPerfLog(): Promise<PerfLogEvent> {
return this._driver.executeAsyncScript('var cb = arguments[0]; window.getProfile(cb);');
}
perfLogFeatures(): PerfLogFeatures { return new PerfLogFeatures({render: true, gc: true}); }
supports(capabilities: {[key: string]: any}): boolean {
return capabilities['browserName'].toLowerCase() === 'firefox';
}
}

Some files were not shown because too many files have changed in this diff Show More