@angular/platform-server 16.0.0-next.3 → 16.0.0-next.4
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_state.mjs +3 -3
- package/esm2020/src/server.mjs +6 -9
- package/esm2020/src/server_events.mjs +3 -3
- package/esm2020/src/server_renderer.mjs +3 -3
- package/esm2020/src/transfer_state.mjs +4 -4
- package/esm2020/src/utils.mjs +27 -20
- 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 +51 -84
- 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 +51 -81
- package/fesm2020/platform-server.mjs.map +1 -1
- package/fesm2020/testing.mjs +5 -5
- package/index.d.ts +1 -42
- package/init/index.d.ts +1 -1
- package/package.json +7 -7
- package/testing/index.d.ts +1 -1
- package/esm2020/src/styles_host.mjs +0 -48
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.4
|
|
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.4", ngImport: i0, type: ServerTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
27
|
+
ServerTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.0-next.4", ngImport: i0, type: ServerTestingModule, imports: [NoopAnimationsModule], exports: [BrowserDynamicTestingModule] });
|
|
28
|
+
ServerTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.0-next.4", ngImport: i0, type: ServerTestingModule, providers: ɵSERVER_RENDER_PROVIDERS, imports: [NoopAnimationsModule, BrowserDynamicTestingModule] });
|
|
29
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.4", ngImport: i0, type: ServerTestingModule, decorators: [{
|
|
30
30
|
type: NgModule,
|
|
31
31
|
args: [{
|
|
32
32
|
exports: [BrowserDynamicTestingModule],
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v16.0.0-next.
|
|
2
|
+
* @license Angular v16.0.0-next.4
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -149,47 +149,6 @@ export declare function renderApplication<T>(bootstrap: () => Promise<Applicatio
|
|
|
149
149
|
platformProviders?: Provider[];
|
|
150
150
|
}): Promise<string>;
|
|
151
151
|
|
|
152
|
-
/**
|
|
153
|
-
* Bootstraps an instance of an Angular application and renders it to a string.
|
|
154
|
-
*
|
|
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).
|
|
157
|
-
*
|
|
158
|
-
* ```typescript
|
|
159
|
-
* @Component({
|
|
160
|
-
* standalone: true,
|
|
161
|
-
* template: 'Hello world!'
|
|
162
|
-
* })
|
|
163
|
-
* class RootComponent {}
|
|
164
|
-
*
|
|
165
|
-
* const output: string = await renderApplication(RootComponent, {appId: 'server-app'});
|
|
166
|
-
* ```
|
|
167
|
-
*
|
|
168
|
-
* @param rootComponent A reference to a Standalone Component that should be rendered.
|
|
169
|
-
* @param options Additional configuration for the render operation:
|
|
170
|
-
* - `appId` - a string identifier of this application. The appId is used to prefix all
|
|
171
|
-
* server-generated stylings and state keys of the application in TransferState
|
|
172
|
-
* use-cases.
|
|
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
|
-
* - `providers` - set of application level providers for the current render request.
|
|
177
|
-
* - `platformProviders` - the platform level providers for the current render request.
|
|
178
|
-
*
|
|
179
|
-
* @returns A Promise, that returns serialized (to a string) rendered page, once resolved.
|
|
180
|
-
*
|
|
181
|
-
* @publicApi
|
|
182
|
-
* @developerPreview
|
|
183
|
-
*/
|
|
184
|
-
export declare function renderApplication<T>(rootComponent: Type<T>, options: {
|
|
185
|
-
/** @deprecated use `APP_ID` token to set the application ID. */
|
|
186
|
-
appId: string;
|
|
187
|
-
document?: string | Document;
|
|
188
|
-
url?: string;
|
|
189
|
-
providers?: Array<Provider | EnvironmentProviders>;
|
|
190
|
-
platformProviders?: Provider[];
|
|
191
|
-
}): Promise<string>;
|
|
192
|
-
|
|
193
152
|
/**
|
|
194
153
|
* Bootstraps an application using provided NgModule and serializes the page content to string.
|
|
195
154
|
*
|
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.4",
|
|
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.4",
|
|
12
|
+
"@angular/common": "16.0.0-next.4",
|
|
13
|
+
"@angular/compiler": "16.0.0-next.4",
|
|
14
|
+
"@angular/core": "16.0.0-next.4",
|
|
15
|
+
"@angular/platform-browser": "16.0.0-next.4",
|
|
16
|
+
"@angular/platform-browser-dynamic": "16.0.0-next.4"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"tslib": "^2.3.0",
|
package/testing/index.d.ts
CHANGED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
import { DOCUMENT, ɵgetDOM as getDOM } from '@angular/common';
|
|
9
|
-
import { APP_ID, Inject, Injectable } from '@angular/core';
|
|
10
|
-
import { ɵSharedStylesHost as SharedStylesHost } from '@angular/platform-browser';
|
|
11
|
-
import * as i0 from "@angular/core";
|
|
12
|
-
class ServerStylesHost extends SharedStylesHost {
|
|
13
|
-
constructor(doc, appId) {
|
|
14
|
-
super();
|
|
15
|
-
this.appId = appId;
|
|
16
|
-
this.head = null;
|
|
17
|
-
this._styleNodes = new Set();
|
|
18
|
-
this.head = doc.getElementsByTagName('head')[0];
|
|
19
|
-
}
|
|
20
|
-
onStyleAdded(style) {
|
|
21
|
-
const adapter = getDOM();
|
|
22
|
-
const el = adapter.createElement('style');
|
|
23
|
-
el.textContent = style;
|
|
24
|
-
if (!!this.appId) {
|
|
25
|
-
el.setAttribute('ng-app', this.appId);
|
|
26
|
-
}
|
|
27
|
-
this.head.appendChild(el);
|
|
28
|
-
this._styleNodes.add(el);
|
|
29
|
-
}
|
|
30
|
-
ngOnDestroy() {
|
|
31
|
-
this._styleNodes.forEach(styleNode => styleNode.remove());
|
|
32
|
-
this._styleNodes.clear();
|
|
33
|
-
super.ngOnDestroy();
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
ServerStylesHost.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.3", ngImport: i0, type: ServerStylesHost, deps: [{ token: DOCUMENT }, { token: APP_ID }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
37
|
-
ServerStylesHost.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.3", ngImport: i0, type: ServerStylesHost });
|
|
38
|
-
export { ServerStylesHost };
|
|
39
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.3", ngImport: i0, type: ServerStylesHost, decorators: [{
|
|
40
|
-
type: Injectable
|
|
41
|
-
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
42
|
-
type: Inject,
|
|
43
|
-
args: [DOCUMENT]
|
|
44
|
-
}] }, { type: undefined, decorators: [{
|
|
45
|
-
type: Inject,
|
|
46
|
-
args: [APP_ID]
|
|
47
|
-
}] }]; } });
|
|
48
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3R5bGVzX2hvc3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wYWN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