Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@angular/ssr

Package Overview
Dependencies
Maintainers
2
Versions
131
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@angular/ssr - npm Package Compare versions

Comparing version 18.2.0 to 19.0.0-next.0

esm2022/src/app-engine.mjs

78

index.d.ts

@@ -6,2 +6,41 @@ import { ApplicationRef } from '@angular/core';

/**
* Represents the bootstrap mechanism for an Angular application.
*
* This type can either be:
* - A reference to an Angular component or module (`Type<unknown>`) that serves as the root of the application.
* - A function that returns a `Promise<ApplicationRef>`, which resolves with the root application reference.
*/
declare type AngularBootstrap = Type<unknown> | (() => Promise<ApplicationRef>);
/**
* Result of extracting routes from an Angular application.
*/
declare interface AngularRouterConfigResult {
/**
* The base URL for the application.
* This is the base href that is used for resolving relative paths within the application.
*/
baseHref: string;
/**
* An array of `RouteResult` objects representing the application's routes.
*
* Each `RouteResult` contains details about a specific route, such as its path and any
* associated redirection targets. This array is asynchronously generated and
* provides information on how routes are structured and resolved.
*
* Example:
* ```typescript
* const result: AngularRouterConfigResult = {
* baseHref: '/app/',
* routes: [
* { route: '/home', redirectTo: '/welcome' },
* { route: '/about' },
* ],
* };
* ```
*/
routes: RouteResult[];
}
/**
* A common engine to use to server render an application.

@@ -56,2 +95,41 @@ */

/**
* Represents the result of processing a route.
*/
declare interface RouteResult {
/**
* The resolved path of the route.
*
* This string represents the complete URL path for the route after it has been
* resolved, including any parent routes or path segments that have been joined.
*/
route: string;
/**
* The target path for route redirection, if applicable.
*
* If this route has a `redirectTo` property in the configuration, this field will
* contain the full resolved URL path that the route should redirect to.
*/
redirectTo?: string;
}
/**
* Retrieves routes from the given Angular application.
*
* This function initializes an Angular platform, bootstraps the application or module,
* and retrieves routes from the Angular router configuration. It handles both module-based
* and function-based bootstrapping. It yields the resulting routes as `RouteResult` objects.
*
* @param bootstrap - A function that returns a promise resolving to an `ApplicationRef` or an Angular module to bootstrap.
* @param document - The initial HTML document used for server-side rendering.
* This document is necessary to render the application on the server.
* @param url - The URL for server-side rendering. The URL is used to configure `ServerPlatformLocation`. This configuration is crucial
* for ensuring that API requests for relative paths succeed, which is essential for accurate route extraction.
* See:
* - https://github.com/angular/angular/blob/d608b857c689d17a7ffa33bbb510301014d24a17/packages/platform-server/src/location.ts#L51
* - https://github.com/angular/angular/blob/6882cc7d9eed26d3caeedca027452367ba25f2b9/packages/platform-server/src/http.ts#L44
* @returns A promise that resolves to an object of type `AngularRouterConfigResult`.
*/
export declare function ɵgetRoutesFromAngularRouterConfig(bootstrap: AngularBootstrap, document: string, url: URL): Promise<AngularRouterConfigResult>;
export { }

16

package.json
{
"name": "@angular/ssr",
"version": "18.2.0",
"version": "19.0.0-next.0",
"description": "Angular server side rendering utilities",

@@ -20,5 +20,15 @@ "license": "MIT",

"peerDependencies": {
"@angular/common": "^18.0.0",
"@angular/core": "^18.0.0"
"@angular/common": "^19.0.0-next.0",
"@angular/core": "^19.0.0-next.0",
"@angular/router": "^19.0.0-next.0"
},
"devDependencies": {
"@angular/common": "19.0.0-next.0",
"@angular/compiler": "19.0.0-next.0",
"@angular/core": "19.0.0-next.0",
"@angular/platform-browser": "19.0.0-next.0",
"@angular/platform-server": "19.0.0-next.0",
"@angular/router": "19.0.0-next.0",
"zone.js": "^0.14.0"
},
"schematics": "./schematics/collection.json",

@@ -25,0 +35,0 @@ "repository": {

esm2022/src/common-engine.mjs

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc