Skip to content

Commit

Permalink
refactor(platform-server): remove deprecated useAbsoluteUrl and `ba…
Browse files Browse the repository at this point in the history
…seUrl` from `PlatformConfig` (#54874)

BREAKING CHANGE: deprecated `useAbsoluteUrl` and `baseUrl` been removed from `PlatformConfig`. Provide and absolute `url` instead.

PR Close #54874
  • Loading branch information
alan-agius4 authored and alxhub committed Mar 18, 2024
1 parent 07ac017 commit 3b1967c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 31 deletions.
9 changes: 0 additions & 9 deletions packages/platform-server/src/location.ts
Expand Up @@ -82,15 +82,6 @@ export class ServerPlatformLocation implements PlatformLocation {
this.hash = url.hash;
this.href = _doc.location.href;
}
if (config.useAbsoluteUrl) {
if (!config.baseUrl) {
throw new Error(`"PlatformConfig.baseUrl" must be set if "useAbsoluteUrl" is true`);
}
const url = parseUrl(config.baseUrl);
this.protocol = url.protocol;
this.hostname = url.hostname;
this.port = url.port;
}
}

getBaseHrefFromDOM(): string {
Expand Down
22 changes: 0 additions & 22 deletions packages/platform-server/src/tokens.ts
Expand Up @@ -26,28 +26,6 @@ export interface PlatformConfig {
* @default none
*/
url?: string;
/**
* Note: this option has no effect and can be removed from the config.
*
* Whether to append the absolute URL to any relative HTTP requests. If set to
* true, this logic executes prior to any HTTP interceptors that may run later
* on in the request. `baseUrl` must be supplied if this flag is enabled.
*
* @deprecated This option is a noop.
* @default false
*/
useAbsoluteUrl?: boolean;
/**
* Note: this option has no effect and can be removed from the config.
*
* The base URL for resolving absolute URL for HTTP requests. It must be set
* if `useAbsoluteUrl` is true, and must consist of protocol, hostname,
* and optional port. This option has no effect if `useAbsoluteUrl` is not
* enabled.
*
* @deprecated This option is a noop.
*/
baseUrl?: string;
}

/**
Expand Down

0 comments on commit 3b1967c

Please sign in to comment.