@angular/platform-server 21.0.0-next.1 → 21.0.0-next.10

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,307 +1,185 @@
1
1
  /**
2
- * @license Angular v21.0.0-next.1
3
- * (c) 2010-2025 Google LLC. https://angular.io/
2
+ * @license Angular v21.0.0-next.10
3
+ * (c) 2010-2025 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
6
6
 
7
- import { PLATFORM_SERVER_PROVIDERS, PlatformState, BEFORE_APP_SERIALIZED, platformServer, INITIAL_CONFIG, createScript } from './server.mjs';
8
- export { ServerModule, DominoAdapter as ɵDominoAdapter, ENABLE_DOM_EMULATION as ɵENABLE_DOM_EMULATION, INTERNAL_SERVER_PLATFORM_PROVIDERS as ɵINTERNAL_SERVER_PLATFORM_PROVIDERS, SERVER_RENDER_PROVIDERS as ɵSERVER_RENDER_PROVIDERS } from './server.mjs';
7
+ import { PLATFORM_SERVER_PROVIDERS, PlatformState, BEFORE_APP_SERIALIZED, platformServer, INITIAL_CONFIG, createScript } from './_server-chunk.mjs';
8
+ export { ServerModule, DominoAdapter as ɵDominoAdapter, ENABLE_DOM_EMULATION as ɵENABLE_DOM_EMULATION, INTERNAL_SERVER_PLATFORM_PROVIDERS as ɵINTERNAL_SERVER_PLATFORM_PROVIDERS, SERVER_RENDER_PROVIDERS as ɵSERVER_RENDER_PROVIDERS } from './_server-chunk.mjs';
9
9
  import { makeEnvironmentProviders, InjectionToken, ApplicationRef, ɵstartMeasuring as _startMeasuring, ɵstopMeasuring as _stopMeasuring, ɵIS_HYDRATION_DOM_REUSE_ENABLED as _IS_HYDRATION_DOM_REUSE_ENABLED, ɵannotateForHydration as _annotateForHydration, CSP_NONCE, APP_ID, ɵSSR_CONTENT_INTEGRITY_MARKER as _SSR_CONTENT_INTEGRITY_MARKER, Renderer2, Version } from '@angular/core';
10
10
  import '@angular/common';
11
11
  import '@angular/platform-browser';
12
12
  import '@angular/common/http';
13
13
  import 'rxjs';
14
14
 
15
- /**
16
- * Sets up providers necessary to enable server rendering functionality for the application.
17
- *
18
- * @usageNotes
19
- *
20
- * Basic example of how you can add server support to your application:
21
- * ```ts
22
- * bootstrapApplication(AppComponent, {
23
- * providers: [provideServerRendering()]
24
- * });
25
- * ```
26
- *
27
- * @publicApi
28
- * @returns A set of providers to setup the server.
29
- */
30
15
  function provideServerRendering() {
31
- if (typeof ngServerMode === 'undefined') {
32
- globalThis['ngServerMode'] = true;
33
- }
34
- return makeEnvironmentProviders([...PLATFORM_SERVER_PROVIDERS]);
16
+ if (typeof ngServerMode === 'undefined') {
17
+ globalThis['ngServerMode'] = true;
18
+ }
19
+ return makeEnvironmentProviders([...PLATFORM_SERVER_PROVIDERS]);
35
20
  }
36
21
 
37
- /**
38
- * Event dispatch (JSAction) script is inlined into the HTML by the build
39
- * process to avoid extra blocking request on a page. The script looks like this:
40
- * ```html
41
- * <script type="text/javascript" id="ng-event-dispatch-contract">...</script>
42
- * ```
43
- * This const represents the "id" attribute value.
44
- */
45
22
  const EVENT_DISPATCH_SCRIPT_ID = 'ng-event-dispatch-contract';
46
- /**
47
- * Creates an instance of a server platform (with or without JIT compiler support
48
- * depending on the `ngJitMode` global const value), using provided options.
49
- */
50
23
  function createServerPlatform(options) {
51
- const extraProviders = options.platformProviders ?? [];
52
- const measuringLabel = 'createServerPlatform';
53
- _startMeasuring(measuringLabel);
54
- const platform = platformServer([
55
- { provide: INITIAL_CONFIG, useValue: { document: options.document, url: options.url } },
56
- extraProviders,
57
- ]);
58
- _stopMeasuring(measuringLabel);
59
- return platform;
24
+ const extraProviders = options.platformProviders ?? [];
25
+ const measuringLabel = 'createServerPlatform';
26
+ _startMeasuring(measuringLabel);
27
+ const platform = platformServer([{
28
+ provide: INITIAL_CONFIG,
29
+ useValue: {
30
+ document: options.document,
31
+ url: options.url
32
+ }
33
+ }, extraProviders]);
34
+ _stopMeasuring(measuringLabel);
35
+ return platform;
60
36
  }
61
- /**
62
- * Finds and returns inlined event dispatch script if it exists.
63
- * See the `EVENT_DISPATCH_SCRIPT_ID` const docs for additional info.
64
- */
65
37
  function findEventDispatchScript(doc) {
66
- return doc.getElementById(EVENT_DISPATCH_SCRIPT_ID);
38
+ return doc.getElementById(EVENT_DISPATCH_SCRIPT_ID);
67
39
  }
68
- /**
69
- * Removes inlined event dispatch script if it exists.
70
- * See the `EVENT_DISPATCH_SCRIPT_ID` const docs for additional info.
71
- */
72
40
  function removeEventDispatchScript(doc) {
73
- findEventDispatchScript(doc)?.remove();
41
+ findEventDispatchScript(doc)?.remove();
74
42
  }
75
- /**
76
- * Annotate nodes for hydration and remove event dispatch script when not needed.
77
- */
78
43
  function prepareForHydration(platformState, applicationRef) {
79
- const measuringLabel = 'prepareForHydration';
80
- _startMeasuring(measuringLabel);
81
- const environmentInjector = applicationRef.injector;
82
- const doc = platformState.getDocument();
83
- if (!environmentInjector.get(_IS_HYDRATION_DOM_REUSE_ENABLED, false)) {
84
- // Hydration is diabled, remove inlined event dispatch script.
85
- // (which was injected by the build process) from the HTML.
86
- removeEventDispatchScript(doc);
87
- return;
88
- }
89
- appendSsrContentIntegrityMarker(doc);
90
- const eventTypesToReplay = _annotateForHydration(applicationRef, doc);
91
- if (eventTypesToReplay.regular.size || eventTypesToReplay.capture.size) {
92
- insertEventRecordScript(environmentInjector.get(APP_ID), doc, eventTypesToReplay, environmentInjector.get(CSP_NONCE, null));
93
- }
94
- else {
95
- // No events to replay, we should remove inlined event dispatch script
96
- // (which was injected by the build process) from the HTML.
97
- removeEventDispatchScript(doc);
98
- }
99
- _stopMeasuring(measuringLabel);
44
+ const measuringLabel = 'prepareForHydration';
45
+ _startMeasuring(measuringLabel);
46
+ const environmentInjector = applicationRef.injector;
47
+ const doc = platformState.getDocument();
48
+ if (!environmentInjector.get(_IS_HYDRATION_DOM_REUSE_ENABLED, false)) {
49
+ removeEventDispatchScript(doc);
50
+ return;
51
+ }
52
+ appendSsrContentIntegrityMarker(doc);
53
+ const eventTypesToReplay = _annotateForHydration(applicationRef, doc);
54
+ if (eventTypesToReplay.regular.size || eventTypesToReplay.capture.size) {
55
+ insertEventRecordScript(environmentInjector.get(APP_ID), doc, eventTypesToReplay, environmentInjector.get(CSP_NONCE, null));
56
+ } else {
57
+ removeEventDispatchScript(doc);
58
+ }
59
+ _stopMeasuring(measuringLabel);
100
60
  }
101
- /**
102
- * Creates a marker comment node and append it into the `<body>`.
103
- * Some CDNs have mechanisms to remove all comment node from HTML.
104
- * This behaviour breaks hydration, so we'll detect on the client side if this
105
- * marker comment is still available or else throw an error
106
- */
107
61
  function appendSsrContentIntegrityMarker(doc) {
108
- // Adding a ng hydration marker comment
109
- const comment = doc.createComment(_SSR_CONTENT_INTEGRITY_MARKER);
110
- doc.body.firstChild
111
- ? doc.body.insertBefore(comment, doc.body.firstChild)
112
- : doc.body.append(comment);
62
+ const comment = doc.createComment(_SSR_CONTENT_INTEGRITY_MARKER);
63
+ doc.body.firstChild ? doc.body.insertBefore(comment, doc.body.firstChild) : doc.body.append(comment);
113
64
  }
114
- /**
115
- * Adds the `ng-server-context` attribute to host elements of all bootstrapped components
116
- * within a given application.
117
- */
118
65
  function appendServerContextInfo(applicationRef) {
119
- const injector = applicationRef.injector;
120
- let serverContext = sanitizeServerContext(injector.get(SERVER_CONTEXT, DEFAULT_SERVER_CONTEXT));
121
- applicationRef.components.forEach((componentRef) => {
122
- const renderer = componentRef.injector.get(Renderer2);
123
- const element = componentRef.location.nativeElement;
124
- if (element) {
125
- renderer.setAttribute(element, 'ng-server-context', serverContext);
126
- }
127
- });
66
+ const injector = applicationRef.injector;
67
+ let serverContext = sanitizeServerContext(injector.get(SERVER_CONTEXT, DEFAULT_SERVER_CONTEXT));
68
+ applicationRef.components.forEach(componentRef => {
69
+ const renderer = componentRef.injector.get(Renderer2);
70
+ const element = componentRef.location.nativeElement;
71
+ if (element) {
72
+ renderer.setAttribute(element, 'ng-server-context', serverContext);
73
+ }
74
+ });
128
75
  }
129
76
  function insertEventRecordScript(appId, doc, eventTypesToReplay, nonce) {
130
- const measuringLabel = 'insertEventRecordScript';
131
- _startMeasuring(measuringLabel);
132
- const { regular, capture } = eventTypesToReplay;
133
- const eventDispatchScript = findEventDispatchScript(doc);
134
- // Note: this is only true when build with the CLI tooling, which inserts the script in the HTML
135
- if (eventDispatchScript) {
136
- // This is defined in packages/core/primitives/event-dispatch/contract_binary.ts
137
- const replayScriptContents = `window.__jsaction_bootstrap(` +
138
- `document.body,` +
139
- `"${appId}",` +
140
- `${JSON.stringify(Array.from(regular))},` +
141
- `${JSON.stringify(Array.from(capture))}` +
142
- `);`;
143
- const replayScript = createScript(doc, replayScriptContents, nonce);
144
- // Insert replay script right after inlined event dispatch script, since it
145
- // relies on `__jsaction_bootstrap` to be defined in the global scope.
146
- eventDispatchScript.after(replayScript);
147
- }
148
- _stopMeasuring(measuringLabel);
77
+ const measuringLabel = 'insertEventRecordScript';
78
+ _startMeasuring(measuringLabel);
79
+ const {
80
+ regular,
81
+ capture
82
+ } = eventTypesToReplay;
83
+ const eventDispatchScript = findEventDispatchScript(doc);
84
+ if (eventDispatchScript) {
85
+ const replayScriptContents = `window.__jsaction_bootstrap(` + `document.body,` + `"${appId}",` + `${JSON.stringify(Array.from(regular))},` + `${JSON.stringify(Array.from(capture))}` + `);`;
86
+ const replayScript = createScript(doc, replayScriptContents, nonce);
87
+ eventDispatchScript.after(replayScript);
88
+ }
89
+ _stopMeasuring(measuringLabel);
149
90
  }
150
- /**
151
- * Renders an Angular application to a string.
152
- *
153
- * @private
154
- *
155
- * @param platformRef - Reference to the Angular platform.
156
- * @param applicationRef - Reference to the Angular application.
157
- * @returns A promise that resolves to the rendered string.
158
- */
159
91
  async function renderInternal(platformRef, applicationRef) {
160
- const platformState = platformRef.injector.get(PlatformState);
161
- prepareForHydration(platformState, applicationRef);
162
- appendServerContextInfo(applicationRef);
163
- // Run any BEFORE_APP_SERIALIZED callbacks just before rendering to string.
164
- const environmentInjector = applicationRef.injector;
165
- const callbacks = environmentInjector.get(BEFORE_APP_SERIALIZED, null);
166
- if (callbacks) {
167
- const asyncCallbacks = [];
168
- for (const callback of callbacks) {
169
- try {
170
- const callbackResult = callback();
171
- if (callbackResult) {
172
- asyncCallbacks.push(callbackResult);
173
- }
174
- }
175
- catch (e) {
176
- // Ignore exceptions.
177
- console.warn('Ignoring BEFORE_APP_SERIALIZED Exception: ', e);
178
- }
92
+ const platformState = platformRef.injector.get(PlatformState);
93
+ prepareForHydration(platformState, applicationRef);
94
+ appendServerContextInfo(applicationRef);
95
+ const environmentInjector = applicationRef.injector;
96
+ const callbacks = environmentInjector.get(BEFORE_APP_SERIALIZED, null);
97
+ if (callbacks) {
98
+ const asyncCallbacks = [];
99
+ for (const callback of callbacks) {
100
+ try {
101
+ const callbackResult = callback();
102
+ if (callbackResult) {
103
+ asyncCallbacks.push(callbackResult);
179
104
  }
180
- if (asyncCallbacks.length) {
181
- for (const result of await Promise.allSettled(asyncCallbacks)) {
182
- if (result.status === 'rejected') {
183
- console.warn('Ignoring BEFORE_APP_SERIALIZED Exception: ', result.reason);
184
- }
185
- }
105
+ } catch (e) {
106
+ console.warn('Ignoring BEFORE_APP_SERIALIZED Exception: ', e);
107
+ }
108
+ }
109
+ if (asyncCallbacks.length) {
110
+ for (const result of await Promise.allSettled(asyncCallbacks)) {
111
+ if (result.status === 'rejected') {
112
+ console.warn('Ignoring BEFORE_APP_SERIALIZED Exception: ', result.reason);
186
113
  }
114
+ }
187
115
  }
188
- return platformState.renderToString();
116
+ }
117
+ return platformState.renderToString();
189
118
  }
190
- /**
191
- * Destroy the application in a macrotask, this allows pending promises to be settled and errors
192
- * to be surfaced to the users.
193
- */
194
119
  function asyncDestroyPlatform(platformRef) {
195
- return new Promise((resolve) => {
196
- setTimeout(() => {
197
- platformRef.destroy();
198
- resolve();
199
- }, 0);
200
- });
120
+ return new Promise(resolve => {
121
+ setTimeout(() => {
122
+ platformRef.destroy();
123
+ resolve();
124
+ }, 0);
125
+ });
201
126
  }
202
- /**
203
- * Specifies the value that should be used if no server context value has been provided.
204
- */
205
127
  const DEFAULT_SERVER_CONTEXT = 'other';
206
- /**
207
- * An internal token that allows providing extra information about the server context
208
- * (e.g. whether SSR or SSG was used). The value is a string and characters other
209
- * than [a-zA-Z0-9\-] are removed. See the default value in `DEFAULT_SERVER_CONTEXT` const.
210
- */
211
128
  const SERVER_CONTEXT = new InjectionToken('SERVER_CONTEXT');
212
- /**
213
- * Sanitizes provided server context:
214
- * - removes all characters other than a-z, A-Z, 0-9 and `-`
215
- * - returns `other` if nothing is provided or the string is empty after sanitization
216
- */
217
129
  function sanitizeServerContext(serverContext) {
218
- const context = serverContext.replace(/[^a-zA-Z0-9\-]/g, '');
219
- return context.length > 0 ? context : DEFAULT_SERVER_CONTEXT;
130
+ const context = serverContext.replace(/[^a-zA-Z0-9\-]/g, '');
131
+ return context.length > 0 ? context : DEFAULT_SERVER_CONTEXT;
220
132
  }
221
- /**
222
- * Bootstraps an application using provided NgModule and serializes the page content to string.
223
- *
224
- * @param moduleType A reference to an NgModule that should be used for bootstrap.
225
- * @param options Additional configuration for the render operation:
226
- * - `document` - the document of the page to render, either as an HTML string or
227
- * as a reference to the `document` instance.
228
- * - `url` - the URL for the current render request.
229
- * - `extraProviders` - set of platform level providers for the current render request.
230
- *
231
- * @publicApi
232
- */
233
133
  async function renderModule(moduleType, options) {
234
- const { document, url, extraProviders: platformProviders } = options;
235
- const platformRef = createServerPlatform({ document, url, platformProviders });
236
- try {
237
- const moduleRef = await platformRef.bootstrapModule(moduleType);
238
- const applicationRef = moduleRef.injector.get(ApplicationRef);
239
- const measuringLabel = 'whenStable';
240
- _startMeasuring(measuringLabel);
241
- // Block until application is stable.
242
- await applicationRef.whenStable();
243
- _stopMeasuring(measuringLabel);
244
- return await renderInternal(platformRef, applicationRef);
245
- }
246
- finally {
247
- await asyncDestroyPlatform(platformRef);
248
- }
134
+ const {
135
+ document,
136
+ url,
137
+ extraProviders: platformProviders
138
+ } = options;
139
+ const platformRef = createServerPlatform({
140
+ document,
141
+ url,
142
+ platformProviders
143
+ });
144
+ try {
145
+ const moduleRef = await platformRef.bootstrapModule(moduleType);
146
+ const applicationRef = moduleRef.injector.get(ApplicationRef);
147
+ const measuringLabel = 'whenStable';
148
+ _startMeasuring(measuringLabel);
149
+ await applicationRef.whenStable();
150
+ _stopMeasuring(measuringLabel);
151
+ return await renderInternal(platformRef, applicationRef);
152
+ } finally {
153
+ await asyncDestroyPlatform(platformRef);
154
+ }
249
155
  }
250
- /**
251
- * Bootstraps an instance of an Angular application and renders it to a string.
252
-
253
- * ```ts
254
- * const bootstrap = () => bootstrapApplication(RootComponent, appConfig);
255
- * const output: string = await renderApplication(bootstrap);
256
- * ```
257
- *
258
- * @param bootstrap A method that when invoked returns a promise that returns an `ApplicationRef`
259
- * instance once resolved.
260
- * @param options Additional configuration for the render operation:
261
- * - `document` - the document of the page to render, either as an HTML string or
262
- * as a reference to the `document` instance.
263
- * - `url` - the URL for the current render request.
264
- * - `platformProviders` - the platform level providers for the current render request.
265
- *
266
- * @returns A Promise, that returns serialized (to a string) rendered page, once resolved.
267
- *
268
- * @publicApi
269
- */
270
156
  async function renderApplication(bootstrap, options) {
271
- const renderAppLabel = 'renderApplication';
272
- const bootstrapLabel = 'bootstrap';
273
- const _renderLabel = '_render';
274
- _startMeasuring(renderAppLabel);
275
- const platformRef = createServerPlatform(options);
276
- try {
277
- _startMeasuring(bootstrapLabel);
278
- const applicationRef = await bootstrap();
279
- _stopMeasuring(bootstrapLabel);
280
- _startMeasuring(_renderLabel);
281
- const measuringLabel = 'whenStable';
282
- _startMeasuring(measuringLabel);
283
- // Block until application is stable.
284
- await applicationRef.whenStable();
285
- _stopMeasuring(measuringLabel);
286
- const rendered = await renderInternal(platformRef, applicationRef);
287
- _stopMeasuring(_renderLabel);
288
- return rendered;
289
- }
290
- finally {
291
- await asyncDestroyPlatform(platformRef);
292
- _stopMeasuring(renderAppLabel);
293
- }
157
+ const renderAppLabel = 'renderApplication';
158
+ const bootstrapLabel = 'bootstrap';
159
+ const _renderLabel = '_render';
160
+ _startMeasuring(renderAppLabel);
161
+ const platformRef = createServerPlatform(options);
162
+ try {
163
+ _startMeasuring(bootstrapLabel);
164
+ const applicationRef = await bootstrap({
165
+ platformRef
166
+ });
167
+ _stopMeasuring(bootstrapLabel);
168
+ _startMeasuring(_renderLabel);
169
+ const measuringLabel = 'whenStable';
170
+ _startMeasuring(measuringLabel);
171
+ await applicationRef.whenStable();
172
+ _stopMeasuring(measuringLabel);
173
+ const rendered = await renderInternal(platformRef, applicationRef);
174
+ _stopMeasuring(_renderLabel);
175
+ return rendered;
176
+ } finally {
177
+ await asyncDestroyPlatform(platformRef);
178
+ _stopMeasuring(renderAppLabel);
179
+ }
294
180
  }
295
181
 
296
- /**
297
- * @module
298
- * @description
299
- * Entry point for all public APIs of the platform-server package.
300
- */
301
- /**
302
- * @publicApi
303
- */
304
- const VERSION = new Version('21.0.0-next.1');
182
+ const VERSION = new Version('21.0.0-next.10');
305
183
 
306
184
  export { BEFORE_APP_SERIALIZED, INITIAL_CONFIG, PlatformState, VERSION, platformServer, provideServerRendering, renderApplication, renderModule, SERVER_CONTEXT as ɵSERVER_CONTEXT, renderInternal as ɵrenderInternal };
307
185
  //# sourceMappingURL=platform-server.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"platform-server.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/packages/platform-server/src/provide_server.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/packages/platform-server/src/utils.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/packages/platform-server/src/version.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {EnvironmentProviders, makeEnvironmentProviders} from '@angular/core';\n\nimport {PLATFORM_SERVER_PROVIDERS} from './server';\n\n/**\n * Sets up providers necessary to enable server rendering functionality for the application.\n *\n * @usageNotes\n *\n * Basic example of how you can add server support to your application:\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [provideServerRendering()]\n * });\n * ```\n *\n * @publicApi\n * @returns A set of providers to setup the server.\n */\nexport function provideServerRendering(): EnvironmentProviders {\n if (typeof ngServerMode === 'undefined') {\n globalThis['ngServerMode'] = true;\n }\n\n return makeEnvironmentProviders([...PLATFORM_SERVER_PROVIDERS]);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n APP_ID,\n ApplicationRef,\n CSP_NONCE,\n InjectionToken,\n PlatformRef,\n Provider,\n Renderer2,\n StaticProvider,\n Type,\n ɵannotateForHydration as annotateForHydration,\n ɵIS_HYDRATION_DOM_REUSE_ENABLED as IS_HYDRATION_DOM_REUSE_ENABLED,\n ɵSSR_CONTENT_INTEGRITY_MARKER as SSR_CONTENT_INTEGRITY_MARKER,\n ɵstartMeasuring as startMeasuring,\n ɵstopMeasuring as stopMeasuring,\n} from '@angular/core';\n\nimport {PlatformState} from './platform_state';\nimport {platformServer} from './server';\nimport {BEFORE_APP_SERIALIZED, INITIAL_CONFIG} from './tokens';\nimport {createScript} from './transfer_state';\n\n/**\n * Event dispatch (JSAction) script is inlined into the HTML by the build\n * process to avoid extra blocking request on a page. The script looks like this:\n * ```html\n * <script type=\"text/javascript\" id=\"ng-event-dispatch-contract\">...</script>\n * ```\n * This const represents the \"id\" attribute value.\n */\nexport const EVENT_DISPATCH_SCRIPT_ID = 'ng-event-dispatch-contract';\n\ninterface PlatformOptions {\n document?: string | Document;\n url?: string;\n platformProviders?: Provider[];\n}\n\n/**\n * Creates an instance of a server platform (with or without JIT compiler support\n * depending on the `ngJitMode` global const value), using provided options.\n */\nfunction createServerPlatform(options: PlatformOptions): PlatformRef {\n const extraProviders = options.platformProviders ?? [];\n const measuringLabel = 'createServerPlatform';\n startMeasuring(measuringLabel);\n\n const platform = platformServer([\n {provide: INITIAL_CONFIG, useValue: {document: options.document, url: options.url}},\n extraProviders,\n ]);\n\n stopMeasuring(measuringLabel);\n return platform;\n}\n\n/**\n * Finds and returns inlined event dispatch script if it exists.\n * See the `EVENT_DISPATCH_SCRIPT_ID` const docs for additional info.\n */\nfunction findEventDispatchScript(doc: Document) {\n return doc.getElementById(EVENT_DISPATCH_SCRIPT_ID);\n}\n\n/**\n * Removes inlined event dispatch script if it exists.\n * See the `EVENT_DISPATCH_SCRIPT_ID` const docs for additional info.\n */\nfunction removeEventDispatchScript(doc: Document) {\n findEventDispatchScript(doc)?.remove();\n}\n\n/**\n * Annotate nodes for hydration and remove event dispatch script when not needed.\n */\nfunction prepareForHydration(platformState: PlatformState, applicationRef: ApplicationRef): void {\n const measuringLabel = 'prepareForHydration';\n startMeasuring(measuringLabel);\n const environmentInjector = applicationRef.injector;\n const doc = platformState.getDocument();\n\n if (!environmentInjector.get(IS_HYDRATION_DOM_REUSE_ENABLED, false)) {\n // Hydration is diabled, remove inlined event dispatch script.\n // (which was injected by the build process) from the HTML.\n removeEventDispatchScript(doc);\n\n return;\n }\n\n appendSsrContentIntegrityMarker(doc);\n\n const eventTypesToReplay = annotateForHydration(applicationRef, doc);\n if (eventTypesToReplay.regular.size || eventTypesToReplay.capture.size) {\n insertEventRecordScript(\n environmentInjector.get(APP_ID),\n doc,\n eventTypesToReplay,\n environmentInjector.get(CSP_NONCE, null),\n );\n } else {\n // No events to replay, we should remove inlined event dispatch script\n // (which was injected by the build process) from the HTML.\n removeEventDispatchScript(doc);\n }\n stopMeasuring(measuringLabel);\n}\n\n/**\n * Creates a marker comment node and append it into the `<body>`.\n * Some CDNs have mechanisms to remove all comment node from HTML.\n * This behaviour breaks hydration, so we'll detect on the client side if this\n * marker comment is still available or else throw an error\n */\nfunction appendSsrContentIntegrityMarker(doc: Document) {\n // Adding a ng hydration marker comment\n const comment = doc.createComment(SSR_CONTENT_INTEGRITY_MARKER);\n doc.body.firstChild\n ? doc.body.insertBefore(comment, doc.body.firstChild)\n : doc.body.append(comment);\n}\n\n/**\n * Adds the `ng-server-context` attribute to host elements of all bootstrapped components\n * within a given application.\n */\nfunction appendServerContextInfo(applicationRef: ApplicationRef) {\n const injector = applicationRef.injector;\n let serverContext = sanitizeServerContext(injector.get(SERVER_CONTEXT, DEFAULT_SERVER_CONTEXT));\n applicationRef.components.forEach((componentRef) => {\n const renderer = componentRef.injector.get(Renderer2);\n const element = componentRef.location.nativeElement;\n if (element) {\n renderer.setAttribute(element, 'ng-server-context', serverContext);\n }\n });\n}\n\nfunction insertEventRecordScript(\n appId: string,\n doc: Document,\n eventTypesToReplay: {regular: Set<string>; capture: Set<string>},\n nonce: string | null,\n): void {\n const measuringLabel = 'insertEventRecordScript';\n startMeasuring(measuringLabel);\n const {regular, capture} = eventTypesToReplay;\n const eventDispatchScript = findEventDispatchScript(doc);\n\n // Note: this is only true when build with the CLI tooling, which inserts the script in the HTML\n if (eventDispatchScript) {\n // This is defined in packages/core/primitives/event-dispatch/contract_binary.ts\n const replayScriptContents =\n `window.__jsaction_bootstrap(` +\n `document.body,` +\n `\"${appId}\",` +\n `${JSON.stringify(Array.from(regular))},` +\n `${JSON.stringify(Array.from(capture))}` +\n `);`;\n\n const replayScript = createScript(doc, replayScriptContents, nonce);\n\n // Insert replay script right after inlined event dispatch script, since it\n // relies on `__jsaction_bootstrap` to be defined in the global scope.\n eventDispatchScript.after(replayScript);\n }\n stopMeasuring(measuringLabel);\n}\n\n/**\n * Renders an Angular application to a string.\n *\n * @private\n *\n * @param platformRef - Reference to the Angular platform.\n * @param applicationRef - Reference to the Angular application.\n * @returns A promise that resolves to the rendered string.\n */\nexport async function renderInternal(\n platformRef: PlatformRef,\n applicationRef: ApplicationRef,\n): Promise<string> {\n const platformState = platformRef.injector.get(PlatformState);\n prepareForHydration(platformState, applicationRef);\n appendServerContextInfo(applicationRef);\n\n // Run any BEFORE_APP_SERIALIZED callbacks just before rendering to string.\n const environmentInjector = applicationRef.injector;\n const callbacks = environmentInjector.get(BEFORE_APP_SERIALIZED, null);\n if (callbacks) {\n const asyncCallbacks: Promise<void>[] = [];\n for (const callback of callbacks) {\n try {\n const callbackResult = callback();\n if (callbackResult) {\n asyncCallbacks.push(callbackResult);\n }\n } catch (e) {\n // Ignore exceptions.\n console.warn('Ignoring BEFORE_APP_SERIALIZED Exception: ', e);\n }\n }\n\n if (asyncCallbacks.length) {\n for (const result of await Promise.allSettled(asyncCallbacks)) {\n if (result.status === 'rejected') {\n console.warn('Ignoring BEFORE_APP_SERIALIZED Exception: ', result.reason);\n }\n }\n }\n }\n\n return platformState.renderToString();\n}\n\n/**\n * Destroy the application in a macrotask, this allows pending promises to be settled and errors\n * to be surfaced to the users.\n */\nfunction asyncDestroyPlatform(platformRef: PlatformRef): Promise<void> {\n return new Promise<void>((resolve) => {\n setTimeout(() => {\n platformRef.destroy();\n resolve();\n }, 0);\n });\n}\n\n/**\n * Specifies the value that should be used if no server context value has been provided.\n */\nconst DEFAULT_SERVER_CONTEXT = 'other';\n\n/**\n * An internal token that allows providing extra information about the server context\n * (e.g. whether SSR or SSG was used). The value is a string and characters other\n * than [a-zA-Z0-9\\-] are removed. See the default value in `DEFAULT_SERVER_CONTEXT` const.\n */\nexport const SERVER_CONTEXT = new InjectionToken<string>('SERVER_CONTEXT');\n\n/**\n * Sanitizes provided server context:\n * - removes all characters other than a-z, A-Z, 0-9 and `-`\n * - returns `other` if nothing is provided or the string is empty after sanitization\n */\nfunction sanitizeServerContext(serverContext: string): string {\n const context = serverContext.replace(/[^a-zA-Z0-9\\-]/g, '');\n return context.length > 0 ? context : DEFAULT_SERVER_CONTEXT;\n}\n\n/**\n * Bootstraps an application using provided NgModule and serializes the page content to string.\n *\n * @param moduleType A reference to an NgModule that should be used for bootstrap.\n * @param options Additional configuration for the render operation:\n * - `document` - the document of the page to render, either as an HTML string or\n * as a reference to the `document` instance.\n * - `url` - the URL for the current render request.\n * - `extraProviders` - set of platform level providers for the current render request.\n *\n * @publicApi\n */\nexport async function renderModule<T>(\n moduleType: Type<T>,\n options: {document?: string | Document; url?: string; extraProviders?: StaticProvider[]},\n): Promise<string> {\n const {document, url, extraProviders: platformProviders} = options;\n const platformRef = createServerPlatform({document, url, platformProviders});\n try {\n const moduleRef = await platformRef.bootstrapModule(moduleType);\n const applicationRef = moduleRef.injector.get(ApplicationRef);\n\n const measuringLabel = 'whenStable';\n startMeasuring(measuringLabel);\n // Block until application is stable.\n await applicationRef.whenStable();\n stopMeasuring(measuringLabel);\n\n return await renderInternal(platformRef, applicationRef);\n } finally {\n await asyncDestroyPlatform(platformRef);\n }\n}\n\n/**\n * Bootstraps an instance of an Angular application and renders it to a string.\n\n * ```ts\n * const bootstrap = () => bootstrapApplication(RootComponent, appConfig);\n * const output: string = await renderApplication(bootstrap);\n * ```\n *\n * @param bootstrap A method that when invoked returns a promise that returns an `ApplicationRef`\n * instance once resolved.\n * @param options Additional configuration for the render operation:\n * - `document` - the document of the page to render, either as an HTML string or\n * as a reference to the `document` instance.\n * - `url` - the URL for the current render request.\n * - `platformProviders` - the platform level providers for the current render request.\n *\n * @returns A Promise, that returns serialized (to a string) rendered page, once resolved.\n *\n * @publicApi\n */\nexport async function renderApplication<T>(\n bootstrap: () => Promise<ApplicationRef>,\n options: {document?: string | Document; url?: string; platformProviders?: Provider[]},\n): Promise<string> {\n const renderAppLabel = 'renderApplication';\n const bootstrapLabel = 'bootstrap';\n const _renderLabel = '_render';\n\n startMeasuring(renderAppLabel);\n const platformRef = createServerPlatform(options);\n try {\n startMeasuring(bootstrapLabel);\n const applicationRef = await bootstrap();\n stopMeasuring(bootstrapLabel);\n\n startMeasuring(_renderLabel);\n\n const measuringLabel = 'whenStable';\n startMeasuring(measuringLabel);\n // Block until application is stable.\n await applicationRef.whenStable();\n stopMeasuring(measuringLabel);\n\n const rendered = await renderInternal(platformRef, applicationRef);\n stopMeasuring(_renderLabel);\n return rendered;\n } finally {\n await asyncDestroyPlatform(platformRef);\n stopMeasuring(renderAppLabel);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of the platform-server package.\n */\n\nimport {Version} from '@angular/core';\n\n/**\n * @publicApi\n */\nexport const VERSION = new Version('21.0.0-next.1');\n"],"names":["startMeasuring","stopMeasuring","IS_HYDRATION_DOM_REUSE_ENABLED","annotateForHydration","SSR_CONTENT_INTEGRITY_MARKER"],"mappings":";;;;;;;;;;;;;;AAYA;;;;;;;;;;;;;;AAcG;SACa,sBAAsB,GAAA;AACpC,IAAA,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE;AACvC,QAAA,UAAU,CAAC,cAAc,CAAC,GAAG,IAAI;;AAGnC,IAAA,OAAO,wBAAwB,CAAC,CAAC,GAAG,yBAAyB,CAAC,CAAC;AACjE;;ACHA;;;;;;;AAOG;AACI,MAAM,wBAAwB,GAAG,4BAA4B;AAQpE;;;AAGG;AACH,SAAS,oBAAoB,CAAC,OAAwB,EAAA;AACpD,IAAA,MAAM,cAAc,GAAG,OAAO,CAAC,iBAAiB,IAAI,EAAE;IACtD,MAAM,cAAc,GAAG,sBAAsB;IAC7CA,eAAc,CAAC,cAAc,CAAC;IAE9B,MAAM,QAAQ,GAAG,cAAc,CAAC;AAC9B,QAAA,EAAC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,EAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAC,EAAC;QACnF,cAAc;AACf,KAAA,CAAC;IAEFC,cAAa,CAAC,cAAc,CAAC;AAC7B,IAAA,OAAO,QAAQ;AACjB;AAEA;;;AAGG;AACH,SAAS,uBAAuB,CAAC,GAAa,EAAA;AAC5C,IAAA,OAAO,GAAG,CAAC,cAAc,CAAC,wBAAwB,CAAC;AACrD;AAEA;;;AAGG;AACH,SA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Ac,CAAC,cAAc,CAAC;AAC9B,IAAA,MAAM,WAAW,GAAG,oBAAoB,CAAC,OAAO,CAAC;AACjD,IAAA,IAAI;QACFA,eAAc,CAAC,cAAc,CAAC;AAC9B,QAAA,MAAM,cAAc,GAAG,MAAM,SAAS,EAAE;QACxCC,cAAa,CAAC,cAAc,CAAC;QAE7BD,eAAc,CAAC,YAAY,CAAC;QAE5B,MAAM,cAAc,GAAG,YAAY;QACnCA,eAAc,CAAC,cAAc,CAAC;;AAE9B,QAAA,MAAM,cAAc,CAAC,UAAU,EAAE;QACjCC,cAAa,CAAC,cAAc,CAAC;QAE7B,MAAM,QAAQ,GAAG,MAAM,cAAc,CAAC,WAAW,EAAE,cAAc,CAAC;QAClEA,cAAa,CAAC,YAAY,CAAC;AAC3B,QAAA,OAAO,QAAQ;;YACP;AACR,QAAA,MAAM,oBAAoB,CAAC,WAAW,CAAC;QACvCA,cAAa,CAAC,cAAc,CAAC;;AAEjC;;AC7UA;;;;AAIG;AAIH;;AAEG;MACU,OAAO,GAAG,IAAI,OAAO,CAAC,mBAAmB;;;;"}
1
+ {"version":3,"file":"platform-server.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/platform-server/src/utils.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n APP_ID,\n ApplicationRef,\n CSP_NONCE,\n InjectionToken,\n PlatformRef,\n Provider,\n Renderer2,\n StaticProvider,\n Type,\n ɵannotateForHydration as annotateForHydration,\n ɵIS_HYDRATION_DOM_REUSE_ENABLED as IS_HYDRATION_DOM_REUSE_ENABLED,\n ɵSSR_CONTENT_INTEGRITY_MARKER as SSR_CONTENT_INTEGRITY_MARKER,\n ɵstartMeasuring as startMeasuring,\n ɵstopMeasuring as stopMeasuring,\n} from '@angular/core';\nimport {BootstrapContext} from '@angular/platform-browser';\n\nimport {platformServer} from './server';\nimport {PlatformState} from './platform_state';\nimport {BEFORE_APP_SERIALIZED, INITIAL_CONFIG} from './tokens';\nimport {createScript} from './transfer_state';\n\n/**\n * Event dispatch (JSAction) script is inlined into the HTML by the build\n * process to avoid extra blocking request on a page. The script looks like this:\n * ```html\n * <script type=\"text/javascript\" id=\"ng-event-dispatch-contract\">...</script>\n * ```\n * This const represents the \"id\" attribute value.\n */\nexport const EVENT_DISPATCH_SCRIPT_ID = 'ng-event-dispatch-contract';\n\ninterface PlatformOptions {\n document?: string | Document;\n url?: string;\n platformProviders?: Provider[];\n}\n\n/**\n * Creates an instance of a server platform (with or without JIT compiler support\n * depending on the `ngJitMode` global const value), using provided options.\n */\nfunction createServerPlatform(options: PlatformOptions): PlatformRef {\n const extraProviders = options.platformProviders ?? [];\n const measuringLabel = 'createServerPlatform';\n startMeasuring(measuringLabel);\n\n const platform = platformServer([\n {provide: INITIAL_CONFIG, useValue: {document: options.document, url: options.url}},\n extraProviders,\n ]);\n\n stopMeasuring(measuringLabel);\n return platform;\n}\n\n/**\n * Finds and returns inlined event dispatch script if it exists.\n * See the `EVENT_DISPATCH_SCRIPT_ID` const docs for additional info.\n */\nfunction findEventDispatchScript(doc: Document) {\n return doc.getElementById(EVENT_DISPATCH_SCRIPT_ID);\n}\n\n/**\n * Removes inlined event dispatch script if it exists.\n * See the `EVENT_DISPATCH_SCRIPT_ID` const docs for additional info.\n */\nfunction removeEventDispatchScript(doc: Document) {\n findEventDispatchScript(doc)?.remove();\n}\n\n/**\n * Annotate nodes for hydration and remove event dispatch script when not needed.\n */\nfunction prepareForHydration(platformState: PlatformState, applicationRef: ApplicationRef): void {\n const measuringLabel = 'prepareForHydration';\n startMeasuring(measuringLabel);\n const environmentInjector = applicationRef.injector;\n const doc = platformState.getDocument();\n\n if (!environmentInjector.get(IS_HYDRATION_DOM_REUSE_ENABLED, false)) {\n // Hydration is diabled, remove inlined event dispatch script.\n // (which was injected by the build process) from the HTML.\n removeEventDispatchScript(doc);\n\n return;\n }\n\n appendSsrContentIntegrityMarker(doc);\n\n const eventTypesToReplay = annotateForHydration(applicationRef, doc);\n if (eventTypesToReplay.regular.size || eventTypesToReplay.capture.size) {\n insertEventRecordScript(\n environmentInjector.get(APP_ID),\n doc,\n eventTypesToReplay,\n environmentInjector.get(CSP_NONCE, null),\n );\n } else {\n // No events to replay, we should remove inlined event dispatch script\n // (which was injected by the build process) from the HTML.\n removeEventDispatchScript(doc);\n }\n stopMeasuring(measuringLabel);\n}\n\n/**\n * Creates a marker comment node and append it into the `<body>`.\n * Some CDNs have mechanisms to remove all comment node from HTML.\n * This behaviour breaks hydration, so we'll detect on the client side if this\n * marker comment is still available or else throw an error\n */\nfunction appendSsrContentIntegrityMarker(doc: Document) {\n // Adding a ng hydration marker comment\n const comment = doc.createComment(SSR_CONTENT_INTEGRITY_MARKER);\n doc.body.firstChild\n ? doc.body.insertBefore(comment, doc.body.firstChild)\n : doc.body.append(comment);\n}\n\n/**\n * Adds the `ng-server-context` attribute to host elements of all bootstrapped components\n * within a given application.\n */\nfunction appendServerContextInfo(applicationRef: ApplicationRef) {\n const injector = applicationRef.injector;\n let serverContext = sanitizeServerContext(injector.get(SERVER_CONTEXT, DEFAULT_SERVER_CONTEXT));\n applicationRef.components.forEach((componentRef) => {\n const renderer = componentRef.injector.get(Renderer2);\n const element = componentRef.location.nativeElement;\n if (element) {\n renderer.setAttribute(element, 'ng-server-context', serverContext);\n }\n });\n}\n\nfunction insertEventRecordScript(\n appId: string,\n doc: Document,\n eventTypesToReplay: {regular: Set<string>; capture: Set<string>},\n nonce: string | null,\n): void {\n const measuringLabel = 'insertEventRecordScript';\n startMeasuring(measuringLabel);\n const {regular, capture} = eventTypesToReplay;\n const eventDispatchScript = findEventDispatchScript(doc);\n\n // Note: this is only true when build with the CLI tooling, which inserts the script in the HTML\n if (eventDispatchScript) {\n // This is defined in packages/core/primitives/event-dispatch/contract_binary.ts\n const replayScriptContents =\n `window.__jsaction_bootstrap(` +\n `document.body,` +\n `\"${appId}\",` +\n `${JSON.stringify(Array.from(regular))},` +\n `${JSON.stringify(Array.from(capture))}` +\n `);`;\n\n const replayScript = createScript(doc, replayScriptContents, nonce);\n\n // Insert replay script right after inlined event dispatch script, since it\n // relies on `__jsaction_bootstrap` to be defined in the global scope.\n eventDispatchScript.after(replayScript);\n }\n stopMeasuring(measuringLabel);\n}\n\n/**\n * Renders an Angular application to a string.\n *\n * @private\n *\n * @param platformRef - Reference to the Angular platform.\n * @param applicationRef - Reference to the Angular application.\n * @returns A promise that resolves to the rendered string.\n */\nexport async function renderInternal(\n platformRef: PlatformRef,\n applicationRef: ApplicationRef,\n): Promise<string> {\n const platformState = platformRef.injector.get(PlatformState);\n prepareForHydration(platformState, applicationRef);\n appendServerContextInfo(applicationRef);\n\n // Run any BEFORE_APP_SERIALIZED callbacks just before rendering to string.\n const environmentInjector = applicationRef.injector;\n const callbacks = environmentInjector.get(BEFORE_APP_SERIALIZED, null);\n if (callbacks) {\n const asyncCallbacks: Promise<void>[] = [];\n for (const callback of callbacks) {\n try {\n const callbackResult = callback();\n if (callbackResult) {\n asyncCallbacks.push(callbackResult);\n }\n } catch (e) {\n // Ignore exceptions.\n console.warn('Ignoring BEFORE_APP_SERIALIZED Exception: ', e);\n }\n }\n\n if (asyncCallbacks.length) {\n for (const result of await Promise.allSettled(asyncCallbacks)) {\n if (result.status === 'rejected') {\n console.warn('Ignoring BEFORE_APP_SERIALIZED Exception: ', result.reason);\n }\n }\n }\n }\n\n return platformState.renderToString();\n}\n\n/**\n * Destroy the application in a macrotask, this allows pending promises to be settled and errors\n * to be surfaced to the users.\n */\nfunction asyncDestroyPlatform(platformRef: PlatformRef): Promise<void> {\n return new Promise<void>((resolve) => {\n setTimeout(() => {\n platformRef.destroy();\n resolve();\n }, 0);\n });\n}\n\n/**\n * Specifies the value that should be used if no server context value has been provided.\n */\nconst DEFAULT_SERVER_CONTEXT = 'other';\n\n/**\n * An internal token that allows providing extra information about the server context\n * (e.g. whether SSR or SSG was used). The value is a string and characters other\n * than [a-zA-Z0-9\\-] are removed. See the default value in `DEFAULT_SERVER_CONTEXT` const.\n */\nexport const SERVER_CONTEXT = new InjectionToken<string>('SERVER_CONTEXT');\n\n/**\n * Sanitizes provided server context:\n * - removes all characters other than a-z, A-Z, 0-9 and `-`\n * - returns `other` if nothing is provided or the string is empty after sanitization\n */\nfunction sanitizeServerContext(serverContext: string): string {\n const context = serverContext.replace(/[^a-zA-Z0-9\\-]/g, '');\n return context.length > 0 ? context : DEFAULT_SERVER_CONTEXT;\n}\n\n/**\n * Bootstraps an application using provided NgModule and serializes the page content to string.\n *\n * @param moduleType A reference to an NgModule that should be used for bootstrap.\n * @param options Additional configuration for the render operation:\n * - `document` - the document of the page to render, either as an HTML string or\n * as a reference to the `document` instance.\n * - `url` - the URL for the current render request.\n * - `extraProviders` - set of platform level providers for the current render request.\n *\n * @publicApi\n */\nexport async function renderModule<T>(\n moduleType: Type<T>,\n options: {document?: string | Document; url?: string; extraProviders?: StaticProvider[]},\n): Promise<string> {\n const {document, url, extraProviders: platformProviders} = options;\n const platformRef = createServerPlatform({document, url, platformProviders});\n try {\n const moduleRef = await platformRef.bootstrapModule(moduleType);\n const applicationRef = moduleRef.injector.get(ApplicationRef);\n\n const measuringLabel = 'whenStable';\n startMeasuring(measuringLabel);\n // Block until application is stable.\n await applicationRef.whenStable();\n stopMeasuring(measuringLabel);\n\n return await renderInternal(platformRef, applicationRef);\n } finally {\n await asyncDestroyPlatform(platformRef);\n }\n}\n\n/**\n * Bootstraps an instance of an Angular application and renders it to a string.\n *\n * @usageNotes\n *\n * ```ts\n * import { BootstrapContext, bootstrapApplication } from '@angular/platform-browser';\n * import { renderApplication } from '@angular/platform-server';\n * import { ApplicationConfig } from '@angular/core';\n * import { AppComponent } from './app.component';\n *\n * const appConfig: ApplicationConfig = { providers: [...] };\n * const bootstrap = (context: BootstrapContext) =>\n * bootstrapApplication(AppComponent, config, context);\n * const output = await renderApplication(bootstrap);\n * ```\n *\n * @param bootstrap A method that when invoked returns a promise that returns an `ApplicationRef`\n * instance once resolved. The method is invoked with an `Injector` instance that\n * provides access to the platform-level dependency injection context.\n * @param options Additional configuration for the render operation:\n * - `document` - the document of the page to render, either as an HTML string or\n * as a reference to the `document` instance.\n * - `url` - the URL for the current render request.\n * - `platformProviders` - the platform level providers for the current render request.\n *\n * @returns A Promise, that returns serialized (to a string) rendered page, once resolved.\n *\n * @publicApi\n */\nexport async function renderApplication(\n bootstrap: (context: BootstrapContext) => Promise<ApplicationRef>,\n options: {document?: string | Document; url?: string; platformProviders?: Provider[]},\n): Promise<string> {\n const renderAppLabel = 'renderApplication';\n const bootstrapLabel = 'bootstrap';\n const _renderLabel = '_render';\n\n startMeasuring(renderAppLabel);\n const platformRef = createServerPlatform(options);\n try {\n startMeasuring(bootstrapLabel);\n const applicationRef = await bootstrap({platformRef});\n stopMeasuring(bootstrapLabel);\n\n startMeasuring(_renderLabel);\n\n const measuringLabel = 'whenStable';\n startMeasuring(measuringLabel);\n // Block until application is stable.\n await applicationRef.whenStable();\n stopMeasuring(measuringLabel);\n\n const rendered = await renderInternal(platformRef, applicationRef);\n stopMeasuring(_renderLabel);\n return rendered;\n } finally {\n await asyncDestroyPlatform(platformRef);\n stopMeasuring(renderAppLabel);\n }\n}\n"],"names":["measuringLabel","extraProviders","platform","findEventDispatchScript","doc","getElementById","EVENT_DISPATCH_SCRIPT_ID","removeEventDispatchScript","environmentInjector","applicationRef","injector","platformState","getDocument","appendSsrContentIntegrityMarker","annotateForHydration","eventTypesToReplay","regular","size","capture","get","CSP_NONCE","stopMeasuring","appendServerContextInfo","renderer","setAttribute","element","serverContext","insertEventRecordScript","appId","nonce","startMeasuring","JSON","stringify","Array","from","after","replayScript","callbacks","BEFORE_APP_SERIALIZED","console","warn","e","length","result","status","reason","asyncDestroyPlatform","platformRef","context","DEFAULT_SERVER_CONTEXT"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA4EG,EAAA,MAAAA,cAAA,GAAA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A,CAAA,EAAA,CAAA,GACF,CAAAG,EAAAA,IAAA,CAAAC,SAAA,CAAAC,KAAA,CAAAC,IAAA,CAAAlB,OAAA,CAGF,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,EAAAe,IAAA,CAAAC,SAAA,CAAAC,KAAA,CAAAC,IAAA,CAAAhB,OAAA,CAEA,CAAA,CAAA,CAAA,GAAA,CAAA,EAAA,CAAA;;uBAKoB,CAAAiB,KAAA,CAAAC,YAAA,CAAA;;+BAEF,CAAA;;;;;;;AAuBT,EAAA,MAAAC,SAAA,GAAA7B,mBAAA,CAAAW,GAAA,CAAAmB,qBAAA,EAAA,IAAA,CAAA;MACDD,SAAA,EAAA;;;;;;;;;AAgBIE,QAAAA,OAAA,CAAAC,IAAA,CACV,4CAAA,EAAAC,CAAA,CAAA;;;AAKI,IAAA,IAAA,cAAA,CAAAC,MAAA,EAAA;;QACF,IAAMC,MAAA,CAAAC,MAAA,KAAA,UAAA,EAAA;AACNL,UAAAA,OAAA,CAAAC,IAAA,CAAA,4CAAuB,EAAAG,MAAA,CAAAE,MAAA,CAAA;AAEvB;;;;qCAM2B,EAAA;;AAM/BC,SAAAA,oBAAAA,CAAAC,WAAA,EAAA;;;;;;;;;;;;AA8BA,EAAA,OAAAC,OAAA,CAAAN,MAAA,GAAAM,CAAAA,GAAAA,OAAA,GAAAC,sBAAA;;;;;;;;;;;;;;;;AA2BI,IAAA,MAAAjD,cAAA,GAAA,YAAA;mBACc,CAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,46 +1,58 @@
1
1
  /**
2
- * @license Angular v21.0.0-next.1
3
- * (c) 2010-2025 Google LLC. https://angular.io/
2
+ * @license Angular v21.0.0-next.10
3
+ * (c) 2010-2025 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
6
6
 
7
7
  import * as i0 from '@angular/core';
8
8
  import { createPlatformFactory, platformCore, NgModule } from '@angular/core';
9
9
  import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing';
10
- import { SERVER_RENDER_PROVIDERS, INTERNAL_SERVER_PLATFORM_PROVIDERS } from './server.mjs';
10
+ import { SERVER_RENDER_PROVIDERS, INTERNAL_SERVER_PLATFORM_PROVIDERS } from './_server-chunk.mjs';
11
11
  import '@angular/common';
12
12
  import '@angular/platform-browser';
13
13
  import '@angular/common/http';
14
14
  import 'rxjs';
15
15
 
16
- const INTERNAL_SERVER_DYNAMIC_PLATFORM_TESTING_PROVIDERS = [
17
- ...INTERNAL_SERVER_PLATFORM_PROVIDERS,
18
- ];
19
- /**
20
- * Platform for testing
21
- *
22
- * @publicApi
23
- * @deprecated from v20.0.0, use e2e testing to verify SSR behavior.
24
- */
16
+ const INTERNAL_SERVER_DYNAMIC_PLATFORM_TESTING_PROVIDERS = [...INTERNAL_SERVER_PLATFORM_PROVIDERS];
25
17
  const platformServerTesting = createPlatformFactory(platformCore, 'serverTesting', INTERNAL_SERVER_DYNAMIC_PLATFORM_TESTING_PROVIDERS);
26
- /**
27
- * NgModule for testing.
28
- *
29
- * @publicApi
30
- * @deprecated from v20.0.0, use e2e testing to verify SSR behavior.
31
- */
32
18
  class ServerTestingModule {
33
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: ServerTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
34
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.2.0-next.2", ngImport: i0, type: ServerTestingModule, exports: [BrowserDynamicTestingModule] });
35
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: ServerTestingModule, providers: SERVER_RENDER_PROVIDERS, imports: [BrowserDynamicTestingModule] });
19
+ static ɵfac = i0.ɵɵngDeclareFactory({
20
+ minVersion: "12.0.0",
21
+ version: "21.0.0-next.10",
22
+ ngImport: i0,
23
+ type: ServerTestingModule,
24
+ deps: [],
25
+ target: i0.ɵɵFactoryTarget.NgModule
26
+ });
27
+ static ɵmod = i0.ɵɵngDeclareNgModule({
28
+ minVersion: "14.0.0",
29
+ version: "21.0.0-next.10",
30
+ ngImport: i0,
31
+ type: ServerTestingModule,
32
+ exports: [BrowserDynamicTestingModule]
33
+ });
34
+ static ɵinj = i0.ɵɵngDeclareInjector({
35
+ minVersion: "12.0.0",
36
+ version: "21.0.0-next.10",
37
+ ngImport: i0,
38
+ type: ServerTestingModule,
39
+ providers: SERVER_RENDER_PROVIDERS,
40
+ imports: [BrowserDynamicTestingModule]
41
+ });
36
42
  }
37
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: ServerTestingModule, decorators: [{
38
- type: NgModule,
39
- args: [{
40
- exports: [BrowserDynamicTestingModule],
41
- providers: SERVER_RENDER_PROVIDERS,
42
- }]
43
- }] });
43
+ i0.ɵɵngDeclareClassMetadata({
44
+ minVersion: "12.0.0",
45
+ version: "21.0.0-next.10",
46
+ ngImport: i0,
47
+ type: ServerTestingModule,
48
+ decorators: [{
49
+ type: NgModule,
50
+ args: [{
51
+ exports: [BrowserDynamicTestingModule],
52
+ providers: SERVER_RENDER_PROVIDERS
53
+ }]
54
+ }]
55
+ });
44
56
 
45
57
  export { ServerTestingModule, platformServerTesting };
46
58
  //# sourceMappingURL=testing.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"testing.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/packages/platform-server/testing/src/server.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n createPlatformFactory,\n NgModule,\n platformCore,\n PlatformRef,\n StaticProvider,\n} from '@angular/core';\nimport {BrowserDynamicTestingModule} from '@angular/platform-browser-dynamic/testing';\nimport {\n ɵINTERNAL_SERVER_PLATFORM_PROVIDERS as INTERNAL_SERVER_PLATFORM_PROVIDERS,\n ɵSERVER_RENDER_PROVIDERS as SERVER_RENDER_PROVIDERS,\n} from '../../index';\n\nconst INTERNAL_SERVER_DYNAMIC_PLATFORM_TESTING_PROVIDERS: StaticProvider[] = [\n ...INTERNAL_SERVER_PLATFORM_PROVIDERS,\n];\n\n/**\n * Platform for testing\n *\n * @publicApi\n * @deprecated from v20.0.0, use e2e testing to verify SSR behavior.\n */\nexport const platformServerTesting: (extraProviders?: StaticProvider[]) => PlatformRef =\n createPlatformFactory(\n platformCore,\n 'serverTesting',\n INTERNAL_SERVER_DYNAMIC_PLATFORM_TESTING_PROVIDERS,\n );\n\n/**\n * NgModule for testing.\n *\n * @publicApi\n * @deprecated from v20.0.0, use e2e testing to verify SSR behavior.\n */\n@NgModule({\n exports: [BrowserDynamicTestingModule],\n providers: SERVER_RENDER_PROVIDERS,\n})\nexport class ServerTestingModule {}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAqBA,MAAM,kDAAkD,GAAqB;AAC3E,IAAA,GAAG,kCAAkC;CACtC;AAED;;;;;AAKG;AACI,MAAM,qBAAqB,GAChC,qBAAqB,CACnB,YAAY,EACZ,eAAe,EACf,kDAAkD;AAGtD;;;;;AAKG;MAKU,mBAAmB,CAAA;8GAAnB,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;AAAnB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,eAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,YAHpB,2BAA2B,CAAA,EAAA,CAAA;+GAG1B,mBAAmB,EAAA,SAAA,EAFnB,uBAAuB,EAAA,OAAA,EAAA,CADxB,2BAA2B,CAAA,EAAA,CAAA;;kGAG1B,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAJ/B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,2BAA2B,CAAC;AACtC,oBAAA,SAAS,EAAE,uBAAuB;AACnC,iBAAA;;;;;"}
1
+ {"version":3,"file":"testing.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}