@lwrjs/app-service 0.10.0-alpha.9 → 0.11.0-alpha.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.
@@ -73,7 +73,7 @@ function normalizeBootstrap(bootstrap) {
73
73
  }
74
74
  function createAppRouteViewBootstrapModule(route, options, lockerConfig) {
75
75
  const {bootstrap} = route;
76
- const {services, syntheticShadow} = bootstrap;
76
+ const {services, syntheticShadow, ssr} = bootstrap;
77
77
  const isAMD = options.format === "amd";
78
78
  const isESM = options.format === "esm";
79
79
  const servicesSource = bootstrap.services && createServicesSource(bootstrap.services);
@@ -82,6 +82,7 @@ function createAppRouteViewBootstrapModule(route, options, lockerConfig) {
82
82
  "/* This module is generated */",
83
83
  isESM && `import { getClientBootstrapConfig } from 'lwr/preInit';`,
84
84
  syntheticShadow && `import '@lwc/synthetic-shadow';`,
85
+ ssr && `import { polyfillDeclarativeShadowDom } from 'lwr/declarativeShadow';`,
85
86
  services && services.length && `import { services } from '${serviceApiModule}';`,
86
87
  servicesSource,
87
88
  isESM && options.hmrEnabled && `import { initHMR } from 'lwr/hmr';`,
@@ -96,6 +97,7 @@ registerLockerDefine(${JSON.stringify(lockerConfig.trustedComponents)});
96
97
  isESM && `
97
98
  const { imports, index, importMappings, endpoints } = clientBootstrapConfig;
98
99
  esmLoaderInit({ imports, index, importMappings, endpoints });`,
100
+ ssr && `polyfillDeclarativeShadowDom();`,
99
101
  `
100
102
  // initialize additional non-configured root components
101
103
  const { rootComponents, ssrProps } = clientBootstrapConfig;
@@ -1,4 +1,4 @@
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
4
  export type AppResourceType = 'module';
@@ -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
@@ -60,7 +60,7 @@ export function normalizeBootstrap(bootstrap) {
60
60
  */
61
61
  export function createAppRouteViewBootstrapModule(route, options, lockerConfig) {
62
62
  const { bootstrap } = route;
63
- const { services, syntheticShadow } = bootstrap;
63
+ const { services, syntheticShadow, ssr } = bootstrap;
64
64
  const isAMD = options.format === 'amd';
65
65
  const isESM = options.format === 'esm';
66
66
  const servicesSource = bootstrap.services && createServicesSource(bootstrap.services);
@@ -72,6 +72,8 @@ export function createAppRouteViewBootstrapModule(route, options, lockerConfig)
72
72
  isESM && `import { getClientBootstrapConfig } from 'lwr/preInit';`,
73
73
  // conditional shadow
74
74
  syntheticShadow && `import '@lwc/synthetic-shadow';`,
75
+ // Declarative ShadowDOM polyfill
76
+ ssr && `import { polyfillDeclarativeShadowDom } from 'lwr/declarativeShadow';`,
75
77
  // Import bootstrap services
76
78
  services && services.length && `import { services } from '${serviceApiModule}';`,
77
79
  // import and register the configured services
@@ -100,6 +102,8 @@ registerLockerDefine(${JSON.stringify(lockerConfig.trustedComponents)});
100
102
  `
101
103
  const { imports, index, importMappings, endpoints } = clientBootstrapConfig;
102
104
  esmLoaderInit({ imports, index, importMappings, endpoints });`,
105
+ // Invoke the Declarative ShadowDOM polyfill
106
+ ssr && `polyfillDeclarativeShadowDom();`,
103
107
  `
104
108
  // initialize additional non-configured root components
105
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.9",
7
+ "version": "0.11.0-alpha.0",
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.9",
37
- "@lwrjs/shared-utils": "0.10.0-alpha.9"
36
+ "@lwrjs/diagnostics": "0.11.0-alpha.0",
37
+ "@lwrjs/shared-utils": "0.11.0-alpha.0"
38
38
  },
39
39
  "devDependencies": {
40
- "@lwrjs/types": "0.10.0-alpha.9"
40
+ "@lwrjs/types": "0.11.0-alpha.0"
41
41
  },
42
42
  "engines": {
43
- "node": ">=16.0.0 <20"
43
+ "node": ">=16.0.0"
44
44
  },
45
- "gitHead": "6da48f5164ac881396055096a6c1e3d0f8d981aa"
45
+ "gitHead": "6917abefe32752eeed0f9ba98505ca2b76f1df9d"
46
46
  }