5 Commits

Author SHA1 Message Date
Andrew Scott 51ed3b510d refactor(core): Separate application and platform files even more (#53371)
This separates application and platform code into even more files. This now removes
the ciruclar dependency between scheduling and application ref.

PR Close #53371
2023-12-08 14:29:46 -08:00
Alan Agius 02437224f5 refactor(core): simplify state transfer escaping (#50201)
This commit removes unnecessary transfer state escaping and updates this process to be done by the means of a `replacer` and `reviver` method as this removes the need to export the escaping and unescaping methods.

The only thing that we need to escape is `<script` and `</script` which are done by the browsers, but not Node.js.

PR Close #50201
2023-05-10 11:31:34 -07:00
Alan Agius a684888af7 fix(core): only try to retrieve transferred state on the browser (#50144)
Prior to this commit we tried to retrieve transferred state on both browser and server. Doing this on the server was redundant and could causes issues as `document` might be undefined.

Closes #50138

PR Close #50144
2023-05-08 14:36:12 -07:00
Andrew Kushnir 030060e3dc refactor(core): use lower-level API to annotate TransferState class (#49272)
This commit updates the `TransferState` class and replaces the `@Injectable` decorator with a lower-level function call. This is a common practice for token defined in `core`, for example:

* https://github.com/angular/angular/blob/main/packages/core/src/change_detection/differs/iterable_differs.ts#L193-L196
* https://github.com/angular/angular/blob/main/packages/core/src/di/injector.ts#L121-L126

This is needed to avoid cirular references when using `TransferState` in other locations in `core`, for
example: https://github.com/angular/angular/pull/49271. Circular dependencies are coming from the fact t
hat the `@Injectable` from the `packages/core/src/di/injectable.ts` file refers to a number of extra symbols.

PR Close #49272
2023-03-01 11:19:10 -08:00
Andrew Kushnir a5dc9960dc refactor(core): move TransferState implementation to core (#49222)
This commit moves the `TransferState` class implementation to `@angular/core`. This class will be needed in core in followup changes and `core` can not depend on `platform-browser` package.

The `core` package does **not** export those symbols into public API surface.
The `platform-browser` package re-exports the symbols under same names for backwards-compatibility.

PR Close #49222
2023-02-27 13:08:40 -08:00