Commit Graph

127 Commits

Author SHA1 Message Date
Chuck Jazdzewski fcc1d17ccb fix(compiler-cli): avoid generating unnecessary factories 2017-02-21 20:48:55 -08:00
Jason Aden de795ea233 perf: distrubute smaller bundled code and include es2015 bundle
TypeScript compiler will now build to ES2015 code and modules. Babili is used to minify ES2015
code, providing an initial optimization that we couldn't previously get just from Uglify. Uses
Babel to convert ES2015 to UMD/ES5 code, and Uglify to minimize the output.
2017-02-21 20:48:55 -08:00
Igor Minar 1bdf7061b8 release: cut v4.0.0-beta.8 2017-02-18 15:00:33 -08:00
Chuck Jazdzewski 3b896709a9 feat(tsc-wrapped): add an option to `ngc` to bundle metadata (#14509)
Closes #14509
2017-02-16 08:15:30 -08:00
Miško Hevery c871af7b5a chore(release): cut the 4.0.0-beta.7 release 2017-02-09 09:36:10 -08:00
Alex Eagle ef32e6b0d0 fix: build and test fixes for TS 2.1 (#13294) 2017-02-08 11:32:40 -06:00
Alex Eagle 2ada3187a6 build: upgrade to TypeScript 2.1 (#13294) 2017-02-08 11:32:30 -06:00
Lucas Sloan 5bccff0d7a fix(tsc-wrapped): use tsickle's new source map composition feature (#14150)
Tsickle transforms typescript code, which can change the location of code.
This can cause issues such as runtime stack traces reporting that errors
were raised on the incorrect line in the orginal source.  This change replaces
the DecoratorDownlevelCompilerHost and the TsickleCompilerHost with tsickle's
TsickleCompilerHost, which automatically composes tsickle's source maps with
typescript's source maps, so that line numbers are correctly reported at
runtime.

PR Close #14150
2017-02-07 16:16:29 -06:00
Misko Hevery 1961332f26 chore(release): cut the 4.0.0-beta.6 release 2017-02-02 21:01:27 -08:00
Chuck Jazdzewski 1079b9381c feat(tsc-wrapped): record arity of generic classes (#14104) 2017-02-01 09:29:51 -06:00
Igor Minar da41a954b5 docs: branding fixes (#14132)
Angular 1.x -> AngularJS
Angular 1 -> AngularJS
Angular1 -> AngularJS
Angular 2+ -> Angular
Angular 2.0 -> Angular
Angular2 -> Angular

I have deliberately not touched any of the symbol names as that would cause big merge collisions with Tobias's work.

All the renames are in .md, .json, and inline comments and jsdocs.

PR Close #14132
2017-01-27 15:03:11 -06:00
Alex Rickabaugh 28bdc5af47 chore(release): cut the 4.0.0-beta.5 release 2017-01-25 15:38:19 -08:00
jolly-roger 0c7726dd74 feat(tsc-wrapped): Support of vinyl like config file was added (#13987)
This feature was implemented in order to provide easier way of use in gulp
2017-01-24 12:51:14 -08:00
Miško Hevery 4b854be29e chore(release): cut the 4.0.0-beta.4 release 2017-01-18 18:55:46 -06:00
Alex Eagle f816319e41 feature(tsc-wrapped): accept any tsc command line option (#13471) 2017-01-17 18:26:29 -06:00
Alex Eagle 5047d9780d feature(tsc-wrapped): re-write /index imports for closure compiler (#13471) 2017-01-17 18:26:19 -06:00
Igor Minar 1c85e99588 chore(tsc-wrapped): bump version number to 4.0.0-beta.2
This was done in order for us to be able to publish tsc-wrapped as @next tag on npm.

The next step is to change the build scripts to version and release @angular/tsc-wrapped
together with all the other packages. I'll create an issue/PR for this.
2017-01-05 17:53:10 -08:00
Chuck Jazdzewski 8063b0d9a2 fix(language-service): support TypeScript 2.1 (#13655)
@angular/language-service now supports using TypeScript 2.1 as the
the TypeScript host. TypeScript 2.1 is now also partially supported
in `ngc` but is not recommended as Tsickle does not yet support 2.1.
2017-01-05 11:34:42 -08:00
Victor Berchet eed83443b8 chore(tslint): update tslint to 4.x (#13603) 2016-12-27 14:55:58 -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
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
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
Chuck Jazdzewski dd0519abad fix(compiler): emit quoted object literal keys if the source is quoted
feat(tsc-wrapped): recored when to quote a object literal key

Collecting quoted literals is off by default as it introduces
a breaking change in the .metadata.json file. A follow-up commit
will address this.

Fixes #13249
Closes #13356
2016-12-14 12:58:41 -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
Victor Berchet 393c1007a8 fix(tsc-wrapped): have UserError display the actual error 2016-12-06 10:40:38 -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 bc69c74be0 fix(tsc-wrapped): still emit version 1 metadata to allow to use new components in old setups 2016-11-28 15:18:57 -08:00
Tobias Bosch 897555ca78 fix(tsc-wrapped): set correct version number 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
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 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
Alex Eagle 664a6273e1 feature(tsc-wrapped): add option for closure compiler JSDoc annotations 2016-11-18 09:37:40 -08:00
Chuck Jazdzewski c1a62e2154 feat(tools): allow disabling annotation lowering 2016-11-18 09:37:40 -08:00
Joao Dias 77ee27c59e refactor(): use const and let instead of var 2016-11-12 16:40:17 -08:00
Chuck Jazdzewski 69f87ca075 fix(tools): harden colletor against invalid asts (#12793) 2016-11-10 11:58:55 -08:00
Joao Dias a382d6dd20 style: add missing semicolons 2016-10-31 14:25:53 -07:00
Joao Dias 52bf188b8f style: add missing copyright headers 2016-10-31 14:25:53 -07:00
Igor Minar 99c0a7fae2 fix(tsc-wrapped): correct the tsickle dependency in package.json 2016-08-31 15:10:09 -07:00
Igor Minar 2b20db6c5a chore: update to typescript@2.0.2 - the currect 2.0 rc 2016-08-30 21:07:45 -07:00
Miško Hevery 979657989b fix(packages): use ES modules for primary build (#11120) 2016-08-30 18:07:40 -07:00
Marc Laval 3dd85cb7f1 test(tools): make the test suite to pass on Windows (#10926) 2016-08-26 15:36:04 -07:00
Chuck Jazdzewski fc2fe00d16 fix(compiler): allow tsc-wrapped to be compile with TypeScript 2.0 (#11086) 2016-08-25 17:28:20 -07:00
Alex Eagle c7a874dd2f feature(ngc): allow codegen to skip over .d.ts inputs (#11021) 2016-08-23 16:26:35 -07:00
Chuck Jazdzewski 39a2c39cef feat(compiler): Added "strictMetadataEmit" option to ngc (#10951)
ngc can now validate metadata before emitting to verify it doesn't
contain an error symbol that will result in a runtime error if
it is used by the StaticReflector.

To enable this add the section,

  "angularCompilerOptions": {
    "strictMetadataEmit": true
  }

to the top level of the tsconfig.json file passed to ngc.

Enabled metadata validation for packages that are intended to be
used statically.
2016-08-22 17:37:48 -07:00
Chuck Jazdzewski a7b76826a0 fix(compiler): Only emit metadata for exported enums (#10957)
Closes: #10955
2016-08-22 10:26:22 -07:00
Alex Eagle 9317056138 fix(ngc): Revert "fix(ngc): add an option to produce TS1.9-pathMapping imports (#10602)" (#10765)
This reverts commit beadf6167a.
2016-08-12 17:38:29 -07:00
Matias Niemelä 6580d67875 feat(i18n): pass translation config directly into ngc (#10622) 2016-08-12 14:45:36 -07:00
Alex Eagle beadf6167a fix(ngc): add an option to produce TS1.9-pathMapping imports (#10602)
This fixes a regression in #10486
2016-08-09 14:58:19 -07:00
Hans 01bca41168 fix: allow users to pass in absolute paths to ngc (#10572) 2016-08-09 09:36:37 -07:00
Igor Minar 94e1ab33ce chore(release): update package.jsons 2016-08-09 09:33:17 -07:00
Chuck Jazdzewski 9925aa89dc fix(compiler): Report references to non-exported symbols.
Includes fixes to places now reported as errors.

Part of #8310
2016-08-03 15:42:38 -07:00
Chuck Jazdzewski 82e7ecd611 fix(compiler): StaticReflect now resolves re-exported symbols (#10453)
Fixes: #10451
2016-08-02 11:45:14 -07:00
Chuck Jazdzewski 763ca60f5b feat(compiler): Support default parameters in static reflector (#10370)
Closes: #10369
2016-07-29 09:10:45 -07:00
Chuck Jazdzewski 20b03bad11 feat(compiler): Added support for conditional expressions. (#10366)
Expression evaluated by the static reflector can now supports
conditional expressions.

Closes: #10365
2016-07-28 17:32:29 -07:00
Alex Eagle 0a46f37444 fix(metadata): fix typechecking with typescript@next 2016-07-28 11:17:53 -07:00
Chuck Jazdzewski b58e9ea775 feat(compiler): Added support for references to static fields. (#10334)
Closes: #10332
2016-07-27 19:26:59 -07:00
Chuck Jazdzewski b449467940 feat(compiler): Allow calls to simple static methods (#10289)
Closes: #10266
2016-07-26 10:18:35 -07:00
Chuck Jazdzewski 4ef86891a3 fix(compiler): Ignore references to declared modules and unneeded types (#9776)
Fixes: #9670
2016-07-11 17:26:35 -07:00
Chuck Jazdzewski e6b24437a9 fix(compiler): Collector collects enum values. (#9967)
Fixes: #9928
2016-07-11 11:50:33 -07:00
Alex Eagle f463e09b9f fix(ngc): work with typescript@next
This is required due to breaking change in TS, see
https://github.com/Microsoft/TypeScript/pull/8841#issuecomment-227300348
2016-06-24 10:27:31 -07:00
Alex Eagle 54dbed4f48 fix(typings): don't test compiler-cli typings on TS 1.8 2016-06-23 10:57:03 -07:00
ScottSWu 8899b83927 chore(typescript): Enabled noFallthroughCasesInSwitch
Turned on the noFallthroughCasesInSwitch flag in tsconfig and fixed
a few cases where there were fallthroughs.
2016-06-22 16:08:55 -07:00
Chuck Jazdzewski 791153c93c fix(compiler): StaticReflector ignores unregistered decorators. (#9266)
Also modified static reflector to allow writing tests in using
the .ts and using the MetadataCollector.

Also made MetadataCollector be able to use SourceFiles that have
not been bound (that is, don't have the parent property set).

Fixes #9182
Fixes #9265
2016-06-17 13:11:00 -07:00
Alex Eagle 37b617dccf chore(tsickle): add @Annotation annotations
This lets users continue using runtime-sideeffect Decorators if they choose,
only down-leveling the marked ones to Annotations.

Also remove the "skipTemplateCodegen" option, which is no longer needed
since Angular compiles with tsc-wrapped rather than ngc. The former doesn't
include any codegen.
2016-06-16 12:29:46 -07:00
Victor Berchet 1eaa193c51 feat(compiler-cli): add a `debug` option to control the output
fixes #9208
2016-06-15 18:13:57 -07:00
Chuck Jazdzewski 5504ca1e38 feat(compiler): Added support for limited function calls in metadata. (#9125)
The collector now collects the body of functions that return an
expression as a symbolic 'function'. The static reflector supports
expanding these functions statically to allow provider macros.

Also added support for the array spread operator in both the
collector and the static reflector.
2016-06-13 15:56:51 -07:00
Alex Eagle bbed364e7b chore(tsc-wrapped): update to newest tsickle 2016-06-09 16:45:16 -07:00
Chuck Jazdzewski e178ee4ba0 fix(compiler): Added support for '* as m' style imports. (#9077)
Also includes fixes for broken test.
2016-06-09 13:23:29 -07:00
Alex Eagle d38aa5e25f chore(lint): sort imports in tools/ 2016-06-08 11:29:37 -07:00
Victor Berchet 9d6b98794e chore: fix build break by using tsickle@0.1.2 2016-06-08 09:34:53 -07:00
Chuck Jazdzewski cf3548a02f fix(compiler): Improved error reporting of the static reflector.
StaticReflector provides more context on errors reported by the
collector.

The metadata collector now records the line and character of the node that
caused it to report the error.

Includes other minor fixes to error reporting and a wording change.

Fixes #8978
Closes #9011
2016-06-07 08:38:32 -07:00
Chuck Jazdzewski 2d8f776e38 feat(build): Added a version stamp in .metadata.json files.
Also modified StaticReflector to handle multiple versions in a
single .metadata.json file.

Fixes #8974
Closes #8981
2016-06-03 10:40:49 -07:00
Chuck Jazdzewski 01dd7dde24 chore(tools): Remove use of TypeChecker from metadata collector.
The metadata collector was modified to look up references in the
import list instead of resolving the symbol using the TypeChecker
making the use of the TypeChecker vestigial. This change removes
all uses of the TypeChecker.

Modified the schema to be able to record global and local (non-module
specific references).

Added error messages to the schema and errors are recorded in
the metadata file allowing the static reflector to throw errors
if an unsupported construct is referenced by metadata.

Closes #8966
Fixes #8893
Fixes #8894
2016-06-02 13:39:15 -07:00
Alex Eagle 3331321f64 build(ngc): run integration test hermetically
This ensures we run in a clean directory, using our real distribution. It finds bugs like @internal
APIs needed to type-check in the offline compiler, as well as problems in package.json.

Also move tsc-wrapped under tools/@angular
2016-05-27 17:21:35 -07:00