@angular/platform-server 16.0.0-next.1 → 16.0.0-next.3
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.
- package/esm2020/src/http.mjs +3 -3
- package/esm2020/src/location.mjs +3 -3
- package/esm2020/src/platform-server.mjs +3 -2
- package/esm2020/src/platform_state.mjs +3 -3
- package/esm2020/src/provide_server.mjs +34 -0
- package/esm2020/src/server.mjs +14 -20
- package/esm2020/src/server_events.mjs +3 -3
- package/esm2020/src/server_renderer.mjs +18 -15
- package/esm2020/src/styles_host.mjs +11 -14
- package/esm2020/src/tokens.mjs +2 -2
- package/esm2020/src/transfer_state.mjs +4 -4
- package/esm2020/src/utils.mjs +16 -66
- package/esm2020/src/version.mjs +1 -1
- package/esm2020/testing/src/server.mjs +4 -4
- package/fesm2015/init.mjs +1 -1
- package/fesm2015/platform-server.mjs +96 -129
- package/fesm2015/platform-server.mjs.map +1 -1
- package/fesm2015/testing.mjs +5 -5
- package/fesm2020/init.mjs +1 -1
- package/fesm2020/platform-server.mjs +96 -129
- package/fesm2020/platform-server.mjs.map +1 -1
- package/fesm2020/testing.mjs +5 -5
- package/index.d.ts +52 -30
- package/init/index.d.ts +1 -1
- package/package.json +7 -7
- package/testing/index.d.ts +1 -1
package/fesm2020/testing.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v16.0.0-next.
|
|
2
|
+
* @license Angular v16.0.0-next.3
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -23,10 +23,10 @@ const platformServerTesting = createPlatformFactory(ɵplatformCoreDynamicTesting
|
|
|
23
23
|
*/
|
|
24
24
|
class ServerTestingModule {
|
|
25
25
|
}
|
|
26
|
-
ServerTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.
|
|
27
|
-
ServerTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.0-next.
|
|
28
|
-
ServerTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.0-next.
|
|
29
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.
|
|
26
|
+
ServerTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.3", ngImport: i0, type: ServerTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
27
|
+
ServerTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.0-next.3", ngImport: i0, type: ServerTestingModule, imports: [NoopAnimationsModule], exports: [BrowserDynamicTestingModule] });
|
|
28
|
+
ServerTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.0-next.3", ngImport: i0, type: ServerTestingModule, providers: ɵSERVER_RENDER_PROVIDERS, imports: [NoopAnimationsModule, BrowserDynamicTestingModule] });
|
|
29
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.3", ngImport: i0, type: ServerTestingModule, decorators: [{
|
|
30
30
|
type: NgModule,
|
|
31
31
|
args: [{
|
|
32
32
|
exports: [BrowserDynamicTestingModule],
|
package/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v16.0.0-next.
|
|
2
|
+
* @license Angular v16.0.0-next.3
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
|
|
8
|
+
import { ApplicationRef } from '@angular/core';
|
|
8
9
|
import { EnvironmentProviders } from '@angular/core';
|
|
9
10
|
import { EventManager } from '@angular/platform-browser';
|
|
10
11
|
import * as i0 from '@angular/core';
|
|
@@ -12,7 +13,6 @@ import * as i1 from '@angular/common/http';
|
|
|
12
13
|
import * as i2 from '@angular/platform-browser/animations';
|
|
13
14
|
import * as i3 from '@angular/platform-browser';
|
|
14
15
|
import { InjectionToken } from '@angular/core';
|
|
15
|
-
import { NgModuleFactory } from '@angular/core';
|
|
16
16
|
import { NgZone } from '@angular/core';
|
|
17
17
|
import { PlatformRef } from '@angular/core';
|
|
18
18
|
import { Provider } from '@angular/core';
|
|
@@ -25,7 +25,7 @@ import { Version } from '@angular/core';
|
|
|
25
25
|
import { ɵSharedStylesHost } from '@angular/platform-browser';
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
|
-
* A function that will be executed when calling `renderApplication
|
|
28
|
+
* A function that will be executed when calling `renderApplication` or
|
|
29
29
|
* `renderModule` just before current platform state is rendered to string.
|
|
30
30
|
*
|
|
31
31
|
* @publicApi
|
|
@@ -105,11 +105,55 @@ export declare class PlatformState {
|
|
|
105
105
|
static ɵprov: i0.ɵɵInjectableDeclaration<PlatformState>;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
+
/**
|
|
109
|
+
* Sets up providers necessary to enable server rendering functionality for the application.
|
|
110
|
+
*
|
|
111
|
+
* @usageNotes
|
|
112
|
+
*
|
|
113
|
+
* Basic example of how you can add server support to your application:
|
|
114
|
+
* ```ts
|
|
115
|
+
* bootstrapApplication(AppComponent, {
|
|
116
|
+
* providers: [provideServerSupport()]
|
|
117
|
+
* });
|
|
118
|
+
* ```
|
|
119
|
+
*
|
|
120
|
+
* @publicApi
|
|
121
|
+
* @returns A set of providers to setup the server.
|
|
122
|
+
*/
|
|
123
|
+
export declare function provideServerSupport(): EnvironmentProviders;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Bootstraps an instance of an Angular application and renders it to a string.
|
|
127
|
+
|
|
128
|
+
* ```typescript
|
|
129
|
+
* const bootstrap = () => bootstrapApplication(RootComponent, appConfig);
|
|
130
|
+
* const output: string = await renderApplication(bootstrap);
|
|
131
|
+
* ```
|
|
132
|
+
*
|
|
133
|
+
* @param bootstrap A method that when invoked returns a promise that returns an `ApplicationRef`
|
|
134
|
+
* instance once resolved.
|
|
135
|
+
* @param options Additional configuration for the render operation:
|
|
136
|
+
* - `document` - the document of the page to render, either as an HTML string or
|
|
137
|
+
* as a reference to the `document` instance.
|
|
138
|
+
* - `url` - the URL for the current render request.
|
|
139
|
+
* - `platformProviders` - the platform level providers for the current render request.
|
|
140
|
+
*
|
|
141
|
+
* @returns A Promise, that returns serialized (to a string) rendered page, once resolved.
|
|
142
|
+
*
|
|
143
|
+
* @publicApi
|
|
144
|
+
* @developerPreview
|
|
145
|
+
*/
|
|
146
|
+
export declare function renderApplication<T>(bootstrap: () => Promise<ApplicationRef>, options: {
|
|
147
|
+
document?: string | Document;
|
|
148
|
+
url?: string;
|
|
149
|
+
platformProviders?: Provider[];
|
|
150
|
+
}): Promise<string>;
|
|
151
|
+
|
|
108
152
|
/**
|
|
109
153
|
* Bootstraps an instance of an Angular application and renders it to a string.
|
|
110
154
|
*
|
|
111
|
-
* Note: the root component passed into this function *must* be a standalone one (should have
|
|
112
|
-
* `standalone: true` flag in the `@Component` decorator config).
|
|
155
|
+
* Note: the root component passed into this function *must* be a standalone one (should have
|
|
156
|
+
* the `standalone: true` flag in the `@Component` decorator config).
|
|
113
157
|
*
|
|
114
158
|
* ```typescript
|
|
115
159
|
* @Component({
|
|
@@ -138,6 +182,7 @@ export declare class PlatformState {
|
|
|
138
182
|
* @developerPreview
|
|
139
183
|
*/
|
|
140
184
|
export declare function renderApplication<T>(rootComponent: Type<T>, options: {
|
|
185
|
+
/** @deprecated use `APP_ID` token to set the application ID. */
|
|
141
186
|
appId: string;
|
|
142
187
|
document?: string | Document;
|
|
143
188
|
url?: string;
|
|
@@ -163,30 +208,6 @@ export declare function renderModule<T>(moduleType: Type<T>, options: {
|
|
|
163
208
|
extraProviders?: StaticProvider[];
|
|
164
209
|
}): Promise<string>;
|
|
165
210
|
|
|
166
|
-
/**
|
|
167
|
-
* Bootstraps an application using provided {@link NgModuleFactory} and serializes the page content
|
|
168
|
-
* to string.
|
|
169
|
-
*
|
|
170
|
-
* @param moduleFactory An instance of the {@link NgModuleFactory} that should be used for
|
|
171
|
-
* bootstrap.
|
|
172
|
-
* @param options Additional configuration for the render operation:
|
|
173
|
-
* - `document` - the document of the page to render, either as an HTML string or
|
|
174
|
-
* as a reference to the `document` instance.
|
|
175
|
-
* - `url` - the URL for the current render request.
|
|
176
|
-
* - `extraProviders` - set of platform level providers for the current render request.
|
|
177
|
-
*
|
|
178
|
-
* @publicApi
|
|
179
|
-
*
|
|
180
|
-
* @deprecated
|
|
181
|
-
* This symbol is no longer necessary as of Angular v13.
|
|
182
|
-
* Use {@link renderModule} API instead.
|
|
183
|
-
*/
|
|
184
|
-
export declare function renderModuleFactory<T>(moduleFactory: NgModuleFactory<T>, options: {
|
|
185
|
-
document?: string;
|
|
186
|
-
url?: string;
|
|
187
|
-
extraProviders?: StaticProvider[];
|
|
188
|
-
}): Promise<string>;
|
|
189
|
-
|
|
190
211
|
/**
|
|
191
212
|
* The ng module for the server.
|
|
192
213
|
*
|
|
@@ -236,10 +257,11 @@ export declare class ɵServerRendererFactory2 implements RendererFactory2 {
|
|
|
236
257
|
private ngZone;
|
|
237
258
|
private document;
|
|
238
259
|
private sharedStylesHost;
|
|
260
|
+
private appId;
|
|
239
261
|
private rendererByCompId;
|
|
240
262
|
private defaultRenderer;
|
|
241
263
|
private schema;
|
|
242
|
-
constructor(eventManager: EventManager, ngZone: NgZone, document:
|
|
264
|
+
constructor(eventManager: EventManager, ngZone: NgZone, document: Document, sharedStylesHost: ɵSharedStylesHost, appId: string);
|
|
243
265
|
createRenderer(element: any, type: RendererType2 | null): Renderer2;
|
|
244
266
|
begin(): void;
|
|
245
267
|
end(): void;
|
package/init/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/platform-server",
|
|
3
|
-
"version": "16.0.0-next.
|
|
3
|
+
"version": "16.0.0-next.3",
|
|
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": "^16.13.0 || >=18.10.0"
|
|
9
9
|
},
|
|
10
10
|
"peerDependencies": {
|
|
11
|
-
"@angular/animations": "16.0.0-next.
|
|
12
|
-
"@angular/common": "16.0.0-next.
|
|
13
|
-
"@angular/compiler": "16.0.0-next.
|
|
14
|
-
"@angular/core": "16.0.0-next.
|
|
15
|
-
"@angular/platform-browser": "16.0.0-next.
|
|
16
|
-
"@angular/platform-browser-dynamic": "16.0.0-next.
|
|
11
|
+
"@angular/animations": "16.0.0-next.3",
|
|
12
|
+
"@angular/common": "16.0.0-next.3",
|
|
13
|
+
"@angular/compiler": "16.0.0-next.3",
|
|
14
|
+
"@angular/core": "16.0.0-next.3",
|
|
15
|
+
"@angular/platform-browser": "16.0.0-next.3",
|
|
16
|
+
"@angular/platform-browser-dynamic": "16.0.0-next.3"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"tslib": "^2.3.0",
|
package/testing/index.d.ts
CHANGED