@lwrjs/types 0.11.0-alpha.8 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/config.d.ts CHANGED
@@ -119,7 +119,7 @@ export interface LwrGlobalConfig {
119
119
  type RequiredPick<T, K extends keyof T> = {
120
120
  [P in K]-?: T[P];
121
121
  };
122
- export type OnStartConfig = RequiredPick<LwrGlobalConfig, 'basePath' | 'i18n' | 'routes'>;
122
+ export type OnStartConfig = RequiredPick<LwrGlobalConfig, 'basePath' | 'i18n' | 'routes' | 'errorRoutes'>;
123
123
  export interface BuildOptions {
124
124
  target?: string;
125
125
  input?: string;
@@ -152,7 +152,6 @@ export interface NormalizedLwrGlobalConfig extends Required<Omit<LwrGlobalConfig
152
152
  }
153
153
  export interface StaticSiteGenerator {
154
154
  outputDir?: string;
155
- locales?: string[];
156
155
  skipCleanOutputDir?: boolean;
157
156
  skipBaseDocumentGeneration?: boolean;
158
157
  _additionalRoutePaths?: string[];
package/build/index.d.ts CHANGED
@@ -157,7 +157,7 @@ export interface ServerModeConfig {
157
157
  compat: CompatMode;
158
158
  watchFiles: boolean;
159
159
  debug: boolean;
160
- defaultLocale: string;
160
+ i18n: I18NConfig;
161
161
  hmrEnabled: boolean;
162
162
  immutableAssets: boolean;
163
163
  env: {
@@ -165,7 +165,7 @@ export interface ServerModeConfig {
165
165
  };
166
166
  featureFlags: FeatureFlags;
167
167
  }
168
- export interface FeatureFlags extends Record<string, boolean | undefined> {
168
+ export interface FeatureFlags extends Record<string, boolean | string | undefined> {
169
169
  ASSETS_ON_LAMBDA?: boolean;
170
170
  LEGACY_LOADER?: boolean;
171
171
  SSR_SANDBOX_WORKER?: boolean;
@@ -179,11 +179,18 @@ export interface RuntimeEnvironment extends ServerModeConfig {
179
179
  debug: boolean;
180
180
  serverMode: string;
181
181
  basePath: string;
182
+ defaultAssetPath: string;
182
183
  }
183
184
  export interface SourceMapRuntimeEnvironment extends RuntimeEnvironment {
184
185
  sourceMapUrl?: string;
185
186
  }
186
187
  export type RuntimeParams = Record<string, string | number | boolean | null | undefined | Record<string, string>>;
188
+ export interface EnvironmentContext {
189
+ basePath: string;
190
+ locale: string;
191
+ assetBasePath: string;
192
+ uiBasePath: string;
193
+ }
187
194
  export interface ModuleIdentity {
188
195
  signature: string;
189
196
  moduleId: AbstractModuleId;
@@ -481,6 +488,9 @@ declare global {
481
488
  readonly env: ImportMetaEnv;
482
489
  }
483
490
  }
491
+ export type ServerData = {
492
+ [prop: string]: Json;
493
+ };
484
494
  export interface ClientBootstrapConfig {
485
495
  appId?: string;
486
496
  bootstrapModule: string;
@@ -489,7 +499,7 @@ export interface ClientBootstrapConfig {
489
499
  preloadModules?: string[];
490
500
  rootComponent?: string;
491
501
  rootComponents?: string[];
492
- serverData?: Json;
502
+ serverData?: ServerData;
493
503
  customInit?: Function;
494
504
  onError?: Function;
495
505
  baseUrl?: string;
@@ -660,6 +670,7 @@ export interface SiteResource extends SiteArtifact {
660
670
  export interface SiteBundle extends SiteArtifact {
661
671
  version?: Version;
662
672
  imports: string[];
673
+ dynamicImports?: string[];
663
674
  includedModules?: string[];
664
675
  }
665
676
  //# sourceMappingURL=index.d.ts.map
package/build/server.d.ts CHANGED
@@ -56,6 +56,7 @@ export interface MiddlewareRequest {
56
56
  headers: Headers;
57
57
  protocol: string;
58
58
  locale: string;
59
+ basePath: string;
59
60
  acceptsLanguages(): string[];
60
61
  get(field: string): string | undefined;
61
62
  cookie(name: string): string | undefined;
@@ -1,7 +1,11 @@
1
+ import type { ServerData } from '../index';
1
2
  import type { RegisterLoaderHooks } from './loaderPlugins/loaderPlugins';
2
3
  import type { RegisterHandleStaleModuleHook } from './handleStaleModule/handleStaleModule';
3
4
  import type { AppMetadata } from './appMetadata/appMetadata';
4
- export interface ServiceAPI {
5
+ export interface DataServiceAPI {
6
+ serverData: ServerData;
7
+ }
8
+ export interface ServiceAPI extends DataServiceAPI {
5
9
  addLoaderPlugin: NoOp | RegisterLoaderHooks;
6
10
  handleStaleModule: RegisterHandleStaleModuleHook;
7
11
  appMetadata: AppMetadata;
package/build/views.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import type { LwrErrorRoute, LwrRoute, RouteHandlerFunction, RouteHandlerView, View } from './config.js';
3
- import type { AssetSource, UriDefinition, Endpoints, FlattenedModuleGraphs, ImportMetadata, Json, LwrStringBuilder, ResourceDefinition, RuntimeEnvironment, RuntimeParams, Specifier } from './index.js';
3
+ import type { AssetSource, UriDefinition, Endpoints, FlattenedModuleGraphs, ImportMetadata, Json, LwrStringBuilder, ResourceDefinition, RuntimeEnvironment, RuntimeParams, Specifier, ServerData } from './index.js';
4
4
  export type ViewIdentity = Pick<View, 'id' | 'rootComponent' | 'contentTemplate'>;
5
5
  export interface ViewSource {
6
6
  name: string;
@@ -44,8 +44,9 @@ export interface CustomElementReference {
44
44
  export interface RenderedViewMetadata {
45
45
  customElements: CustomElementReference[];
46
46
  assetReferences: AssetReference[];
47
- serverData?: {
48
- [prop: string]: Json;
47
+ serverData?: ServerData;
48
+ serverDebug?: {
49
+ message?: string;
49
50
  };
50
51
  }
51
52
  export interface RenderedAssetReference {
@@ -124,7 +125,7 @@ export interface ViewDefinitionResponse {
124
125
  export interface ViewProvider {
125
126
  name: string;
126
127
  initialize(): Promise<void>;
127
- getView(viewId: ViewIdentity, runtimeParams: RuntimeParams): Promise<CompiledView | undefined>;
128
+ getView(viewId: ViewIdentity): Promise<CompiledView | undefined>;
128
129
  }
129
130
  export interface ViewTransformPluginContext {
130
131
  view: View;
@@ -171,6 +172,8 @@ export interface ViewPageContext {
171
172
  id: string;
172
173
  title?: string;
173
174
  url: string;
175
+ basePath?: string;
176
+ locale?: string;
174
177
  }
175
178
  export type ViewModuleResourceContext = {
176
179
  isPreload?: boolean;
@@ -181,7 +184,7 @@ export interface ViewRegistry {
181
184
  addViewProviders(providers: ViewProvider[]): void;
182
185
  addViewTransformers(transformers: ViewTransformPlugin[]): void;
183
186
  initializeViewProviders(): Promise<void[]>;
184
- getView(viewId: ViewIdentity, runtimeParams: RuntimeParams, skipCaching?: boolean): Promise<CompiledView>;
187
+ getView(viewId: ViewIdentity, skipCaching?: boolean): Promise<CompiledView>;
185
188
  getViewDefinition<R extends RuntimeEnvironment>(view: View, viewParams: ViewParams, runtimeEnvironment: R, runtimeParams?: RuntimeParams, renderOptions?: RenderOptions): Promise<LinkedViewDefinition>;
186
189
  hasViewDefinition<R extends RuntimeEnvironment>(view: View, viewParams: ViewParams, runtimeEnvironment: R, runtimeParams?: RuntimeParams, renderOptions?: RenderOptions): boolean;
187
190
  getPublicApi(): PublicViewRegistry;
@@ -194,13 +197,13 @@ export interface ViewHandler {
194
197
  }
195
198
  export interface SsrRequestContext {
196
199
  props: Json;
200
+ url: string;
197
201
  params: {
198
202
  [key: string]: string;
199
203
  };
200
- query: {
201
- [key: string]: string;
202
- };
204
+ query: ViewRequestQs;
203
205
  locale: string;
206
+ basePath: string;
204
207
  }
205
208
  export interface SsrDataResponse {
206
209
  props?: {
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "build": "tsc -b"
9
9
  },
10
10
  "type": "module",
11
- "version": "0.11.0-alpha.8",
11
+ "version": "0.11.0",
12
12
  "homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
13
13
  "repository": {
14
14
  "type": "git",
@@ -29,5 +29,5 @@
29
29
  "engines": {
30
30
  "node": ">=16.0.0"
31
31
  },
32
- "gitHead": "bba3cfa996e84ee702f287e7e7b6361b807434db"
32
+ "gitHead": "fbc883ea90a12672ce6f1adc2201144fda8762bd"
33
33
  }