A multi RENDER_MODULE_HOOK provider can provide function that will be called with the current document just before the document is rendered to
string.
This hook can for example be used for the state transfer module to serialize any server state that needs to be transported to the client, just before the current platform state is rendered to string.
PR Close#19023
* The problem was with the `fireChildActivationStart` function. It was taking a `path` param, which was an
array of `ActivatedRouteSnapshot`s. The function was being fired for each piece of the route that was being
activated. This resulted in far too many `ChildActivationStart` events being fired, and being fired on routes
that weren't actually getting activated. This change fires the event only for those routes that are actually
being activated.
fixes#18942
PR Close#19043
* Introduced with #18407, `RouteEvents` don't actually have a common constructor. Reverting here to be able to add new functionality to ChildActivation events.
PR Close#19043
BREAKING CHANGE: the compiler option `enableLegacyTemplate` is now disabled by default as the `<template>` element has been deprecated since v4. Use `<ng-template>` instead. The option `enableLegacyTemplate` and the `<template>` element will both be removed in Angular v6.
PR Close#18756
* Remove now unnecessary portions of build.
* Add a compilePackageES5 method to build ES5 from sources
* Rework all package.json and rollup config files to new format
* Remove "extends" from tsconfig-build.json files and fixup compilation roots
PR Close#18541
This is a corner case, and converting them is what
was expected in G3. This also fits the fact that
we already convert package paths into relative paths.
PR Close#18912
With this change ngc now accepts a `-w` or a `--watch`
command-line option that will automatically perform a
recompile whenever any source files change on disk.
PR Close#18818
With this commit the compiler will "lower" expressions into exported
variables for values the compiler does not need to know statically
in order to be able to generate a factory. For example:
```
providers: [{provider: 'token', useValue: calculated()}]
```
produced an error as the expression `calculated()` is not supported
by the compiler because `calculated` is not a
[known function](https://angular.io/guide/metadata#annotationsdecorators)
With this commit this is rewritten, during emit of the .js file, into
something like:
```
export var ɵ0 = calculated();
...
provdiers: [{provider: 'token', useValue: ɵ0}]
```
The compiler then will now generate a reference to the exported `ɵ0`
instead of failing to evaluate `calculated()`.
PR Close#18905
With this change ngc now accepts a `-w` or a `--watch`
command-line option that will automatically perform a
recompile whenever any source files change on disk.
PR Close#18818
With this commit the compiler will "lower" expressions into exported
variables for values the compiler does not need to know statically
in order to be able to generate a factory. For example:
```
providers: [{provider: 'token', useValue: calculated()}]
```
produced an error as the expression `calculated()` is not supported
by the compiler because `calculated` is not a
[known function](https://angular.io/guide/metadata#annotationsdecorators)
With this commit this is rewritten, during emit of the .js file, into
something like:
```
export var ɵ0 = calculated();
...
provdiers: [{provider: 'token', useValue: ɵ0}]
```
The compiler then will now generate a reference to the exported `ɵ0`
instead of failing to evaluate `calculated()`.
PR Close#18905
Fixes#14638
Uses Domino - https://github.com/fgnass/domino and removes dependency on
Parse5.
The DOCUMENT and nativeElement were never typed earlier and were
different on the browser(DOM nodes) and the server(Parse5 nodes). With
this change, platform-server also exposes a DOCUMENT and nativeElement
that is closer to the client. If you were relying on nativeElement on
the server, you would have to change your code to use the DOM API now
instead of Parse5 AST API.
Removes the need to add services for each and every Document
manipulation like Title/Meta etc.
This does *not* provide a global variable 'document' or 'window' on the
server. You still have to inject DOCUMENT to get the document backing
the current platform server instance.
Currently HttpClient sends requests for JSON data with the
XMLHttpRequest.responseType set to 'json'. With this flag, the browser
will attempt to parse the response as JSON, but will return 'null' on
any errors. If the JSON response contains an XSSI-prevention prefix,
this will cause the browser's parsing to fail, which is unrecoverable.
The only compelling reason to use the responseType 'json' is for
performance (especially if the browser offloads JSON parsing to a
separate thread). I'm not aware of any browser which does this currently,
nor of any plans to do so. JSON.parse and responseType 'json' both
end up using the same V8 code path in Chrome to implement the parse.
Thus, this change switches all JSON parsing in HttpClient to use
JSON.parse directly.
Fixes#18396, #18453.
PR Close#18466
Today, constructing a new GET request with headers looks like:
const headers = new HttpHeaders({
'My-Header': 'header value',
});
http.get('/url', {headers}).subscribe(...);
This indirection is unnecessary. It'd be more ergonomic to write:
http.get('/url', {headers: {'My-Header': 'header value'}}).subscribe(...);
This commit allows that new syntax, both for HttpHeaders and HttpParams.
In the HttpParams case it also allows construction of HttpParams with a map.
PR Close#18490