
Security News
pnpm 10.12 Introduces Global Virtual Store and Expanded Version Catalogs
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.
@angular/platform-server
Advanced tools
@angular/platform-server is an Angular package that enables server-side rendering (SSR) for Angular applications. It allows you to render Angular applications on the server, which can improve performance, SEO, and user experience by delivering fully rendered pages to the client.
Server-Side Rendering (SSR)
This feature allows you to render an Angular application on the server. The `renderModule` function takes an Angular module and renders it to a string, which can then be sent to the client.
const { renderModule } = require('@angular/platform-server');
const { AppServerModule } = require('./src/main.server');
renderModule(AppServerModule, {
document: '<app-root></app-root>',
url: '/'
}).then(html => {
console.log(html);
});
Preboot
Preboot is a library that works with Angular Universal to record and playback user events while the client-side app is loading. This code sample demonstrates how to set up a global window and document object using the 'domino' library to enable Preboot.
const { renderModule } = require('@angular/platform-server');
const { AppServerModule } = require('./src/main.server');
const { createWindow } = require('domino');
const win = createWindow('<html><head></head><body><app-root></app-root></body></html>');
global['window'] = win;
global['document'] = win.document;
global['navigator'] = win.navigator;
renderModule(AppServerModule, {
document: win.document,
url: '/'
}).then(html => {
console.log(html);
});
Transfer State
Transfer State allows you to transfer state from the server to the client, reducing the need for duplicate HTTP requests. This code sample shows how to import and use the ServerTransferStateModule in your server-side module.
import { NgModule } from '@angular/core';
import { ServerModule, ServerTransferStateModule } from '@angular/platform-server';
import { AppComponent } from './app.component';
import { AppModule } from './app.module';
@NgModule({
imports: [
AppModule,
ServerModule,
ServerTransferStateModule
],
bootstrap: [AppComponent],
})
export class AppServerModule {}
Next.js is a React framework that enables server-side rendering and static site generation. It provides a similar SSR functionality to @angular/platform-server but is designed for React applications. It also includes features like API routes, automatic code splitting, and more.
Nuxt.js is a framework for Vue.js that enables server-side rendering and static site generation. It offers similar SSR capabilities to @angular/platform-server but is tailored for Vue.js applications. Nuxt.js also provides features like automatic routing, Vuex store integration, and more.
Sapper is a framework for Svelte that provides server-side rendering and other advanced features. It offers similar SSR functionality to @angular/platform-server but is designed for Svelte applications. Sapper also includes features like file-based routing and prefetching.
The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.
Usage information and reference details can be found in Angular documentation.
License: MIT
20.0.0-rc.2 (2025-05-21)
@angular/platform-browser-dynamic
Resource.value()
now returns a default value when in a loading state after reloading the error stateResource.value()
now throws an error when it's in an error state. Previously it returned undefined
.Resource.error
now has a type of Signal<Error | undefined>
instead of Signal<unknown>
Resource.reload
has been moved to WritableResource.reload
.| Commit | Type | Description | | -- | -- | -- | | af7881abac | fix | cancel reader when app is destroyed (#61528) | | 966df84351 | fix | prevent reading chunks if app is destroyed (#61354) |
| Commit | Type | Description | | -- | -- | -- | | e74266b108 | fix | avoid conflicts between HMR code and local symbols (#61550) |
| Commit | Type | Description | | -- | -- | -- | | b57084267e | fix | Always retain prior results for all files (#61487) | | 7a3a41f33f | fix | avoid ECMAScript private field metadata emit (#61227) |
| Commit | Type | Description |
| -- | -- | -- |
| 7efb3384a7 | fix | cleanup rxResource
abort listener (#58306) |
| b90160d10a | fix | cleanup testability subscriptions (#61261) |
| 3ba39bc28f | fix | getting resource value throws an error instead of returning undefined (#61441) |
| ca6295e90b | fix | handle different DI token types in Chrome DevTools integration (#61333) |
| d62379bb13 | fix | move reload method from Resource to WritableResource (#61441) |
| a89f1cff24 | fix | narrow error type for resources API (#61441) |
| 6e79eaf739 | fix | reading resource value after reload in the error state (#61441) |
| 350776b412 | fix | TestBed.tick should ensure test components are synchronized (#61382) |
| 648d42fe65 | fix | Testing should not throw when Zone does not patch test FW APIs (#61376) |
| 5dbeb42308 | fix | unregister onDestroy
in toSignal
. (#61514) |
| 30e081287d | fix | update min Node.js support to 20.19, 22.12, and 24.0 (#61500) |
| Commit | Type | Description |
| -- | -- | -- |
| bc2cab747f | refactor | Deprecate the platform-browser-dynamic
package (#61043) |
| Commit | Type | Description | | -- | -- | -- | | 6d8e57d131 | perf | speed up resolution of base (#61392) |
<!-- CHANGELOG SPLIT MARKER --><a name="19.2.12"></a>
FAQs
Angular - library for using Angular in Node.js
The npm package @angular/platform-server receives a total of 355,687 weekly downloads. As such, @angular/platform-server popularity was classified as popular.
We found that @angular/platform-server demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.
Security News
Amaro 1.0 lays the groundwork for stable TypeScript support in Node.js, bringing official .ts loading closer to reality.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.