Compare commits

...

2140 Commits

Author SHA1 Message Date
f77234e6bd chore(package): bump version to alpha 38 2015-10-02 17:29:59 -07:00
c7f5762d89 chore(changelog): update changelog to alpha 38 2015-10-02 17:29:32 -07: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
50f8892c6b chore(release): bump version
Somehow the version bump from alpha.16 was not submitted to master…
2015-03-27 16:21:41 -07:00
3bfbfa8ae0 chore(release): bump version 2015-03-27 16:18:36 -07:00
8598c87ef4 docs(bench press): add initial docs 2015-03-27 16:16:35 -07:00
33bfc4c24a feat(bench press): replace microIterations with microMetrics 2015-03-27 16:16:35 -07:00
3afb744e77 chore(ci): reorganize e2e/perf test running
Now, running protractor configs by default only runs e2e tests. If
the --benchmark flag is added, it runs only the perf tests, and always
restarts the browser in between tests. If the --dryrun test is added,
the perf tests are run only once.

This should make it easier to run perf tests versus example e2e tests,
and help stabilize the travis build because perf tests always
run with a clean browser.
2015-03-27 13:29:21 -07:00
e92918bbfe feat(change_detector): split light dom and shadow dom children 2015-03-27 13:26:37 -07:00
723e8fde93 feat(change_detection): added a directive lifecycle hook that is called after children are checked 2015-03-27 13:26:36 -07:00
507f7ea70a chore(package.json): upgrade zone.js to v0.4.2
Closes #1142
2015-03-27 16:24:07 -04:00
6b985d56a5 cleanup(forms): added missing type annotations
Closes #1054
2015-03-27 11:30:39 -07:00
c8385ad998 refactor(cd): remove dead code 2015-03-27 16:59:23 +01:00
9d21a6f40d chore(package.json): upgrade traceur to v0.0.87
Fix in source-map test to follow through the sourcemap chain.
2015-03-26 18:37:03 -07:00
d304f41197 docs(core): improved docs on directive lifecycle 2015-03-26 18:18:25 -07:00
8d85b839b6 feat(change_detection): pass binding propagation config to pipe registry 2015-03-26 16:57:04 -07:00
dd235f38a3 fix(build): try to eliminate build flakes by running dartstyle:format sequentially 2015-03-26 16:23:09 -07:00
5306b6dd0c fix(change_detection): expose values when detecting changes in key-value pairs
Fixes #1118

Closes #1123
2015-03-26 21:18:14 +01:00
b09624024b example(forms): added a example of using forms 2015-03-26 11:36:14 -07:00
edc3709451 fix(ElementBinderBuilder): properly bind CSS classes with "-" in their names
Fixes #1057

Closes #1059
2015-03-26 19:25:31 +01:00
e706f3477b Remove invalid super() call
Unless I'm missing something?
2015-03-26 11:10:39 -07:00
6298cb3999 chore(ci): upgrade to new version of protractor and selenium-webdriver
Protractor 2.0.0
selenium-webdriver 2.45.1
2015-03-26 10:00:46 -07:00
878fce6482 fix(ts): ts doesn't like ";;" 2015-03-26 17:32:48 +01:00
b02bd65871 feat(forms): made forms works with single controls 2015-03-26 07:48:17 -07:00
ee36aaf163 fix(tests): fixed a broken test 2015-03-26 07:46:26 -07:00
ff84506bd5 feat(forms): added support for arrays of controls 2015-03-26 07:43:25 -07:00
0ae33b7e3c refactor(compiler): factorize common util code dash <-> camel
Closes #1114
Fixes #1097
2015-03-26 15:22:35 +01:00
b1dc6239ef feat(core): @Attribute annotation
Closes #1091
Fixes #622
2015-03-26 10:51:44 +01:00
3ce0f1146f chore(dgeni): set log level to 'warning' 2015-03-26 09:31:36 +01:00
3ec837bfdb test(di): Add a test for sync binding + resolved async dependency 2015-03-26 08:38:29 +01:00
18ff2be9bb feat(ts2dart): include srcFolderInsertion in ts2dart step. 2015-03-25 21:31:40 -07:00
c0d296334c feature(ts2dart): ts2dart runs on all .js files.
Update the experimental ts2dart task to also read the .es6 files, which are the next step.
2015-03-25 17:14:06 -07:00
9a0a2e319c chore(ts2dart) remove extra semi
This breaks our ts2dart transpilation.
2015-03-25 17:06:47 -07:00
a0d86ac2bb chore(ts2dart): ts2dart doesn't support mixed typed/untyped var decl lists. 2015-03-25 16:41:33 -07:00
99045b2f6a refactor: update Dart package dependencies 2015-03-25 15:54:12 -07:00
c34ca36778 chore: build the stable branch of Dart
Now that Dart 1.9 is stable
2015-03-25 21:17:07 +01:00
58dd75a1c8 feat(compiler): Add support for setting attributes to Component host element
Fixes #1008
Fixes #1009
Closes #1052
2015-03-25 17:32:07 +01:00
f995b07876 docs: annotations edits 2015-03-24 23:28:24 +00:00
101a4aa3cf feat(PrivateComponentLoader): Explicit error message when loading a non-component
fixes #1062
2015-03-24 22:11:41 +01:00
65d759316b fix(PrivateComponentLoader): add the loader to the app injector
fixes #1063
2015-03-24 22:10:26 +01:00
19c1773133 feat(forms): added an observable of value changes to Control 2015-03-24 13:45:47 -07:00
9b3b3d325f feat(facade): added support for observables 2015-03-24 13:45:39 -07:00
43f4374944 feature(build): Include ts2dart transpile step in the Angular build.
This only transpiles one package to start with: di/
It ensures that package transpiles without errors, so no one can
introduce non-TypeScript syntax.
Next step is to widen the task inputs to cover additional packages.

See design doc for the migration:
https://docs.google.com/document/d/14RJLhu6uuv7NchFkAb6PKzOOO0L7l3Z507eKWzkEUhQ/edit

A convenience task 'ts2dart' is added for developing ts2dart, and
it runs all of the angular code through the transpiler to collect errors.
2015-03-24 10:34:46 -07:00
81e6d13241 chore: bump up the version to 2.0.0-alpha.15 2015-03-24 07:50:39 -07:00
f8e7a37c0d fix(view): fixed view instantiation to use the component template's change detector when creating BindingPropagationConfig 2015-03-24 07:49:28 -07:00
c686e7ea30 chore(doc-gen): ignore non-jsdoc style comments
Now the visitor will find the last jsdoc style comment (e.g. `/** jsdoc comment */`)
before the current code item, ignoring any inline style comments (e.g. `// inline comment`)
in between.

Closes #1072
2015-03-24 11:25:58 +00:00
7e89af8190 chore(doc-gen): move @publicModule tag-def to base package
This prevents unwanted "unknown tag" warnings when generating the non-public docs.
2015-03-24 10:57:42 +00:00
539e8e2cce chore(doc-gen): add specific template for displaying variable exports
Closes #1071
2015-03-24 10:57:42 +00:00
aab084866c doc(test): add a comment on why tests are disabled 2015-03-24 09:52:41 +01:00
0e61a86763 docs: annotations 2015-03-24 00:42:58 +00:00
1c9938ed98 chore(packaging): bump version to alpha.14 2015-03-23 17:14:55 -07:00
47c1a0f381 feat(forms): added value accessor for input=text 2015-03-23 08:53:27 -07:00
514529b5d9 refactor(formed): changed forms to use event and property setters instead of NgElement 2015-03-23 08:52:54 -07:00
a12dc7d75a refactor(forms): wrapped all validators into the Validator class 2015-03-23 08:50:56 -07:00
41b53e71e1 feat(selector): support , for multiple targets
Fixes #867
Closes #1019
2015-03-23 10:06:33 +01:00
0fb9f3bd6c fix(ElementBinderBuilder): properly bind to web component properties
Fixes #776

Closes #1024
2015-03-22 14:14:36 +01:00
81f3f32217 refactor(DirectiveParser): remove checks for missing directives
Based on the discussion in #776 we can't reliably check if a given
element has a particular property at the compilation time. As such
the existing algorithm detecting "missing" directives can't be used.

We need to see if there is a different / better algorithm or maybe
those checks need to be moved later in the process (runtime). Leaving
integration tests in place (disabled) so we can come back to the
topic after unblocking the situation.

This commit effectivelly reverts 94e203b9df
2015-03-22 14:14:36 +01:00
b35f288794 refactor(dart/transform): Use package:guinness in tests
`guinness` is a Dart port of Jasmine. Since the rest of Angular 2 uses
Jasmine, use it for the transformer too.

Closes #8

Closes #1037

Closes #1000
2015-03-21 15:18:15 -07:00
4e82cc0861 refactor(dart/transform): Test directive_linker as a unit
Formerly, it was tested only as a piece of the transformer pipeline. Add
its own directory and test the linker on its own.
2015-03-21 15:18:15 -07:00
c735644c57 refactor(dart/transform): Minor logging changes
Enable easier testing by providing a null log implementation and a way
to use it.
2015-03-21 15:18:15 -07:00
5d479fa0ae refactor(dart/transform): Remove ngData
Now that we have `Parser`, `ngData` is redundant & unnecessary.
2015-03-21 15:18:15 -07:00
8baedca972 style(dart/transform): Remove src from library directives
Conform to Angular 2 style by removing `src` from library directives.
Completed with:
```
find -name "*.dart" | xargs sed -i -e 's!library\(.*\)src\.\(.*\)!library \1\2!'
```

Closes #1005

Closes #1038
2015-03-21 14:55:11 -07:00
02aa8e7945 feat(compiler): support bindings for any attribute
Closes #1029
2015-03-21 14:55:11 -07:00
ee523efcb4 feat(ShadowCss): Support the new deep combinator syntax >>>
fixes #990

ref http://dev.w3.org/csswg/css-scoping-1/#deep-combinator

Closes #1028
2015-03-21 14:55:11 -07:00
eef5f7e06d README - don't forget to build app before start
Don't forget to build app before start HTTP server

Closes #1014
2015-03-21 14:55:11 -07:00
83402930f2 chore(install+test): single cmd to full install/test & test JS w/o Dart
* `npm install` now does a full install; auxiliary installation steps
have been integrated into the `postinstall` script.
* Updated developer docs `DEVELOPER.md` accordingly; also added
instructions to dev docs for performing full tests (via `npm test`) --
same as those run on Travis.
* Reorg in tests so that JS tests can run without a Dart env.

Partly fixes #945 **under the assumption that when running JS tests
locally, `ChromeCanary` is the desired browser to use**. Note that CI
tests (Travis) still uses `DartiumWithWebPlatform` across the board
(Maybe because ChromeCanary isn't being installed?)

Fixes #1012.

Closes #1010
2015-03-21 14:55:11 -07:00
bd48c927d0 fix(ViewContainer) removeChild called with null parent
In view_container.js, templateElement.parentNode can be null
when two template tags are nested in one another.
Accessing the parent node through view.nodes[0].parentNode fixes
the problem.

closes #997

Closes #999
2015-03-21 14:55:10 -07:00
b61b8d60b7 refactor(forEach): change to for-of with iterable
rename: foreach -> for
rename: array -> iterable
update: DartParseTreeWriter
update: naive_infinite_scroll
update: todo
fix: tests in foreach_spec

Closes #919
2015-03-21 14:19:21 -07:00
f1fca5abb6 (docs) decorator events property
As from what i understand shouldn't the event property rather be events: https://github.com/angular/angular/blob/master/modules/angular2/src/core/annotations/annotations.js#L161

Closes #1018
2015-03-21 18:26:13 +00:00
045ce3c77a Fix which dependency is injected w/ current elem.
Docs for the "Injecting a directive from the current element" indicate that having a dependency of `dependency: Dependency` should cause the current element's dependency to be injected, but then uses the ID value from the parent element in the example.

Closes #1032
2015-03-21 18:14:43 +00:00
f822066e2a docs: annotations 2015-03-21 18:05:12 +00:00
1821 changed files with 153266 additions and 43178 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

23
.gitignore vendored
View File

@ -1,11 +1,18 @@
.DS_STORE
# Dont commit the following directories created by pub.
packages
pubspec.lock
.pub
.packages
/dist/
packages/
.buildlog
node_modules
bower_components
.pub
.DS_STORE
# Or broccoli working directory
tmp
# Or the files created by dart2js.
*.dart.js
@ -14,13 +21,23 @@ bower_components
*.js.deps
*.js.map
# Or type definitions we mirror from github
**/typings/**/*.d.ts
**/typings/tsd.cached.json
# Include when developing application packages.
pubspec.lock
.c9
.idea/
*.swo
modules/.settings
.vscode
modules/.vscode
# Don't check in secret files
*secret.js
# Ignore npm debug log
npm-debug.log
/docs/bower_components/

1
.nvmrc Normal file
View File

@ -0,0 +1 @@
0.12

12
.settings/settings.json Normal file
View File

@ -0,0 +1,12 @@
{
"search.exclude": {
".git" : true,
".idea": true,
"node_modules" : true,
"bower_components" : true,
"packages" : true,
"build" : true,
"dist" : true,
"tmp" : true
}
}

View File

@ -1,38 +1,128 @@
language: node_js
sudo: false
node_js:
- '0.10'
- '0.12'
branches:
except:
- g3sync
cache:
directories:
- node_modules
- $HOME/.pub-cache
env:
global:
- KARMA_BROWSERS=DartiumWithWebPlatform
- E2E_BROWSERS=Dartium
- LOGS_DIR=/tmp/angular-build/logs
- SAUCE_USERNAME=angular-ci
- SAUCE_ACCESS_KEY=9b988f434ff8-fbca-8aa4-4ae3-35442987
- ARCH=linux-x64
# TODO: change DART_DEV_VERSION to "latest" again once
# https://github.com/angular/angular/issues/4467 is solved
- DART_DEV_VERSION=1.13.0-dev.3.1
- DART_STABLE_VERSION=latest
# Token for tsd to increase github rate limit
# See https://github.com/DefinitelyTyped/tsd#tsdrc
# This does not use http://docs.travis-ci.com/user/environment-variables/#Secure-Variables
# because those are not visible for pull requests, and those should also be reliable.
# This SSO token belongs to github account angular-github-ratelimit-token which has no access
# (password is in Valentine)
- TSDRC='{"token":"ef474500309daea53d5991b3079159a29520a40b"}'
# GITHUB_TOKEN_ANGULAR
- secure: "fq/U7VDMWO8O8SnAQkdbkoSe2X92PVqg4d044HmRYVmcf6YbO48+xeGJ8yOk0pCBwl3ISO4Q2ot0x546kxfiYBuHkZetlngZxZCtQiFT9kyId8ZKcYdXaIW9OVdw3Gh3tQyUwDucfkVhqcs52D6NZjyE2aWZ4/d1V4kWRO/LMgo="
matrix:
- MODE=js DART_CHANNEL=dev
# Dissabled until Dart v1.9 hits stable
# - MODE=dart DART_CHANNEL=stable
- MODE=dart DART_CHANNEL=dev
# Order: slowest build on top, so that we don't hog VMs while waiting for others to complete.
- MODE=dart DART_CHANNEL=stable DART_VERSION=$DART_STABLE_VERSION
- MODE=dart DART_CHANNEL=dev DART_VERSION=$DART_DEV_VERSION
- MODE=saucelabs DART_CHANNEL=dev DART_VERSION=$DART_DEV_VERSION
- MODE=dart_experimental DART_CHANNEL=dev DART_VERSION=$DART_DEV_VERSION
- MODE=js DART_CHANNEL=dev DART_VERSION=$DART_DEV_VERSION
- MODE=router DART_CHANNEL=dev DART_VERSION=$DART_DEV_VERSION
- MODE=lint DART_CHANNEL=dev DART_VERSION=$DART_DEV_VERSION
matrix:
allow_failures:
- env: "MODE=saucelabs DART_CHANNEL=dev DART_VERSION=$DART_DEV_VERSION"
- env: "MODE=dart_experimental DART_CHANNEL=dev DART_VERSION=$DART_DEV_VERSION"
addons:
firefox: "38.0"
before_install:
- echo ${TSDRC} > .tsdrc
- export DISPLAY=:99.0
- export GIT_SHA=$(git rev-parse HEAD)
- ./scripts/ci/init_android.sh
- ./scripts/ci/install_dart.sh ${DART_CHANNEL} ${ARCH}
- ./scripts/ci/install_dart.sh ${DART_CHANNEL} ${DART_VERSION} ${ARCH}
- sh -e /etc/init.d/xvfb start
- if [[ -e SKIP_TRAVIS_TESTS ]]; then { cat SKIP_TRAVIS_TESTS ; exit 0; } fi
- '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${TRAVIS_BRANCH}" = "master" ] && SAUCE_USERNAME="angular2-ci" && SAUCE_ACCESS_KEY="693ebc16208a-0b5b-1614-8d66-a2662f4e" || true'
install:
# Update npm
- npm install -g npm@2.9.1
- npm --version
# Check the size of caches
- du -sh ./node_modules || true
# Install npm dependecies
- npm install
before_script:
- mkdir -p $LOGS_DIR
- ./scripts/ci/presubmit-queue-setup.sh
script:
- ./scripts/ci/build_and_test.sh ${MODE}
after_script:
- ./scripts/ci/print-logs.sh
- ./scripts/ci/after-script.sh
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/1ef62e23078036f9cee4
on_success: change # options: [always|never|change] default: always
# trigger Buildtime Trend Service to parse Travis CI log
- https://buildtimetrend.herokuapp.com/travis
on_success: always # 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=
deploy:
- provider: gcs
# This is for project angular-github-babysitter
access_key_id: GOOGIOQTDBEOPBUAWFZQ
secret_access_key:
secure: "MEDggllZ5fw4wI9CEUi8WR6jKsKXqdRF/DLxSNC2JpzM5RlVeBm0uqjntYT1Cf1dASvQ2/+vZCUikL/3A48NcoEYRHXGmxu8D6t/SvleQD8Xv434xFOdsa2QqP/HiCtqCLOI5jJz1JVoB5nNyKKZ33ogTUL1LV1TfcrAioyizW8="
# this bucket has a lifecycle to delete after 90 days:
# $ echo '{"rule": [{"action": {"type": "Delete"}, "condition": {"age": 90}}]}' > lifecycle.json
# $ gsutil lifecycle set lifecycle.json gs://angular2-snapshots
bucket: angular2-snapshots
# don't delete generated files
skip_cleanup: true
# serve to public at https://storage.googleapis.com/angular2-snapshots/SHA/dart_stable/dist.tgz
acl: public-read
# upload the .tgz archive created in scripts/ci/build_and_test.sh
local-dir: deploy
# create a "subdirectory" for each commit
upload-dir: $TRAVIS_COMMIT/dart_stable
on:
repo: angular/angular
condition: "$MODE = dart && $DART_CHANNEL = stable"
- provider: gcs
access_key_id: GOOGIOQTDBEOPBUAWFZQ
secret_access_key:
secure: "MEDggllZ5fw4wI9CEUi8WR6jKsKXqdRF/DLxSNC2JpzM5RlVeBm0uqjntYT1Cf1dASvQ2/+vZCUikL/3A48NcoEYRHXGmxu8D6t/SvleQD8Xv434xFOdsa2QqP/HiCtqCLOI5jJz1JVoB5nNyKKZ33ogTUL1LV1TfcrAioyizW8="
bucket: angular2-snapshots
skip_cleanup: true
acl: public-read
local-dir: deploy
upload-dir: $TRAVIS_COMMIT/js
on:
repo: angular/angular
condition: "$MODE = js"

1175
CHANGELOG.md Normal file

File diff suppressed because it is too large Load Diff

31
COMMITTER.md Normal file
View File

@ -0,0 +1,31 @@
# 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 is ready to merge, a project member in the CoreTeamMember list (see below) can add the special label,
`PR: merge`.
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 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

@ -18,7 +18,7 @@ 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].
discussion list or [StackOverflow][stackoverflow]. Please note that Angular 2 is still in early developer preview, and the core team's capacity to answer usage questions is limited. We are also available on [Gitter][gitter].
## <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
@ -27,27 +27,16 @@ If you find a bug in the source code or a mistake in the documentation, you can
## <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:
Repository][github]. 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. Angular 2 is in developer preview
and we are not ready to accept major contributions ahead of the full release.
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
@ -60,7 +49,6 @@ chances of your issue being dealt with quickly:
* **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.
@ -71,7 +59,7 @@ chances of your issue being dealt with quickly:
### <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.
@ -147,9 +135,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 +157,14 @@ 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.
### 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 +173,14 @@ 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
### 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 +198,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].

View File

@ -3,56 +3,63 @@
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`.
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)
* [Environment Variable Setup](#environment-variable-setup)
* [Installing NPM Modules and Dart Packages](#installing-npm-modules-and-dart-packages)
* [Running Tests Locally](#running-tests-locally)
* [Formatting](#clang-format)
* [Project Information](#project-information)
* [CI using Travis](#ci-using-travis)
* [Transforming Dart code](#transforming-dart-code)
* [Debugging](#debugging)
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
* [Dart](https://www.dartlang.org) (version ` >=1.12.0 <2.0.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).
download [page for instructions](https://www.dartlang.org/tools/download.html).
You can also download both **stable** and **dev** channel versions from the [download
archive](https://www.dartlang.org/tools/download-archive). In that case, on Windows, Dart must be added
to the `Path` (e.g. `path-to-dart-sdk-folder\bin`) and a new `DARTIUM_BIN` environment variable must be
created, pointing to the executable (e.g. `path-to-dartium-folder\chrome.exe).`
* [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.
* [Node.js](http://nodejs.org), (version `>=0.12.0 <0.13.0`) which is used to run a development web server,
run tests, and generate distributable files. We also use Node's Package Manager, `npm`
(version `>=2.0 <3.0`), which comes with Node. 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).
* [Bower](http://bower.io/).
## 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:
@ -90,32 +97,31 @@ 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 and Dart packages needed to build and test Angular:
```shell
# Install Angular project dependencies (package.json)
npm install
# Ensure protractor has the latest webdriver
$(npm bin)/webdriver-manager update
# Install Dart packages
pub get
```
**Optional**: In this document, we make use of project local `npm` package scripts and binaries
(stored under `./node_modules/.bin`) by prefixing these command invocations with `$(npm bin)`; in
particular `gulp` and `protractor` commands. If you prefer, you can drop this path prefix by
globally installing these two packages as follows:
particular `gulp` and `protractor` commands. If you prefer, you can drop this path prefix by either:
*Option 1*: globally installing these two packages as follows:
* `npm install -g gulp` (you might need to prefix this command with `sudo`)
* `npm install -g protractor` (you might need to prefix this command with `sudo`)
Since global installs can become stale, we avoid their use in these instructions.
Since global installs can become stale, and required versions can vary by project, we avoid their
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
To build Angular and prepare tests, run:
```shell
$(npm bin)/gulp build
@ -124,42 +130,69 @@ $(npm bin)/gulp build
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`
every file that matches `<module>/src/<module>.dart`, e.g. `di/src/di.dart`.
You can selectively build either the JS or Dart versions as follows:
* `$(npm bin)/gulp build.js`
* `$(npm bin)/gulp build.dart`
Also note that in order for the whole test suite to succeed you will need to generate the type definitions by running:
```shell
$(npm bin)/gulp docs/typings
```
To clean out the `dist` folder, run:
To clean out the `dist` folder use:
```shell
$(npm bin)/gulp clean
```
## Running Tests Locally
### Basic tests
### Full test suite
1. `$(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).
2. `$(npm bin)/gulp test.unit.cjs`: JS tests in NodeJS; runs in **watch mode**
3. `$(npm bin)/gulp test.unit.dart`: Dart tests in Dartium; runs in **watch mode**.
* `npm test`: full test suite for both JS and Dart versions of Angular. These are the same tests
that run on Travis.
If you prefer running tests in "single-run" mode rather than watch mode use
You can selectively run either the JS or Dart versions as follows:
* `$(npm bin)/gulp test.all.js`
* `$(npm bin)/gulp test.all.dart`
### Unit tests
You can run just the unit tests as follows:
* `$(npm bin)/gulp test.unit.js`: JS tests in a browser; runs in **watch mode** (i.e.
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**.
If you prefer running tests in "single-run" mode rather than watch mode use:
* `$(npm bin)/gulp test.unit.js/ci`
* `$(npm bin)/gulp test.unit.cjs/ci`
* `$(npm bin)/gulp test.unit.dart/ci`
**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.
The task updates the dist folder with transpiled code whenever a source or test file changes, and
Karma is run against the new output.
**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**: 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.
### E2e tests
**Note**: **watch mode** needs symlinks to work, so if you're using windows, ensure you have the
rights to built them in your operating system.
### E2E tests
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).
2. `$(npm bin)/gulp serve.js.prod serve.dart` (runs a local webserver).
3. `$(npm bin)/protractor protractor-js.conf.js`: JS e2e tests.
4. `$(npm bin)/protractor protractor-dart2js.conf.js`: Dart2JS e2e tests.
4. `$(npm bin)/protractor protractor-dart2js.conf.js`: dart2js e2e tests.
Angular specific command line options when running protractor:
- `$(npm bin)/protractor protractor-{js|dart2js}-conf.js --ng-help`
@ -167,13 +200,79 @@ Angular specific command line options when running protractor:
### Performance tests
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)
2. `$(npm bin)/gulp serve.js.prod serve.dart` (runs a 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
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`
## Formatting with <a name="clang-format">clang-format</a>
We use [clang-format](http://clang.llvm.org/docs/ClangFormat.html) to automatically enforce code
style for our TypeScript code. This allows us to focus our code reviews more on the content, and
less on style nit-picking. It also lets us encode our style guide in the `.clang-format` file in the
repository, allowing many tools and editors to share our settings.
To check the formatting of your code, run
gulp check-format
Note that the continuous build on Travis runs `gulp enforce-format`. Unlike the `check-format` task,
this will actually fail the build if files aren't formatted according to the style guide.
Your life will be easier if you include the formatter in your standard workflow. Otherwise, you'll
likely forget to check the formatting, and waste time waiting for a build on Travis that fails due
to some whitespace difference.
* Install clang-format with `npm install -g clang-format`.
* Use `clang-format -i [file name]` to format a file (or multiple).
Note that `clang-format` tries to load a `clang-format` node module close to the sources being
formatted, or from the `$CWD`, and only then uses the globally installed one - so the version used
should automatically match the one required by the project.
Use `clang-format -version` in case you get confused.
* Use `gulp enforce-format` to check if your code is `clang-format` clean. This also gives
you a command line to format your code.
* `clang-format` also includes a git hook, run `git clang-format` to format all files you
touched.
* You can run this as a **git pre-commit hook** to automatically format your delta regions when you
commit a change. In the angular repo, run
```
$ echo -e '#!/bin/sh\nexec git clang-format' > .git/hooks/pre-commit
$ chmod u+x !$
```
* **WebStorm** can run clang-format on the current file.
1. Under Preferences, open Tools > External Tools.
1. Plus icon to Create Tool
1. Fill in the form:
- Name: clang-format
- Description: Format
- Synchronize files after execution: checked
- Open console: not checked
- Show in: Editor menu
- Program: [path to clang-format, try `$ echo $(npm config get prefix)/bin/clang-format`]
- Parameters: `-i -style=file $FilePath$`
- Working directory: `$ProjectFileDir$`
* `clang-format` integrations are also available for many popular editors (`vim`, `emacs`,
`Sublime Text`, etc.).
## Generating the API documentation
The following gulp task will generate the API docs in the `dist/angular.io/partials/api/angular2`:
```shell
$(npm bin)/gulp docs/angular.io
```
You can serve the generated documentation to check how it would render on [angular.io](https://angular.io/):
- check out the [angular.io repo](https://github.com/angular/angular.io) locally,
- install dependencies as described in the [angular.io README](https://github.com/angular/angular.io/blob/master/README.md),
- copy the generated documentation from your local angular repo at `angular/dist/angular.io/partials/api/angular2` to your local angular.io repo at `angular.io/public/docs/js/latest/api`,
- run `harp compile` at the root of the angular.io repo to check the generated documentation for errors,
- run `harp server` and open a browser at `http://localhost:9000/docs/js/latest/api/` to check the rendered documentation.
## Project Information
### Folder structure
@ -184,16 +283,18 @@ Angular specific command line options when running protractor (e.g. force gc, ..
### 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
* `*.ts`: TypeScript files that get transpiled to Dart and EcmaScript 5/6
* `*.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).
## Transforming Dart code
See the [wiki](//github.com/angular/angular/wiki/Angular-2-Dart-Transformer).
## Debugging
### Debug the transpiler
@ -219,17 +320,18 @@ Notes:
If you need to debug the tests:
- add a `debugger;` statement to the test you want to debug (oe the source code),
- add a `debugger;` statement to the test you want to debug (or 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
- open the DevTools and press F5,
- the execution halts 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.
1. Create a Karma run config from WebStorm.
2. Then in the "Run" menu, press "Debug 'karma-js.conf.js'", and WebStorm will stop in the generated
code on the `debugger;` statement.
3. 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.

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,15 +1,26 @@
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)
[![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)](http://issuestats.com/github/angular/angular)
[![Issue Stats](http://issuestats.com/github/angular/angular/badge/issue)](http://issuestats.com/github/angular/angular)
[![npm version](https://badge.fury.io/js/angular2.svg)](http://badge.fury.io/js/angular2)
[![Downloads](http://img.shields.io/npm/dm/angular2.svg)](https://npmjs.org/package/angular2)
[![Sauce Test Status](https://saucelabs.com/browser-matrix/angular2-ci.svg)](https://saucelabs.com/u/angular2-ci)
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
Angular 2 is currently in **Developer 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).
## Quickstart
[Get started in 5 minutes][quickstart].
## Setup & Install Angular 2
@ -18,35 +29,15 @@ Follow the instructions given on the [Angular download page][download].
## Want to help?
Want to file a bug, or contribute some code or improve documentation? Excellent! Read up on our
guidelines for [contributing][contributing].
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).
## 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 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).
[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
[download]: http://angular.io/download/
[quickstart]: https://angular.io/docs/js/latest/quickstart.html
[ng2]: http://angular.io
[ngDart]: http://angulardart.org
[ngJS]: http://angularjs.org

4
TOOLS.md Normal file
View File

@ -0,0 +1,4 @@
# Developer Tools for Angular 2
- [JavaScript](TOOLS_JS.md)
- [Dart](TOOLS_DART.md)

324
TOOLS_DART.md Normal file
View File

@ -0,0 +1,324 @@
# Developer Tools for Dart
Use these tools and techniques to increase your app's performance
and reliability.
* [Angular debugging tools](#angular-debugging-tools)
* [Code size](#code-size)
* [Performance](#performance)
## Angular debugging tools
Starting with alpha.38, Angular provides a set of debugging tools
that are accessible from any browser's developer console.
In Chrome, you can get to the dev console by pressing
Ctrl + Shift + J (on Mac: Cmd + Opt + J).
### Enabling the debugging tools
By default the debugging tools are disabled.
Enable the debugging tools as follows:
```dart
import 'package:angular2/tools.dart';
main() async {
var appRef = await bootstrap(Application);
enableDebugTools(appRef);
}
```
<!-- Change function name to enableDebuggingTools? -->
### Using the debugging tools
In the browser, open the dev console. The top-level object is called `ng` and
contains more specific tools inside it.
For example, to run the change detection profiler on your app:
<!-- QUESTION: is "on your app" accurate?
is "run the change detection profiler on your app" the best wording? -->
```javascript
// In the dev console:
ng.profiler.timeChangeDetection();
```
The [Change detection profiler](#change-detection-profiler) section
has more details.
<!-- Point to API docs when they're published, if they're useful.
They should be under
http://www.dartdocs.org/documentation/angular2/latest
and/or
https://angular.io/docs/js/latest/api/. -->
## Code size
Code must be downloaded, parsed, and executed. Too much code can lead to
slow application start-up time, especially on slow networks and low-end devices.
The tools and techniques in this section can help you to identify
unnecessarily large code and to reduce code size.
### Finding contributors to code size
Options for investigating code size include the `--dump-info` dart2js option,
ng2soyc, `reflector.trackUsage()`, and code coverage information
from the Dart VM.
#### --dump-info
The `--dump-info` option of `dart2js` outputs information about what happened
during compilation. You can specify `--dump-info` in `pubspec.yaml`:
```yaml
transformers:
...
- $dart2js:
commandLineOptions:
- --dump-info
```
The [Dump Info Visualizer](https://github.com/dart-lang/dump-info-visualizer)
can help you analyze the output.
For more information, see the
[dart2js_info API reference](http://dart-lang.github.io/dart2js_info/doc/api/).
#### ng2soyc.dart
[ng2soyc](https://github.com/angular/ng2soyc.dart) is a utility for analyzing
code size contributors in Angular 2 applications. It groups code size by
library and, assuming your library names follow
[standard naming conventions](https://www.dartlang.org/articles/style-guide/#do-prefix-library-names-with-the-package-name-and-a-dot-separated-path)
(package.library.sublibrary...), gives the code size breakdown at
each level. To reduce noise in the output of very large apps, ng2soyc provides
an option to hide libraries that are too small, so you can focus on the biggest
contributors.
#### Track unused reflection data
<!-- QUESTION: How do you get access to reflector & ReflectionInfo? -->
Call `reflector.trackUsage()` to track reflection information used
by the application. Reflection information (`ReflectionInfo`) is a data
structure that stores information about your application that Angular uses for
locating DI factories, generated change detectors and other code related to a
given type. After exercising your application, call `reflector.listUnusedKeys()`
to get a list of types and functions whose reflection information was retained
but never used by the application.
#### Use code coverage to find dead code
When running in Dartium (or in the Dart VM, in general) you can request code
coverage information from the VM. You can either use
[observatory](https://www.dartlang.org/tools/observatory/) or download
the coverage file and use your own tools to inspect it. Lines of code that are
not covered are top candidates for dead code.
Keep in mind, however, that uncovered code is not sufficient evidence of dead
code, only necessary evidence. It is perfectly possible that you simply didn't
exercise your application in a way that triggers the execution of uncovered
code. A common example is error handling code. Just because your testing never
encountered an error does not mean the error won't happen in production. You
therefore don't have to rush and remove all the `catch` blocks.
### Reducing code size
To reduce code size, you can disable reflection,
enable minification, and manually remove dead code.
You can also try less safe options such as
telling dart2js to trust type annotations.
#### Disable reflection
`dart:mirrors` allows discovering program metadata at runtime. However, this
means that `dart2js` needs to retain that metadata and thus increase the size
of resulting JS output. In practice, however, it is possible to extract most
metadata necessary for your metaprogramming tasks statically using a
transformer and `package:analyzer`, and act on it before compiling to JS.
#### Enable minification
Minification shortens all your `longMethodNames` into 2- or 3-letter long
symbols. `dart2js` ensures that this kind of renaming is done safely, without
breaking the functionality of your programs. You can enable it in `pubspec.yaml`
under `$dart2js` transformer:
```yaml
transformers:
...
- $dart2js:
minify: true
```
#### Manually remove dead code
`dart2js` comes with dead code elimination out-of-the-box. However, it may not
always be able to tell if a piece of code could be used. Consider the following
example:
```dart
/// This function decides which serialization format to use
void setupSerializers() {
if (server.doYouSupportProtocolBuffers()) {
useProtobufSerializers();
} else {
useJsonSerializers();
}
}
```
In this example the application asks the server what kind of serialization
format it uses and dynamically chooses one or the other. `dart2js` can't
tell whether the server responds with yes or no, so it must retain both
kinds of serializers. However, if you know that your server supports
protocol buffers, you can remove that `if` block entirely and default to
protocol buffers.
Code coverage (see above) is a good way to find dead code in your app.
#### Unsafe options
Dart also provides more aggressive optimization options. However, you have to
be careful when using them and as of today the benefits aren't that clear. If
your type annotations are inaccurate you may end up with non-Darty runtime
behavior, including the classic "undefined is not a function" tautology, as
well as the "keep on truckin'" behavior, e.g. `null + 1 == 1` and
`{} + [] == 0`.
`--trust-type-annotations` tells `dart2js` to trust that your type annotations
are correct. So if you have a function `foo(Bar bar)` the compiler can omit the
check that `bar` is truly `Bar` when calling methods on it.
`--trust-primitives` tells `dart2js` that primitive types, such as numbers and
booleans are never `null` when performing arithmetic, and that your program
does not run into range error when operating on lists, letting the compiler
remove some of the error checking code.
Specify these options in `pubspec.yaml`.
Example:
```yaml
transformers:
...
- $dart2js:
commandLineOptions:
- --trust-type-annotations
- --trust-primitives
```
## 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 are likely to see different numbers
as you go from one screen in your application to another.
#### Running the profiler
Enable the debugging tools (see above),
then in the dev console enter the following:
```javascript
ng.profiler.timeChangeDetection();
```
The results are printed to the console.
#### Recording CPU profiles
To record a profile, pass `{record: true}` to `timeChangeDetection()`:
```javascript
ng.profiler.timeChangeDetection({record: true});
```
Then open the **Profiles** tab. The recorded profile has the title
**Change Detection**. In Chrome, if you record the profile repeatedly, all the
profiles are nested under Change Detection.
#### Interpreting the numbers
In a properly designed application, repeated attempts to detect changes without
any user actions result in no changes to 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 helps to understand how change detection works. Such a
discussion is outside the scope of this document,
but here are some key concepts.
<!-- TODO: link to change detection docs -->
By default, Angular uses a _dirty checking_ mechanism to find 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 might contribute to slow change detection. A good way to
speed things up is to use plain class fields in your expressions and avoid any
kind of computation. For example:
```dart
@View(
template: '<button [enabled]="isEnabled">{{title}}</button>'
)
class FancyButton {
// GOOD: no computation, just returns the value
bool isEnabled;
// BAD: computes the final value upon request
String _title;
String get title => _title.trim().toUpperCase();
}
```
Most cases like these can 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.
<!-- TODO: link to discussion of push model -->

140
TOOLS_JS.md Normal file
View File

@ -0,0 +1,140 @@
# Developer Tools for JavaScript
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 'angular2/tools';
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
@View({
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).

168
TRIAGE_AND_LABELS.md Normal file
View File

@ -0,0 +1,168 @@
# Triage Process and Github Labels for Angular 2
This document describes how the Angular team uses labels and milestones to triage issues on github.
# Issues and PRs
## Triaged vs Untriaged Issues
Every triaged issue must have four attributes assigned to it:
* `priority` -- P0 through P4. P0 issues are "drop everything and do this now". P4 are nice to have.
* `component` -- Which area of Angular knowledge this relates to.
* `effort` -- Rough assessment of how much work this issue is. E.g. `effort: easy` means
"probably a few hours of work".
* `type` -- Whether this issue is a bug, feature, or other kind of task.
Untriaged issues are any issues in the queue that don't yet have these four attributes.
You can view a report of untriaged issues here, in our
[Angular Triage Dashboard](http://mhevery.github.io/github_issues/).
Issues should also have a clear action to complete that can be addressed or resolved within the
scope of Angular 2. We'll close issues that don't meet these criteria.
### 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 Untriaged PRs
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.
Victor (`vsavkin`) and Tobias (`tbosch`) are owners of the PR queue. Here is a list of [current
untriaged PRs](https://github.com/angular/angular/pulls?utf8=%E2%9C%93&q=is%3Aopen+no%3Amilestone+is%3Apr+-label%3A%22pr_action%3A+cleanup%22+-label%3A%22pr_action%3A+merge%22+-label%3A%22pr_action%3A+review%22+-label%3A%22pr_action%3A+discuss%22+-label%3A%22pr_state%3A+blocked%22+-label%3A%22pr_state%3A+WIP%22+).
# Prioritization of Work
What should you be working on?
1. Any PRs that are assigned to you that don't have `pr_state: WIP` or `pr_state: blocked`
1. Any issues that are assigned to you in the lowest-numbered Milestone
1. Any issues that are assigned to you in any Milestone
If there are no issues assigned to you in any Milestone, pick an issue, self-assign it, and add
it to the most appropriate Milestone based on effort.
Here are some suggestions for what to work on next:
* Filter for issues in a component that you are knowledgeable about, and pick something that has a
high priority.
* Filter for any small effort task that has the special `cust: GT` or `cust:Ionic` tags,
and priority > P3.
* Add a new task that's really important, add `component`, `priority`, `effort`, `type` and
assign it to yourself and the most appropriate milestone.
# Labels Used in Triage
## Priority
How urgent is this issue? We use priority to determine what should be worked on in each new
milestone.
* `P0: critical` -- drop everything to work on this
* `P1: urgent` -- resolve quickly in the current milestone. people are blocked
* `P2: required` -- needed for development but not urgent yet. workaround exists, or e.g. new API
* `P3: important` -- must complete before Angular 2 is ready for release
* `P4: nice to have` -- a good idea, but maybe not until after release
## Effort
Rough, non-binding estimate of how much work this issue represents. Please change this assessment
for anything you're working on to better reflect reality.
* `effort: easy` -- straightforward issue that can be resolved in a few hours, e.g. < 1 day of work.
* `effort: medium` -- issue that will be a few days of work. Can be completed within a single
milestone.
* `effort: tough` -- issue that will likely take more than 1 milestone to complete.
<!-- We don't like these label names as
they're not absolute (what is one developer-hour, really?) but decided it wasn't worth arguing
over terms. -->
## Component
Which area of Angular knowledge is this issue most closely related to? Helpful when deciding what
to work on next.
* `comp: benchpress` -- benchmarks and performance testing &rarr; *tbosch*, *crossj*
* `comp: build/dev-productivity` -- build process, e.g. CLI and related tasks &rarr; *iminar*, *caitp*
* `comp: build/pipeline` -- build pipeline, e.g. ts2dart &rarr; *mprobst*, *alexeagle*
* `comp: core` -- general core Angular issues, not related to a sub-category (see below) &rarr;
*mhevery*
* `comp: core/animations` -- animations framework &rarr; *matsko*
* `comp: core/change_detection` -- change detection &rarr; *vsavkin*
* `comp: core/di` -- dependency injection &rarr; *vicb*, *rkirov*
* `comp: core/directives` -- directives
* `comp: core/forms` -- forms &rarr; *vsavkin*
* `comp: core/pipes` -- pipes
* `comp: core/view` -- runtime processing of the `View`s
* `comp: core/view/compiler` -- static analysis of the templates which generate `ProtoView`s.
* `comp: core/testbed` -- e2e tests and support for them
* `comp: core/webworker` -- core web worker infrastructure
* `comp: dart-transformer` -- Dart transforms &rarr; *kegluneq*, *jakemac*
* `comp: data-access` -- &rarr; *jeffbcross*
* `comp: docs` -- API docs and doc generation &rarr; *naomiblack*, *petebacondarwin*
* `comp: material-components` -- Angular Material components built in Angular 2 &rarr; *jelbourn*
* `comp: router` -- Component Router &rarr; *btford*, *igorminar*, *matsko*
* `comp: wrenchjs`
## Type
What kind of problem is this?
* `type RFC / discussion / question`
* `type bug`
* `type chore`
* `type feature`
* `type performance`
* `type refactor`
## 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.
### cust
This is an issue causing user pain for early adopter customers `cust: GT` or `cust: Ionic`.
### 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"
}
}
}

View File

@ -0,0 +1,76 @@
var path = require('canonical-path');
var Package = require('dgeni').Package;
var basePackage = require('../public-docs-package');
var PARTIAL_PATH = 'partials';
var MODULES_DOCS_PATH = PARTIAL_PATH + '/api';
module.exports = new Package('angular.io', [basePackage])
.factory(require('./services/renderMarkdown'))
.processor(require('./processors/addJadeDataDocsProcessor'))
.processor(require('./processors/filterUnwantedDecorators'))
// Configure rendering
.config(function(templateFinder, templateEngine) {
templateFinder.templateFolders
.unshift(path.resolve(__dirname, 'templates'));
})
.config(function(writeFilesProcessor) {
writeFilesProcessor.outputFolder = 'dist/angular.io';
})
.config(function(readFilesProcessor, generateNavigationDoc, createOverviewDump) {
// Clear out unwanted processors
readFilesProcessor.$enabled = false;
generateNavigationDoc.$enabled = false;
createOverviewDump.$enabled = false;
})
.config(function(filterUnwantedDecorators, log) {
log.level = 'info';
filterUnwantedDecorators.decoratorsToIgnore = [
'CONST',
'IMPLEMENTS',
'ABSTRACT'
];
})
.config(function(computeIdsProcessor, computePathsProcessor, EXPORT_DOC_TYPES) {
computePathsProcessor.pathTemplates.push({
docTypes: ['module'],
pathTemplate: '${id}/',
outputPathTemplate: MODULES_DOCS_PATH + '/${id}/index.jade'
});
computePathsProcessor.pathTemplates.push({
docTypes: EXPORT_DOC_TYPES,
pathTemplate: '${moduleDoc.id}/${name}-${docType}.html',
outputPathTemplate: MODULES_DOCS_PATH + '/${moduleDoc.id}/${name}-${docType}.jade',
});
computePathsProcessor.pathTemplates.push({
docTypes: ['jade-data'],
pathTemplate: '${originalDoc.id}/_data',
outputPathTemplate: MODULES_DOCS_PATH + '/${path}.json'
});
})
.config(function(getLinkInfo) {
getLinkInfo.relativeLinks = true;
})
.config(function(templateEngine, getInjectables) {
templateEngine.filters = templateEngine.filters.concat(getInjectables([
require('./rendering/trimBlankLines'),
require('./rendering/toId')
]));
});

View File

@ -0,0 +1,8 @@
var Package = require('dgeni').Package;
module.exports = function mockPackage() {
return new Package('mockPackage', [require('../')])
.factory('log', function() { return require('dgeni/lib/mocks/log')(false); })
};

View File

@ -0,0 +1,86 @@
var _ = require('lodash');
var path = require('canonical-path');
var titleCase = function(text) {
return text.replace(/(.)(.*)/, function(_, first, rest) {
return first.toUpperCase() + rest;
});
};
/*
* Create _data.json file for Harp pages
*
* http://harpjs.com/docs/development/metadata
*
* This method creates the meta data required for each page
* such as the title, description, etc. This meta data is used
* in the harp static site generator to create the title for headers
* and the navigation used in the API docs
*
*/
module.exports = function addJadeDataDocsProcessor() {
return {
$runAfter: ['adding-extra-docs'],
$runBefore: ['extra-docs-added'],
$process: function(docs) {
var extraDocs = [];
var modules = [];
/*
* Create Data for Modules
*
* Modules must be public and have content
*/
_.forEach(docs, function(doc) {
if (doc.docType === 'module' && !doc.private && doc.exports.length) {
modules.push(doc);
// GET DATA FOR INDEX PAGE OF MODULE SECTION
var indexPageInfo = [{
name: 'index',
title: _.map(path.basename(doc.fileInfo.baseName).split('_'), function(part) {
return titleCase(part);
}).join(' '),
intro: doc.description.replace('"', '\"').replace(/\s*(\r?\n|\r)\s*/g," "),
docType: 'module'
}];
// GET DATA FOR EACH PAGE (CLASS, VARS, FUNCTIONS)
var modulePageInfo = _(doc.exports)
.map(function(exportDoc) {
var dataDoc = {
name: exportDoc.name + '-' + exportDoc.docType,
title: exportDoc.name,
docType: exportDoc.docType
};
if (exportDoc.symbolTypeName) dataDoc.varType = titleCase(exportDoc.symbolTypeName);
if (exportDoc.originalModule) dataDoc.originalModule = exportDoc.originalModule;
return dataDoc;
})
.sortBy('name')
.value();
//COMBINE PAGE DATA
var allPageData = indexPageInfo.concat(modulePageInfo);
// PUSH DATA TO EXTRA DOCS ARRAY
extraDocs.push({
id: doc.id + "-data",
aliases: [doc.id + "-data"],
docType: 'jade-data',
originalDoc: doc,
data: allPageData
});
}
});
return docs.concat(extraDocs);
}
};
};

View File

@ -0,0 +1,66 @@
var mockPackage = require('../mocks/mockPackage');
var Dgeni = require('dgeni');
describe('addJadeDataDocsProcessor', function() {
var dgeni, injector, processor;
beforeEach(function() {
dgeni = new Dgeni([mockPackage()]);
injector = dgeni.configureInjector();
processor = injector.get('addJadeDataDocsProcessor');
});
it('should add a doc for each module', function() {
var docs = [
{
docType: 'module',
id: 'someModule',
exports: [
{ name: 'someObj', docType: 'var', symbolTypeName: 'MyClass', originalModule: 'some/private/module' }
],
fileInfo: { baseName: 'x_y' },
description: 'some description\nsecond line'
}
];
docs = processor.$process(docs);
expect(docs[1]).toEqual({
id : 'someModule-data',
aliases : [ 'someModule-data' ],
docType : 'jade-data',
originalDoc : docs[0],
data : [
{ name : 'index', title : 'X Y', intro : 'some description second line', docType : 'module' },
{ name : 'someObj-var', title : 'someObj', varType : 'MyClass', docType: 'var', originalModule: 'some/private/module' }
] });
});
it('should sort the exports into alphabetical order', function() {
var docs = [
{
docType: 'module',
id: 'someModule',
exports: [
{ name: 'Beta', docType: 'class'},
{ name: 'Alpha', docType: 'class'},
{ name: 'Gamma', docType: 'class'},
{ name: 'Nu', docType: 'class'},
{ name: 'Mu', docType: 'class'}
],
fileInfo: { baseName: 'x_y' },
description: 'some description\nsecond line'
}
];
docs = processor.$process(docs);
expect(docs[1].data).toEqual([
{ name : 'index', title : 'X Y', intro : 'some description second line', docType : 'module' },
{ name: 'Alpha-class', title: 'Alpha', docType: 'class' },
{ name: 'Beta-class', title: 'Beta', docType: 'class' },
{ name: 'Gamma-class', title: 'Gamma', docType: 'class' },
{ name: 'Mu-class', title: 'Mu', docType: 'class' },
{ name: 'Nu-class', title: 'Nu', docType: 'class' }
]);
});
});

View File

@ -0,0 +1,20 @@
var _ = require('lodash');
module.exports = function filterUnwantedDecorators() {
return {
decoratorsToIgnore: [],
$runAfter: ['processing-docs'],
$runBefore: ['docs-processed'],
$process: function(docs) {
var decoratorsToIgnore = this.decoratorsToIgnore || [];
_.forEach(docs, function(doc) {
if (doc.decorators) {
doc.decorators = _.filter(doc.decorators, function(decorator) {
return decoratorsToIgnore.indexOf(decorator.name) === -1;
});
}
});
return docs;
}
};
}

View File

@ -0,0 +1,46 @@
var mockPackage = require('../mocks/mockPackage');
var Dgeni = require('dgeni');
describe('filterUnwantedDecorators', function() {
var dgeni, injector, processor;
beforeEach(function() {
dgeni = new Dgeni([mockPackage()]);
injector = dgeni.configureInjector();
processor = injector.get('filterUnwantedDecorators');
});
it('should remove decorators specified by name', function() {
var docs = [
{ id: 'doc1', decorators: [ { name: 'A' }, { name: 'B' } ] },
{ id: 'doc2', decorators: [ { name: 'B' }, { name: 'C' } ] },
{ id: 'doc3', decorators: [ { name: 'A' }, { name: 'C' } ] }
];
processor.decoratorsToIgnore = ['D', 'B'];
docs = processor.$process(docs);
expect(docs).toEqual([
{ id: 'doc1', decorators: [ { name: 'A' } ] },
{ id: 'doc2', decorators: [ { name: 'C' } ] },
{ id: 'doc3', decorators: [ { name: 'A' }, { name: 'C' } ] }
]);
});
it('should ignore docs that have no decorators', function() {
var docs = [
{ id: 'doc1', decorators: [ { name: 'A' }, { name: 'B' } ] },
{ id: 'doc2' },
{ id: 'doc3', decorators: [ { name: 'A' }, { name: 'C' } ] }
];
processor.decoratorsToIgnore = ['D', 'B'];
docs = processor.$process(docs);
expect(docs).toEqual([
{ id: 'doc1', decorators: [ { name: 'A' } ] },
{ id: 'doc2' },
{ id: 'doc3', decorators: [ { name: 'A' }, { name: 'C' } ] }
]);
});
});

View File

@ -0,0 +1,8 @@
module.exports = function() {
return {
name: 'toId',
process: function(str) {
return str.replace(/[^(a-z)(A-Z)(0-9)._-]/, '-');
}
};
};

View File

@ -0,0 +1,12 @@
module.exports = function() {
return {
name: 'trimBlankLines',
process: function(str) {
var lines = str.split(/\r?\n/);
while(lines.length && (lines[0].trim() === '')) {
lines.shift();
}
return lines.join('\n');
}
};
};

View File

@ -0,0 +1,18 @@
var factory = require('./trimBlankLines');
describe('trimBlankLines filter', function() {
var filter;
beforeEach(function() {
filter = factory();
});
it('should be called "trimBlankLines"', function() {
expect(filter.name).toEqual('trimBlankLines');
});
it('should remove all empty lines from the start of the string', function() {
expect(filter.process('\n\n\nsome text\n\nmore text\n\n'))
.toEqual('some text\n\nmore text\n\n');
});
});

View File

@ -0,0 +1,54 @@
var marked = require('marked');
var Encoder = require('node-html-encoder').Encoder;
var html2jade = require('html2jade');
var indentString = require('indent-string');
function stripTags(s) { //from sugar.js
return s.replace(RegExp('<\/?[^<>]*>', 'gi'), '');
}
// entity type encoder
var encoder = new Encoder('entity');
/**
* @dgService renderMarkdown
* @description
* Render the markdown in the given string as HTML.
*/
module.exports = function renderMarkdown(trimIndentation) {
var renderer = new marked.Renderer();
renderer.code = function(code, lang, escaped) {
var cssClasses = ['prettyprint', 'linenums'];
var trimmedCode = trimIndentation(code);
if(lang) {
if(lang=='html') {
trimmedCode = encoder.htmlEncode(trimmedCode);
}
cssClasses.push(this.options.langPrefix + escape(lang, true));
}
return 'pre(class="' + cssClasses.join(' ') + '")\n' + indentString('code.\n', ' ', 2) + trimmedCode;
};
renderer.heading = function (text, level, raw) {
var headingText = marked.Renderer.prototype.heading.call(renderer, text, level, raw);
var title = 'h2 ' + stripTags(headingText);
if (level==2) {
title = '.l-main-section\n' + indentString(title, ' ', 2) ;
}
return title;
};
return function(content) {
return marked(content, { renderer: renderer });
};
};

View File

@ -0,0 +1,62 @@
{% include "lib/githubLinks.html" -%}
{% include "lib/paramList.html" -%}
{% extends 'layout/base.template.html' -%}
{% block body %}
p.location-badge.
exported from {@link {$ doc.moduleDoc.id $} {$doc.moduleDoc.id $} }
defined in {$ githubViewLink(doc) $}
:markdown
{$ doc.description | indent(2, true) | trimBlankLines $}
{%- if doc.decorators %}
.l-main-section
h2 Annotations
{%- for decorator in doc.decorators %}
.l-sub-section
h3.annotation {$ decorator.name $}
pre.prettyprint
code.
@{$ decorator.name $}{$ paramList(decorator.arguments) | indent(8, false) $}
{% endfor %}
{% endif -%}
{%- if doc.constructorDoc or doc.members.length -%}
.l-main-section
h2 Members
{%- if doc.constructorDoc %}
.l-sub-section
h3#{$ doc.constructorDoc.name | toId $} {$ doc.constructorDoc.name $}
{% if doc.constructorDoc.parameters %}
pre.prettyprint
code.
{$ doc.constructorDoc.name $}{$ paramList(doc.constructorDoc.parameters) | indent(8, false) | trim $}
{% endif %}
:markdown
{$ doc.constructorDoc.description | indent(6, true) | replace('## Example', '') | replace('# Example', '') | trimBlankLines $}
{% endif -%}
{%- for member in doc.members %}{% if not member.private %}
.l-sub-section
h3#{$ member.name | toId $} {$ member.name $}{% if member.optional %}?{% endif %}
{% if member.parameters %}
pre.prettyprint
code.
{$ member.name $}{$ paramList(member.parameters) | indent(8, false) | trim $}{$ returnType(doc.returnType) $}
{% endif %}
:markdown
{$ member.description | indent(6, true) | replace('## Example', '') | replace('# Example', '') | trimBlankLines $}
{% endif %}{% endfor %}
{%- endif -%}
{% endblock %}

View File

@ -0,0 +1 @@
{% extends 'class.template.html' -%}

View File

@ -0,0 +1,22 @@
{% include "lib/githubLinks.html" -%}
{% include "lib/paramList.html" -%}
{% extends 'layout/base.template.html' -%}
{% block body %}
.l-main-section
h2(class="function export") {$ doc.name $}
{% if doc.parameters %}
pre.prettyprint
code.
{$ doc.name $}{$ paramList(doc.parameters) | indent(4, true) | trim $}{$ returnType(doc.returnType) $}
{% endif %}
p.location-badge.
exported from {@link {$ doc.moduleDoc.id $} {$doc.moduleDoc.id $} }
defined in {$ githubViewLink(doc) $}
:markdown
{$ doc.description | indent(4, true) | trimBlankLines $}
{% endblock %}

View File

@ -0,0 +1,17 @@
{
{%- for item in doc.data %}
"{$ item.name $}" : {
"title" : "{$ item.title $}",
{%- if item.intro %}
"intro" : "{$ item.intro $}",
{%- endif %}
{%- if item.varType %}
"varType" : "{$ item.varType $}",
{%- endif %}
{%- if item.originalModule %}
"originalModule" : "{$ item.originalModule $}",
{%- endif %}
"docType": "{$ item.docType $}"
}{% if not loop.last %},{% endif %}
{% endfor -%}
}

View File

@ -0,0 +1,12 @@
{% macro paramList(params) -%}
{%- if params -%}
({%- for param in params -%}
{$ param | escape $}{% if not loop.last %}, {% endif %}
{%- endfor %})
{%- endif %}
{%- endmacro -%}
{% macro returnType(returnType) -%}
{%- if returnType %} : {$ returnType | escape $}{% endif -%}
{%- endmacro -%}

View File

@ -0,0 +1,15 @@
{% include "lib/githubLinks.html" -%}
{% extends 'layout/base.template.html' -%}
{% block body -%}
p.location-badge.
defined in {$ githubViewLink(doc) $}
ul
for page, slug in public.docs[current.path[1]][current.path[2]][current.path[3]][current.path[4]]._data
if slug != 'index'
- var url = "/docs/" + current.path[1] + "/" + current.path[2] + "/" + current.path[3] + "/" + current.path[4] + "/" + slug + ".html"
li.c8
!= partial("../../../../../_includes/_hover-card", {name: page.title, url: url })
{% endblock %}

View File

@ -0,0 +1,12 @@
{% include "lib/githubLinks.html" -%}
{% extends 'layout/base.template.html' %}
{% block body %}
.l-main-section
p.location-badge.
exported from {@link {$ doc.moduleDoc.id $} {$doc.moduleDoc.id $} }
defined in {$ githubViewLink(doc) $}
:markdown
{$ doc.description | indent(4, true) | trimBlankLines $}
{% endblock %}

View File

@ -364,3 +364,16 @@ md-content.demo-source-container > hljs > pre > code.highlight {
padding-left:32px !important;
padding-right:32px !important;
}
.member .name {
white-space: pre-wrap;
word-wrap: break-word;
font-family: monospace;
font-size: 1.17em;
margin: 1em 0;
}
.left-nav {
min-width: 300px;
}

View File

@ -28,7 +28,7 @@
<section layout="row">
<md-content>
<md-content class="left-nav">
<h2>Navigation</h2>
<section ng-repeat="area in nav.areas">
<h3>{{ area.name }}</h3>
@ -47,7 +47,7 @@
<md-content class="md-padding">
<ng-include src="nav.currentPage.partial"></ng-include>
<ng-include autoscroll src="nav.currentPage.partial"></ng-include>
</md-content>
</section>

View File

@ -14,7 +14,6 @@ angular.module('app', ['ngMaterial', 'navigation-modules', 'navigation-guides',
];
this.updateCurrentPage = function(path) {
path = path.replace(/^\//, '');
console.log('path', path);
this.currentPage = null;

View File

@ -1,147 +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 = 'info';
})
// 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'
];
})
// 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,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,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,47 +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) {
log.silly('comment: ' + this.currentComment.range.start.line + ' - ' +
this.currentComment.range.end.line + ' : ' +
this.currentComment.range.toString());
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,74 +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 parser = new TraceurParser(sourceFile);
// Configure the parser
parser.handleComment = function(range) {
comments.push({ range: range });
};
traceurOptions.setFromObject(service.traceurOptions);
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 traceurOptions() {
return System.get(System.map.traceur + '/src/Options.js').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 %}

117
docs/docs-package/index.js Normal file
View File

@ -0,0 +1,117 @@
var Package = require('dgeni').Package;
var jsdocPackage = require('dgeni-packages/jsdoc');
var nunjucksPackage = require('dgeni-packages/nunjucks');
var typescriptPackage = require('../typescript-package');
var linksPackage = require('../links-package');
var gitPackage = require('dgeni-packages/git');
var path = require('canonical-path');
// Define the dgeni package for generating the docs
module.exports = new Package('angular-v2-docs', [jsdocPackage, nunjucksPackage, typescriptPackage, linksPackage, gitPackage])
// Register the services and file readers
.factory(require('./readers/ngdoc'))
// Register the processors
.processor(require('./processors/convertPrivateClassesToInterfaces'))
.processor(require('./processors/generateNavigationDoc'))
.processor(require('./processors/extractTitleFromGuides'))
.processor(require('./processors/createOverviewDump'))
.processor(require('./processors/checkUnbalancedBackTicks'))
// Configure the log service
.config(function(log) {
log.level = 'warn';
})
.config(function(renderDocsProcessor, versionInfo) {
renderDocsProcessor.extraData.versionInfo = versionInfo;
})
// Configure file reading
.config(function(readFilesProcessor, ngdocFileReader, readTypeScriptModules) {
readFilesProcessor.fileReaders = [ngdocFileReader];
readFilesProcessor.basePath = path.resolve(__dirname, '../..');
readFilesProcessor.sourceFiles = [
{ include: 'modules/*/docs/**/*.md', basePath: 'modules' },
{ include: 'docs/content/**/*.md', basePath: 'docs/content' }
];
readTypeScriptModules.sourceFiles = [
'*/*.@(js|es6|ts)',
'*/src/**/*.@(js|es6|ts)'
];
readTypeScriptModules.basePath = path.resolve(readFilesProcessor.basePath, 'modules');
})
.config(function(parseTagsProcessor, getInjectables) {
// We actually don't want to parse param docs in this package as we are getting the data out using TS
parseTagsProcessor.tagDefinitions.forEach(function(tagDef) {
if (tagDef.name === 'param') {
tagDef.docProperty = 'paramData';
tagDef.transforms = [];
}
});
})
// Configure links
.config(function(getLinkInfo) {
getLinkInfo.useFirstAmbiguousLink = true;
})
// 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'
];
})
// Configure ids and paths
.config(function(computeIdsProcessor, computePathsProcessor) {
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: ['guide'],
pathTemplate: '/${id}',
outputPathTemplate: 'partials/guides/${id}.html'
});
});

View File

@ -0,0 +1 @@
export var x = 100;

View File

@ -0,0 +1,34 @@
/**
* @module
* @description
* This is the module description
*/
export * from 'importedSrc';
/**
* This is some random other comment
*/
/**
* This is MyClass
*/
export class MyClass {
message: String;
/**
* Create a new MyClass
* @param {String} name The name to say hello to
*/
constructor(name) { this.message = 'hello ' + name; }
/**
* Return a greeting message
*/
greet() { return this.message; }
}
/**
* An exported function
*/
export var myFn = (val: number) => return val * 2;

View File

@ -0,0 +1,28 @@
var _ = require('lodash');
/**
* @dgProcessor checkUnbalancedBackTicks
* @description
* Searches the rendered content for an odd number of (```) backticks,
* which would indicate an unbalanced pair and potentially a typo in the
* source content.
*/
module.exports = function checkUnbalancedBackTicks(log, createDocMessage) {
var BACKTICK_REGEX = /^ *```/gm;
return {
$runAfter: ['checkAnchorLinksProcessor'],
$process: function(docs) {
_.forEach(docs, function(doc) {
if ( doc.renderedContent ) {
var matches = doc.renderedContent.match(BACKTICK_REGEX);
if (matches && matches.length % 2 !== 0) {
log.warn(createDocMessage('checkUnbalancedBackTicks processor: unbalanced backticks found in rendered content', doc));
console.log(doc.renderedContent);
}
}
});
}
};
};

View File

@ -0,0 +1,10 @@
module.exports = function convertPrivateClassesToInterfacesProcessor(convertPrivateClassesToInterfaces) {
return {
$runAfter: ['processing-docs'],
$runBefore: ['docs-processed'],
$process: function(docs) {
convertPrivateClassesToInterfaces(docs, false);
return docs;
}
};
};

View File

@ -0,0 +1,24 @@
var _ = require('lodash');
module.exports = function createOverviewDump() {
return {
$runAfter: ['processing-docs'],
$runBefore: ['docs-processed'],
$process: function(docs) {
var overviewDoc = {
id: 'overview-dump',
aliases: ['overview-dump'],
path: 'overview-dump',
outputPath: 'overview-dump.html',
modules: []
};
_.forEach(docs, function(doc) {
if ( doc.docType === 'module' ) {
overviewDoc.modules.push(doc);
}
});
docs.push(overviewDoc);
}
};
};

View File

@ -27,13 +27,15 @@ module.exports = function generateNavigationDoc() {
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);
if (!exportDoc.private) {
var exportNavItem = {
path: exportDoc.path,
partial: exportDoc.outputPath,
name: exportDoc.name,
type: exportDoc.docType
};
moduleNavItem.pages.push(exportNavItem);
}
});
}
});

View File

@ -0,0 +1,44 @@
{% include "lib/paramList.html" -%}
{% include "lib/githubLinks.html" -%}
{% extends 'layout/base.template.html' -%}
{% block body %}
<h1 class="class export">{$ doc.name $} <span class="type">{$ doc.docType $}</span></h1>
<p class="module">exported from {@link {$ doc.moduleDoc.id $} {$doc.moduleDoc.id $} }<br/>
defined in {$ githubViewLink(doc) $}
</p>
<p>{$ doc.description | marked $}</p>
{%- if doc.decorators %}
<h2>Annotations</h2>
{%- for decorator in doc.decorators %}
<h3 class="annotation">@{$ decorator.name $}{$ paramList(decorator.arguments) $}</h3>
{% endfor %}
{% endif -%}
{%- if doc.constructorDoc or doc.members.length -%}
<h2>Members</h2>
{%- if doc.constructorDoc %}
<section class="member constructor">
<h1 id="constructor" class="name">{$ doc.constructorDoc.name $}{$ paramList(doc.constructorDoc.params) $}</h1>
{% marked %}
{$ doc.constructorDoc.description $}
{% endmarked %}
</section>
{% endif -%}
{%- for member in doc.members %}{% if not member.private %}
<section class="member">
<h1 id="{$ member.name $}" class="name">
{$ member.name $}{% if member.optional %}?{% endif %}{$ paramList(member.params) $}
</h1>
{% marked %}
{$ member.description $}
{% endmarked %}
</section>
{% endif %}{% endfor %}
{%- endif -%}
{% endblock %}

View File

@ -0,0 +1 @@
{% extends 'var.template.html' -%}

View File

@ -0,0 +1,11 @@
{% include "lib/paramList.html" -%}
{% include "lib/githubLinks.html" -%}
{% extends 'layout/base.template.html' -%}
{% block body %}
<h1 class="function export">{$ doc.name $}{$ paramList(doc.parameters) $}</h1>
<p class="module">exported from {@link {$ doc.moduleDoc.id $} {$doc.moduleDoc.id $} }<br/>
defined in {$ githubViewLink(doc) $}</p>
<p>{$ doc.description | marked $}</p>
{% endblock %}

View File

@ -0,0 +1 @@
{% extends 'class.template.html' -%}

View File

@ -0,0 +1 @@
{% block body %}{% endblock %}

View File

@ -0,0 +1,3 @@
{% macro githubViewLink(doc) -%}
<a href="https://github.com/{$ versionInfo.gitRepoInfo.owner $}/{$ versionInfo.gitRepoInfo.repo $}/tree/{$ versionInfo.currentVersion.isSnapshot and versionInfo.currentVersion.SHA or versionInfo.currentVersion.raw $}/modules/{$ doc.fileInfo.relativePath $}#L{$ doc.location.start.line+1 $}-L{$ doc.location.end.line+1 $}">{$ doc.fileInfo.relativePath $} (line {$ doc.location.start.line+1 $})</a>
{%- endmacro -%}

View File

@ -0,0 +1,7 @@
{% macro paramList(params) -%}
{%- if params -%}<span class="params">(
{%- for param in params -%}
<span class="param">{$ param | escape $}{% if not loop.last %}, {% endif %}</span>
{%- endfor %})</span>
{%- endif %}
{%- endmacro -%}

View File

@ -1,15 +1,18 @@
{% include "lib/githubLinks.html" -%}
{% extends 'layout/base.template.html' %}
{% block body %}
<h1 class="id">{$ doc.id $} <span class="type">module</span></h1>
<p>defined in {$ githubViewLink(doc) $}</p>
<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>
{% if not exportDoc.private -%}
<li><a href="{$ exportDoc.path $}"><strong>{$ exportDoc.name $}</strong> {$ exportDoc.docType $}</a></li>
{%- endif %}
{%- endfor %}
</ul>
{% endif %}

View File

@ -0,0 +1,43 @@
{% include "lib/paramList.html" -%}
<!DOCTYPE html>
<html>
<head>
<title></title>
<style>
h2 {
padding-left: 20px;
}
h3 {
padding-left: 50px;
}
h4 {
padding-left: 60px;
}
</style>
</head>
<body>
<h1>Modules</h1>
{% for module in doc.modules %}
<h2>{$ module.id $}
{%- if module.public %} (public){% endif %}</h2>
{% for export in module.exports %}
<h3>{$ export.name $}</h3>
{%- if export.constructorDoc %}
<h4>{$ doc.constructorDoc.name $}{$ paramList(doc.constructorDoc.params) $}</h4>
{% endif -%}
{%- for member in export.members %}
<h4>{$ member.name $}{$ paramList(member.params) $}</h4>
{% endfor %}
{% endfor %}
{% endfor %}
</body>
</html>

View File

@ -0,0 +1,10 @@
{% include "lib/githubLinks.html" -%}
{% extends 'layout/base.template.html' %}
{% block body %}
<h1>{$ doc.name $} <span class="type">type alias</span></h1>
<p class="module">exported from {@link {$ doc.moduleDoc.id $} {$doc.moduleDoc.id $} }<br/>
defined in {$ githubViewLink(doc) $}</p>
<p>{$ doc.description | marked $}</p>
{% endblock %}

View File

@ -0,0 +1,10 @@
{% include "lib/githubLinks.html" -%}
{% extends 'layout/base.template.html' %}
{% block body %}
<h1>{$ doc.name $} <span class="type">variable</span></h1>
<p class="module">exported from {@link {$ doc.moduleDoc.id $} {$doc.moduleDoc.id $} }<br/>
defined in {$ githubViewLink(doc) $}</p>
<p>{$ doc.description | marked $}</p>
{% endblock %}

View File

@ -0,0 +1,12 @@
var Package = require('dgeni').Package;
module.exports = new Package('links', [])
.factory(require('./inline-tag-defs/link'))
.factory(require('dgeni-packages/ngdoc/services/getAliases'))
.factory(require('dgeni-packages/ngdoc/services/getDocFromAlias'))
.factory(require('./services/getLinkInfo'))
.config(function(inlineTagProcessor, linkInlineTagDef) {
inlineTagProcessor.inlineTagDefinitions.push(linkInlineTagDef);
});

View File

@ -0,0 +1,33 @@
var INLINE_LINK = /(\S+)(?:\s+([\s\S]+))?/;
/**
* @dgService linkInlineTagDef
* @description
* Process inline link tags (of the form {@link some/uri Some Title}), replacing them with HTML anchors
* @kind function
* @param {Object} url The url to match
* @param {Function} docs error message
* @return {String} The html link information
*
* @property {boolean} relativeLinks Whether we expect the links to be relative to the originating doc
*/
module.exports = function linkInlineTagDef(getLinkInfo, createDocMessage, log) {
return {
name: 'link',
description: 'Process inline link tags (of the form {@link some/uri Some Title}), replacing them with HTML anchors',
handler: function(doc, tagName, tagDescription) {
// Parse out the uri and title
return tagDescription.replace(INLINE_LINK, function(match, uri, title) {
var linkInfo = getLinkInfo(uri, title, doc);
if ( !linkInfo.valid ) {
log.warn(createDocMessage(linkInfo.error, doc));
}
return "<a href='" + linkInfo.url + "'>" + linkInfo.title + "</a>";
});
}
};
};

View File

@ -0,0 +1,72 @@
var _ = require('lodash');
var path = require('canonical-path');
/**
* @dgService getLinkInfo
* @description
* Get link information to a document that matches the given url
* @kind function
* @param {String} url The url to match
* @param {String} title An optional title to return in the link information
* @return {Object} The link information
*
* @property {boolean} relativeLinks Whether we expect the links to be relative to the originating doc
*/
module.exports = function getLinkInfo(getDocFromAlias, encodeCodeBlock, log) {
return function getLinkInfoImpl(url, title, currentDoc) {
var linkInfo = {
url: url,
type: 'url',
valid: true,
title: title || url
};
if ( !url ) {
throw new Error('Invalid url');
}
var docs = getDocFromAlias(url, currentDoc);
if ( !getLinkInfoImpl.useFirstAmbiguousLink && docs.length > 1 ) {
linkInfo.valid = false;
linkInfo.errorType = 'ambiguous';
linkInfo.error = 'Ambiguous link: "' + url + '".\n' +
docs.reduce(function(msg, doc) { return msg + '\n "' + doc.id + '" ('+ doc.docType + ') : (' + doc.path + ' / ' + doc.fileInfo.relativePath + ')'; }, 'Matching docs: ');
} else if ( docs.length >= 1 ) {
linkInfo.url = docs[0].path;
linkInfo.title = title || encodeCodeBlock(docs[0].name, true);
linkInfo.type = 'doc';
if ( getLinkInfoImpl.relativeLinks && currentDoc && currentDoc.path ) {
var currentFolder = path.dirname(currentDoc.path);
var docFolder = path.dirname(linkInfo.url);
var relativeFolder = path.relative(path.join('/', currentFolder), path.join('/', docFolder));
linkInfo.url = path.join(relativeFolder, path.basename(linkInfo.url));
log.debug(currentDoc.path, docs[0].path, linkInfo.url);
}
} else if ( url.indexOf('#') > 0 ) {
var pathAndHash = url.split('#');
linkInfo = getLinkInfoImpl(pathAndHash[0], title, currentDoc);
linkInfo.url = linkInfo.url + '#' + pathAndHash[1];
return linkInfo;
} else if ( url.indexOf('/') === -1 && url.indexOf('#') !== 0 ) {
linkInfo.valid = false;
linkInfo.errorType = 'missing';
linkInfo.error = 'Invalid link (does not match any doc): "' + url + '"';
} else {
linkInfo.title = title || (( url.indexOf('#') === 0 ) ? url.substring(1) : path.basename(url, '.html'));
}
return linkInfo;
};
};

View File

@ -1,18 +1,21 @@
var Package = require('dgeni').Package;
var basePackage = require('../dgeni-package');
var basePackage = require('../docs-package');
module.exports = new Package('angular-v2-public-docs', [basePackage])
module.exports = new Package('angular-public', [basePackage])
.processor(require('./processors/filterPublicDocs'))
.config(function(parseTagsProcessor) {
parseTagsProcessor.tagDefinitions.push({ name: 'publicModule' });
.config(function(readTypeScriptModules) {
readTypeScriptModules.sourceFiles = [
'angular2/lifecycle_hooks.ts',
'angular2/core.ts',
'angular2/http.ts',
'angular2/router.ts',
'angular2/test.ts'
];
readTypeScriptModules.hidePrivateMembers = true;
})
.config(function(processClassDocs, filterPublicDocs, EXPORT_DOC_TYPES) {
processClassDocs.ignorePrivateMembers = true;
filterPublicDocs.docTypes = EXPORT_DOC_TYPES;
.config(function(getLinkInfo) {
getLinkInfo.useFirstAmbiguousLink = false;
})
// Configure file writing

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

@ -0,0 +1,121 @@
var Package = require('dgeni').Package;
var jsdocPackage = require('dgeni-packages/jsdoc');
var nunjucksPackage = require('dgeni-packages/nunjucks');
var typescriptPackage = require('../typescript-package');
var gitPackage = require('dgeni-packages/git');
var path = require('canonical-path');
// Define the dgeni package for generating the docs
module.exports = new Package('angular-v2-docs', [jsdocPackage, nunjucksPackage, typescriptPackage, gitPackage])
// Register the processors
.processor(require('./processors/createTypeDefinitionFile'))
.config(function(readFilesProcessor, inlineTagProcessor) {
readFilesProcessor.basePath = path.resolve(__dirname, '../..');
// Don't run unwanted processors
readFilesProcessor.$enabled = false;
inlineTagProcessor.$enabled = false;
})
// Configure the log service
.config(function(log) {
log.level = 'info';
})
.config(function(renderDocsProcessor, versionInfo) {
renderDocsProcessor.extraData.versionInfo = versionInfo;
})
.config(function(readFilesProcessor, inlineTagProcessor, readTypeScriptModules, createTypeDefinitionFile) {
// Don't run unwanted processors
readFilesProcessor.$enabled = false; // We are not using the normal file reading processor
inlineTagProcessor.$enabled = false; // We are not actually processing the inline link tags
// Configure file reading
readFilesProcessor.basePath = path.resolve(__dirname, '../..');
readTypeScriptModules.sourceFiles = [
'angular2/angular2.ts',
'angular2/web_worker/worker.ts',
'angular2/web_worker/ui.ts',
'angular2/router.ts',
'angular2/http.ts',
'angular2/test_lib.ts'
];
readTypeScriptModules.basePath = path.resolve(path.resolve(__dirname, '../../modules'));
createTypeDefinitionFile.typeDefinitions = [
{
id: 'angular2/angular2',
references: ['../es6-shim/es6-shim.d.ts'],
modules: {
'angular2/angular2': {namespace: 'ng', id: 'angular2/angular2'},
'angular2/web_worker/worker': {namespace: 'ngWorker', id: 'angular2/web_worker/worker'},
'angular2/web_worker/ui': {namespace: 'ngUi', id: 'angular2/web_worker/ui'}
}
},
{
id: 'angular2/router',
references: ['./angular2.d.ts'],
remapTypes: {Type: 'ng.Type', InjectableReference: 'ng.InjectableReference'},
modules: {'angular2/router': {namespace: 'ngRouter', id: 'angular2/router'}}
},
{
id: 'angular2/http',
references: ['./angular2.d.ts'],
remapTypes: {Type: 'ng.Type', Observable: 'ng.Observable', EventEmitter: 'ng.EventEmitter', InjectableReference: 'ng.InjectableReference' },
modules: {'angular2/http': {namespace: 'ngHttp', id: 'angular2/http'}}
},
{
id: 'angular2/test_lib',
references: ['./angular2.d.ts', '../jasmine/jasmine.d.ts'],
remapTypes: { Type: 'ng.Type', Binding: 'ng.Binding', ViewMetadata: 'ng.ViewMetadata', Injector: 'ng.Injector',
Predicate: 'ng.Predicate', ElementRef: 'ng.ElementRef', DebugElement: 'ng.DebugElement',
InjectableReference: 'ng.InjectableReference' },
modules: {'angular2/test_lib': {namespace: 'ngTestLib', id: 'angular2/test_lib'}}
}
];
})
.config(function(parseTagsProcessor, getInjectables) {
// We actually don't want to parse param docs in this package as we are getting the data out using TS
parseTagsProcessor.tagDefinitions.forEach(function(tagDef) {
if (tagDef.name === 'param') {
tagDef.docProperty = 'paramData';
tagDef.transforms = [];
}
});
})
// 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'
];
});

View File

@ -0,0 +1,11 @@
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); })
// .factory('templateEngine', function() { return {}; });
};

View File

@ -0,0 +1,216 @@
'use strict';
function DtsSerializer(remap) {
this.remap = remap;
}
DtsSerializer.prototype = {
_initializerRegex: /\s*=[^>][^,}]*/g,
constructor: DtsSerializer,
declaration: function(buffer, ast) {
buffer.push(ast.name);
if (ast.optional) buffer.push('?');
if (ast.typeParameters) {
buffer.push('<');
buffer.push(ast.typeParameters.join(', '));
buffer.push('>');
}
if (ast.parameters) {
buffer.push('(');
var parameters = ast.parameters;
for (var i = 0; i < parameters.length; i++) {
parameters[i] = parameters[i].replace(this._initializerRegex, '');
}
buffer.push(parameters.join(', '));
buffer.push(')');
}
if (!isConstructor(ast)) {
if (ast.returnType) {
buffer.push(': ', ast.returnType);
} else if (ast.parameters) {
buffer.push(': void');
} else {
buffer.push(': any');
}
}
buffer.push(';\n');
},
comment: function(buffer, commentText) {
if (!(commentText && commentText.match(/\S/))) return;
buffer.push('/**\n');
commentText.replace(/\n*$/, '').split('\n').forEach(function(line) {
buffer.push(' * ' + line + '\n');
});
buffer.push(' */\n');
},
member: function(buffer, ast) {
if (ast.private) return;
buffer.push('\n');
this.comment(buffer, ast.content);
if (ast.isStatic) buffer.push('static ');
this.declaration(buffer, ast);
},
interfaceOrClass: function(buffer, ast, isInterface) {
buffer.push(isInterface ? 'interface ' : 'class ');
buffer.push(ast.name);
buffer.push(ast.typeParams);
buffer.push(ast.heritage);
buffer.push(' {');
buffer.indent();
if (ast.newMember) this.member(buffer, ast.newMember);
if (ast.callMember) this.member(buffer, ast.callMember);
if (ast.constructorDoc) this.member(buffer, ast.constructorDoc);
ast.statics.forEach(function(staticMember) {
this.member(buffer, staticMember);
}.bind(this));
ast.members.forEach(function(member) {
this.member(buffer, member);
}.bind(this));
buffer.unindent();
buffer.push('}');
},
enum: function(buffer, ast) {
buffer.push('enum ');
buffer.push(ast.name);
buffer.push(ast.typeParams);
buffer.push(ast.heritage);
buffer.push(' {');
buffer.indent();
ast.members.forEach(function(member, index) {
buffer.push('\n');
this.comment(buffer, member.content);
buffer.push(member.name);
if (index !== (ast.members.length - 1)) {
buffer.push(',\n');
}
}.bind(this));
buffer.unindent();
buffer.push('}\n');
},
function: function(buffer, ast) {
buffer.push('function ');
this.declaration(buffer, ast);
},
var: function(buffer, ast) {
buffer.push('var ');
this.declaration(buffer, ast);
},
let: function(buffer, ast) {
buffer.push('let ');
this.declaration(buffer, ast);
},
const: function(buffer, ast) {
buffer.push('const ');
this.declaration(buffer, ast);
},
typeAlias: function(buffer, ast) {
buffer.push('type ', ast.name, ' = ', ast.returnType);
},
serializeExport: function(ast) {
var buffer = new Buffer();
buffer.push('\n');
try {
this.comment(buffer, ast.content);
switch (ast.docType) {
case 'class': this.interfaceOrClass(buffer, ast, false); break;
case 'interface': this.interfaceOrClass(buffer, ast, true); break;
case 'function': this.function(buffer, ast); break;
case 'enum': this.enum(buffer, ast); break;
case 'var': this.var(buffer, ast); break;
case 'let': this.let(buffer, ast); break;
case 'const': this.const(buffer, ast); break;
case 'type-alias': this.typeAlias(buffer, ast); break;
default: throw new Error("unknown docType: " + ast.docType);
}
var string = buffer.toString();
for (var key in this.remap) {
if (this.remap.hasOwnProperty(key)) {
string = string.replace(new RegExp('\\b' + key + '\\b', 'gm'), this.remap[key]);
}
}
return string;
} catch (e) {
console.log(e.toString(), e.stack);
return 'ERROR: ' + e.toString();
}
}
};
function Buffer() {
this._globalBuffer = [];
this._indentedBuffer = [];
this._indentationLevel = 1;
}
Buffer.prototype = {
constructor: Buffer,
push: function() {
this._indentedBuffer.push.apply(this._indentedBuffer, arguments);
},
indent: function() {
this._globalBuffer.push({indentationLevel: this._indentationLevel, content: this._indentedBuffer.join('')});
this._indentationLevel++;
this._indentedBuffer = [];
},
unindent: function() {
this._globalBuffer.push({indentationLevel: this._indentationLevel, content: this._indentedBuffer.join('')});
this._indentationLevel--;
this._indentedBuffer = [];
},
toString: function() {
if (this._indentationLevel !== 1) {
throw new Exception("Forgot to unindent? Indentation level: " + this._indentationLevel);
}
this.unindent();
var string = '';
this._globalBuffer.forEach(function(indentedChunk) {
var indentation = (new Array(indentedChunk.indentationLevel * 2 + 1)).join(' ');
indentedChunk.content.split('\n').forEach(function(line) {
string += indentation + line + '\n';
});
});
return string;
}
};
function isConstructor(ast) {
return ast.parameters && ast.name === "constructor";
}
module.exports = {
DtsSerializer: DtsSerializer
};

View File

@ -0,0 +1,72 @@
var _ = require('lodash');
var path = require('canonical-path');
var codeGen = require('./code_gen.js');
module.exports = function createTypeDefinitionFile(log, convertPrivateClassesToInterfaces) {
return {
$runAfter: ['processing-docs'],
$runBefore: ['docs-processed'],
$validate: {
dtsPath: { presence: true },
dtsExtension: { presence: true },
typeDefinitions: { presence: true }
},
dtsPath: 'typings',
dtsExtension: '.d.ts',
typeDefinitions: [],
$process: function(docs) {
var dtsPath = this.dtsPath;
var dtsExtension = this.dtsExtension;
// For each type definition that we wish to create we define a dgeni "doc" for it
var typeDefDocs = _.map(this.typeDefinitions, function(def) {
var id = def.id + dtsExtension;
var docPath = path.join(dtsPath, id);
return {
docType: 'type-definition',
id: id,
aliases: [id],
path: docPath,
outputPath: docPath,
// A type definition may include a number of top level modules
// And those modules could be aliased (such as 'angular2/angular2.api' ->
// 'angular2/angular2')
moduleDocs: _.transform(def.modules,
function(moduleDocs, props, alias) {
moduleDocs[props.id] = {
id: alias,
doc: null, namespace: props.namespace,
references: def.references
};
}),
dts: new codeGen.DtsSerializer(def.remapTypes)
};
});
// Now add all the module docs to their corresponding type definition doc
_.forEach(docs, function(doc) {
_.forEach(typeDefDocs, function(typeDefDoc) {
if(typeDefDoc.moduleDocs[doc.id]) {
// Add a copy, because we are going to modify it
typeDefDoc.moduleDocs[doc.id].doc = doc;
}
});
});
return _.filter(typeDefDocs, function(doc) {
_.forEach(doc.moduleDocs, function(modDoc, alias) {
if (!doc || !modDoc.doc) {
log.error('createTypeDefinitionFile processor: no such module "' + alias + '" (Did you forget to add it to the modules to load?)');
doc = null;
return;
}
convertPrivateClassesToInterfaces(modDoc.doc.exports, true);
});
return !!doc;
});
}
};
};

View File

@ -0,0 +1,53 @@
var mockPackage = require('../mocks/mockPackage');
var Dgeni = require('dgeni');
var path = require('canonical-path');
var _ = require('lodash');
describe('createTypeDefinitionFile processor', function() {
var dgeni, injector, processor;
beforeEach(function() {
dgeni = new Dgeni([mockPackage()]);
injector = dgeni.configureInjector();
processor = injector.get('createTypeDefinitionFile');
// Initialize the processor
processor.typeDefinitions = [{
id: 'angular2/angular2',
modules: {
'angular2/angular2': {
id: 'angular2/angular2',
namespace: 'ng'
}
}
}];
});
describe('classes with private constructors', function() {
it('should convert heritage from `implements` into `extends`', function() {
// Create some mock docs for testing
var docs = [
{
id: 'angular2/angular2',
exports: [
{ docType: 'class', heritage: 'implements Xyz', constructorDoc: { private: true } }
]
}
];
docs = processor.$process(docs);
expect(docs.length).toEqual(1);
expect(docs[0].docType).toEqual('type-definition');
var moduleDoc = docs[0].moduleDocs['angular2/angular2'].doc;
expect(moduleDoc.exports.length).toEqual(2);
expect(moduleDoc.exports[0].heritage).toEqual('extends Xyz');
});
});
});

View File

@ -0,0 +1,18 @@
{% extends '../type-definition.template.html' %}
{% block staticDeclarations %}
interface Map<K,V> {}
interface StringMap<K,V> extends Map<K,V> {}
{% for alias, module in doc.moduleDocs %}
declare module {$ module.namespace $} {
// See https://github.com/Microsoft/TypeScript/issues/1168
class BaseException /* extends Error */ {
message: string;
stack: string;
toString(): string;
}
interface InjectableReference {}
}
{% endfor %}
{% endblock %}

View File

@ -0,0 +1,43 @@
{%- macro commentBlock(doc, level) -%}
{%- if doc.content | trim %}
{% if level > 1 %}{$ '/**' | indent(level-1, true) | replace(r/\n$/, "") $}{% else %}/**{% endif %}
{$ doc.content | trim | replace(r/^/gm, "* ") | indent(level, true) | replace(r/\n$/, "") $}
{$ '*/' | indent(level, true) | replace(r/\n$/, "") $}{% endif -%}
{%- endmacro -%}
// Type definitions for Angular v{$ versionInfo.currentVersion.full | replace(r/\+/, "_") $}
// Project: http://angular.io/
// Definitions by: angular team <https://github.com/angular/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// ***********************************************************
// This file is generated by the Angular build process.
// Please do not create manual edits or send pull requests
// modifying this file.
// ***********************************************************
{% for alias, module in doc.moduleDocs %}
{%- if module.references.length %}
// {$ alias $} depends transitively on these libraries.
// If you don't have them installed you can install them using TSD
// https://github.com/DefinitelyTyped/tsd
{%- endif %}
{% for reference in module.references %}
///<reference path="{$ reference $}"/>{% endfor %}{% endfor %}
{% block staticDeclarations %}{% endblock %}
{% for alias, module in doc.moduleDocs %}
{$ commentBlock(module.doc, 1) $}
declare module {$ module.namespace $} {
{%- for export in module.doc.exports -%}
{$ doc.dts.serializeExport(export) $}
{% endfor %}
}
declare module "{$ alias $}" {
export = {$ module.namespace $};
}
{% endfor %}

View File

@ -0,0 +1,70 @@
var basePackage = require('dgeni-packages/base');
var Package = require('dgeni').Package;
var path = require('canonical-path');
// Define the dgeni package for generating the docs
module.exports = new Package('typescript-parsing', [basePackage])
// Register the services and file readers
.factory(require('./services/modules'))
.factory(require('./services/tsParser'))
.factory(require('./services/tsParser/createCompilerHost'))
.factory(require('./services/tsParser/getFileInfo'))
.factory(require('./services/tsParser/getExportDocType'))
.factory(require('./services/tsParser/getContent'))
.factory(require('./services/convertPrivateClassesToInterfaces'))
.factory('EXPORT_DOC_TYPES', function() {
return [
'class',
'interface',
'function',
'var',
'const',
'enum',
'type-alias'
];
})
// Register the processors
.processor(require('./processors/readTypeScriptModules'))
// Configure the log service
.config(function(log) {
log.level = 'warn';
})
// Configure ids and paths
.config(function(computeIdsProcessor, computePathsProcessor, EXPORT_DOC_TYPES) {
computeIdsProcessor.idTemplates.push({
docTypes: ['member'],
idTemplate: '${classDoc.id}.${name}',
getAliases: function(doc) { return [doc.id]; }
});
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
});
var MODULES_DOCS_PATH = 'partials/modules';
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'
});
});

View File

@ -0,0 +1,11 @@
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); })
.factory('templateEngine', function() { return {}; });
};

View File

@ -0,0 +1,4 @@
export var __esModule = true;
export class OKToExport {}
export function _thisIsPrivate() {}
export var thisIsOK = '!';

View File

@ -0,0 +1,5 @@
export interface MyInterface {
optionalProperty? : string
<T, U extends Findable<T>>(param: T) : U
new (param: number) : MyInterface
}

View File

@ -0,0 +1,6 @@
export class Test {
firstItem;
constructor() { this.doStuff(); }
otherMethod() {}
doStuff() {}
}

View File

@ -0,0 +1 @@
export var x = 10;

View File

@ -0,0 +1 @@
export { x as y} from './privateModule';

View File

@ -0,0 +1 @@
export var x = 100;

Some files were not shown because too many files have changed in this diff Show More