659 Commits

Author SHA1 Message Date
Victor Berchet
798947efa4 feat(compiler): adds support for quoted object keys in the parser 2017-07-07 16:17:33 -07:00
Victor Berchet
7ae8ad6aab fix(compiler): fix types 2017-07-07 16:17:33 -07:00
Victor Berchet
9c3386b1b7 fix(compiler): remove i18n markup even if no translations (#17999)
Fixes #11042
2017-07-07 16:16:49 -07:00
Victor Berchet
dd7c1134e3 feat(compiler): update the schema by extracting from latest chrome (#17858)
adds:
- the slot element,
- the slot attribute on [Element],
- a few other attributes.
2017-07-06 12:11:34 -07:00
Victor Berchet
448d9f9f46 test(compiler): add a test for components not part of any NgModule 2017-06-26 13:24:36 -07:00
Chuck Jazdzewski
3097083277 feat(compiler-cli): new compiler api and command-line using TypeScript transformers 2017-06-23 16:18:44 -07:00
Victor Berchet
b754e600e3 feat(compiler): add support ::ng-deep
- /deep/ is deprecated and being removed from Chrome
- >>> is semantically invalid in a stylesheet
- sass will no longer support either in any version of sass

-> use ::ng-deep in emulated shadow DOM mode

Because the deep combinator is deprecated in the CSS spec,
`/deep/`, `>>>` and `::ng-deep` are also deprecated in emulated shadow DOM mode
and will be removed in the future.

see https://www.chromestatus.com/features/6750456638341120
2017-06-23 14:43:42 -07:00
Chuck Jazdzewski
81734cf7b6 refactor(compiler): add tracking comment for self-import detection
The underlying cause of #17386 needs to be investigated and as a
simple string compare should have been valid.
2017-06-23 14:43:24 -07:00
Chuck Jazdzewski
4352dd27c4 fix(compiler): avoid emitting self importing factories
Fixes: #17389
2017-06-21 16:19:43 -07:00
Trotyl Yu
9315ab88d7 test(compiler): fix typo "mamespace" 2017-06-16 11:17:15 -07:00
olegdunkan
93d1b4ed9d refactor(compiler): remove duplicate code 2017-06-13 13:37:33 -07:00
Tobias Bosch
90b0713e32 refactor(compiler): don’t write summaries for jit by default
The default is false externally but true internally at Google.
2017-06-09 15:58:53 -07:00
Georgios Kalpakas
022835bab2 ci: update Chromium to 464641 (Chrome v59) 2017-06-08 09:36:35 -07:00
Alex Eagle
b00b80a45b feat(compiler-cli): introduce synchronous codegen API 2017-06-06 14:12:02 -07:00
Chuck Jazdzewski
230255f887 feat(compiler-cli): produce template diagnostics error messages (#17125)
Refactoring the compiler to use transformers moves the code generation
after type-checking which suppresses the errors TypeScript would
generate in the user code.

`TypeChecker` currently produces the same factory code that was
generated prior the switch to transfomers, getting back the same
diagnostics as before. The refactoring will allow the code to
diverge from the factory code and allow better diagnostic error
messages than was previously possible by type-checking the factories.
2017-06-01 10:13:50 -07:00
Andrew Mitchell
8ffa483bb6 fix(compiler): enableLegacyTemplate should not be ignored (#17051)
Fixes #15555
2017-05-30 13:19:42 -07:00
Chuck Jazdzewski
18bf77204e feat(compiler): emit typescript nodes from an output ast (#16823) 2017-05-30 10:43:13 -07:00
Tobias Bosch
eba59aaf87 refactor(compiler): add ability to produce stub .ngfactory / .ngsummary files (#16963)
These files are needed so that:
- user code can compile even without real codegen
- as tsc transformers cannot create but only change existing files
  in the transformation pipeline.
2017-05-23 14:40:50 -06:00
Jason Aden
fa809ec8cf build: import tslib rather than output TS helpers (#16901) 2017-05-23 14:01:39 -06:00
Chuck Jazdzewski
1651a8f189 fix(tsc-wrapped): ignore |null and |undefined when collecting types (#16222) 2017-05-23 11:53:38 -06:00
Chuck Jazdzewski
27761b4500 fix(compiler): do not report type errors for arguments with @Inject (#16222)
Fixes #15424
2017-05-23 11:53:38 -06:00
Tobias Bosch
a80ac0a8d3 fix(core): make decorators closure safe (#16905)
This is required as e.g. `token` from `@Inject` is
accessed in string form via makeParamDecorator
but as a property in the `ReflectiveInjector`.

Closes #16889 as this is a more general fix.
2017-05-23 11:52:40 -06:00
Tobias Bosch
5af143e8e4 refactor(compiler): allow sync AOT compilation (#16832).
AOT compilation can be executed synchronously now,
if the `ReosurceLoader` returns a string directly
(and no `Promise`).
2017-05-23 10:41:23 -06:00
Tobias Bosch
50abca4583 refactor(compiler): don’t rely on global reflector (#16832)
Using the global reflector made it impossible
to compile multiple programs at the same time.
2017-05-23 10:41:23 -06:00
Tobias Bosch
de8d7c65f2 refactor(compiler): emit OutputAst and not sources (#16832)
This is in preparation for creating typescript nodes
directly from `OutputAst` nodes.
2017-05-23 10:41:23 -06:00
Tobias Bosch
6123b9c0c6 refactor(compiler): make OutputAst contain the moduleName, not the filePath (#16832).
The goal of this change is to simplify the emitters,
as we will soon create a new one to emit TypeScript nodes directly.
2017-05-23 10:41:23 -06:00
Olivier Combe
08dfe91b95 feat(compiler): add location note to extracted xliff2 files (#16791)
Add source location as a note tag as `<note category="location">path/to/file.ts:start_line[,end_line]</note>`.
`[,end_line]` part is optional and specified only if the end line is different from the start line.

Fixes  #16531
2017-05-22 12:20:45 -06:00
Chuck Jazdzewski
9a7f5d580f ci: update build to use TypeScript 2.3.2 (#16707) 2017-05-16 13:29:38 -07:00
Tobias Bosch
5afaa39e68 refactor(compiler): produce more dense generated code (#16666)
This changes the formatting to be less verbose but still
tries to be readable.
2017-05-11 10:28:48 -07:00
Tobias Bosch
ce1d7c4a6e refactor: use view engine also for NgModuleFactorys (#16658)
* refactor(core): provide error message in stack for reflective DI

Fixes #16355

* fix(compiler): make AOT work with `noUnusedParameters`

Fixes #15532

* refactor: use view engine also for `NgModuleFactory`s

This is a prerequisite for being able to mock providers
in AOTed code later on.
2017-05-11 10:26:02 -07:00
Chuck Jazdzewski
b9521b568f feat(compiler): support a non-null postfix assert (#16672)
Template expressions can now use a post-fix `!` operator
that asserts the target of the operator is not null. This is
similar to the TypeScript non-null assert operator. Expressions
generated in factories will be generated with the non-null assert
operator.

Closes: #10855
2017-05-11 10:15:54 -07:00
Chuck Jazdzewski
bb0902c592 refactor(compiler-cli): move the expression expression type checker (#16562)
The expression type checker moved from the language service
to the compiler-cli in preparation to using it to check
template expressions.
2017-05-09 16:16:50 -07:00
Martin Probst
e0a8376237 fix(compiler): avoid a ...null spread in extraction (#16547)
This code only runs in ES5 mode in the test suite, so this is difficult to test.
However `updateFromTemplate` is being called with a spread operator, as
`...updateFromTemplate(...)`. The spread operator should fail on `null` values.
This change avoids the problem by always returning a (possibly empty) array.

PR Close #16547
2017-05-08 17:49:43 -05:00
Tobias Bosch
547c363473 feat: add .ngsummary.ts files to support AOT unit tests
Design doc: https://docs.google.com/document/d/1VmTkz0EbEVSWfEEWEvQ5sXyQXSCvtMOw4t7pKU-jOwc/edit?usp=sharing
2017-05-05 13:23:53 -04:00
Tobias Bosch
c946a929b7 refactor(compiler): simplify AOT tests 2017-05-02 15:51:54 -07:00
Olivier Combe
6e2abcd5fc feat(compiler-cli): add param to set MissingTranslationStrategy on ngc (#15987)
This commit adds a new parameter to ngc named `missingTranslation`  to set the MissingTranslationStrategy for AoT, it takes the value `error`, `warning` or `ignore`.

Fixes #15808

PR Close #15987
2017-04-27 17:38:59 -05:00
David
745731e1a3 fix(compiler): make I18NHtmlParser provider AoT-compliant (#15980)
PR Close #15980
2017-04-19 22:46:40 -05:00
Miško Hevery
5293794316 fix: turn on nullability in the code base. 2017-04-18 12:07:33 -07:00
Chuck Jazdzewski
38a7e0d1c7 fix(compiler): ignore calls to unresolved symbols in metadata
This only shows up in the language service. Calls to symbols
that are not resolve resulted in null instead of being resolved
causing the language service to see exceptions when the null
was not expected such as in the animations array.

Fixes #15969
2017-04-17 14:36:08 -07:00
Randall Koutnik
a77b126d72 fix(compiler): Inform user where Quoted error was thrown 2017-04-17 10:19:09 -07:00
Victor Berchet
5b141fbf27 fix(compiler): support <ng-container> whatever the namespace
fixes #14257
2017-04-17 10:14:15 -07:00
Tobias Bosch
86396a43e9 Revert "fix(compiler): ignore calls to unresolved symbols in metadata (#15970)"
This reverts commit ce47d33cd94a242f23b47f287e975c80506c9a05.
2017-04-14 11:20:12 -07:00
Victor Berchet
bd704c90dd fix(compiler): fix build error in xliff2 2017-04-14 11:20:12 -07:00
Olivier Combe
4054055d0d feat(compiler): add source files to xmb/xliff translations (#14705)
Fixes #14190
2017-04-14 09:06:25 -07:00
Panuruj Khambanonda (PK)
09c4cb2540 feat(compiler): Implement i18n XLIFF 2.0 serializer (#14185)
- Ensure that the result passes OASIS XLIFF 2.0 schema validation
- Use <ph/> for self-closing placeholder tags
- Use <pc></pc> for other placeholder tags
- Check for the correct XLIFF file version
- Add ICU support

fixes #11735
2017-04-14 09:05:00 -07:00
Chuck Jazdzewski
ce47d33cd9 fix(compiler): ignore calls to unresolved symbols in metadata (#15970)
This only shows up in the language service. Calls to symbols
that are not resolve resulted in null instead of being resolved
causing the language service to see exceptions when the null
was not expected such as in the animations array.

Fixes #15969
2017-04-14 09:02:32 -07:00
Victor Berchet
fdb3f26448 refactor(compiler): cleanup (#15960) 2017-04-13 11:56:00 -07:00
Miško Hevery
540581da3e fix(language-service): Update types for TypeScript nullability support 2017-04-12 11:36:19 -07:00
Miško Hevery
09d9f5fe54 fix(compiler): Update types for TypeScript nullability support 2017-04-10 15:26:33 -06:00
Chuck Jazdzewski
7764c5c697 fix(language-service): avoid throwing exceptions when reporting metadata errors 2017-04-04 14:11:51 -06:00