Commit Graph

273 Commits

Author SHA1 Message Date
vikerman a1d4769199 feat: add a PLATFORM_ID token that provides a platform id Object. (#14647) 2017-02-22 16:49:46 -08:00
Alex Rickabaugh 88bc143431 fix: app ids for better <style> management for ssr (#14632)
Currently styles are rendered to the root component element, which ensures they're cleaned up automatically
when the client application is bootstrapped. This is less than ideal as progressive rendering can cause HTML
to be rendered before the CSS is loaded, causing flicker.

This change returns to rendering <style> elements in the <head>, and introduces a mechanism for removing
them on client bootstrap. This relies on associating the server and client bootstrap. Another way to think
of this is that the client, when bootstrapping an app, needs to know whether to expect a server rendered
application exists on the page, and to identify the <style> elements that are part of that app in order
to remove them.

This is accomplished by providing a string TRANSITION_ID on both server and client. For most applications,
this will be achieved by writing a client app module that imports BrowserModule.withServerTransition({appId: <id>}).
The server app module will import this client app module and therefore inherit the provider for
TRANSITION_ID. renderModule[Factory] on the server will validate that a TRANSITION_ID has been provided.
2017-02-22 16:06:21 -08:00
Matias Niemelä 830393d234 refactor(animations): support browser animation rendering (#14578) 2017-02-22 15:14:49 -08:00
Chuck Jazdzewski c9bfc59a21 fix(tsc-wrapped): use agreed on options names (#14630) 2017-02-22 10:57:01 -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
Miško Hevery 738d93caf7 refactor: rewrite private export using the ɵ prefix 2017-02-21 20:48:55 -08:00
Tobias Bosch 7db93310f1 fix: view engine - fix some corner cases 2017-02-21 09:12:21 -08:00
Victor Berchet 3517f28609 feat(platform-webworker): renderer v2 integration 2017-02-20 16:17:43 -08:00
Tobias Bosch ab26b6518d fix(platform-browser): allow to mix shadow dom with non shadow dom
Allow to style components that don’t use shadow dom inside of components that do.

This reverts 53cf2ec573
and adds a test for this case.

Related to #7887
2017-02-17 17:18:55 -08:00
Tobias Bosch 778ded9fcf refactor: rename `ComponentRenderTypeV2` to `RendererTypeV2` 2017-02-17 17:18:55 -08:00
Tobias Bosch b9f17a9cb2 fix: make all tests green with new view engine and JIT
Note that this does not yet include enabling the view engine
by default.

Included refactoring:
- view engine: split namespace of elements / attributes already
  when creating the `NodeDef`
- view engine: when injecting the old `Renderer`, use an implementation
  that is based on `RendererV2`
- view engine: store view queries in the component view, not
  on the host element
2017-02-17 17:18:55 -08:00
Tobias Bosch 0fa3895d5b feat(compiler): implement style encapsulation for new view engine (#14518)
Included refactoring:
- splits the `RendererV2` into a `RendererFactoryV2` and a `RendererV2`
- makes the `DebugRendererV2` a private class in `@angular/core`
- remove `setBindingDebugInfo` from `RendererV2`, but rename `RendererV2.setText` to 
  `RendererV2.setValue` and allow it on comments and text nodes.

Part of #14013
2017-02-16 13:55:55 -08:00
Tobias Bosch 4e7752a12a feat(compiler): integrate compiler with view engine (#14487)
Aspects: di, query, content projection

Included refactoring:
- use a number as query id
- use a bloom filter for aggregating matched queries of nested elements
- separate static vs dynamic queries

Part of #14013
2017-02-15 08:36:49 -08:00
Victor Berchet bb9c7ae6e7 feat: RendererV2 integration (#14469) 2017-02-14 21:03:18 -08:00
vikerman b4d444a0a7 feat(platform-server): add API to render Module and ModuleFactory to string (#14381)
- PlatformState provides an interface to serialize the current Platform State as a string or Document.

- renderModule and renderModuleFactory are convenience methods to wait for Angular Application to stabilize and then render the state to a string.

- refactor code to remove defaultDoc from DomAdapter and inject DOCUMENT where it's needed.
2017-02-14 16:14:40 -08:00
Dzmitry Shylovich 53cf2ec573 fix(platform-browser): should only add styles with native encapsulation in shadow DOM (#14313)
Closes #7887

PR Close #14313
2017-02-10 15:03:20 -06:00
Dzmitry Shylovich 1cfbefebe3 fix(platform-browser): should not throw for debug attrs containing $ (#14353)
Closes #9566

PR Close #14353
2017-02-10 15:03:05 -06:00
Alex Eagle 03e855ae8f build: allow users to specify --strictNullChecks (#14382)
PR Close #14382
2017-02-10 14:10:03 -06:00
Matias Niemelä 96073e51c3 refactor(animations): introduce @angular/animation module (#14351)
PR Close: #14351
2017-02-10 14:10:03 -06:00
Bowen Ni 44bb337acc fix(compiler): disable non-components as an entry component (#14335)
PR Close #14335
2017-02-09 14:45:49 -08:00
Alex Eagle b9d293af03 build: first pass of de-duplicating tsconfig.json content (#14369)
PR Close #14369
2017-02-09 14:32:40 -08:00
Alex Eagle 5c431cee02 build: remove post-processing of .d.ts files (#13294)
Note that the duplication in tsconfig.json files will be fixed in a followup CL now that we have tsconfig inheritance

BREAKING CHANGE: Angular 4 will support only TypeScript 2.1, so we no longer provide backwards compatibility to TS 1.8.
2017-02-08 11:32:34 -06:00
Dzmitry Shylovich cd3901f774 fix(platform-browser): remove style nodes on destroy (#13744)
Closes #11746

PR Close #13744
2017-01-29 12:10:44 -06:00
Dzmitry Shylovich a64c9b5d5b refactor(platform-browser): polishing (#13744) 2017-01-29 12:10:39 -06:00
Dimitri Benin 5f40e5ba21 fix(testing): async/fakeAsync/inject/withModule helpers should pass through context to callback functions (#13718)
Make sure that context (`this`) that is passed to functions generated by test helpers is passed through to the callback functions. Enables usage of Jasmine's variable sharing system to prevent accidental memory leaks during test runs.
2017-01-29 12:08:53 -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
Miško Hevery d169c2434e feat(core): Add type information to injector.get() (#13785)
- Introduce `InjectionToken<T>` which is a parameterized and type-safe
  version of `OpaqueToken`.

DEPRECATION:
- `OpaqueToken` is now deprecated, use `InjectionToken<T>` instead.
- `Injector.get(token: any, notFoundValue?: any): any` is now deprecated
  use the same method which is now overloaded as
  `Injector.get<T>(token: Type<T>|InjectionToken<T>, notFoundValue?: T): T;`.

Migration
- Replace `OpaqueToken` with `InjectionToken<?>` and parameterize it.
- Migrate your code to only use `Type<?>` or `InjectionToken<?>` as
  injection tokens. Using other tokens will not be supported in the
  future.

BREAKING CHANGE:
- Because `injector.get()` is now parameterize it is possible that code
  which used to work no longer type checks. Example would be if one
  injects `Foo` but configures it as `{provide: Foo, useClass: MockFoo}`.
  The injection instance will be that of `MockFoo` but the type will be
  `Foo` instead of `any` as in the past. This means that it was possible
  to call a method on `MockFoo` in the past which now will fail type
  check. See this example:

```
class Foo {}
class MockFoo extends Foo {
  setupMock();
}

var PROVIDERS = [
  {provide: Foo, useClass: MockFoo}
];

...

function myTest(injector: Injector) {
  var foo = injector.get(Foo);
  // This line used to work since `foo` used to be `any` before this
  // change, it will now be `Foo`, and `Foo` does not have `setUpMock()`.
  // The fix is to downcast: `injector.get(Foo) as MockFoo`.
  foo.setUpMock();
}
```

PR Close #13785
2017-01-17 15:34:54 -06:00
Martin Probst e19bf70b47 feat(security): allow calc and gradient functions. (#13943)
PR Close #13943

Also includes support for # color notation in function arguments (common
in gradient functions).
2017-01-17 15:34:53 -06:00
Matias Niemelä c2aa981dd6 fix(animations): fix internal jscompiler issue and AOT quoting (#13798)
CL #143630929
PR Close #13798
2017-01-13 13:52:00 -06:00
Matias Niemelä 21030e9a1c fix(core): animations no longer silently exits if the element is not apart of the DOM (#13763) 2017-01-05 11:33:40 -08:00
Matias Niemelä 889b48d85f fix(core): animations should blend in all previously transitioned styles into next animation if interrupted (#13148) 2017-01-05 11:32:52 -08:00
Dzmitry Shylovich 2dd6280ab8 fix(common): do not override locale provided on bootstrap (#13654)
Closes #13607
2017-01-05 09:24:37 -08:00
Victor Berchet eed83443b8 chore(tslint): update tslint to 4.x (#13603) 2016-12-27 14:55:58 -08:00
Dzmitry Shylovich 67380d4b28 fix(testing): improve misleading error message when don't call compileComponents (#13543)
Closes #11301
2016-12-22 12:35:57 -08:00
Matias Niemelä 842f52e841 fix(animations): always recover from a failed animation step (#13604) 2016-12-21 14:14:45 -08:00
Chuck Jazdzewski e69c1fb36c refactor(platform-browser): resolver merge conflict for tslint (#13601) 2016-12-20 17:49:25 -08:00
Dzmitry Shylovich fcd116fdc0 fix(common): throw an error if trackBy is not a function (#13420)
* fix(common): throw an error if trackBy is not a function

Closes #13388

* refactor(platform-browser): disable no-console rule in DomAdapter
2016-12-20 16:18:24 -08:00
Matias Niemelä 0c19898694 fix(animations): allow players to be destroyed before initialized (#13346)
Closes #13293
Closes #13346
2016-12-15 14:18:57 -08:00
Dzmitry Shylovich 169ed82900 feat(testing): add overrideTemplate method (#13372)
Closes #10685
2016-12-14 15:05:17 -08:00
Matias Niemelä fd8e15b15d chore(animations/aot): always export NoOpAnimationDriver (#13480) 2016-12-14 14:51:29 -08:00
Matias Niemelä b56474d067 fix(animations): throw errors and normalize offset beyond the range of [0,1]
Closes #13348
Closes #13440
2016-12-14 12:59:47 -08:00
Victor Berchet 7295a5e7f2 refactor: format and lint code 2016-12-12 11:30:25 -08:00
Dzmitry Shylovich 8a8c53250e fix(dom_adapter): remove logError from logGroup (#12925) 2016-12-09 15:40:26 -08:00
Dzmitry Shylovich 72361fb68f feat(platform browser): introduce Meta service (#12322) 2016-12-08 18:44:28 -08:00
Miško Hevery 16efb13dd1 fix: display framework version on bootstrapped component (#13252) 2016-12-06 16:21:07 -08:00
Victor Savkin e628b66cca feat(build): record angular version in the dom (#13164) 2016-11-30 13:52:08 -08:00
Matias Niemelä be3784c957 revert: fix(animations): blend in all previously transitioned styles into next animation if interrupted
This reverts commit ef96763fa4.
2016-11-28 13:23:52 -08:00
Bowen Ni a6c4490fce Check if `console.error` is defined 2016-11-23 15:47:02 -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
Matias Niemelä ef96763fa4 fix(animations): blend in all previously transitioned styles into next animation if interrupted (#13014)
Closes #13013
Closes #13014
2016-11-21 15:46:59 -08:00