dynim-react 1.0.26 → 1.0.28

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.
@@ -1 +1 @@
1
- {"version":3,"file":"InferenceProvider.d.ts","sourceRoot":"","sources":["../../src/inference/InferenceProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAkB,MAAM,SAAS,CAAC;AAkHtE;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,SAAS,EACT,WAAW,EACX,mBAAmB,EACnB,gBAAgB,EAChB,WAAmB,EACnB,OAAO,EACP,MAAM,EACN,QAAQ,GACT,EAAE,sBAAsB,GAAG,GAAG,CAAC,OAAO,CA8LtC;AAED,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"InferenceProvider.d.ts","sourceRoot":"","sources":["../../src/inference/InferenceProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAgC,MAAM,SAAS,CAAC;AAkFpF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,SAAS,EACT,WAAW,EACX,mBAAmB,EACnB,gBAAgB,EAChB,WAAmB,EACnB,OAAO,EACP,MAAM,EACN,QAAQ,GACT,EAAE,sBAAsB,GAAG,GAAG,CAAC,OAAO,CA0LtC;AAED,eAAe,iBAAiB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { useState, useEffect, useCallback, useRef } from 'react';
2
+ import { useState, useEffect, useCallback } from 'react';
3
3
  /**
4
4
  * Default loading component shown while bundle is loading
5
5
  */
@@ -25,39 +25,17 @@ function DefaultErrorBanner({ error }) {
25
25
  }, children: [_jsx("strong", { children: "Customization Error:" }), " ", error.message] }));
26
26
  }
27
27
  /**
28
- * Container for rendering tenant bundle content
28
+ * Loads a bundle module via fetch and dynamic import
29
+ * Uses blob URL to allow importing fetched JavaScript as an ES module
29
30
  */
30
- function BundleContainer() {
31
- return _jsx("div", { id: "dynim-root" });
32
- }
33
- /**
34
- * Loads a script from a URL and returns a promise that resolves when loaded
35
- */
36
- function loadScript(url) {
37
- return new Promise((resolve, reject) => {
38
- // Check if script already exists
39
- const existingScript = document.querySelector(`script[src="${url}"]`);
40
- if (existingScript) {
41
- resolve();
42
- return;
43
- }
44
- const script = document.createElement('script');
45
- script.src = url;
46
- script.async = true;
47
- script.onload = () => resolve();
48
- script.onerror = () => reject(new Error(`Failed to load bundle from ${url}`));
49
- document.head.appendChild(script);
50
- });
51
- }
52
- /**
53
- * Loads a script from a URL with authentication and returns a promise
54
- */
55
- async function loadScriptWithAuth(url, token) {
56
- const response = await fetch(url, {
57
- headers: {
58
- Authorization: `Bearer ${token}`,
59
- },
60
- });
31
+ async function loadBundleModule(url, token) {
32
+ const headers = {
33
+ Accept: 'application/javascript',
34
+ };
35
+ if (token) {
36
+ headers['Authorization'] = `Bearer ${token}`;
37
+ }
38
+ const response = await fetch(url, { headers });
61
39
  if (!response.ok) {
62
40
  if (response.status === 401) {
63
41
  throw new Error('Bundle token is invalid or expired');
@@ -67,27 +45,20 @@ async function loadScriptWithAuth(url, token) {
67
45
  }
68
46
  throw new Error(`Failed to load bundle: ${response.status} ${response.statusText}`);
69
47
  }
70
- const scriptContent = await response.text();
71
- // Execute the script content
72
- const script = document.createElement('script');
73
- script.textContent = scriptContent;
74
- script.setAttribute('data-dynim-bundle', url);
75
- document.head.appendChild(script);
76
- }
77
- /**
78
- * Removes a previously loaded script (handles both src and data-dynim-bundle attributes)
79
- */
80
- function removeScript(url) {
81
- // Try src attribute first (script tag injection)
82
- let script = document.querySelector(`script[src="${url}"]`);
83
- if (script) {
84
- script.remove();
85
- return;
48
+ const code = await response.text();
49
+ // Create blob URL for dynamic import
50
+ const blob = new Blob([code], { type: 'application/javascript' });
51
+ const blobUrl = URL.createObjectURL(blob);
52
+ try {
53
+ const module = await import(/* @vite-ignore */ blobUrl);
54
+ return {
55
+ App: module.App || module.default,
56
+ cleanup: () => URL.revokeObjectURL(blobUrl),
57
+ };
86
58
  }
87
- // Try data-dynim-bundle attribute (authenticated fetch)
88
- script = document.querySelector(`script[data-dynim-bundle="${url}"]`);
89
- if (script) {
90
- script.remove();
59
+ catch (err) {
60
+ URL.revokeObjectURL(blobUrl);
61
+ throw err;
91
62
  }
92
63
  }
93
64
  /**
@@ -115,7 +86,7 @@ export function InferenceProvider({ tenantId, bundleUrl, bundleToken, checkCusto
115
86
  error: null,
116
87
  currentTenantId: null,
117
88
  });
118
- const loadedUrlRef = useRef(null);
89
+ const [bundleModule, setBundleModule] = useState(null);
119
90
  /**
120
91
  * Resolves the bundle URL for a given tenant ID
121
92
  */
@@ -127,19 +98,14 @@ export function InferenceProvider({ tenantId, bundleUrl, bundleToken, checkCusto
127
98
  return bundleUrl.replace('{tenantId}', id);
128
99
  }, [bundleUrl]);
129
100
  /**
130
- * Cleans up previously loaded bundle
101
+ * Cleans up previously loaded bundle module
131
102
  */
132
103
  const cleanup = useCallback(() => {
133
- if (loadedUrlRef.current) {
134
- removeScript(loadedUrlRef.current);
135
- loadedUrlRef.current = null;
104
+ if (bundleModule?.cleanup) {
105
+ bundleModule.cleanup();
136
106
  }
137
- // Clear the bundle render target
138
- const root = document.getElementById('dynim-root');
139
- if (root) {
140
- root.innerHTML = '';
141
- }
142
- }, []);
107
+ setBundleModule(null);
108
+ }, [bundleModule]);
143
109
  /**
144
110
  * Main effect to handle tenant bundle loading
145
111
  */
@@ -182,18 +148,13 @@ export function InferenceProvider({ tenantId, bundleUrl, bundleToken, checkCusto
182
148
  // Clean up previous bundle
183
149
  cleanup();
184
150
  const url = resolveBundleUrl(tenantId);
185
- // Use authenticated fetch if bundleToken is provided, otherwise use script tag
186
- if (bundleToken) {
187
- await loadScriptWithAuth(url, bundleToken);
188
- }
189
- else {
190
- await loadScript(url);
191
- }
151
+ // Load bundle via fetch + dynamic import
152
+ const module = await loadBundleModule(url, bundleToken);
192
153
  if (cancelled) {
193
- removeScript(url);
154
+ module.cleanup();
194
155
  return;
195
156
  }
196
- loadedUrlRef.current = url;
157
+ setBundleModule(module);
197
158
  setState({
198
159
  status: 'loaded',
199
160
  error: null,
@@ -253,8 +214,13 @@ export function InferenceProvider({ tenantId, bundleUrl, bundleToken, checkCusto
253
214
  case 'loading':
254
215
  return loadingComponent ?? _jsx(DefaultLoadingComponent, {});
255
216
  case 'loaded':
256
- // Bundle is loaded and will render itself into #dynim-root
257
- return _jsx(BundleContainer, {});
217
+ // Render the loaded App component directly
218
+ if (bundleModule?.App) {
219
+ const TenantApp = bundleModule.App;
220
+ return _jsx(TenantApp, {});
221
+ }
222
+ // Fallback if no App component found
223
+ return children;
258
224
  case 'error':
259
225
  // Show children as fallback with optional error banner
260
226
  return (_jsxs(_Fragment, { children: [renderErrorBanner(), children] }));
@@ -51,6 +51,15 @@ export interface InferenceState {
51
51
  error: Error | null;
52
52
  currentTenantId: string | null;
53
53
  }
54
+ /**
55
+ * Module loaded from a tenant bundle via dynamic import
56
+ */
57
+ export interface BundleModule {
58
+ /** The App component exported by the bundle */
59
+ App: React.ComponentType<unknown>;
60
+ /** Cleanup function to revoke the blob URL */
61
+ cleanup: () => void;
62
+ }
54
63
  /**
55
64
  * The global SDK object exposed to tenant bundles
56
65
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/inference/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,gDAAgD;IAChD,KAAK,EAAE,cAAc,OAAO,CAAC,CAAC;IAC9B,mDAAmD;IACnD,QAAQ,EAAE,cAAc,WAAW,CAAC,CAAC;IACrC,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC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AG,OAAO,CAAC;CACxB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,SAAS,CAAC,EAAE,WAAW,CAAC;KACzB;CACF"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Vite integration for dynim-react
3
+ */
4
+ export { dynimPackages, type DynimPackagesOptions } from './plugin.js';
5
+ export { dynimPackages as default } from './plugin.js';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vite/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,MAAM,aAAa,CAAA;AACtE,OAAO,EAAE,aAAa,IAAI,OAAO,EAAE,MAAM,aAAa,CAAA"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Vite integration for dynim-react
3
+ */
4
+ export { dynimPackages } from './plugin.js';
5
+ export { dynimPackages as default } from './plugin.js';
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Vite plugin for dynim-react
3
+ *
4
+ * Generates a virtual module that exports all specified packages,
5
+ * so you don't have to manually import and map each one.
6
+ *
7
+ * Usage:
8
+ * ```ts
9
+ * // vite.config.ts
10
+ * import { dynimPackages } from 'dynim-react/vite'
11
+ *
12
+ * export default {
13
+ * plugins: [
14
+ * dynimPackages([
15
+ * 'react-router-dom',
16
+ * '@tanstack/react-query',
17
+ * 'axios',
18
+ * ])
19
+ * ]
20
+ * }
21
+ * ```
22
+ *
23
+ * Then in your app:
24
+ * ```ts
25
+ * import packages from 'virtual:dynim-packages'
26
+ *
27
+ * <BuilderProvider config={{ packages }}>
28
+ * ```
29
+ */
30
+ import type { Plugin } from 'vite';
31
+ export interface DynimPackagesOptions {
32
+ /**
33
+ * List of package names to expose to dynim bundles.
34
+ * These must be installed in your project's node_modules.
35
+ */
36
+ packages: string[];
37
+ }
38
+ /**
39
+ * Vite plugin that generates a virtual module exporting all specified packages.
40
+ *
41
+ * @param packages - Array of package names, or options object
42
+ * @returns Vite plugin
43
+ *
44
+ * @example
45
+ * // Simple usage - array of package names
46
+ * dynimPackages(['react-router-dom', 'axios'])
47
+ *
48
+ * @example
49
+ * // Options object
50
+ * dynimPackages({ packages: ['react-router-dom', 'axios'] })
51
+ */
52
+ export declare function dynimPackages(packagesOrOptions: string[] | DynimPackagesOptions): Plugin;
53
+ export default dynimPackages;
54
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/vite/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAKlC,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,QAAQ,EAAE,MAAM,EAAE,CAAA;CACnB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAC3B,iBAAiB,EAAE,MAAM,EAAE,GAAG,oBAAoB,GACjD,MAAM,CAuCR;AAED,eAAe,aAAa,CAAA"}
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Vite plugin for dynim-react
3
+ *
4
+ * Generates a virtual module that exports all specified packages,
5
+ * so you don't have to manually import and map each one.
6
+ *
7
+ * Usage:
8
+ * ```ts
9
+ * // vite.config.ts
10
+ * import { dynimPackages } from 'dynim-react/vite'
11
+ *
12
+ * export default {
13
+ * plugins: [
14
+ * dynimPackages([
15
+ * 'react-router-dom',
16
+ * '@tanstack/react-query',
17
+ * 'axios',
18
+ * ])
19
+ * ]
20
+ * }
21
+ * ```
22
+ *
23
+ * Then in your app:
24
+ * ```ts
25
+ * import packages from 'virtual:dynim-packages'
26
+ *
27
+ * <BuilderProvider config={{ packages }}>
28
+ * ```
29
+ */
30
+ const VIRTUAL_MODULE_ID = 'virtual:dynim-packages';
31
+ const RESOLVED_VIRTUAL_MODULE_ID = '\0' + VIRTUAL_MODULE_ID;
32
+ /**
33
+ * Vite plugin that generates a virtual module exporting all specified packages.
34
+ *
35
+ * @param packages - Array of package names, or options object
36
+ * @returns Vite plugin
37
+ *
38
+ * @example
39
+ * // Simple usage - array of package names
40
+ * dynimPackages(['react-router-dom', 'axios'])
41
+ *
42
+ * @example
43
+ * // Options object
44
+ * dynimPackages({ packages: ['react-router-dom', 'axios'] })
45
+ */
46
+ export function dynimPackages(packagesOrOptions) {
47
+ const packageNames = Array.isArray(packagesOrOptions)
48
+ ? packagesOrOptions
49
+ : packagesOrOptions.packages;
50
+ return {
51
+ name: 'dynim-packages',
52
+ resolveId(id) {
53
+ if (id === VIRTUAL_MODULE_ID) {
54
+ return RESOLVED_VIRTUAL_MODULE_ID;
55
+ }
56
+ },
57
+ load(id) {
58
+ if (id === RESOLVED_VIRTUAL_MODULE_ID) {
59
+ // Generate import statements for each package
60
+ const imports = packageNames
61
+ .map((name, i) => `import * as _pkg${i} from '${name}'`)
62
+ .join('\n');
63
+ // Generate the packages object entries
64
+ const entries = packageNames
65
+ .map((name, i) => ` '${name}': _pkg${i}`)
66
+ .join(',\n');
67
+ // Return the generated module code
68
+ return `${imports}
69
+
70
+ const packages = {
71
+ ${entries}
72
+ }
73
+
74
+ export default packages
75
+ export { packages }
76
+ `;
77
+ }
78
+ },
79
+ };
80
+ }
81
+ export default dynimPackages;
package/package.json CHANGED
@@ -1,9 +1,22 @@
1
1
  {
2
2
  "name": "dynim-react",
3
- "version": "1.0.26",
3
+ "version": "1.0.28",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/index.js"
11
+ },
12
+ "./vite": {
13
+ "types": "./dist/vite/index.d.ts",
14
+ "import": "./dist/vite/index.js"
15
+ },
16
+ "./vite/virtual-module": {
17
+ "types": "./dist/vite/virtual-module.d.ts"
18
+ }
19
+ },
7
20
  "files": [
8
21
  "dist",
9
22
  "README.md"
@@ -17,14 +30,21 @@
17
30
  },
18
31
  "peerDependencies": {
19
32
  "react": ">=17.0.0",
20
- "react-dom": ">=17.0.0"
33
+ "react-dom": ">=17.0.0",
34
+ "vite": ">=4.0.0"
35
+ },
36
+ "peerDependenciesMeta": {
37
+ "vite": {
38
+ "optional": true
39
+ }
21
40
  },
22
41
  "devDependencies": {
23
42
  "@types/react": "^18.3.27",
24
43
  "@types/react-dom": "^18.3.7",
25
44
  "react": "^19.2.3",
26
45
  "react-dom": "^19.2.3",
27
- "typescript": "^5.9.3"
46
+ "typescript": "^5.9.3",
47
+ "vite": "^5.0.0"
28
48
  },
29
49
  "license": "MIT"
30
50
  }