@angular/platform-server 14.0.0-next.8 → 14.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,188 +1,229 @@
1
1
  /**
2
- * @license Angular v14.0.0-next.8
2
+ * @license Angular v14.0.0-rc.1
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
7
- import { EventManager } from '@angular/platform-browser';
8
- import * as i0 from '@angular/core';
9
- import * as i1 from '@angular/common/http';
10
- import * as i2 from '@angular/platform-browser/animations';
11
- import * as i3 from '@angular/platform-browser';
12
- import { InjectionToken } from '@angular/core';
13
- import { NgModuleFactory } from '@angular/core';
14
- import { NgZone } from '@angular/core';
15
- import { PlatformRef } from '@angular/core';
16
- import { Provider } from '@angular/core';
17
- import { Renderer2 } from '@angular/core';
18
- import { RendererFactory2 } from '@angular/core';
19
- import { RendererType2 } from '@angular/core';
20
- import { StaticProvider } from '@angular/core';
21
- import { Type } from '@angular/core';
22
- import { Version } from '@angular/core';
23
- import { ɵSharedStylesHost } from '@angular/platform-browser';
24
-
25
- /**
26
- * A function that will be executed when calling `renderModuleFactory` or `renderModule` just
27
- * before current platform state is rendered to string.
28
- *
29
- * @publicApi
30
- */
31
- export declare const BEFORE_APP_SERIALIZED: InjectionToken<(() => void | Promise<void>)[]>;
32
-
33
- /**
34
- * The DI token for setting the initial config for the platform.
35
- *
36
- * @publicApi
37
- */
38
- export declare const INITIAL_CONFIG: InjectionToken<PlatformConfig>;
39
-
40
- /**
41
- * Config object passed to initialize the platform.
42
- *
43
- * @publicApi
44
- */
45
- export declare interface PlatformConfig {
46
- /**
47
- * The initial DOM to use to bootstrap the server application.
48
- * @default create a new DOM using Domino
49
- */
50
- document?: string;
51
- /**
52
- * The URL for the current application state. This is used for initializing
53
- * the platform's location. `protocol`, `hostname`, and `port` will be
54
- * overridden if `baseUrl` is set.
55
- * @default none
56
- */
57
- url?: string;
58
- /**
59
- * Whether to append the absolute URL to any relative HTTP requests. If set to
60
- * true, this logic executes prior to any HTTP interceptors that may run later
61
- * on in the request. `baseUrl` must be supplied if this flag is enabled.
62
- * @default false
63
- */
64
- useAbsoluteUrl?: boolean;
65
- /**
66
- * The base URL for resolving absolute URL for HTTP requests. It must be set
67
- * if `useAbsoluteUrl` is true, and must consist of protocol, hostname,
68
- * and optional port. This option has no effect if `useAbsoluteUrl` is not
69
- * enabled.
70
- */
71
- baseUrl?: string;
72
- }
73
-
74
- /**
75
- * The server platform that supports the runtime compiler.
76
- *
77
- * @publicApi
78
- */
79
- export declare const platformDynamicServer: (extraProviders?: StaticProvider[] | undefined) => PlatformRef;
80
-
81
- /**
82
- * @publicApi
83
- */
84
- export declare const platformServer: (extraProviders?: StaticProvider[] | undefined) => PlatformRef;
85
-
86
- /**
87
- * Representation of the current platform state.
88
- *
89
- * @publicApi
90
- */
91
- export declare class PlatformState {
92
- private _doc;
93
- constructor(_doc: any);
94
- /**
95
- * Renders the current state of the platform to string.
96
- */
97
- renderToString(): string;
98
- /**
99
- * Returns the current DOM state.
100
- */
101
- getDocument(): any;
102
- static ɵfac: i0.ɵɵFactoryDeclaration<PlatformState, never>;
103
- static ɵprov: i0.ɵɵInjectableDeclaration<PlatformState>;
104
- }
105
-
106
- /**
107
- * Renders a Module to string.
108
- *
109
- * `document` is the full document HTML of the page to render, as a string.
110
- * `url` is the URL for the current render request.
111
- * `extraProviders` are the platform level providers for the current render request.
112
- *
113
- * @publicApi
114
- */
115
- export declare function renderModule<T>(module: Type<T>, options: {
116
- document?: string;
117
- url?: string;
118
- extraProviders?: StaticProvider[];
119
- }): Promise<string>;
120
-
121
- /**
122
- * Renders a {@link NgModuleFactory} to string.
123
- *
124
- * `document` is the full document HTML of the page to render, as a string.
125
- * `url` is the URL for the current render request.
126
- * `extraProviders` are the platform level providers for the current render request.
127
- *
128
- * @publicApi
129
- *
130
- * @deprecated
131
- * This symbol is no longer necessary as of Angular v13.
132
- * Use {@link renderModule} API instead.
133
- */
134
- export declare function renderModuleFactory<T>(moduleFactory: NgModuleFactory<T>, options: {
135
- document?: string;
136
- url?: string;
137
- extraProviders?: StaticProvider[];
138
- }): Promise<string>;
139
-
140
- /**
141
- * The ng module for the server.
142
- *
143
- * @publicApi
144
- */
145
- export declare class ServerModule {
146
- static ɵfac: i0.ɵɵFactoryDeclaration<ServerModule, never>;
147
- static ɵmod: i0.ɵɵNgModuleDeclaration<ServerModule, never, [typeof i1.HttpClientModule, typeof i2.NoopAnimationsModule], [typeof i3.BrowserModule]>;
148
- static ɵinj: i0.ɵɵInjectorDeclaration<ServerModule>;
149
- }
150
-
151
- /**
152
- * NgModule to install on the server side while using the `TransferState` to transfer state from
153
- * server to client.
154
- *
155
- * @publicApi
156
- */
157
- export declare class ServerTransferStateModule {
158
- static ɵfac: i0.ɵɵFactoryDeclaration<ServerTransferStateModule, never>;
159
- static ɵmod: i0.ɵɵNgModuleDeclaration<ServerTransferStateModule, never, never, never>;
160
- static ɵinj: i0.ɵɵInjectorDeclaration<ServerTransferStateModule>;
161
- }
162
-
163
- /**
164
- * @publicApi
165
- */
166
- export declare const VERSION: Version;
167
-
168
- export declare const ɵINTERNAL_SERVER_PLATFORM_PROVIDERS: StaticProvider[];
169
-
170
- export declare const ɵSERVER_RENDER_PROVIDERS: Provider[];
171
-
172
- export declare class ɵServerRendererFactory2 implements RendererFactory2 {
173
- private eventManager;
174
- private ngZone;
175
- private document;
176
- private sharedStylesHost;
177
- private rendererByCompId;
178
- private defaultRenderer;
179
- private schema;
180
- constructor(eventManager: EventManager, ngZone: NgZone, document: any, sharedStylesHost: ɵSharedStylesHost);
181
- createRenderer(element: any, type: RendererType2 | null): Renderer2;
182
- begin(): void;
183
- end(): void;
184
- static ɵfac: i0.ɵɵFactoryDeclaration<ɵServerRendererFactory2, never>;
185
- static ɵprov: i0.ɵɵInjectableDeclaration<ɵServerRendererFactory2>;
186
- }
187
-
188
- export { }
7
+
8
+ import { EventManager } from '@angular/platform-browser';
9
+ import * as i0 from '@angular/core';
10
+ import * as i1 from '@angular/common/http';
11
+ import * as i2 from '@angular/platform-browser/animations';
12
+ import * as i3 from '@angular/platform-browser';
13
+ import { ImportedNgModuleProviders } from '@angular/core';
14
+ import { InjectionToken } from '@angular/core';
15
+ import { NgModuleFactory } from '@angular/core';
16
+ import { NgZone } from '@angular/core';
17
+ import { PlatformRef } from '@angular/core';
18
+ import { Provider } from '@angular/core';
19
+ import { Renderer2 } from '@angular/core';
20
+ import { RendererFactory2 } from '@angular/core';
21
+ import { RendererType2 } from '@angular/core';
22
+ import { StaticProvider } from '@angular/core';
23
+ import { Type } from '@angular/core';
24
+ import { Version } from '@angular/core';
25
+ import { ɵSharedStylesHost } from '@angular/platform-browser';
26
+
27
+ /**
28
+ * A function that will be executed when calling `renderApplication`, `renderModuleFactory` or
29
+ * `renderModule` just before current platform state is rendered to string.
30
+ *
31
+ * @publicApi
32
+ */
33
+ export declare const BEFORE_APP_SERIALIZED: InjectionToken<(() => void | Promise<void>)[]>;
34
+
35
+ /**
36
+ * The DI token for setting the initial config for the platform.
37
+ *
38
+ * @publicApi
39
+ */
40
+ export declare const INITIAL_CONFIG: InjectionToken<PlatformConfig>;
41
+
42
+ /**
43
+ * Config object passed to initialize the platform.
44
+ *
45
+ * @publicApi
46
+ */
47
+ export declare interface PlatformConfig {
48
+ /**
49
+ * The initial DOM to use to bootstrap the server application.
50
+ * @default create a new DOM using Domino
51
+ */
52
+ document?: string;
53
+ /**
54
+ * The URL for the current application state. This is used for initializing
55
+ * the platform's location. `protocol`, `hostname`, and `port` will be
56
+ * overridden if `baseUrl` is set.
57
+ * @default none
58
+ */
59
+ url?: string;
60
+ /**
61
+ * Whether to append the absolute URL to any relative HTTP requests. If set to
62
+ * true, this logic executes prior to any HTTP interceptors that may run later
63
+ * on in the request. `baseUrl` must be supplied if this flag is enabled.
64
+ * @default false
65
+ */
66
+ useAbsoluteUrl?: boolean;
67
+ /**
68
+ * The base URL for resolving absolute URL for HTTP requests. It must be set
69
+ * if `useAbsoluteUrl` is true, and must consist of protocol, hostname,
70
+ * and optional port. This option has no effect if `useAbsoluteUrl` is not
71
+ * enabled.
72
+ */
73
+ baseUrl?: string;
74
+ }
75
+
76
+ /**
77
+ * The server platform that supports the runtime compiler.
78
+ *
79
+ * @publicApi
80
+ */
81
+ export declare const platformDynamicServer: (extraProviders?: StaticProvider[] | undefined) => PlatformRef;
82
+
83
+ /**
84
+ * @publicApi
85
+ */
86
+ export declare const platformServer: (extraProviders?: StaticProvider[] | undefined) => PlatformRef;
87
+
88
+ /**
89
+ * Representation of the current platform state.
90
+ *
91
+ * @publicApi
92
+ */
93
+ export declare class PlatformState {
94
+ private _doc;
95
+ constructor(_doc: any);
96
+ /**
97
+ * Renders the current state of the platform to string.
98
+ */
99
+ renderToString(): string;
100
+ /**
101
+ * Returns the current DOM state.
102
+ */
103
+ getDocument(): any;
104
+ static ɵfac: i0.ɵɵFactoryDeclaration<PlatformState, never>;
105
+ static ɵprov: i0.ɵɵInjectableDeclaration<PlatformState>;
106
+ }
107
+
108
+ /**
109
+ * Bootstraps an instance of an Angular application and renders it to a string.
110
+ *
111
+ * Note: the root component passed into this function *must* be a standalone one (should have the
112
+ * `standalone: true` flag in the `@Component` decorator config).
113
+ *
114
+ * ```typescript
115
+ * @Component({
116
+ * standalone: true,
117
+ * template: 'Hello world!'
118
+ * })
119
+ * class RootComponent {}
120
+ *
121
+ * const output: string = await renderApplication(RootComponent, {appId: 'server-app'});
122
+ * ```
123
+ *
124
+ * @param rootComponent A reference to a Standalone Component that should be rendered.
125
+ * @param options Additional configuration for the render operation:
126
+ * - `appId` - a string identifier of this application. The appId is used to prefix all
127
+ * server-generated stylings and state keys of the application in TransferState
128
+ * use-cases.
129
+ * - `document` - the full document HTML of the page to render, as a string.
130
+ * - `url` - the URL for the current render request.
131
+ * - `providers` - set of application level providers for the current render request.
132
+ * - `platformProviders` - the platform level providers for the current render request.
133
+ * @returns A Promise, that returns serialized (to a string) rendered page, once resolved.
134
+ *
135
+ * @publicApi
136
+ */
137
+ export declare function renderApplication<T>(rootComponent: Type<T>, options: {
138
+ appId: string;
139
+ document?: string;
140
+ url?: string;
141
+ providers?: Array<Provider | ImportedNgModuleProviders>;
142
+ platformProviders?: Provider[];
143
+ }): Promise<string>;
144
+
145
+ /**
146
+ * Renders a Module to string.
147
+ *
148
+ * `document` is the full document HTML of the page to render, as a string.
149
+ * `url` is the URL for the current render request.
150
+ * `extraProviders` are the platform level providers for the current render request.
151
+ *
152
+ * @publicApi
153
+ */
154
+ export declare function renderModule<T>(module: Type<T>, options: {
155
+ document?: string;
156
+ url?: string;
157
+ extraProviders?: StaticProvider[];
158
+ }): Promise<string>;
159
+
160
+ /**
161
+ * Renders a {@link NgModuleFactory} to string.
162
+ *
163
+ * `document` is the full document HTML of the page to render, as a string.
164
+ * `url` is the URL for the current render request.
165
+ * `extraProviders` are the platform level providers for the current render request.
166
+ *
167
+ * @publicApi
168
+ *
169
+ * @deprecated
170
+ * This symbol is no longer necessary as of Angular v13.
171
+ * Use {@link renderModule} API instead.
172
+ */
173
+ export declare function renderModuleFactory<T>(moduleFactory: NgModuleFactory<T>, options: {
174
+ document?: string;
175
+ url?: string;
176
+ extraProviders?: StaticProvider[];
177
+ }): Promise<string>;
178
+
179
+ /**
180
+ * The ng module for the server.
181
+ *
182
+ * @publicApi
183
+ */
184
+ export declare class ServerModule {
185
+ static ɵfac: i0.ɵɵFactoryDeclaration<ServerModule, never>;
186
+ static ɵmod: i0.ɵɵNgModuleDeclaration<ServerModule, never, [typeof i1.HttpClientModule, typeof i2.NoopAnimationsModule], [typeof i3.BrowserModule]>;
187
+ static ɵinj: i0.ɵɵInjectorDeclaration<ServerModule>;
188
+ }
189
+
190
+ /**
191
+ * NgModule to install on the server side while using the `TransferState` to transfer state from
192
+ * server to client.
193
+ *
194
+ * @publicApi
195
+ */
196
+ export declare class ServerTransferStateModule {
197
+ static ɵfac: i0.ɵɵFactoryDeclaration<ServerTransferStateModule, never>;
198
+ static ɵmod: i0.ɵɵNgModuleDeclaration<ServerTransferStateModule, never, never, never>;
199
+ static ɵinj: i0.ɵɵInjectorDeclaration<ServerTransferStateModule>;
200
+ }
201
+
202
+ /**
203
+ * @publicApi
204
+ */
205
+ export declare const VERSION: Version;
206
+
207
+ export declare const ɵINTERNAL_SERVER_PLATFORM_PROVIDERS: StaticProvider[];
208
+
209
+ export declare const ɵSERVER_RENDER_PROVIDERS: Provider[];
210
+
211
+ export declare class ɵServerRendererFactory2 implements RendererFactory2 {
212
+ private eventManager;
213
+ private ngZone;
214
+ private document;
215
+ private sharedStylesHost;
216
+ private rendererByCompId;
217
+ private defaultRenderer;
218
+ private schema;
219
+ constructor(eventManager: EventManager, ngZone: NgZone, document: any, sharedStylesHost: ɵSharedStylesHost);
220
+ createRenderer(element: any, type: RendererType2 | null): Renderer2;
221
+ begin(): void;
222
+ end(): void;
223
+ static ɵfac: i0.ɵɵFactoryDeclaration<ɵServerRendererFactory2, never>;
224
+ static ɵprov: i0.ɵɵInjectableDeclaration<ɵServerRendererFactory2>;
225
+ }
226
+
227
+ export declare function ɵsetDomTypes(): void;
228
+
229
+ export { }
@@ -1,7 +1,8 @@
1
1
  /**
2
- * @license Angular v14.0.0-next.8
2
+ * @license Angular v14.0.0-rc.1
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
7
- export { }
7
+
8
+ export { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/platform-server",
3
- "version": "14.0.0-next.8",
3
+ "version": "14.0.0-rc.1",
4
4
  "description": "Angular - library for using Angular in Node.js",
5
5
  "author": "angular",
6
6
  "license": "MIT",
@@ -8,12 +8,12 @@
8
8
  "node": "^14.15.0 || >=16.10.0"
9
9
  },
10
10
  "peerDependencies": {
11
- "@angular/animations": "14.0.0-next.8",
12
- "@angular/common": "14.0.0-next.8",
13
- "@angular/compiler": "14.0.0-next.8",
14
- "@angular/core": "14.0.0-next.8",
15
- "@angular/platform-browser": "14.0.0-next.8",
16
- "@angular/platform-browser-dynamic": "14.0.0-next.8"
11
+ "@angular/animations": "14.0.0-rc.1",
12
+ "@angular/common": "14.0.0-rc.1",
13
+ "@angular/compiler": "14.0.0-rc.1",
14
+ "@angular/core": "14.0.0-rc.1",
15
+ "@angular/platform-browser": "14.0.0-rc.1",
16
+ "@angular/platform-browser-dynamic": "14.0.0-rc.1"
17
17
  },
18
18
  "dependencies": {
19
19
  "domino": "^2.1.2",
@@ -46,14 +46,14 @@
46
46
  ]
47
47
  },
48
48
  "sideEffects": [
49
- "./esm2020/init/src/init.mjs",
49
+ "./esm2020/init/**",
50
50
  "./fesm2015/init.mjs",
51
51
  "./fesm2020/init.mjs"
52
52
  ],
53
53
  "fesm2020": "./fesm2020/platform-server.mjs",
54
54
  "fesm2015": "./fesm2015/platform-server.mjs",
55
55
  "esm2020": "./esm2020/platform-server.mjs",
56
- "typings": "./platform-server.d.ts",
56
+ "typings": "./index.d.ts",
57
57
  "module": "./fesm2015/platform-server.mjs",
58
58
  "es2020": "./fesm2020/platform-server.mjs",
59
59
  "type": "module",
@@ -62,7 +62,7 @@
62
62
  "default": "./package.json"
63
63
  },
64
64
  ".": {
65
- "types": "./platform-server.d.ts",
65
+ "types": "./index.d.ts",
66
66
  "esm2020": "./esm2020/platform-server.mjs",
67
67
  "es2020": "./fesm2020/platform-server.mjs",
68
68
  "es2015": "./fesm2015/platform-server.mjs",
@@ -70,7 +70,7 @@
70
70
  "default": "./fesm2020/platform-server.mjs"
71
71
  },
72
72
  "./init": {
73
- "types": "./init/init.d.ts",
73
+ "types": "./init/index.d.ts",
74
74
  "esm2020": "./esm2020/init/init.mjs",
75
75
  "es2020": "./fesm2020/init.mjs",
76
76
  "es2015": "./fesm2015/init.mjs",
@@ -78,7 +78,7 @@
78
78
  "default": "./fesm2020/init.mjs"
79
79
  },
80
80
  "./testing": {
81
- "types": "./testing/testing.d.ts",
81
+ "types": "./testing/index.d.ts",
82
82
  "esm2020": "./esm2020/testing/testing.mjs",
83
83
  "es2020": "./fesm2020/testing.mjs",
84
84
  "es2015": "./fesm2015/testing.mjs",
@@ -1,31 +1,32 @@
1
1
  /**
2
- * @license Angular v14.0.0-next.8
2
+ * @license Angular v14.0.0-rc.1
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
7
- import * as i0 from '@angular/core';
8
- import * as i1 from '@angular/platform-browser/animations';
9
- import * as i2 from '@angular/platform-browser-dynamic/testing';
10
- import { PlatformRef } from '@angular/core';
11
- import { StaticProvider } from '@angular/core';
12
-
13
- /**
14
- * Platform for testing
15
- *
16
- * @publicApi
17
- */
18
- export declare const platformServerTesting: (extraProviders?: StaticProvider[] | undefined) => PlatformRef;
19
-
20
- /**
21
- * NgModule for testing.
22
- *
23
- * @publicApi
24
- */
25
- export declare class ServerTestingModule {
26
- static ɵfac: i0.ɵɵFactoryDeclaration<ServerTestingModule, never>;
27
- static ɵmod: i0.ɵɵNgModuleDeclaration<ServerTestingModule, never, [typeof i1.NoopAnimationsModule], [typeof i2.BrowserDynamicTestingModule]>;
28
- static ɵinj: i0.ɵɵInjectorDeclaration<ServerTestingModule>;
29
- }
30
-
31
- export { }
7
+
8
+ import * as i0 from '@angular/core';
9
+ import * as i1 from '@angular/platform-browser/animations';
10
+ import * as i2 from '@angular/platform-browser-dynamic/testing';
11
+ import { PlatformRef } from '@angular/core';
12
+ import { StaticProvider } from '@angular/core';
13
+
14
+ /**
15
+ * Platform for testing
16
+ *
17
+ * @publicApi
18
+ */
19
+ export declare const platformServerTesting: (extraProviders?: StaticProvider[] | undefined) => PlatformRef;
20
+
21
+ /**
22
+ * NgModule for testing.
23
+ *
24
+ * @publicApi
25
+ */
26
+ export declare class ServerTestingModule {
27
+ static ɵfac: i0.ɵɵFactoryDeclaration<ServerTestingModule, never>;
28
+ static ɵmod: i0.ɵɵNgModuleDeclaration<ServerTestingModule, never, [typeof i1.NoopAnimationsModule], [typeof i2.BrowserDynamicTestingModule]>;
29
+ static ɵinj: i0.ɵɵInjectorDeclaration<ServerTestingModule>;
30
+ }
31
+
32
+ export { }
package/init/package.json DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "name": "@angular/platform-server/init",
3
- "sideEffects": true,
4
- "fesm2020": "../fesm2020/init.mjs",
5
- "fesm2015": "../fesm2015/init.mjs",
6
- "esm2020": "../esm2020/init/init.mjs",
7
- "typings": "./init.d.ts",
8
- "module": "../fesm2015/init.mjs",
9
- "es2020": "../fesm2020/init.mjs"
10
- }
@@ -1,9 +0,0 @@
1
- {
2
- "name": "@angular/platform-server/testing",
3
- "fesm2020": "../fesm2020/testing.mjs",
4
- "fesm2015": "../fesm2015/testing.mjs",
5
- "esm2020": "../esm2020/testing/testing.mjs",
6
- "typings": "./testing.d.ts",
7
- "module": "../fesm2015/testing.mjs",
8
- "es2020": "../fesm2020/testing.mjs"
9
- }