@lwrjs/app-service 0.10.0-alpha.2 → 0.10.0-alpha.20

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.
@@ -78,16 +78,16 @@ function createAppRouteViewBootstrapModule(route, options, lockerConfig) {
78
78
  const isESM = options.format === "esm";
79
79
  const servicesSource = bootstrap.services && createServicesSource(bootstrap.services);
80
80
  const serviceApiModule = getServiceApiModule(options.format, options.moduleLoader);
81
- const bootstrapModule = ssr && !lockerConfig.enabled ? "lwr/initSsr" : "lwr/init";
82
81
  return [
83
82
  "/* This module is generated */",
84
83
  isESM && `import { getClientBootstrapConfig } from 'lwr/preInit';`,
85
84
  syntheticShadow && `import '@lwc/synthetic-shadow';`,
85
+ ssr && `import { polyfillDeclarativeShadowDom } from 'lwr/declarativeShadow';`,
86
86
  services && services.length && `import { services } from '${serviceApiModule}';`,
87
87
  servicesSource,
88
88
  isESM && options.hmrEnabled && `import { initHMR } from 'lwr/hmr';`,
89
89
  isESM && `import { init as esmLoaderInit } from 'lwr/esmLoader';`,
90
- `import { init, toKebabCase } from '${bootstrapModule}';`,
90
+ `import { init, toKebabCase } from 'lwr/init';`,
91
91
  isAMD && lockerConfig && lockerConfig.enabled && lockerConfig.clientOnly && `
92
92
  import { registerLockerDefine } from 'lwr/lockerDefine';
93
93
  registerLockerDefine(${JSON.stringify(lockerConfig.trustedComponents)});
@@ -97,6 +97,7 @@ registerLockerDefine(${JSON.stringify(lockerConfig.trustedComponents)});
97
97
  isESM && `
98
98
  const { imports, index, importMappings, endpoints } = clientBootstrapConfig;
99
99
  esmLoaderInit({ imports, index, importMappings, endpoints });`,
100
+ ssr && `polyfillDeclarativeShadowDom();`,
100
101
  `
101
102
  // initialize additional non-configured root components
102
103
  const { rootComponents, ssrProps } = clientBootstrapConfig;
@@ -1,7 +1,7 @@
1
- import { ModuleFormat } from '@lwrjs/types';
1
+ import type { ModuleFormat } from '@lwrjs/types';
2
2
  export declare const APP_BOOTSTRAP_PACKAGE_NAME = "@lwrjs/app-service";
3
3
  export declare const SUPPORTED_MODULE_FORMATS: string[];
4
- export declare type AppResourceType = 'module';
4
+ export type AppResourceType = 'module';
5
5
  export declare enum AppResourceEnum {
6
6
  MODULE = "module"
7
7
  }
@@ -10,7 +10,7 @@ export interface ApplicationIdentity {
10
10
  namespace?: string;
11
11
  name: string;
12
12
  }
13
- export declare type SubResourceIdentity = PathResourceIdentity | WorkerResourceIdentity;
13
+ export type SubResourceIdentity = PathResourceIdentity | WorkerResourceIdentity;
14
14
  export declare enum ResourceIdentityTypes {
15
15
  PATH = "path",
16
16
  WORKER = "worker"
@@ -19,12 +19,12 @@ export interface PathResourceIdentity {
19
19
  type: ResourceIdentityTypes.PATH;
20
20
  requestPath: string;
21
21
  }
22
- export declare type WorkerResourceIdentityType = 'worker';
22
+ export type WorkerResourceIdentityType = 'worker';
23
23
  export interface WorkerResourceIdentity {
24
24
  type: ResourceIdentityTypes.WORKER;
25
25
  workerId: string;
26
26
  }
27
- export declare type AppResourceId = Pick<AppResourceIdentity, 'appName' | 'resourceType' | 'format' | 'subResource'>;
27
+ export type AppResourceId = Pick<AppResourceIdentity, 'appName' | 'resourceType' | 'format' | 'subResource'>;
28
28
  export interface AppResourceIdentity {
29
29
  packageName: string;
30
30
  appName: string;
@@ -1,5 +1,5 @@
1
- import { ModuleCompiled, ModuleEntry, ModuleProvider, ModuleSource, ProviderContext, AbstractModuleId, ProviderAppConfig } from '@lwrjs/types';
2
- import { LwrLockerConfig } from 'packages/@lwrjs/types/src/config.js';
1
+ import type { ModuleCompiled, ModuleEntry, ModuleProvider, ModuleSource, ProviderContext, AbstractModuleId, ProviderAppConfig } from '@lwrjs/types';
2
+ import type { LwrLockerConfig } from 'packages/@lwrjs/types/src/config.js';
3
3
  export default class AppModuleProvider implements ModuleProvider {
4
4
  name: string;
5
5
  version: string;
@@ -1,4 +1,4 @@
1
- import { LwrAppBootstrapConfig, LwrLockerConfig, NormalizedLwrAppBootstrapConfig, NormalizedLwrErrorRoute, NormalizedLwrRoute } from '@lwrjs/types';
1
+ import type { LwrAppBootstrapConfig, LwrLockerConfig, NormalizedLwrAppBootstrapConfig, NormalizedLwrErrorRoute, NormalizedLwrRoute } from '@lwrjs/types';
2
2
  /**
3
3
  * Create the virtual source for the application bootstrap module with a worker root
4
4
  * @returns the generated source
@@ -65,7 +65,6 @@ export function createAppRouteViewBootstrapModule(route, options, lockerConfig)
65
65
  const isESM = options.format === 'esm';
66
66
  const servicesSource = bootstrap.services && createServicesSource(bootstrap.services);
67
67
  const serviceApiModule = getServiceApiModule(options.format, options.moduleLoader);
68
- const bootstrapModule = ssr && !lockerConfig.enabled ? 'lwr/initSsr' : 'lwr/init';
69
68
  return [
70
69
  '/* This module is generated */',
71
70
  // pre app initialization step
@@ -73,6 +72,8 @@ export function createAppRouteViewBootstrapModule(route, options, lockerConfig)
73
72
  isESM && `import { getClientBootstrapConfig } from 'lwr/preInit';`,
74
73
  // conditional shadow
75
74
  syntheticShadow && `import '@lwc/synthetic-shadow';`,
75
+ // Declarative ShadowDOM polyfill
76
+ ssr && `import { polyfillDeclarativeShadowDom } from 'lwr/declarativeShadow';`,
76
77
  // Import bootstrap services
77
78
  services && services.length && `import { services } from '${serviceApiModule}';`,
78
79
  // import and register the configured services
@@ -82,7 +83,7 @@ export function createAppRouteViewBootstrapModule(route, options, lockerConfig)
82
83
  // Import the ESM module initializer
83
84
  isESM && `import { init as esmLoaderInit } from 'lwr/esmLoader';`,
84
85
  // init module
85
- `import { init, toKebabCase } from '${bootstrapModule}';`,
86
+ `import { init, toKebabCase } from 'lwr/init';`,
86
87
  // locker
87
88
  isAMD &&
88
89
  lockerConfig &&
@@ -101,6 +102,8 @@ registerLockerDefine(${JSON.stringify(lockerConfig.trustedComponents)});
101
102
  `
102
103
  const { imports, index, importMappings, endpoints } = clientBootstrapConfig;
103
104
  esmLoaderInit({ imports, index, importMappings, endpoints });`,
105
+ // Invoke the Declarative ShadowDOM polyfill
106
+ ssr && `polyfillDeclarativeShadowDom();`,
104
107
  `
105
108
  // initialize additional non-configured root components
106
109
  const { rootComponents, ssrProps } = clientBootstrapConfig;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.10.0-alpha.2",
7
+ "version": "0.10.0-alpha.20",
8
8
  "homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
9
9
  "repository": {
10
10
  "type": "git",
@@ -33,14 +33,14 @@
33
33
  "build/**/*.d.ts"
34
34
  ],
35
35
  "dependencies": {
36
- "@lwrjs/diagnostics": "0.10.0-alpha.2",
37
- "@lwrjs/shared-utils": "0.10.0-alpha.2"
36
+ "@lwrjs/diagnostics": "0.10.0-alpha.20",
37
+ "@lwrjs/shared-utils": "0.10.0-alpha.20"
38
38
  },
39
39
  "devDependencies": {
40
- "@lwrjs/types": "0.10.0-alpha.2"
40
+ "@lwrjs/types": "0.10.0-alpha.20"
41
41
  },
42
42
  "engines": {
43
- "node": ">=16.0.0 <20"
43
+ "node": ">=16.0.0"
44
44
  },
45
- "gitHead": "592cda0637513885477829beea35a86407b342d4"
45
+ "gitHead": "45a867fc54e98f77dd442ccd5f668e23027b9246"
46
46
  }