Skip to content

Commit

Permalink
fix(@angular/ssr): export RESPONSE_INIT, REQUEST, and `REQUEST_CO…
Browse files Browse the repository at this point in the history
…NTEXT` tokens

This commit exports that the `RESPONSE_INIT`, `REQUEST`, and `REQUEST_CONTEXT` tokens.
  • Loading branch information
alan-agius4 committed Sep 25, 2024
1 parent ce26415 commit 65b6e75
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
10 changes: 10 additions & 0 deletions goldens/public-api/angular/ssr/index.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
```ts

import { EnvironmentProviders } from '@angular/core';
import { InjectionToken } from '@angular/core';

// @public
export class AngularAppEngine {
Expand Down Expand Up @@ -34,6 +35,15 @@ export enum RenderMode {
Server = 1
}

// @public
export const REQUEST: InjectionToken<Request>;

// @public
export const REQUEST_CONTEXT: InjectionToken<unknown>;

// @public
export const RESPONSE_INIT: InjectionToken<ResponseInit>;

// @public
export type ServerRoute = ServerRouteAppShell | ServerRouteClient | ServerRoutePrerender | ServerRoutePrerenderWithParams | ServerRouteServer;

Expand Down
2 changes: 2 additions & 0 deletions packages/angular/ssr/public_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ export {
provideServerRoutesConfig,
RenderMode,
} from './src/routes/route-config';

export { REQUEST, RESPONSE_INIT, REQUEST_CONTEXT } from './src/tokens';
3 changes: 3 additions & 0 deletions packages/angular/ssr/src/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,18 @@ import { InjectionToken } from '@angular/core';

/**
* Injection token for the current request.
* @developerPreview
*/
export const REQUEST = new InjectionToken<Request>('REQUEST');

/**
* Injection token for the response initialization options.
* @developerPreview
*/
export const RESPONSE_INIT = new InjectionToken<ResponseInit>('RESPONSE_INIT');

/**
* Injection token for additional request context.
* @developerPreview
*/
export const REQUEST_CONTEXT = new InjectionToken<unknown>('REQUEST_CONTEXT');

0 comments on commit 65b6e75

Please sign in to comment.