Skip to content

Commit

Permalink
refactor(@angular/ssr): add route configs to public API
Browse files Browse the repository at this point in the history
These interfaces needs to be exported to be included in adev.

(cherry picked from commit d6dfce1)
  • Loading branch information
alan-agius4 committed Oct 31, 2024
1 parent 7502fee commit 4ae1fd2
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 74 deletions.
34 changes: 34 additions & 0 deletions goldens/public-api/angular/ssr/index.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,40 @@ export enum RenderMode {
// @public
export type ServerRoute = ServerRouteAppShell | ServerRouteClient | ServerRoutePrerender | ServerRoutePrerenderWithParams | ServerRouteServer;

// @public
export interface ServerRouteAppShell extends Omit<ServerRouteCommon, 'headers' | 'status'> {
renderMode: RenderMode.AppShell;
}

// @public
export interface ServerRouteClient extends ServerRouteCommon {
renderMode: RenderMode.Client;
}

// @public
export interface ServerRouteCommon {
headers?: Record<string, string>;
path: string;
status?: number;
}

// @public
export interface ServerRoutePrerender extends Omit<ServerRouteCommon, 'status'> {
fallback?: never;
renderMode: RenderMode.Prerender;
}

// @public
export interface ServerRoutePrerenderWithParams extends Omit<ServerRoutePrerender, 'fallback'> {
fallback?: PrerenderFallback;
getPrerenderParams: () => Promise<Record<string, string>[]>;
}

// @public
export interface ServerRouteServer extends ServerRouteCommon {
renderMode: RenderMode.Server;
}

// (No @packageDocumentation comment for this package)

```
43 changes: 0 additions & 43 deletions goldens/public-api/angular/ssr/index_transitive.api.md

This file was deleted.

12 changes: 1 addition & 11 deletions packages/angular/ssr/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@npm//@angular/build-tooling/bazel/api-golden:index.bzl", "api_golden_test", "api_golden_test_npm_package")
load("@npm//@angular/build-tooling/bazel/api-golden:index.bzl", "api_golden_test_npm_package")
load("@rules_pkg//:pkg.bzl", "pkg_tar")
load("//tools:defaults.bzl", "ng_package", "ts_library")

Expand Down Expand Up @@ -71,13 +71,3 @@ api_golden_test_npm_package(
golden_dir = "angular_cli/goldens/public-api/angular/ssr",
npm_package = "angular_cli/packages/angular/ssr/npm_package",
)

api_golden_test(
name = "ssr_transitive_api",
data = [
":ssr",
"//goldens:public-api",
],
entry_point = "angular_cli/packages/angular/ssr/public_api_transitive.d.ts",
golden = "angular_cli/goldens/public-api/angular/ssr/index_transitive.api.md",
)
6 changes: 6 additions & 0 deletions packages/angular/ssr/public_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,10 @@ export {
type ServerRoute,
provideServerRoutesConfig,
RenderMode,
type ServerRouteAppShell,
type ServerRouteClient,
type ServerRoutePrerender,
type ServerRoutePrerenderWithParams,
type ServerRouteServer,
type ServerRouteCommon,
} from './src/routes/route-config';
20 changes: 0 additions & 20 deletions packages/angular/ssr/public_api_transitive.ts

This file was deleted.

0 comments on commit 4ae1fd2

Please sign in to comment.