@granite-js/micro-frontend 2.3.1 → 2.3.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @granite-js/micro-frontend
2
2
 
3
+ ## 2.3.2
4
+
5
+ ### Patch Changes
6
+
7
+ - f92bbc7: Register pending host components with the configured app scheme so route evaluation works before an initial URL is available and does not inherit another app's scheme.
8
+ - @granite-js/utils@2.3.2
9
+
3
10
  ## 2.3.1
4
11
 
5
12
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- import { createRoute as createGraniteRoute, getSchemeUri } from '@granite-js/react-native';
3
+ import { createRoute as createGraniteRoute } from '@granite-js/react-native';
4
4
  import { registerPendingHostComponentRoute } from "./host/pendingHostComponentStore.js";
5
5
  export function createRoute(path, options) {
6
6
  const {
@@ -27,10 +27,10 @@ function getCurrentGraniteApp() {
27
27
  }
28
28
  const host = granite['app']['host'];
29
29
  const name = granite['app']['name'];
30
- if (typeof host !== 'string' || typeof name !== 'string') {
30
+ const scheme = granite['app']['scheme'];
31
+ if (typeof host !== 'string' || typeof name !== 'string' || typeof scheme !== 'string') {
31
32
  return null;
32
33
  }
33
- const scheme = new URL(getSchemeUri()).protocol.replace(/:$/g, '');
34
34
  return {
35
35
  name,
36
36
  scheme,
@@ -1 +1 @@
1
- {"version":3,"names":["createRoute","createGraniteRoute","getSchemeUri","registerPendingHostComponentRoute","path","options","hostPendingComponent","routeOptions","app","getCurrentGraniteApp","String","component","parserParams","validateParams","granite","Reflect","get","globalThis","isPropertyMap","host","name","scheme","URL","protocol","replace","value"],"sourceRoot":"../../src","sources":["createRoute.ts"],"mappings":";;AAAA,SACEA,WAAW,IAAIC,kBAAkB,EACjCC,YAAY,QAIP,0BAA0B;AAEjC,SAASC,iCAAiC,QAAQ,qCAAkC;AA+BpF,OAAO,SAASH,WAAWA,CACzBI,IAA+B,EAC/B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ignoreList":[]}
1
+ {"version":3,"names":["createRoute","createGraniteRoute","registerPendingHostComponentRoute","path","options","hostPendingComponent","routeOptions","app","getCurrentGraniteApp","String","component","parserParams","validateParams","granite","Reflect","get","globalThis","isPropertyMap","host","name","scheme","value"],"sourceRoot":"../../src","sources":["createRoute.ts"],"mappings":";;AAAA,SACEA,WAAW,IAAIC,kBAAkB,QAI5B,0BAA0B;AAEjC,SAASC,iCAAiC,QAAQ,qCAAkC;AA+BpF,OAAO,SAASF,WAAWA,CACzBG,IAA+B,EAC/BC,OAA2C,EAC3C;EACA,MAAM;IAAEC,oBAAoB;IAAE,GAAGC;EAAa,CAAC,GAAGF,OAAO;EAEzD,IAAIC,oBAAoB,IAAI,IAAI,EAAE;IAChC,MAAME,GAAG,GAAGC,oBAAoB,CAAC,CAAC;IAClC,IAAID,GAAG,IAAI,IAAI,EAAE;MACfL,iCAAiC,CAACO,MAAM,CAACN,IAAI,CAAC,EAAE;QAC9CI,GAAG;QACHG,SAAS,EAAEL,oBAAoB;QAC/BM,YAAY,EAAEL,YAAY,CAACK,YAAY;QACvCC,cAAc,EAAEN,YAAY,CAACM;MAC/B,CAAC,CAAC;IACJ;EACF;EAEA,OAAOX,kBAAkB,CAACE,IAAI,EAAEG,YAAY,CAAC;AAC/C;AAEA,SAASE,oBAAoBA,CAAA,EAAyC;EACpE,MAAMK,OAAgB,GAAGC,OAAO,CAACC,GAAG,CAACC,UAAU,EAAE,WAAW,CAAC;EAC7D,IAAI,CAACC,aAAa,CAACJ,OAAO,CAAC,IAAI,CAACI,aAAa,CAACJ,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE;IAC7D,OAAO,IAAI;EACb;EAEA,MAAMK,IAAI,GAAGL,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC;EACnC,MAAMM,IAAI,GAAGN,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC;EACnC,MAAMO,MAAM,GAAGP,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC;EACvC,IAAI,OAAOK,IAAI,KAAK,QAAQ,IAAI,OAAOC,IAAI,KAAK,QAAQ,IAAI,OAAOC,MAAM,KAAK,QAAQ,EAAE;IACtF,OAAO,IAAI;EACb;EAEA,OAAO;IACLD,IAAI;IACJC,MAAM;IACNF;EACF,CAAC;AACH;AAEA,SAASD,aAAaA,CAACI,KAAc,EAAmD;EACtF,OAAO,OAAOA,KAAK,KAAK,QAAQ,IAAIA,KAAK,KAAK,IAAI;AACpD","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@granite-js/micro-frontend",
3
- "version": "2.3.1",
3
+ "version": "2.3.2",
4
4
  "description": "Micro-frontend build, runtime, session, and Portal contracts for Granite brownfield applications",
5
5
  "main": "./dist/module/index.js",
6
6
  "types": "./dist/typescript/index.d.ts",
@@ -56,7 +56,7 @@
56
56
  },
57
57
  "dependencies": {
58
58
  "@babel/core": "7.28.5",
59
- "@granite-js/utils": "2.3.1",
59
+ "@granite-js/utils": "2.3.2",
60
60
  "@standard-schema/spec": "^1.0.0"
61
61
  },
62
62
  "peerDependencies": {
@@ -72,8 +72,8 @@
72
72
  },
73
73
  "devDependencies": {
74
74
  "@babel/types": "7.28.5",
75
- "@granite-js/plugin-core": "2.3.1",
76
- "@granite-js/react-native": "2.3.1",
75
+ "@granite-js/plugin-core": "2.3.2",
76
+ "@granite-js/react-native": "2.3.2",
77
77
  "@types/babel__core": "^7.20.5",
78
78
  "@types/node": "24.10.12",
79
79
  "@types/react": "19.2.0",
@@ -1,6 +1,5 @@
1
1
  import {
2
2
  createRoute as createGraniteRoute,
3
- getSchemeUri,
4
3
  type RegisterScreenInput,
5
4
  type RouteOptions,
6
5
  useNavigation,
@@ -66,12 +65,11 @@ function getCurrentGraniteApp(): PendingHostComponentAppConfig | null {
66
65
 
67
66
  const host = granite['app']['host'];
68
67
  const name = granite['app']['name'];
69
- if (typeof host !== 'string' || typeof name !== 'string') {
68
+ const scheme = granite['app']['scheme'];
69
+ if (typeof host !== 'string' || typeof name !== 'string' || typeof scheme !== 'string') {
70
70
  return null;
71
71
  }
72
72
 
73
- const scheme = new URL(getSchemeUri()).protocol.replace(/:$/g, '');
74
-
75
73
  return {
76
74
  name,
77
75
  scheme,