93 Commits

Author SHA1 Message Date
Kristiyan Kostadinov
184d270725 fix(ivy): DebugElement.triggerEventHandler not picking up events registered via Renderer2 ()
Fixes Ivy's `DebugElement.triggerEventHandler` to picking up events that have been registered through a `Renderer2`, unlike ViewEngine.

This PR resolves FW-1480.

PR Close 
2019-08-01 10:13:07 -07:00
Paul Gschwendtner
10a1e1974b fix(platform-browser): debug element query predicates not compatible with strictFunctionTypes ()
Currently developers can use the `By` class to construct common
`DebugElement` query predicates. e.g. `By.directive(MyDirective)`.

The `directive()` and `all()` predicates are currently returning
a predicate that works for `DebugElement` nodes. This return type
is too strict since the predicate is not specific to `DebugElement`
instances and can also apply to `DebugNode` instances.

Meaning that developers are currently able to use the `directive()`
predicate when using `queryAllNodes()`. This is a common practice
but will break when the project is compiled with TypeScript's
`--strictFunctionTypes` flag as the `DebugElement` predicate type
is not assignable to predicates for `DebugNode`. In order to make
these predicates usable with `--strictFuntionTypes` enabled, we
adjust the predicate type to reflect what is actually needed for
evaluation of the predicate.

PR Close 
2019-07-18 14:21:26 -07:00
Paul Gschwendtner
18f0c2f1d4 refactor(platform-browser): compatibility with typescript strict flag ()
As part of FW-1265, the `@angular/platform-browser` package is made compatible
with the TypeScript `--strict` flag. Read more about the strict flag [here](https://www.typescriptlang.org/docs/handbook/compiler-options.html)

PR Close 
2019-07-18 14:21:26 -07:00
Misko Hevery
975845596d perf(ivy): use string concatination instead template string ()
PR Close 
2019-05-23 10:30:58 -07:00
Ben Lesh
d7eaae6f22 refactor(ivy): Move instructions back to ɵɵ ()
There is an encoding issue with using delta `Δ`, where the browser will attempt to detect the file encoding if the character set is not explicitly declared on a `<script/>` tag, and Chrome will find the `Δ` character and decide it is window-1252 encoding, which misinterprets the `Δ` character to be some other character that is not a valid JS identifier character

So back to the frog eyes we go.

```
    __
   /ɵɵ\
  ( -- ) - I am ineffable. I am forever.
 _/    \_
/  \  /  \
==  ==  ==
```

PR Close 
2019-05-20 16:37:47 -07:00
Filipe Silva
ac34a1429b refactor: remove toplevel property accesses ()
PR Close 
2019-05-16 12:08:49 -07:00
Ben Lesh
cf86ed7b29 refactor(ivy): migrate ɵɵ prefix back to Δ ()
Now that issues are resolved with Closure compiler, we can move back to our desired prefix of `Δ`.

PR Close 
2019-05-14 16:52:15 -07:00
Kara Erickson
71b8b355a6 fix(ivy): remove debug utilities from ivy production builds ()
Prior to this commit, we were pulling DebugNode and DebugElement
into production builds because BrowserModule automatically pulled
in NgProbe and thus getDebugNode. In Ivy, this is not necessary
because Ivy has its own set of debug utilities. We should use these
existing tools instead of NgProbe.

This commit adds an Ivy switch so we do not pull in NgProbe utilities
when running with Ivy. This saves us ~8KB in prod builds.

PR Close 
2019-04-26 11:04:47 -07:00
Adam Plumer
3a9d2473ca feat: remove deprecated DOCUMENT token from platform-browser ()
PR Close 
2019-04-25 14:40:16 -07:00
Jason Aden
152d99eef0 feat(common): add @angular/common/upgrade package for $location-related APIs ()
AngularJS's `$location` service doesn't have a direct counterpart in Angular. This is largely because the `Location` service in Angular was pulled out of the `Router`, but was not purpose-built to stand on its own.

This commit adds a new `@angular/common/upgrade` package with the beginnings of a new `LocationUpgradeService`. This service will more closely match the API of AngularJS and provide a way to replace the `$location` service from AngularJS.

PR Close 
2019-04-24 13:49:29 -07:00
Jason Aden
b635fe80cc feat(common): add APIs to read component pieces of URL ()
Without this change, the framework doesn't surface URL parts such as hostname, protocol, and port. This makes it difficult to rebuild a complete URL. This change provides new APIs to read these values.

PR Close 
2019-04-24 13:49:29 -07:00
Jason Aden
b44b14368f feat(common): add ability to retrieve the state from Location service ()
Previously there wasn't a way to retrieve `history.state` from the `Location` service. The only time the framework exposed this value was in navigation events. This meant if you weren't using the Angular router, there wasn't a way to get access to this `history.state` value other than going directly to the DOM.

This PR adds an API to retrieve the value of `history.state`. This will be useful and needed to provide a backwards-compatible `Location` service that can emulate AngularJS's `$location` service since we will need to be able to read the state data in order to produce AngularJS location transition events.

This feature will additionally be useful to any application that wants to access state data through Angular rather than going directly to the DOM APIs.

PR Close 
2019-04-24 13:49:28 -07:00
Alex Rickabaugh
b0578061ce refactor(ivy): use ɵɵ instead of Δ for now ()
The `Δ` caused issue with other infrastructure, and we are temporarily
changing it to `ɵɵ`.

This commit also patches ts_api_guardian_test and AIO to understand `ɵɵ`.

PR Close 
2019-04-11 16:27:56 -07:00
Peter Johan Salomonsen
712d60e467 fix(platform-browser): insert APP_ID in styles, contentAttr and hostAttr ()
PR Close 
2019-04-11 07:59:22 -07:00
Ben Lesh
138ca5a246 refactor(ivy): prefix all generated instructions ()
- Updates all instructions to be prefixed with the Greek delta symbol

PR Close 
2019-04-10 12:11:40 -07:00
Adam Plumer
7b70760c8d refactor: move DOCUMENT imports from platform-browser to common ()
PR Close 
2019-03-14 16:01:57 -04:00
Trevor Karjanis
5e68e35112 docs(platform-browser): fix a grammatical error in the BrowserModule documentation ()
The browser module is not included by defaults, it is included by default. Default should be singular.

There is no associated issue.
PR Close 
2019-02-19 12:54:52 -08:00
Ben Lesh
2b9cc8503d fix(ivy): Ensure proper namespace is used to create elements in JIT ()
PR Close 
2019-01-18 09:56:41 -08:00
Alan Agius
b61dafaeac refactor: remove redundant error in catch ()
PR Close 
2019-01-04 15:42:19 -08:00
Pete Bacon Darwin
0bae97a726 docs: update platform-browser with @publicApi tags ()
PR Close 
2018-10-19 14:35:52 -07:00
Pete Bacon Darwin
24521f549c docs: convert all @experimental tags to @publicApi tags ()
PR Close 
2018-10-19 14:35:52 -07:00
krzysztof-grzybek
0a3f8173f0 refactor(platform-browser): remove type assertion on console.profileEnd ()
Since typescript v3.1 type definition for console.profileEnd is fixed and type assertion 'any' is
not needed any more

PR Close 
2018-10-11 14:12:23 -07:00
JiaLi.Passion
55d54c7e97 fix(platform-browser): fix , destroy hammer manager when off ()
PR Close 
2018-10-05 15:44:05 -07:00
Igor Minar
9993c72335 feat: add support for TypeScript 3.1 ()
PR Close 
2018-09-28 09:34:51 -07:00
Pete Bacon Darwin
fc4b993d98 docs(platform-browser): move examples to @usageNotes ()
PR Close 
2018-09-24 09:11:02 -07:00
Judy Bogart
dd5e35ee67 docs: add ngmodule api doc ()
PR Close 
2018-09-19 10:40:58 -07:00
Rob Wormald
6e828bba88 fix(core): do not clear element content when using shadow dom ()
PR Close 
2018-08-30 21:33:13 -07:00
Victor Berchet
aea8832243 refactor(ivy): misc cleanup ()
PR Close 
2018-08-05 15:31:19 -07:00
Alex Rickabaugh
60aeee7abf feat(ivy): selector side of ModuleWithProviders via type metadata ()
Within an @NgModule it's common to include in the imports a call to
a ModuleWithProviders function, for example RouterModule.forRoot().
The old ngc compiler was able to handle this pattern because it had
global knowledge of metadata of not only the input compilation unit
but also all dependencies.

The ngtsc compiler for Ivy doesn't have this knowledge, so the
pattern of ModuleWithProviders functions is more difficult. ngtsc
must be able to determine which module is imported via the function
in order to expand the selector scope and properly tree-shake
directives and pipes.

This commit implements a solution to this problem, by adding a type
parameter to ModuleWithProviders through which the actual module
type can be passed between compilation units.

The provider side isn't a problem because the imports are always
copied directly to the ngInjectorDef.

PR Close 
2018-07-20 11:48:35 -07:00
vikerman
7d27ecc319
fix(platform-browser): workaround wrong import path generated by ngc for DOCUMENT () 2018-07-10 17:09:29 -07:00
Vikram Subramanian
197387d05e fix(platform-browser): mark Meta and Title services as tree shakable providers ()
This lets services that use Meta and Title services to be tree shakable and provided in root.

PR Close 
2018-07-10 11:11:09 -07:00
Igor Minar
e3064d5432 feat: typescript 2.9 support ()
PR Close 
2018-07-03 13:32:06 -07:00
Rob Wormald
3553977bd7 feat(core): add support for ShadowDOM v1 ()
add a new ViewEncapsulation.ShadowDom option that uses the v1 Shadow DOM API to provide style encapsulation.

PR Close 
2018-07-02 14:37:41 -07:00
Jeremy Elbourn
13d60eac61 fix(platform-browser): add missing deps for HammerGesturesPlugin ()
PR Close 
2018-06-28 15:13:11 -07:00
Rado Kirov
c95437f15d build(bazel): Turning on strictPropertyInitialization for Angular. ()
All errors for existing fields have been detected and suppressed with a
`!` assertion.

Issue/24571 is tracking proper clean up of those instances.

One-line change required in ivy/compilation.ts, because it appears that
the new syntax causes tsickle emitted node to no longer track their
original sourceFiles.

PR Close 
2018-06-25 07:57:13 -07:00
Jason Aden
e3759f7a73 feat(ivy): add support of ApplicationRef.bootstrapModuleFactory ()
PR Close 
2018-06-07 16:15:26 -04:00
Victor Berchet
7de2ba0e22 Revert "feat(ivy): add namespace instructions for SVG and others ()"
This reverts commit 81e4b2a4bf21d8b6ab7d33053f4e020c09021e1f.
2018-06-06 13:38:21 -07:00
Ben Lesh
81e4b2a4bf feat(ivy): add namespace instructions for SVG and others ()
PR Close 
2018-06-06 10:22:27 -07:00
Victor Berchet
c494d3cf60
Revert "feat(ivy): add support of ApplicationRef.bootstrapModuleFactory ()"
This reverts commit 22b58a717aad87092a7f7080805c10ef36960694.
This commit causes a breakage in g3.
2018-06-05 22:11:47 -07:00
Jason Aden
22b58a717a feat(ivy): add support of ApplicationRef.bootstrapModuleFactory ()
PR Close 
2018-06-05 20:10:25 -07:00
Vikram Subramanian
b96a3c8def fix(platform-server): avoid clash between server and client style encapsulation attributes ()
Previously the style encapsulation attributes(_nghost-* and _ngcontent-*) created on the server could overlap with the attributes and styles created by the client side app when it botstraps. In case the client is bootstrapping a lazy route, the client side styles are added before the server-side styles are removed. If the components on the client are bootstrapped in a different order than on the server, the styles generated by the client will cause the elements on the server to have the wrong styles.

The fix puts the styles and attributes generated on the server in a completely differemt space so that they are not affected by the client generated styles. The client generated styles will only affect elements bootstrapped on the client.

PR Close 
2018-05-30 14:28:14 -07:00
Jeremy Elbourn
24e5c5b425 refactor(platform-browser): make HAMMER_LOADER non-nullable ()
PR Close 
2018-05-30 11:25:32 -07:00
Vikram Subramanian
d6595ebd39 feat(platform-server): use EventManagerPlugin on the server ()
Previously event handlers on the server were setup directly. This change makes it so that the event registration on the server go through EventManagerPlugin just like on client. This allows us to add custom event registration handlers on the server which allows us to hook up preboot event handlers cleanly.

PR Close 
2018-05-30 10:17:31 -07:00
Judy Bogart
23a98b9e51 docs: add doc to event-management api ()
PR Close 
2018-05-22 17:33:49 -04:00
Jeremy Elbourn
26fbf1d13c feat(platform-browser): add HammerJS lazy-loader symbols to public API ()
PR Close 
2018-05-22 13:41:16 -04:00
Jeremy Elbourn
313bdce590 feat(platform-browser): allow lazy-loading HammerJS ()
PR Close 
2018-05-15 15:33:00 -07:00
swseverance
fe3679a356 style: remove empty comments ()
PR Close 
2018-05-10 15:48:13 -07:00
Pete Bacon Darwin
4b96a58c5a docs: remove all deprecated @stable jsdoc tags ()
These are no longer needed as stable docs are computed as those that
do not have `@experimental` or `@deprecated` tags.

PR Close 
2018-04-10 21:49:32 -07:00
Veres Lajos
de90314304 style: typos fixed - https://github.com/vlajos/misspell-fixer ()
PR Close 
2018-03-27 14:51:53 -04:00
Alex Rickabaugh
db56836425 feat: tree-shakeable providers API updates ()
Rename @Injectable({scope -> providedIn}).

Instead of {providedIn: APP_ROOT_SCOPE}, accept {providedIn: 'root'}.
Also, {providedIn: null} implies the injectable should not be added
to any scope.

PR Close 
2018-03-13 09:28:05 -07:00