Commit Graph

370 Commits

Author SHA1 Message Date
Harry Terkelsen c320240086 chore(benchmarks): enable transformer on the benchmarks
Closes #3960
2015-09-05 00:25:51 +00:00
Misko Hevery e916836261 chore(ts2dart): replace List with Array
Closes #3514
2015-08-31 21:32:10 +00:00
vsavkin d49bc438e8 feat(core): added afterContentInit, afterViewInit, and afterViewChecked hooks
Closes #3897
2015-08-31 17:16:54 +00:00
Misko Hevery 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
Misko Hevery 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
Jeff Cross 8ed22ce6e7 chore: update all import paths 2015-08-25 15:33:23 -07:00
Marc Laval c2279dd651 fix(build): make e2e tests faster
Closes #3822
2015-08-25 17:04:46 +00:00
Pawel Kozlowski c4044102d6 test(ViewMetadata): use ViewMetadata consistently in tests
Closes #3746
2015-08-23 10:47:23 +00:00
vsavkin a9ce454b21 fix(change_detection): fixed reflect properties as attributes
Closes #3761
2015-08-21 19:08:32 +00:00
vsavkin d2d0715568 feat(change_detection): do not reparse AST when using generated detectors 2015-08-21 05:16:31 +00:00
Misko Hevery b986c54079 chore: remove int in favor for number
Closes #3511
2015-08-21 05:10:31 +00:00
Misko Hevery 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
vsavkin 4845583dcf refactor(change_detector): made change detection responsible for processing events
Closes #3666
2015-08-17 15:39:00 +00:00
Caitlin Potter 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
vsavkin 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
Alex Eagle 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
Misko Hevery 39b0286d6b fix: remove unused imports 2015-07-31 20:40:33 +00:00
Tobias Bosch 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
Tim Blasi 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
Tim Blasi 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
Pawel Kozlowski d894aa9101 feat(compiler): introduce schema for elements
Closes #3353
2015-07-29 19:40:46 +02:00
Tobias Bosch 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
Tim Blasi 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
vsavkin 71bb4b3ee5 feat(change_detection): generate checkNoChanges only in dev mode 2015-07-27 15:50:19 -07:00
Misko Hevery 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
Misko Hevery c83a3f3372 chore(docs): added more docs for core.ts 2015-07-25 03:20:12 +00:00
yjbanov 469afda53e fix(url_resolver): in Dart make package urls relative to AppRootUrl 2015-07-24 16:37:01 -07:00
Jason Teplitz 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
yjbanov 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
Tobias Bosch 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
Kevin Moore 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
Alfonso Presa 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
Caitlin Potter 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
vsavkin 4656c6f5cf tools: added experimentalDecorators flag to tsconfig 2015-07-08 10:46:03 -07:00
vsavkin 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
vsavkin 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
Victor Berchet b15474c6f2 refactor(TemplateResolver): rename to ViewResolver 2015-06-24 18:40:04 +02:00
Victor Berchet 356c927d12 refactor(TemplateLoader): rename to ViewLoader 2015-06-24 18:40:04 +02:00
Victor Berchet 3ea655918e refactor(Compiler): inline styles before compiling the template 2015-06-24 18:40:03 +02:00
Victor Berchet 06aaa0c50e refactor(UrlResolver): extract app url resolution into AppRootUrl
fixes #1732
2015-06-24 18:40:03 +02:00
Julie Ralph 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
Pawel Kozlowski 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
Victor Berchet 1c4d233fe7 fix(ShadowDomStrategy): always inline import rules
fixes #1694
2015-06-19 18:50:30 -07:00
Martin Probst 920982c4e8 chore: update files to match clang-format 1.0.21. 2015-06-19 15:00:32 -07:00
vsavkin 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
Martin Probst be7ac9fd41 feat: remove MapWrapper.create()/get()/set().
Better dart2js code, better Angular code.
2015-06-18 14:55:12 -07:00
vsavkin b0e2ebda70 feat(query): added support for querying by var bindings 2015-06-17 16:36:55 -07:00
Martin Probst 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
Tobias Bosch 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
vsavkin 5bfcca2d5b feat(query): notify on changes 2015-06-15 11:10:21 -07:00
Tim Blasi 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
Tobias Bosch d07ed581a9 refactor(benchmark): add view cache param to largetable benchmarks 2015-06-11 14:45:43 -07:00
Tim Blasi 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
Martin Probst 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
Ian Riley 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
Ian Riley 2b60d1bae1 refactor (benchmarks/): Ts'ifying benchmarks/
Translating AtScript in benchmarks/ to TypeScript.
2015-06-02 13:11:30 -07:00
Victor Berchet 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
vsavkin c39c8ebcd0 feat(change_detection): added onInit and onCheck hooks 2015-05-28 16:46:22 -07:00
Victor Berchet 6ec5d5daaf refactor(async): extract timer related functions into a TimerWrapper 2015-05-20 07:47:46 +02:00
vsavkin b066b8d15a feat(di): added hostInjector and viewInjector to the Directive annotation 2015-05-18 18:30:53 -07:00
Tim Blasi 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
Tobias Bosch 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
vsavkin d8c7c274e4 refactor(change_detector): extracted ChangeDetectorDefinition 2015-05-13 16:23:22 -07:00
Victor Berchet cdbb2473bb fix(benchmark): change If for NgIf 2015-05-13 11:56:50 +02:00
Rado Kirov 38926f7123 fix(benchmark): fixes ng-if ng-for renaming for templates. 2015-05-13 11:56:50 +02:00
Misko Hevery 111fa60a93 chore: rename for to ng-for
Closes #1598
Closes #1295
Closes #1827

Closes #1827
2015-05-12 15:32:44 -07:00
Misko Hevery e9f236b70f chore: rename switch to ng-switch 2015-05-12 15:32:44 -07:00
Misko Hevery d310a9c0b4 chore: rename if to ng-if 2015-05-12 15:32:44 -07:00
yjbanov 1a0da11e55 feat(di): components can self-publish via publishAs 2015-05-08 16:13:00 -07:00
Tobias Bosch 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
Kevin Moore 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
Kevin Moore 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
Tobias Bosch 0856516ae9 refactor(renderer): separate compiler from renderer
Part of #1675
Closes #1702
2015-05-06 10:50:15 -07:00
Rado Kirov 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
vsavkin ce6a2ba836 refactor(view): moved the logic from ProtoView to ProtoViewFactory 2015-05-01 13:35:17 -07:00
vsavkin e4342743c0 feat(benchmark): added an implementation of the tree benchmark in React 2015-04-30 18:12:21 -07:00
Tobias Bosch 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
Rado Kirov 87dcd5eb6f fix(decorators): updates missing benchmark and fixes typo. 2015-04-30 10:22:30 -07:00
Tobias Bosch 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
Tobias Bosch 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
Rado Kirov fb67e37339 feat(decorators): adds decorators to be used by TS and Babel transpiled apps. 2015-04-29 15:13:25 -07:00
Tobias Bosch 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
Yegor Jbanov 427f0d021c perf(benchmarks): benchmark that measure cost of dynamic components 2015-04-27 10:16:53 -07:00
Yegor Jbanov 9fc9d53566 perf(benchmarks): benchmark measuring cost of decorators (fixes #1479) 2015-04-27 10:16:52 -07:00
Tobias Bosch 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
Tobias Bosch 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
vsavkin 8ccafb0524 feat(view): reimplemented property setters using change detection 2015-04-23 11:55:27 -07:00
Kevin Moore 7551a28f1a chore: show dart2js package warnings for angular2, benchmarks, examples
Closes #1468
2015-04-21 16:22:49 -07:00
Tobias Bosch 97e6fb6835 fix(benchmarks): wait for end of benchmarks 2015-04-21 11:25:07 -07:00
Yegor Jbanov 3dc4df2ffa chore(analysis): analyze web folders; fix existing warnings 2015-04-17 13:52:02 -07:00
vsavkin 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
Tobias Bosch 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
vsavkin 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
Yegor Jbanov c05bad381c perf(benchmark): measure Injector init from resolved bindings 2015-04-13 15:06:44 -07:00
Yegor Jbanov 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
Yegor Jbanov 0012caa4d5 perf(benchmarks): measure cost of Injector init with a variety of bindings 2015-04-13 10:02:13 -07:00
vsavkin 6f8fef4f13 feat(bootstrap): changed bootstrap to return ComponentRef 2015-04-10 18:14:59 -07:00
Tobias Bosch 6ce085a21a feat(benchmark): make view cache a parameter to the tree benchmark 2015-04-10 16:57:46 -07:00
Tim Blasi 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
Pawel Kozlowski bf7933714a chore(rename): rename View and Template concepts for #1244 2015-04-10 12:00:37 -07:00
vsavkin f45281a10a feat(view): generalized loading of dynamic components 2015-04-09 22:15:42 -07:00
vsavkin 61cb99ea42 refactor(change_detection): removed directive and binding mementos 2015-04-09 18:56:19 -07:00
Martin Probst 22c1a0d030 fix(benchmarks): Stop working around a Traceur bug. 2015-04-09 18:03:27 -07:00
vsavkin 69c3bff086 feat(change_detection): updated change detection to update directive directly, without the dispatcher 2015-04-08 22:14:50 -07:00
Tobias Bosch 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
Tim Blasi 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
vsavkin 9c62b5867e benchmark(change_detection): added a new set of benchmarks measuring updating properties 2015-04-06 18:13:20 -07:00
Tobias Bosch 1d4d18d9db refactor(render): user render compiler 2015-04-03 23:41:00 -07:00
vsavkin abea92af59 refactor(change_detection): call onChange from the change detector 2015-04-02 21:22:42 -07:00
Tobias Bosch 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
Tobias Bosch 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
Tobias Bosch 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
Julie Ralph 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
Jeff Cross a55efbd8b8 feat(perf): add Angular2 implementation of largetable benchmark from AngularJS 1.x 2015-03-31 09:54:41 -07:00
Tobias Bosch 33bfc4c24a feat(bench press): replace microIterations with microMetrics 2015-03-27 16:16:35 -07:00
Julie Ralph 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
vsavkin 723e8fde93 feat(change_detection): added a directive lifecycle hook that is called after children are checked 2015-03-27 13:26:36 -07:00
Victor Berchet 65d759316b fix(PrivateComponentLoader): add the loader to the app injector
fixes #1063
2015-03-24 22:10:26 +01:00
Marc Laval 41b53e71e1 feat(selector): support , for multiple targets
Fixes #867
Closes #1019
2015-03-23 10:06:33 +01:00
Pawel Kozlowski 0fb9f3bd6c fix(ElementBinderBuilder): properly bind to web component properties
Fixes #776

Closes #1024
2015-03-22 14:14:36 +01:00
gdi2290 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
vsavkin a16954d3a5 refactor(view): separate context and locals 2015-03-17 14:25:57 -07:00
vsavkin 3273adade5 refactor(view): change view to pass all bindings to proto change detector at once 2015-03-13 14:03:57 -07:00
Victor Berchet 951a808e0e refactor(PropertySetter): use the global reflector 2015-03-12 19:49:34 +01:00
Rado Kirov f1593ebca5 feat(shadowdom): turn on ShadowDom Emulated Mode by default.
Closes: #526
2015-03-11 12:46:15 -07:00
Victor Berchet 370643539f refactor(EventHandler): have a single instance of event handlers per ProtoView 2015-03-10 15:26:06 +01:00
Victor Berchet b349c35678 feat(ElementInjector): implement @PropertySetter
relates to #621
2015-03-09 18:28:39 +01:00
Tobias Bosch 043b8c6d2e feat(bench press): add microIterations option 2015-03-03 14:41:03 -08:00
Victor Berchet 03793d0714 feat(CssProcessor): add support for CssTransformers
Closes #860
2015-03-03 11:24:08 -08:00
Victor Berchet 9982520a23 refactor(Compiler): make shadow DOM stragegy support more flexible 2015-03-03 11:24:08 -08:00
Tobias Bosch 8adac5332a fix(benchmarks): prepare publish to pub 2015-03-02 16:34:32 -08:00
Tobias Bosch 81a5ae8f6e fix(build): report and fail on errors
tree benchmark was broken and we didn’t know it…

also changes reporting to not include messages from `console.time()`, …
2015-03-02 16:34:32 -08:00
Tobias Bosch 7ddfbf8bea refactor(tests): move files from `angular2/e2e_test` to `angular2/src/test_lib`
The `e2e_test` folder in `angular2` never contained e2e tests but was
used to store utilities for writing e2e/perf tests. A better place for
them is `angular2/src/test_lib`.

Closes #855
2015-03-02 14:38:02 -08:00
vsavkin 21f24d19dd feat(change_detection): implement hydration/dehydration 2015-03-02 13:28:39 -08:00
Yegor Jbanov 757eae8ad3 feat(compiler): DOM adapters + html5lib implementation; misc fixes 2015-02-27 16:49:14 -08:00
Tobias Bosch 3b40052dc7 feat(build): enforce mobile layout during e2e tests
This is important as we run our benchmarks on
mobile devices as web driver tests fails if buttons
are not visible / overlaid by other content.
2015-02-27 11:11:32 -08:00
Victor Berchet 009e11a6be fix: Static DI init 2015-02-26 19:31:44 +01:00
Victor Berchet 929fc65493 refactor(template loading): add support for base URLs, css rewriting
fixes #654
2015-02-26 09:36:04 +01:00
Alex Eagle 56906db4d5 fix es6 compilation for Element.remove.
Use DOM facade to delete an Element since the remove method is only in Dart.
2015-02-25 15:56:08 -08:00
Alex Eagle 642e9a36b7 fix es6 compilation for Map.remove.
In dart, Map has a remove method,but in ES6 it is delete.
2015-02-25 15:44:29 -08:00
Victor Berchet 1376e49ea0 fix(Injector): fix dependencies in static injectors
Closes #784
2015-02-25 09:52:56 -08:00
Bertrand Laporte 94e203b9df feat(DirectiveParser): throw errors when expected directives are not present
closes #527
Closes #570
2015-02-24 20:57:21 -08:00
vsavkin 987a5fdf56 feat(change_detection): add support for pipes in the template 2015-02-20 17:16:57 -08:00
Victor Berchet 8a3d9050d9 feat(TreeBenchmark): use angular2 If directive 2015-02-20 20:53:44 +01:00
vsavkin 58ba700b14 feat(change_detection): change binding syntax to explicitly specify pipes 2015-02-20 10:59:46 -08:00
Julie Ralph 5af0ac258b tests(e2e): upgrade Protractor to 1.7.0 and remove special cases for shadow dom
With Protractor 1.7.0, which installs chromedriver 2.14, shadow DOM is supported.
2015-02-18 10:54:48 -08:00
Pawel Kozlowski 56f4e84d45 fix: flip attr / property bind in directives annotations
Fixes #648

Closes #684
2015-02-18 17:07:53 +01:00
Pawel Kozlowski 709c3ca6b5 refactor: use the ExceptionHandler service
Fixes #533
Closes #672
2015-02-18 13:48:28 +01:00
vsavkin 695b4ebbc7 feat(change_detection): add support for pipes 2015-02-17 17:12:58 -08:00
Tobias Bosch f6284f2a55 feat(benchpress): rewritten implementation
Limitations:
- cloud reporter is not yet supported any more
2015-02-16 11:43:27 -08:00
Yegor Jbanov 6d45153b67 fix(benchmarks): fix scrolling benchmark; add more tests 2015-02-13 17:35:19 -08:00
Victor Berchet e6c8bde808 feat(Compiler): Multiple template per component
fixes #596

- TemplateConfig becomes Template
- introduce a TemplateResolver to pick the cmp template,
- @Component and @Template are disociated
2015-02-13 18:07:08 +01:00
Victor Berchet 6d23d00057 refactor(ViewPort): @Template -> @Viewport, ViewPort -> ViewContainer
fixes #595
2015-02-13 17:48:27 +01:00
Tobias Bosch 013e1faf27 fix(build): support transpile to commonjs 2015-02-11 13:09:52 -08:00
Rado Kirov 7bf5ab8f43 feat(view_pool): adds a view pool of dehydrated views per protoview. 2015-02-09 22:17:38 -08:00
Tobias Bosch f39c6dc2c7 fix(setup): use upstream traceur with explicit patches
Also correct the transpile to ES6

Also support generics correctly

All patches are hooked in via `/tools/transpiler/index.js`
https://github.com/google/traceur-compiler/issues/1700
https://github.com/google/traceur-compiler/issues/1699
https://github.com/google/traceur-compiler/issues/1708
https://github.com/google/traceur-compiler/issues/1625
https://github.com/google/traceur-compiler/issues/1706
2015-02-06 17:04:08 -08:00
Marc Laval 6bfa48bc64 refactor(directives): Drop ng- prefix from all angular directives and rename NgRepeat to Foreach
fixes #532

Closes #539
2015-02-06 09:24:50 -08:00
Rado Kirov 7dba3a3e32 fix(benchmarks): fix infinite scroll benchmark. 2015-02-05 20:47:30 -08:00
Victor Berchet 746f85a621 feat(compiler, ShadowDom): adds TemplateLoader using XHR.
Also adds css shimming for emulated shadow dom and makes the shadowDom
strategy global to the application.
2015-02-05 19:47:29 -08:00
Yegor Jbanov fcbdf02767 feat(perf): port table scrolling benchmark to Angular 2 2015-02-05 18:33:57 -08:00
Yegor Jbanov 8250a8c1ca chore(packaging): update benchmark imports 2015-02-05 15:47:13 -08:00
Yegor Jbanov 3f228669d7 chore(packaging): update import for the new file structure 2015-02-05 15:47:12 -08:00
vsavkin ab9438ffdf fix e2e tests 2015-02-05 14:36:18 -08:00
vsavkin 3067601961 feat(change_detection): update change detection benchmark 2015-02-05 11:55:49 -08:00
Tobias Bosch 05ffdc9b44 refactor(build): explicitly mention `src` folder in imports
Export files are now directly under the module folder,
e.g. `core/core.js`. With this, an import like `core/core`
won’t need a path mapping (e.g. via `System.paths`) any more.
This adds the `src` folder to all other import statements as well.
2015-02-05 11:55:48 -08:00
vsavkin 850cf0fef4 feat(change_detection): implement a change detector generator 2015-01-27 16:18:15 -08:00
yjbanov 9682437aeb fix(tests): make Angular 2 compiler perf test use correct param name 2015-01-26 16:30:33 -08:00
Rado Kirov ec5cb3eb66 feat(package): introduce a catch-all package angular.
modules/angular has no implementation, but depends on all the pieces
that make angular - core, di, directives, etc. It is the package that
all client apps will depend on.
2015-01-23 10:31:24 -08:00
Rado Kirov fd34a56347 feat(events): adds support for injectable angular event emitters.
Event emitters can be injected into Directives. Event emitters take over
browser events with the same name. Emitted events do not bubble. Event
emitters can be injected even if there is no corresponding callback in
the template.

Use as follows:
@Decorator(...)
class MyDec(@EventEmitter('click') clickEmitter) {
 ...
 fireClick() {
  var eventData = {...};
  this._clickEmitter(eventData);
 }
}
2015-01-22 10:14:03 -08:00
vsavkin 9957c1338e feat(change_detection): reimplement change detection 2015-01-21 14:21:14 -08:00
Tobias Bosch 48125a8448 fix(perf): fix selector benchmark 2015-01-20 13:06:37 -08:00
Tobias Bosch 5c064c19e2 feat(perf): autoscale benchmarks depending on the browser. 2015-01-20 13:06:37 -08:00
Tobias Bosch d02c0accbb refactor(benchmarks): add cloud reporter, add params
- adds console and cloud reporter (via Google BigQuery).
- makes parameters of tests explicit and modifiable.
- removes `detect` and `ignoreGc` mode from benchpress
  as these can result in unstable numbers.
2015-01-15 09:09:05 -08:00
Rado Kirov bccc863567 fix(benchmark): remove duplicate line. 2015-01-13 21:09:28 -08:00
Misko Hevery f6ebaf74d3 perf: force GC on profiles 2015-01-13 13:06:17 -08:00
vsavkin abf03401df make dart analyzer happy 2015-01-13 11:14:05 -08:00
Misko Hevery bed4b52a63 perf: Change baseline benchmark to be more consistent with the Angular 2015-01-12 21:58:19 -08:00
Misko Hevery e4a4ec840e perf: run CPU profile on constant count so that time numbers can be compared between runs 2015-01-12 21:58:18 -08:00
Misko Hevery 6e9f48564f perf: add button for profiling tree benchmark 2015-01-12 15:16:24 -08:00
Tobias Bosch 14e91e209e feat(test): add e2e tests for benchmarks and examples
Disables running the actual benchmarks on every commit as well
to speed up the build.
2015-01-08 10:51:08 -08:00
Tobias Bosch 77aa3ed61b feat(benchpress): show more metrics and make the run mode configurable
Shows the metrics:
script, render, gcAmount, gcAmountInScript, gcTime

Run modes:
- detect: auto detect whether to force gc
- forceGc: forces a gc before every run and ignores no runs
- noGcInScript: ignore runs that have gc while a script was executing
- plain: does not force gc nor ignore runs

Closes #368
2015-01-07 16:37:52 -08:00
Tobias Bosch 82b1601a31 refactor(benchmarks): rename `timeBenchmark` into `benchmark` 2015-01-07 16:37:52 -08:00
Tobias Bosch fe2a09bc7f refactor(perf): e2e tests and benchpress should be written in es6 2015-01-06 15:32:49 -08:00
Misko Hevery 373fd7d04a chore: add dart2js flags to benchmark to enable trust-type-annotations 2015-01-06 15:17:12 -08:00
Tobias Bosch 6f303121c6 refactor(perf): introduce benchpress2
Major changes:
- make API more reusable
- format output nicely
- only force gc if needed

Regarding forcing gc:
Forcing gc can change script execution time.
We now don't force gc at first and ignore results where gc happens during script execution.
When we ignored too many results, we switch to forcing gc.

Closes #339
2015-01-05 17:49:50 -08:00
Tobias Bosch 3a80c4197d refactor(perf): move navigation into test files and rename `runSimpleBenchmark` 2014-12-29 16:58:31 -08:00
vsavkin 739f624cc8 refactor(change_detection): add change_detection library file 2014-12-29 15:20:42 -08:00
vsavkin da9d041f90 feat(view): add support for components that use shadow dom emulation 2014-12-29 11:42:34 -08:00
Tobias Bosch df4ac0dd33 refactor(perf): use webdriver to execute benchmarks
- use performance log of chromedriver / appium to get timeline data
  for calculating metrics for benchmarks
- change all benchmarks to be made of a standalone application
  and a protractor test that collectes timeline data
- fix and simplify benchmarks
- add dart2js to build
- remove benchpress

Closes #330
2014-12-23 22:22:55 -08:00
vsavkin d5fcac4d7a feat(compiler): pass compilation unit to the parser 2014-12-12 18:52:53 -08:00
Misko Hevery c25e9e7c5f fix: properly close the <tree> tag in benchmark 2014-12-11 14:23:02 -08:00
Misko Hevery 56b7ba4bce perf: improve baseline speed by 30%
Use node.firstChild and node.nextSibling instead 
of node.children or node.childNodes in the baseline
benchmark.
2014-12-11 14:05:58 -08:00
Tobias Bosch e7de5f8f37 feat(benchmarks): tree benchmark baseline 2014-12-08 15:54:04 -08:00
Victor Berchet c362f33fe4 style(Change Detection): rename WatchGroupDispatcher to ChangeDispatcher 2014-12-08 21:59:59 +01:00
Tobias Bosch 01fa90c11d feat(benchmarks): initial version of tree benchmark
Closes #269
2014-12-08 12:05:00 -08:00
Tobias Bosch 5793311421 fix(benchmarks): use explicit `main()` function and do not reexport
Otherwise `pub` would not pick it up e.g. for `dart2js`.
2014-12-08 12:00:48 -08:00
Tobias Bosch 9c2d411450 feat(compiler): allow recursive components 2014-12-08 12:00:43 -08:00
Tobias Bosch 8db77f2405 refactor(build): simplify and modularize
simplify:
- use same html file for dart and JS
- build benchmarks automatically when doing `gulp build`
- centralize configuration

modularize:
- move all build tasks into separate node.js modules under
  `tools/build`.

changes:
- the `build` folder is now the `dist` folder

Closes #284
2014-12-05 16:30:36 -08:00
vsavkin 65242fbd6d perf(change_detection): add baseline to change detection benchmark 2014-12-03 18:09:21 -08:00
vsavkin 6187b80ce6 benchmark(compiler): add a benchmark measuring view instantiation in AngularDart 1.0 2014-11-25 17:46:11 -08:00