Commit Graph

193 Commits

Author SHA1 Message Date
Victor Berchet eed83443b8 chore(tslint): update tslint to 4.x (#13603) 2016-12-27 14:55:58 -08:00
Chuck Jazdzewski e49c7fae22 refactor(compiler-cli): support extracting the mesage bundle without writing a file (#13580) 2016-12-19 15:28:55 -08:00
Victor Berchet 6b65fc1286 feat(compiler-cli): private i18n API for the CLI (#13536)
Also change the Extractor API to align with the Codegen API (internal APIs)
2016-12-19 11:56:10 -08:00
Chuck Jazdzewski 0e3981afc1 fix(compiler-cli): produce metadata for .d.ts files without metadata (#13526)
Fixes #13307
Fixes #13473
Fixes #13521
2016-12-16 15:33:47 -08:00
Bowen Ni f0e092515c refactor(compiler): don't print stack trace on template parse errors (#13390) 2016-12-15 13:07:12 -08:00
Tobias Bosch 33910ddfc9 refactor(compiler): store metadata of top level symbols also in summaries (#13289)
This allows a build using summaries to not need .metadata.json files at all
any more.

Part of #12787
2016-12-15 09:12:40 -08:00
Victor Berchet 6cefccb314 build: bump angular to 4.0.0-beta.0 & tsc-wrapped to 0.5.0 2016-12-14 16:42:44 -08:00
Victor Berchet fa9e21e83c fix(compiler): fix merge error in compiler_host 2016-12-14 15:36:49 -08:00
Chuck Jazdzewski b6078f5887 fix(compiler): update to metadata version 3 (#13464)
This change retracts support for metadata version 2.

The collector used to produce version 2 metadata was incomplete
and can cause the AOT compiler to fail to resolve symbols or
produce other spurious errors.

All libraries compiled and published with 2.3.0 ngc will need
to be recompiled and updated with this change.
2016-12-14 15:28:51 -08:00
Victor Berchet 40d8d9c3e3 fix(tsc-wrapped): generate metadata for exports without module specifier
fixes #13327
2016-12-14 14:33:04 -08:00
Victor Berchet ee2ac025ef fix(compiler): propagate exports when upgrading metadata to v2 2016-12-14 14:33:04 -08:00
Victor Berchet a0a05041ac refactor: format & lint 2016-12-13 17:44:52 -08:00
Hans 7256d0ede5 chore(internal API): introduce an internal API for ngtools. (#13415) 2016-12-13 17:35:06 -08:00
Hans d62d89319e fix(compiler): generated CSS files suffixed with ngstyle. (#13353)
Mirrors factories which ends in `ngfactory`.

Closes #13141.
2016-12-13 17:34:46 -08:00
Alex Rickabaugh 13b41bd631 chore(release): update version of tsc-wrapped to 0.4.2 2016-12-07 13:54:22 -08:00
Miško Hevery 16efb13dd1 fix: display framework version on bootstrapped component (#13252) 2016-12-06 16:21:07 -08:00
Chuck Jazdzewski 6cf7a1bf84 refactor(build): fix build location of compiler-cli esm module (#13212) 2016-12-02 15:19:52 -08:00
Chuck Jazdzewski 3ff6554cbc fix(language-service): update to use `CompilerHost` from compiler-cli (#13189) 2016-12-02 14:34:16 -08:00
Bowen Ni dfd8140084 Fix format 2016-12-02 14:31:55 -08:00
Bowen Ni 6ea3ab7e14 Fix exit code. Give a specific type. Add test cases. 2016-12-02 14:31:55 -08:00
Bowen Ni 9761db5ac2 refactor(compiler): change ngc error handling
Do not print stack trace for user errors
Print stack trace for compiler internal errors
2016-12-02 14:31:55 -08:00
Tobias Bosch 614a35d539 feat(compiler): read and write `.ngsummary.json` files
When compiling libraries, this feature extracts the minimal information
from the directives/pipes/modules of the library into `.ngsummary.json` files,
so that applications that use this library only need to be recompiled
if one of the summary files change, but not on every change
of the libraries (e.g. one of the templates).

Only works if individual codegen for libraries is enabled,
see the `generateCodeForLibraries: false` option.

Closes #12787
2016-12-01 14:49:52 -08:00
Chuck Jazdzewski 25a6da244c refactor(compiler-cli): refactor compiler host parameters (#13147) 2016-12-01 13:24:51 -08:00
Victor Savkin e628b66cca feat(build): record angular version in the dom (#13164) 2016-11-30 13:52:08 -08:00
Tobias Bosch 627282d2c8 fix(compiler): correctly evaluate references to static functions (#13133) 2016-11-29 12:02:50 -08:00
Tobias Bosch 966bcbad5a fix(compiler-cli): pin the version of `tsc-wrapped` 2016-11-28 15:18:56 -08:00
Tobias Bosch f5c8e0989d feat(core): properly support inheritance
## Inheritance Semantics:

Decorators:
1) list the decorators of the class and its parents in the ancestor first order
2) only use the last decorator of each kind (e.g. @Component / ...)

Constructor parameters:
If a class inherits from a parent class and does not declare
a constructor, it inherits the parent class constructor,
and with it the parameter metadata of that parent class.

Lifecycle hooks:
Follow the normal class inheritance model,
i.e. lifecycle hooks of parent classes will be called
even if the method is not overwritten in the child class.

## Example

E.g. the following is a valid use of inheritance and it will
also inherit all metadata:

```
@Directive({selector: 'someDir'})
class ParentDirective {
  constructor(someDep: SomeDep) {}

  ngOnInit() {}
}

class ChildDirective extends ParentDirective {}
```

Closes #11606
Closes #12892
2016-11-28 14:12:12 -08:00
Igor Minar 2a3ca7bfcf fix(compiler-cli): fix paths in source maps to be relative
The change looks bigger than it really is because I reordered the properties to match other tsconfigs we have.

The only real change is removal of sourceRoot property.

Fixes #13040
2016-11-23 15:48:24 -08:00
Bowen Ni 2c02d34c05 refactor(lint): Don't allow console.log
Enable tslint check for `console.log` as a follow-up to
https://github.com/angular/angular/issues/13018
2016-11-23 15:47:01 -08:00
Tobias Bosch 59d2b4c831 refactor(compiler): further minor fixes 2016-11-18 10:04:14 -08:00
Tobias Bosch 2a5bd2f345 refactor(compiler): Reintroduce `ReflectorHost` and move `Extractor` into `@angular/compiler` 2016-11-18 10:04:14 -08:00
Tobias Bosch 3c06a5dc25 refactor(comiler): various cleanups 2016-11-18 10:04:14 -08:00
Tobias Bosch adeea5d86a refactor(compiler): renames
- `NgHost` to `CompilerHost`
- `AotCompilerHost.resolveFileToImport` to `AotCompilerHost.fileNameToModuleName`
- `AotCompilerHoset.resolveImportToFile` to `AotCompilerHost.moduleNameToFileName`
2016-11-18 10:04:14 -08:00
Tobias Bosch dddbb1c1cb refactor(tsc-wrapped): collect all exported functions and classes and bump metadata version from 1 to 2
This is needed to resolve symbols without `.d.ts` files.
This bumps the version of the metadata from 1 to 2.
This adds logic into `ng_host.ts` to automatically upgrade
version 1 to version 2 metadata by adding the exported symbols
from the `.d.ts` file.
2016-11-18 10:04:14 -08:00
Tobias Bosch bccf0e69dc fix(compiler): fix versions of `@angular/tsc-wrapped` 2016-11-18 10:04:14 -08:00
Tobias Bosch b15039d228 refactor(compiler): move symbol extraction to `AotCompiler` 2016-11-18 10:04:14 -08:00
Tobias Bosch 2235048432 refactor(compiler): add `createAotCompiler` factory
Also adds 2 more methods to the `AotCompilerHost`:
- `loadResource`
- `resolveFileToImport`
2016-11-18 10:04:14 -08:00
Tobias Bosch 484119e59f refactor(compiler): remove `asset:` urls
These urls were just relicts from Dart.
2016-11-18 10:04:14 -08:00
Tobias Bosch 24099bdbd2 refactor(compiler): move `findDeclaration` into the `StaticReflector`
Previously, this was part of the `AotCompilerHost`.
The `AotCompilerHost` is now also greatly simplified.
2016-11-18 10:04:14 -08:00
Tobias Bosch 912ca44979 refactor(compiler): move `static_reflector` into `@angular/compiler` and rename files
- `src/runtime_compiler.ts` -> `src/jit/compiler.ts`
- `src/compiler.ts` -> `src/jit/compiler_factory.ts`
- `src/offline_compiler` -> `src/aot/compiler.ts`

Part of #12867
2016-11-18 10:04:14 -08:00
Chuck Jazdzewski 481c9b3258 refactor(compiler): allows synchronous retrieving of metadata (#12908)
Allows non-normalized metadata to be retrieved synchronously.

Related to #7482
2016-11-16 10:22:11 -08:00
Alex Eagle 75277cd94b fix(tsickle): support ctorParams in function closure (#12876)
See https://github.com/angular/tsickle/issues/261 for context.
2016-11-15 09:19:00 -08:00
Victor Berchet 2f14415836 fix(compiler): updates hash algo for xmb/xtb files 2016-11-14 12:55:48 -08:00
Victor Berchet 76e4911e8b fix(core): fix placeholders handling in i18n.
Prior to this commit, translations were built in the serializers. This
could not work as a single translation can be used for different source
messages having different placeholder content.

Serializers do not try to replace the placeholders any more.
Placeholders are replaced by the translation bundle and the source
message is given as parameter so that the content of the placeholders is
taken into account.

Also XMB ids are now independent of the expression which is replaced by
a placeholder in the extracted file.
fixes #12512
2016-11-14 12:55:48 -08:00
Victor Berchet 08c038ebd9 fix(core): xmb serializer uses decimal messaged IDs
fixes #12511
2016-11-14 12:55:48 -08:00
Joao Dias 77ee27c59e refactor(): use const and let instead of var 2016-11-12 16:40:17 -08:00
Tobias Bosch 79383ce150 refactor(compiler): never create CompileDirectiveMetadata with not loaded resources (#12788)
Part of #12787
2016-11-10 14:07:30 -08:00
Chuck Jazdzewski 7cab30f85d refactor(compiler-cli): add position data to static reflector errors (#12782) 2016-11-09 16:29:22 -08:00
Chuck Jazdzewski 4595a61aeb refactor(compiler-cli): refactor imports in codegen to enable rollup (#12781) 2016-11-09 15:17:24 -08:00
Matias Niemelä a0e9fde653 fix(animations): always normalize style properties and values during compilation (#12755)
Closes #11582
Closes #12481
Closes #12755
2016-11-08 15:45:30 -08:00