@lwrjs/router 0.15.0-alpha.26 → 0.15.0-alpha.27

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.
Files changed (24) hide show
  1. package/build/cjs/modules/lwr/serverRouter/serverRouter.cjs +1 -6
  2. package/build/es/modules/lwr/contextProvider/contextProvider.js +1 -1
  3. package/build/es/modules/lwr/serverRouter/serverRouter.js +3 -7
  4. package/build/modules/lwr/contextProvider/contextProvider.js +1 -1
  5. package/build/modules/lwr/contextProvider/contextProvider.js-meta.xml +6 -0
  6. package/build/modules/lwr/contextUtils/contextUtils.js-meta.xml +6 -0
  7. package/build/modules/lwr/currentPageReference/currentPageReference.js-meta.xml +6 -0
  8. package/build/modules/lwr/currentView/currentView.js-meta.xml +6 -0
  9. package/build/modules/lwr/domRouter/domRouter.js-meta.xml +6 -0
  10. package/build/modules/lwr/domRouterUtils/domRouterUtils.js-meta.xml +6 -0
  11. package/build/modules/lwr/historyRouter/historyRouter.js-meta.xml +6 -0
  12. package/build/modules/lwr/navigation/navigation.js-meta.xml +1 -1
  13. package/build/modules/lwr/navigationContext/navigationContext.js-meta.xml +6 -0
  14. package/build/modules/lwr/navigationMixinHacks/navigationMixinHacks.js-meta.xml +6 -0
  15. package/build/modules/lwr/observable/observable.js-meta.xml +6 -0
  16. package/build/modules/lwr/outlet/outlet.js-meta.xml +1 -1
  17. package/build/modules/lwr/router/router.js-meta.xml +1 -1
  18. package/build/modules/lwr/routerBridge/routerBridge.js-meta.xml +1 -1
  19. package/build/modules/lwr/routerContainer/routerContainer.js-meta.xml +1 -1
  20. package/build/modules/lwr/routerErrors/routerErrors.js-meta.xml +6 -0
  21. package/build/modules/lwr/routerUtils/routerUtils.js-meta.xml +6 -0
  22. package/build/modules/lwr/serverRouter/serverRouter.js +3 -7
  23. package/build/modules/lwr/serverRouter/serverRouter.js-meta.xml +6 -0
  24. package/package.json +6 -6
@@ -68,12 +68,7 @@ var ServerRouter = class {
68
68
  return;
69
69
  }
70
70
  url = this.getRelativeUrl(url);
71
- const routingMatch = this.router.matchRoute(url, {});
72
- if (!routingMatch) {
73
- this.processError((0, import_routerErrors.generateMessageObject)(import_routerErrors.messages.MISSING_ROUTE, [url]));
74
- return;
75
- }
76
- this.currentRoute = routingMatch;
71
+ this.currentRoute = this.router.matchRoute(url, {}) || void 0;
77
72
  (0, import_navigation.registerNavigationHelm)(this.contextId, {
78
73
  navigate: (address, replace, options) => this.navigate(address, replace, options),
79
74
  generateUrl: (address, options) => this.generateUrl(address, options),
@@ -1,7 +1,7 @@
1
1
  import { createContextProvider } from 'lwc';
2
2
  import { hasDocument } from 'lwr/routerUtils';
3
3
  import { CurrentPageReference, CurrentView, NavigationContext } from 'lwr/navigation';
4
- // Creating a context with LWC requires eventing APIs, which are not available from "@lwc/engine-server"
4
+ // Creating a context with LWC requires eventing APIs, which are not available for LWC SSR
5
5
  export const currentPageReferenceContextualizer = createContextProvider(CurrentPageReference);
6
6
  export const currentViewContextualizer = hasDocument ? createContextProvider(CurrentView) : undefined;
7
7
  export const navigationContextContextualizer = createContextProvider(NavigationContext);
@@ -58,13 +58,9 @@ export class ServerRouter {
58
58
  return;
59
59
  }
60
60
  url = this.getRelativeUrl(url);
61
- // ensure the initial URL matches a valid route definition
62
- const routingMatch = this.router.matchRoute(url, {});
63
- if (!routingMatch) {
64
- this.processError(generateMessageObject(messages.MISSING_ROUTE, [url]));
65
- return;
66
- }
67
- this.currentRoute = routingMatch;
61
+ // get an initial value for the current route
62
+ // it will be undefined if this is an invalid page (errorRoute)
63
+ this.currentRoute = this.router.matchRoute(url, {}) || undefined;
68
64
  // set up the navigation context APIs
69
65
  registerNavigationHelm(this.contextId, {
70
66
  navigate: (address, replace, options) => this.navigate(address, replace, options),
@@ -1,7 +1,7 @@
1
1
  import { createContextProvider } from 'lwc';
2
2
  import { hasDocument } from 'lwr/routerUtils';
3
3
  import { CurrentPageReference, CurrentView, NavigationContext } from 'lwr/navigation';
4
- // Creating a context with LWC requires eventing APIs, which are not available from "@lwc/engine-server"
4
+ // Creating a context with LWC requires eventing APIs, which are not available for LWC SSR
5
5
  export const currentPageReferenceContextualizer = createContextProvider(CurrentPageReference);
6
6
  export const currentViewContextualizer = hasDocument ? createContextProvider(CurrentView) : undefined;
7
7
  export const navigationContextContextualizer = createContextProvider(NavigationContext);
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
3
+ <capabilities>
4
+ <capability>lightning__ServerRenderable</capability>
5
+ </capabilities>
6
+ </LightningComponentBundle>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
3
+ <capabilities>
4
+ <capability>lightning__ServerRenderable</capability>
5
+ </capabilities>
6
+ </LightningComponentBundle>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
3
+ <capabilities>
4
+ <capability>lightning__ServerRenderable</capability>
5
+ </capabilities>
6
+ </LightningComponentBundle>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
3
+ <capabilities>
4
+ <capability>lightning__ServerRenderable</capability>
5
+ </capabilities>
6
+ </LightningComponentBundle>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
3
+ <capabilities>
4
+ <capability>lightning__ServerRenderableWithHydration</capability>
5
+ </capabilities>
6
+ </LightningComponentBundle>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
3
+ <capabilities>
4
+ <capability>lightning__ServerRenderableWithHydration</capability>
5
+ </capabilities>
6
+ </LightningComponentBundle>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
3
+ <capabilities>
4
+ <capability>lightning__ServerRenderableWithHydration</capability>
5
+ </capabilities>
6
+ </LightningComponentBundle>
@@ -1,5 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <LightningComponentBundle xmlns="xmlns=http://soap.sforce.com/2006/04/metadata">
2
+ <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
3
3
  <isExposed>true</isExposed>
4
4
  <capabilities>
5
5
  <capability>lightning__ServerRenderable</capability>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
3
+ <capabilities>
4
+ <capability>lightning__ServerRenderable</capability>
5
+ </capabilities>
6
+ </LightningComponentBundle>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
3
+ <capabilities>
4
+ <capability>lightning__ServerRenderable</capability>
5
+ </capabilities>
6
+ </LightningComponentBundle>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
3
+ <capabilities>
4
+ <capability>lightning__ServerRenderable</capability>
5
+ </capabilities>
6
+ </LightningComponentBundle>
@@ -1,5 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <LightningComponentBundle xmlns="xmlns=http://soap.sforce.com/2006/04/metadata">
2
+ <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
3
3
  <isExposed>true</isExposed>
4
4
  <capabilities>
5
5
  <capability>lightning__ServerRenderableWithHydration</capability>
@@ -1,5 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <LightningComponentBundle xmlns="xmlns=http://soap.sforce.com/2006/04/metadata">
2
+ <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
3
3
  <isExposed>true</isExposed>
4
4
  <capabilities>
5
5
  <capability>lightning__ServerRenderable</capability>
@@ -1,4 +1,4 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <LightningComponentBundle xmlns="xmlns=http://soap.sforce.com/2006/04/metadata">
2
+ <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
3
3
  <isExposed>true</isExposed>
4
4
  </LightningComponentBundle>
@@ -1,5 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <LightningComponentBundle xmlns="xmlns=http://soap.sforce.com/2006/04/metadata">
2
+ <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
3
3
  <isExposed>true</isExposed>
4
4
  <capabilities>
5
5
  <capability>lightning__ServerRenderableWithHydration</capability>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
3
+ <capabilities>
4
+ <capability>lightning__ServerRenderable</capability>
5
+ </capabilities>
6
+ </LightningComponentBundle>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
3
+ <capabilities>
4
+ <capability>lightning__ServerRenderable</capability>
5
+ </capabilities>
6
+ </LightningComponentBundle>
@@ -65,13 +65,9 @@ export class ServerRouter {
65
65
  }
66
66
  url = this.getRelativeUrl(url);
67
67
 
68
- // ensure the initial URL matches a valid route definition
69
- const routingMatch = this.router.matchRoute(url, {});
70
- if (!routingMatch) {
71
- this.processError(generateMessageObject(messages.MISSING_ROUTE, [url]));
72
- return;
73
- }
74
- this.currentRoute = routingMatch;
68
+ // get an initial value for the current route
69
+ // it will be undefined if this is an invalid page (errorRoute)
70
+ this.currentRoute = this.router.matchRoute(url, {}) || undefined;
75
71
 
76
72
  // set up the navigation context APIs
77
73
  registerNavigationHelm(this.contextId, {
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
3
+ <capabilities>
4
+ <capability>lightning__ServerRenderable</capability>
5
+ </capabilities>
6
+ </LightningComponentBundle>
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
8
- "version": "0.15.0-alpha.26",
8
+ "version": "0.15.0-alpha.27",
9
9
  "homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
10
10
  "repository": {
11
11
  "type": "git",
@@ -53,14 +53,14 @@
53
53
  "test:server": "jest --config ./jest.server.config.cjs"
54
54
  },
55
55
  "dependencies": {
56
- "@lwrjs/client-modules": "0.15.0-alpha.26",
57
- "@lwrjs/diagnostics": "0.15.0-alpha.26",
58
- "@lwrjs/shared-utils": "0.15.0-alpha.26",
56
+ "@lwrjs/client-modules": "0.15.0-alpha.27",
57
+ "@lwrjs/diagnostics": "0.15.0-alpha.27",
58
+ "@lwrjs/shared-utils": "0.15.0-alpha.27",
59
59
  "ajv": "6.12.6"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@lwc/jest-preset": "^16.1.0",
63
- "@lwrjs/fs-watch": "0.15.0-alpha.26",
63
+ "@lwrjs/fs-watch": "0.15.0-alpha.27",
64
64
  "@rollup/plugin-typescript": "^11.1.6",
65
65
  "jest": "^26.6.3",
66
66
  "memfs": "^4.13.0",
@@ -99,5 +99,5 @@
99
99
  "volta": {
100
100
  "extends": "../../../package.json"
101
101
  },
102
- "gitHead": "b73171fb2777cf921935959d60d51750747de343"
102
+ "gitHead": "6051c73d6009467325975f79dfa608a10bf2efa8"
103
103
  }