refactor: convert constructor parameter properties for erasableSyntaxOnly compatibility

Signed-off-by: Paul Schultz <pschultz@pobox.com>
This commit is contained in:
Paul Schultz
2025-09-16 12:29:49 -05:00
parent b3a437e15d
commit 05f60e1e0a
167 changed files with 1826 additions and 679 deletions
@@ -179,18 +179,31 @@ function resolveBasePath(
}
export class RouteResolver implements RouteResolutionApi {
private readonly routePaths: Map<RouteRef, string>;
private readonly routeParents: Map<RouteRef, RouteRef | undefined>;
private readonly routeObjects: BackstageRouteObject[];
private readonly routeBindings: Map<ExternalRouteRef, RouteRef | SubRouteRef>;
private readonly appBasePath: string; // base path without a trailing slash
private readonly routeAliasResolver: RouteAliasResolver;
private readonly routeRefsById: Map<string, RouteRef | SubRouteRef>;
constructor(
private readonly routePaths: Map<RouteRef, string>,
private readonly routeParents: Map<RouteRef, RouteRef | undefined>,
private readonly routeObjects: BackstageRouteObject[],
private readonly routeBindings: Map<
ExternalRouteRef,
RouteRef | SubRouteRef
>,
private readonly appBasePath: string, // base path without a trailing slash
private readonly routeAliasResolver: RouteAliasResolver,
private readonly routeRefsById: Map<string, RouteRef | SubRouteRef>,
) {}
routePaths: Map<RouteRef, string>,
routeParents: Map<RouteRef, RouteRef | undefined>,
routeObjects: BackstageRouteObject[],
routeBindings: Map<ExternalRouteRef, RouteRef | SubRouteRef>,
appBasePath: string, // base path without a trailing slash
routeAliasResolver: RouteAliasResolver,
routeRefsById: Map<string, RouteRef | SubRouteRef>,
) {
this.routePaths = routePaths;
this.routeParents = routeParents;
this.routeObjects = routeObjects;
this.routeBindings = routeBindings;
this.appBasePath = appBasePath;
this.routeAliasResolver = routeAliasResolver;
this.routeRefsById = routeRefsById;
}
resolve<TParams extends AnyRouteRefParams>(
anyRouteRef:
@@ -115,11 +115,13 @@ function deduplicateFeatures(
// Helps delay callers from reaching out to the API before the app tree has been materialized
class AppTreeApiProxy implements AppTreeApi {
#routeInfo?: RouteInfo;
private readonly tree: AppTree;
private readonly appBasePath: string;
constructor(
private readonly tree: AppTree,
private readonly appBasePath: string,
) {}
constructor(tree: AppTree, appBasePath: string) {
this.tree = tree;
this.appBasePath = appBasePath;
}
private checkIfInitialized() {
if (!this.#routeInfo) {
@@ -163,13 +165,16 @@ class RouteResolutionApiProxy implements RouteResolutionApi {
#delegate: RouteResolutionApi | undefined;
#routeObjects: BackstageRouteObject[] | undefined;
private readonly routeBindings: Map<ExternalRouteRef, RouteRef | SubRouteRef>;
private readonly appBasePath: string;
constructor(
private readonly routeBindings: Map<
ExternalRouteRef,
RouteRef | SubRouteRef
>,
private readonly appBasePath: string,
) {}
routeBindings: Map<ExternalRouteRef, RouteRef | SubRouteRef>,
appBasePath: string,
) {
this.routeBindings = routeBindings;
this.appBasePath = appBasePath;
}
resolve<TParams extends AnyRouteRefParams>(
anyRouteRef: