Commit Graph

198 Commits

Author SHA1 Message Date
Tim Blasi 3e9b532409 fix(dart/transform): Handle edge cases in ReflectionRemover
Handle some cases which would previously result in broken code.

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

Closes #6749
2016-02-01 15:17:44 -08:00
Tim Blasi 566d3ede04 test(dart/transform): Update unit tests to expect code in <file>.template.dart
Closes #6711
2016-02-01 21:21:38 +00:00
Tim Blasi 8c36aa866a feat(dart/transform): Generate all code into <file>.template.dart
Previously, we generated the code to initialize the reflector into the
<file>.ng_deps.dart and the compiled template and change detector code
into <file>.template.dart.

Update the transformer to generate all code into <file>.template.dart to
avoid the additional HTTP requests necessary when debugging
applications in Dartium.
2016-02-01 21:21:37 +00:00
vsavkin 42231f5719 feat(change_detection): allow all legal programs in the dev mode
BEFORE:

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

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

AFTER:

The checkNoChanges function compares only primitives types for equality, and deeply compares iterables. Other objects cannot cause checkNoChanges to throw. This means that the dev mode would never fail given a legal program, but may allow some illegal programs.
2016-01-26 21:01:19 -08:00
Tim Blasi 5f0baaac73 fix(dart/transform): Ensure template codegen is completed sync
Previously, template codegen was done asynchronously, which could result
in reflector state being overwritten and leading to compile errors.

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

Closes #6603
2016-01-26 04:18:11 +00:00
Tim Blasi 47a3b4d56b feat(dart/transform): Promote missing Directive warning to error
Closes #6519

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

Closes #6359

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

Closes #6517
2016-01-22 00:21:27 +00:00
vsavkin a593ffa6f3 fix(transformer): record HostBinding annotations applied to getters
Closes #6283
2016-01-21 01:02:56 +00:00
Jacob Richman 3e65d1458e fix(Dart): make some playground samples run with Dart Dev Compiler
Resolve all invalid field override errors, workaround current
reflection limitations in Dart Dev Compiler. todo, hello_world and
key_events samples now work with Dart Dev Compiler.

BREAKING CHANGE: remove TemplateRef.elementRef setter

Closes #6441
2016-01-21 00:41:42 +00:00
Tim Blasi 4d0c2ed1f6 test(dart/transform): Update dependencies & fix Dart tests
Widen version dependencies for `package:angular`, `package:code_transformers`,
and `package:observe`.

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

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

Closes #5922

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

Closes #5931
2016-01-13 22:24:42 +00:00
Yegor Jbanov ac85cbb28a fix(web_workers): support @AngularEntrypoint in web workers
And enable transformers on all playground apps

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

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

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

Before:

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

After:

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

setBaseTestProviders(TEST_BROWSER_PLATFORM_PROVIDERS,
                     TEST_BROWSER_APPLICATION_PROVIDERS);
```

Closes #5351, Closes #5585

Closes #5975
2016-01-13 02:11:06 +00:00
Tim Blasi 89f32f808f perf(dart/transform): Avoid unnecessary reads for files with no view
In the `TemplateCompiler` phase, avoid reading in the `.ng_meta.json` files of
imported libraries when we can determine that the file we are processing
does not define any `View`s.

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

Closes #5993
2016-01-05 08:56:46 -08:00
Julie Ralph e748adda2e refactor(testing): move common testing logic into test_injector
Before, all test framework wrappers (internal for dart and js/ts,
angular2_test for dart and testing for js/ts) had similar logic to
keep track of current global test injector and test provider list.
This change wraps that logic into one class managed by the test
injector.

Closes #5920
2015-12-18 08:23:29 +00:00
Alex Eagle 2aaef81b1b Revert "refactor(testing): move common testing logic into test_injector"
This reverts commit b88a6d983f.
2015-12-14 20:27:31 -08:00
Julie Ralph b88a6d983f refactor(testing): move common testing logic into test_injector
Before, all test framework wrappers (internal for dart and js/ts,
angular2_test for dart and testing for js/ts) had similar logic to
keep track of current global test injector and test provider list.
This change wraps that logic into one class managed by the test
injector.

Closes #5819
2015-12-15 01:14:48 +00:00
Victor Berchet da9b46a071 feat: camelCase Angular (kebab-case removal)
BREAKING CHANGE:

Angular is now fully camel case.

Before:

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

After

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

The full details are found in [angular2/docs/migration/kebab-case.md](https://github.com/angular/angular/blob/master/modules/angular2/docs/migration/kebab-case.md)
2015-12-09 19:59:40 -08:00
Julie Ralph cc8f1f9552 feat(testing): package angular2_testing to prepare it for publishing
Closes #5682
2015-12-09 03:01:21 +00:00
Victor Berchet d388c0ae62 feat(HtmlParser): enforce only void & foreign elts can be self closed
BREAKING CHANGE:

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

Closes #5591
2015-12-04 20:05:27 +00:00
vsavkin 4ea5b6e57f feat(router): implement router link DSL
Closes #5557

Closes #5562
2015-12-04 00:47:20 +00:00
Tobias Bosch 0614797d84 refactor(test_injector): Provide separate methods for creating test injector with and without runtime compiler.
BREAKING CHANGE:
`createTestInjector()` does not more include the runtime compiler. Use `createTestInjectorWithRuntimeCompiler()` instead.
Closes #5583
2015-12-03 22:50:14 +00:00
Kevin Moore 1edb17b8d0 chore(test): add config for `pub serve` testing.
Closes #5580

Closes #5580
2015-12-03 13:35:16 -08:00
Julie Ralph 93a1ec29e1 feat(test): add angular2_testing dart library
angular2_testing is a user-facing dart test library built on top of
the package:test dart unittest framework and runner. For usage,
see modules_dart/angular2_testing/README.md.

Closes #3289
2015-12-03 11:33:46 -08:00
Tim Blasi f77ca7b5e2 feat(dart/transform): Add quick_transformer
Add an implementation of the transformer which runs only the phases
which replace `Asset`s, rather than generate them.

Closes #5484
2015-12-01 23:23:28 +00:00
Tim Blasi 87449ab43c feature(dart/transform): Inject `initReflector` at @AngularEntrypoint
Detect the `@AngularEntrypoint` annotations on methods and/or
functions and add a call to `initReflector` there.

See #4865
2015-12-01 13:34:29 -08:00
Tim Blasi 2ada3ecad5 refactor(dart/transform): Remove `reflectPropertiesAsAttributes`
Remove deprecated `reflectPropertiesAsAttributes` as an option. It has
been renamed `reflect_properties_as_attributes`.

Closes #5108

Closes #5512
2015-12-01 17:53:39 +00:00
Jeff Cross 604c8bbad5 refactor(lifecycle): prefix lifecycle methods with "ng"
BREAKING CHANGE:
Previously, components that would implement lifecycle interfaces would include methods
like "onChanges" or "afterViewInit." Given that components were at risk of using such
names without realizing that Angular would call the methods at different points of
the component lifecycle. This change adds an "ng" prefix to all lifecycle hook methods,
far reducing the risk of an accidental name collision.

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

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

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

Closes #5036
2015-11-30 16:40:50 -08:00
vsavkin 7f3223bd2c fix(transformers): use BarbackMode instead of assertionEnabled to enable debug info generation
Closes #5245

Closes #5466
2015-11-30 20:08:19 +00:00
Tim Blasi 9ae171e0c8 refactor(dart/transform): Improve logging
Ensure that, where possible, log messages include an [AssetId].

Closes #5369
2015-11-24 18:41:24 +00:00
Tim Blasi a35a93d0da chore(analytics): Include all of angular2 in hello_world
Import dependencies from `angular2/angular2.dart` in `hello_world` to
ensure that any size regressions are caught by our checks.

Update to avoid regressions like #5419.

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

See #5312, #5314
2015-11-23 20:10:04 +00:00
Yegor Jbanov a43ed79ee7 feat(parser): allows users install custom AST transformers
Closes #5382
2015-11-20 19:46:02 +00:00
Olivier Chafik 4e12b0831e Make Angular2 transformers lazy in debug mode when option `lazy_transformers: true` is set.
This make apps to load quicker with pub serve (only builds what is
needed).
Note that lazy transformers seem to make pub build slower, so we wrap
transformers to force them to be eager in release mode.

Closes #5372
2015-11-19 20:58:12 +00:00
vsavkin 5ba9ced1ab cleanup(core): stop reexporting angular2/common from angular2/core
All common directives, forms, and pipes have been moved out of angular2/core,
but we kept reexporting them to make transition easier.

This commit removes the reexports.

BREAKING CHANGE

Before

import {NgIf} from 'angular2/core';

After

import {NgIf} from 'angular2/common';

Closes #5362
2015-11-19 19:54:27 +00:00
Tim Blasi 0db02523d3 fix(dart/transform): Omit bootstrap.dart in ng_deps
Special-case to avoid copying the bootstrap{,_static}.dart
import when creating `.ng_deps.dart` files.

Closes #5315

Closes #5348
2015-11-18 22:46:29 +00:00
vsavkin 2c8fcec432 refactor(core): move render/dom from core
Currently, core depends on DomRenderer, which depends on the browser.
This means that if you depend on angular2/core, you will always
pull in the browser dom adapter and the browser render, regardless
if you need them or not.

This PR moves the browser dom adapter and the browser renderer out of core.

BREAKING CHANGE

If you import browser adapter or dom renderer directly (not via angular2/core),
you will have to change the import path.
2015-11-17 15:53:55 -08:00
Tim Blasi a31e2f5f47 fix(dart/transform): Consider of line numbers in inliner_for_test
Ensure that line numbers aren't changed by inliner_for_test.

Fixes #5281

Closes #5285
2015-11-17 01:51:58 +00:00
Ted Sander d9f362a713 fix(transformers): Fix @Input/@Output annotations with setters/getters
Fix @Input annotations to work with setter methods in dart, and fix @Output
annotations to work with getter methods in Dart when using transformers.

Closes #5251

Closes #5259
2015-11-13 02:42:38 +00:00
Tim Blasi f80321fd26 feat(dart/transform): Bail early for files with no deferred libraries
In `DeferredRewriter` if we can determine that there are no `deferred`
libraries imported, bail early to avoid parsing the entire file.
2015-11-12 11:27:46 -08:00
Tim Blasi 8f91ff84c7 feat(dart/transform): Do not re-process generated files
In the `DeferredRewriter` phase, do not process files which were
generated by the transformer, since these will never need to be
rewritten.
2015-11-12 11:23:19 -08:00
vsavkin e27665c368 feat(core): renam AMBIENT_DIRECTIVES and AMBIENT_PIPES into PLATFORM_DIRECTIVES and PLATFORM_PIPES
After discussing it we decided that PLATFORM_ is a better prefix for directives available everywhere in the app.

BREAKING CHANGE

AMBIENT_DIRECTIVES -> PLATFORM_DIRECTIVES
AMBIENT_PIPES -> PLATFORM_PIPES

Closes #5201
2015-11-10 01:45:25 +00:00
Tobias Bosch e667ad3e6b refactor(compiler): make all commands const
Closes #5135
2015-11-09 10:59:08 -08:00
vsavkin 79472b77ca refactor(core): move facades out of core
This is part of ongoing work to make core platform-independent.

BREAKING CHANGE

All private exports from 'angular2/src/core/facade/{lang,collection,exception_handler}' should be replaced with 'angular2/src/facade/{lang,collection,exception_handler}'.
2015-11-07 01:36:06 +00:00
Tim Blasi 63e853dcd7 feat(change_detect): Guard `checkNoChanges` behind `assertionsEnabled`
Always generate `checkNoChanges` tests, but guard them behind
`assertionsEnabled` tests.

Closes #4560
2015-11-06 11:59:03 -08:00
vsavkin 695923dcd6 refactor(core): move directives, pipes, and forms into common
BREAKING CHANGE

All private exports from 'angular2/src/core/{directives,pipes,forms}' should be replaced with 'angular2/src/common/{directives,pipes,formis}'

Closes #5153
2015-11-05 23:00:32 +00:00
vsavkin 6edd964a83 chore(core): move compiler out of core
BREAKING CHANGE

All imports from 'angular2/core/compiler' should be changed to 'angular2/compiler'.
2015-11-05 14:44:52 -08:00
Tim Blasi a8f45a6b43 SQUASH ME! Unit test updates.
Kept separate since these are mostly mechanical changes.
2015-11-05 12:19:27 -08:00
Tim Blasi 9d0b61bad5 feat(dart/transform): Simplify dependency imports
Store dependency import information in a dedicated list in `NgDepsModel`
rather than as a boolean field on `ImportModel`. An `ImportModel` should
not "care" whether it is a .ng_deps.dart import or not -- this
information belongs in `NgDepsModel`.

This simplifies some of the logic around how `NgDepsModel` imports are
processed and eventually output.
2015-11-05 12:19:27 -08:00
Victor Berchet 7e92d2e6b7 feat(ChangeDetector): Add support for short-circuiting 2015-11-05 19:28:30 +00:00
Tim Blasi 5d9b1e90dc refactor(dart/transform): Separate log & zone code
- Move zone-related code out of logger.dart and into zone.dart.
- Rename `logger` => `log`.
- Add the ability to specify a zone-local `TemplateCompiler`.
2015-11-05 10:24:36 -08:00
vsavkin 4909feddde feat(core): add support for ambient directives to dart transformers
Closes #5129
2015-11-05 17:26:57 +00:00
Tim Blasi c9a3ba0f48 refactor(dart/transform): Remove generate_change_detectors
The template compiler update removed the option to run the transformer
without generating change detectors and deprecated the
`generate_change_detectors` transformer parameter.

Now that it has been deprecated for several weeks, remove it from the
transformer code.

Forward `reflectPropertiesAsAttributes` => `reflect_properties_as_attributes`
and add a deprecation warning to `reflectPropertiesAsAttributes`.

Closes #4433
2015-11-03 16:40:08 -08:00
vsavkin 16bc238f10 feat(core): make transformers handle @Input/@Output/@HostBinding/@HostListener
Closes #5080
2015-11-03 00:46:54 +00:00
Alex Rickabaugh d1b54d6807 fix(core): Add an error state for ChangeDetectors that is set when bindings or lifecycle events throw exceptions and prevents further detection.
- Changes the `alreadyChecked` flag of AbstractChangeDetector to a new `state` flag.
- Changes all checks of alreadyChecked to check that the state is NeverChecked.
- Set state to Errored if an error is thrown during detection.
- Skip change detection for a detector and its children when the state is Errored.
- Add a test to validate this fixes issue #4323.

Closes #4953
2015-10-29 23:11:02 +00:00
Tim Blasi a87c5d989c fix(dart/transform): Gracefully handle empty .ng_meta.json files
Fix the `template_compiler` step to gracefully handle null & empty
.ng_meta.json files.
2015-10-29 11:29:04 -07:00
Tim Blasi 6b40293c0a refactor(dart/transform): Run `ReflectionRemover` after codegen phases
Move the `ReflectionRemover` phase to execute after the codegen phases.
2015-10-29 09:53:09 -07:00
Tim Blasi bdd031aecc feat(dart/transform): Match runtime semantics for template values
Match [ViewResolver][]'s semantics for reading template and style values
from `@Component` and `@View` annotations.

We now warn if template and/or style values appear on an `@Component`
annotation and a `@View` annotation is present.

[ViewResolver]: 7c6130c2c5/modules/angular2/src/core/linker/view_resolver.ts
2015-10-28 08:18:56 -07:00
Tim Blasi 798be2776d refactor(dart/transform): Rename `dumbEval` to `naiveEval` 2015-10-28 08:18:56 -07:00
Tim Blasi d69bd021ee refactor(dart/transform): Fix potential import collision
Previously, importing a library twice using different prefixes could
cause the template compiler step to incorrect omit `Directive`
dependencies provided by that library.
2015-10-28 08:18:56 -07:00
Tim Blasi 26044026c9 feat(dart/transform): Parse `directives` dependencies from the Dart ast
Previously, we parsed dependencies out of a the stringified value of
`directives`, which is brittle and error-prone.

Move this parsing into `DirectiveProcessor` where we have the full Dart
ast to help.
2015-10-28 08:18:56 -07:00
Tim Blasi ca5e31bc77 feat(dart/transform): Avoid overwriting assets
For easier debugging, avoid overwriting assets in Dart transform steps
where possible.
2015-10-28 08:18:56 -07:00
Tim Blasi e9c4c61986 refactor(dart/transform): Have DeferredRewriter run in parallel
Previously, `DeferredRewriter` checked for the existence of
`.ng_deps.dart` files to determine which deferred libraries it needed to
rewrite, requiring that those assets exist at the time it was run.

Update to check for `.ng_meta.json` files instead, which exist after the
`DirectiveProcessor` phase. This allows the `DeferredRewriter` (which
only processes *.dart files) to run in
parallel with `TemplateComplier` (which only processes *.ng_meta.json
files) and `StylesheetCompiler` (which only processes *.css files).

Have DeferredRewriter to check existence of .ng_meta.json assets rather than .ng_deps.dart assets
2015-10-28 08:18:56 -07:00
Tim Blasi 563a76304a refactor(dart/transform): Delete unused bind_generator
All getters & setters generated by `bind_generator` are now generated in
the `directive_processor` or `template_compiler` stage.
2015-10-28 08:18:56 -07:00
Tim Blasi c91fc49d01 test(dart/transform): Update tests for new codegen
Update unit tests for `bind_generator` responsibility move.
2015-10-28 08:18:56 -07:00
Tim Blasi a18358d484 refactor(dart/transform): Fold bind_generator into other phases
Update `DirectiveProcessor` and `TemplateCompiler` to generate the
getters, setters, and methods currently generated in `BindGenerator`.

Update `DirectiveMetadataLinker` to output `.ng_meta.json` files instead
of `.ng_deps.dart` files, avoiding full codegen until the last phase.

This allows us to dedupe codegen logic and remove an additional phase
from the transformer.
2015-10-28 08:18:56 -07:00
Tim Blasi d68955ac6d feat(dart/transform): Add getters, setters, methods to NgDepsModel
Add `List<String>` `getters`, `setters`, and `methods`, which will be
used to generate code that registers those closures with the reflection
system.
2015-10-28 08:18:56 -07:00
Tim Blasi b318945680 refactor(dart/transform): Create common dumbEval function 2015-10-28 08:18:56 -07:00
Tim Blasi 150d3686c3 refactor(dart/transform): Remove unused test files
Remove directive_metadata_linker test files which are no longer used as
of 820b30c181.
2015-10-28 08:18:56 -07:00
Victor Berchet 1316c3e391 fix(ChangeDetector): support for NaN
Closes #4853
2015-10-28 00:44:06 +00:00
Tim Blasi 27ead8c883 feat(dart/transform): Do not declare outputs
Experience shows that for large projects, declaring transformer outputs
can cause ~10x slowdown. Remove output declarations to avoid this.
2015-10-21 14:20:03 -07:00
Tim Blasi 1caccc410a refactor(dart/transform): Simplify logging class
Use `TransformLogger` for the transformer rather than `BuildLogger`,
which has additional funtionality (and complexity) that is unused.
2015-10-21 12:52:28 -07:00
Tim Blasi fd0ba37734 refactor(dart): Format Dart code
Use the dart formatter to clean up all pure Dart code.

Closes #4832
2015-10-20 17:39:37 +00:00
Tim Blasi 6be95ae88a fix(dart/transform): Fix issue with deferred in .ng_deps
Fix an issue in the linking step which prevents libraries from being
imported as `deferred`.
2015-10-19 13:50:47 -07:00
Tim Blasi cf9d4662c9 refactor(dart/transform): Update protobuf dependencies
Update
- libprotoc to 2.6.1
- dart-protoc-plugin to 0.5.0
- pkg/protobuf 0.5.0

Closes #4681
2015-10-19 10:32:17 -07:00
kutyel e4e74ae65c chore: rename modules/examples to modules/playground
The directory contains code authored in a style that makes it transpilable to dart. As such, these are not idiomatic examples of Angular 2 usage.

The main purpose of this directory is to enable experimentation with Angular within the angular/angular repository.

Closes #4342

Closes #4639
2015-10-18 11:48:43 +00:00
Tobias Bosch 6436f96fd1 fix(transformers): show nice error message when an invalid uri is found
Closes #4731
2015-10-14 10:20:29 -07:00
Tim Blasi efddc9069c fix(dart/transform): Parse directives agnostic of annotation order
Now that we can specify `directives` in either `@View` or `@Component`,
we will try to parse from both.

Previously, we would trash any `directives` parsed in the first
annotation upon encountering the second annotation. This ensures that we
maintain that list of `directives` regardless of annotation ordering.
2015-10-14 10:17:14 -07:00
Tim Blasi 5a505975bf fix(dart/transform): Handle empty .ng_deps.dart files
Handle the situation where a `.dart` file generates a `.ng_meta.json`
file but does not register any reflective information.

An example of this would be a file that defines a const list that looks
like a directive alias. The transformer keeps track of this, and creates
a `.ng_meta.json` file but never creates a `.ng_deps.dart` file, which
can result in other files being linked to it and it not defining an
`initReflector` method.
2015-10-14 01:34:55 +00:00
Tim Blasi 115ad4d062 refactor(dart/transform): Allow inlining only using `inline_views`
Remove the `inliner_for_test` standalone transformer and make inlining
available via the `inline_views` parameter to the main angular2
transformer.
2015-10-13 18:06:59 -07:00
Sam Rawlins eb2c15786e refactor: Update multiple ctors warning with a space and grammar
Add a space before the word "using" and make spelling of
constructor/ctor consistent

Closes #3923
2015-10-13 02:35:43 +00:00
Yegor Jbanov 04b3dee667 fix(css): when compiling CSS, leave absolute imports alone
Closes #4592
2015-10-08 16:39:32 +00:00
Tim Blasi 811d4c03bd fix(dart/transform): Run DeferredRewriter in the correct phase
`DeferredRewriter` depends on the presence of `.ng_deps.dart` files,
which do not yet exist in the phase where it was previously run.

Update the transformer phases to fix this and add an integration test to
prevent regression.
2015-10-07 17:10:23 -07:00
Tim Blasi fcc6f2c561 refactor(dart/transform): Generate `inputs` setters in `TemplateCompiler` step
Move generation of setters for `inputs` from `BindGenerator` into
`TemplateCompiler`.
2015-10-07 12:29:35 -07:00
Tim Blasi c94f239536 fix(dart/transform): Write correct ng_deps without deferred imports
Previously, the presence of a `deferred` import would cause us to output
incomplete `.ng_deps.dart` code.

Closes #4587
2015-10-07 11:21:59 -07:00
Tim Blasi 07572652ff feat(dart/transform): Track timing of transform tasks 2015-10-07 17:44:48 +00:00
vsavkin dea6a4593b cleanup(core): making @View optional
Closes #4566
2015-10-07 02:16:42 +00:00
vsavkin a2e7ae568e feat(transformers): update transformers to handle components without @View 2015-10-07 02:16:42 +00:00
Tim Blasi ba6e0e11fa fix(dart/transform): Sanitize generated library names
Sanitize generated library names by removing unsafe characters and
ensuring that Dart keywords do not appear as library segments.
2015-10-06 16:18:58 -07:00
Tim Blasi 4ac29621f4 refactor(dart/transform): Compose NgDepsModel & NgMeta phases
Link `NgDeps` & `NgMeta` data in the same phase to avoid unnecessary asset
creation & reading.

Remove `NgMeta#exports` and instead use `NgDeps#exports` to link `NgMeta` files
in `ng_meta_linker.dart`.
2015-10-06 16:18:58 -07:00
Tim Blasi 349416ea53 test(dart/transform): e2e test inliner_for_test
Add an e2e test for the `inliner_for_test` transformer.
2015-10-05 20:18:15 +00:00
Tobias Bosch 0b3e4fa090 refactor(core): move `ViewEncapsulation` and `ViewType` to the right places
Closes #4526
2015-10-05 11:22:21 -07:00
Tim Blasi decdbea7d7 fix(dart/transformer): Correctly handle const object annotations
Previously, annotations which were const objects (as opposed to const
instance creation expressions) were incorrectly output as instance
creation expressions.

Before:
```
const override() // A const instance creation expression
```

After
```
override // A const instance
```

Closes #4481
2015-10-03 00:27:52 +00:00
vsavkin 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
Tim Blasi 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
Tobias Bosch 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
Tobias Bosch e8e57cdd73 refactor(core): adjust imports for rename angular2/src/compiler -> angular2/src/core/compiler 2015-10-02 08:59:43 -07:00
Tobias Bosch 6248a5e846 refactor(core): move core/compiler to core/linker, adjust imports 2015-10-02 08:42:12 -07:00