73 Commits

Author SHA1 Message Date
vsavkin
f9c1de46b3 feat(compiler): added support for host actions 2015-05-11 13:28:19 -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
vsavkin
ce6a2ba836 refactor(view): moved the logic from ProtoView to ProtoViewFactory 2015-05-01 13:35:17 -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
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
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
f7f06c5ad4 chore: add more type annotations 2015-04-21 08:49:05 -07:00
Tobias Bosch
ada1e642c5 feat(view): add imperative views 2015-04-20 17:18:44 -07:00
Marc Laval
883e1c1541 feat(events): support preventdefault
Fixes #1039
Closes #1397
2015-04-20 15:20:52 +02:00
Tobias Bosch
f830cfca12 refactor(view): provide ViewContainers dynamically on any element 2015-04-17 12:35:59 -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
vsavkin
8c1adabe1c refactor(change_detection): renamed BindingPropagationConfig to ChangeDetectorRef 2015-04-15 12:58:58 -07:00
Tobias Bosch
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
Misko Hevery
e819e97f9a docs: expose more API to public, document QueryList 2015-04-15 05:10:26 +00:00
Yegor Jbanov
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
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
Marc Laval
b96e560c8d feat(events): add support for global events
Fixes #1098
Closes #1255
2015-04-13 22:35:36 +02:00
Peter Bacon Darwin
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
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
vsavkin
5408a9a72d cleanup(change_detection): removed dead code 2015-04-09 18:56:19 -07:00
vsavkin
3bdf669ddf cleanup(change_detection): removed dead code 2015-04-09 17:30:04 -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
Tobias Bosch
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
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
Misko Hevery
86dc3e5b07 docs: create public API surface
Closes #1181
2015-04-02 23:23:39 +00: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
vsavkin
b65b145122 refactor(view): refactored DirectiveMemento to expose properties in a consistent way 2015-03-31 18:26:58 -07:00
vsavkin
e92918bbfe feat(change_detector): split light dom and shadow dom children 2015-03-27 13:26:37 -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
vsavkin
8d85b839b6 feat(change_detection): pass binding propagation config to pipe registry 2015-03-26 16:57:04 -07:00
vsavkin
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
vsavkin
b69f3043e0 feat(compiler): added the DynamicComponent annotation 2015-03-17 15:23:58 -07:00
Peter Bacon Darwin
85799aa1a5 docs(*): add @publicModule tags
Initial set of tags to demonstrate the public docs filtering

Closes #988
2015-03-17 14:44:45 -07:00
vsavkin
a16954d3a5 refactor(view): separate context and locals 2015-03-17 14:25:57 -07:00
Yegor Jbanov
70c875ee14 refactor(shadow dom): do not use injectors nor directives
This prepares us for the app/render split in the compiler.
2015-03-16 16:58:38 -07:00
vsavkin
33bff17f33 refactor(tests): refactor tests to clarify the behavior of onChange 2015-03-13 18:09:31 -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
7322ed721e refactor: remove reference to the FIELD class 2015-03-13 18:59:51 +01:00
Victor Berchet
951a808e0e refactor(PropertySetter): use the global reflector 2015-03-12 19:49:34 +01:00
Rado Kirov
dd3e6271c2 chore(services): rename services.
Closes #711
2015-03-11 18:30:37 -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
bfa18ffd9b feat(Directives): add the ability to declaratively bind events
relates to #621
2015-03-10 08:14:24 +01:00
Victor Berchet
b349c35678 feat(ElementInjector): implement @PropertySetter
relates to #621
2015-03-09 18:28:39 +01:00