@memberjunction/react-runtime 5.37.0 → 5.39.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.
Files changed (44) hide show
  1. package/.turbo/turbo-build.log +14 -14
  2. package/CHANGELOG.md +57 -0
  3. package/dist/324.runtime.umd.js +150 -134
  4. package/dist/compiler/component-compiler.d.ts +1 -1
  5. package/dist/compiler/component-compiler.d.ts.map +1 -1
  6. package/dist/compiler/component-compiler.js +17 -22
  7. package/dist/compiler/component-compiler.js.map +1 -1
  8. package/dist/compiler/index.d.ts +2 -2
  9. package/dist/compiler/index.js +2 -2
  10. package/dist/component-manager/component-manager.d.ts +4 -4
  11. package/dist/component-manager/index.d.ts +2 -2
  12. package/dist/component-manager/index.js +1 -1
  13. package/dist/component-manager/types.d.ts +1 -1
  14. package/dist/index.d.ts +28 -28
  15. package/dist/index.js +23 -23
  16. package/dist/registry/component-registry-service.d.ts +3 -3
  17. package/dist/registry/component-registry.d.ts +1 -1
  18. package/dist/registry/component-registry.js +1 -1
  19. package/dist/registry/component-resolver.d.ts +3 -3
  20. package/dist/registry/component-resolver.js +1 -1
  21. package/dist/registry/index.d.ts +4 -4
  22. package/dist/registry/index.js +3 -3
  23. package/dist/runtime/component-hierarchy.d.ts +3 -3
  24. package/dist/runtime/error-boundary.d.ts +1 -1
  25. package/dist/runtime/index.d.ts +5 -5
  26. package/dist/runtime/index.js +4 -4
  27. package/dist/runtime/prop-builder.d.ts +1 -1
  28. package/dist/runtime/react-root-manager.d.ts +1 -1
  29. package/dist/runtime/react-root-manager.js +1 -1
  30. package/dist/runtime.umd.js +5000 -3031
  31. package/dist/types/index.d.ts +3 -2
  32. package/dist/types/index.d.ts.map +1 -1
  33. package/dist/types/index.js +2 -2
  34. package/dist/types/index.js.map +1 -1
  35. package/dist/utilities/core-libraries.d.ts +1 -1
  36. package/dist/utilities/index.d.ts +9 -9
  37. package/dist/utilities/index.js +9 -9
  38. package/dist/utilities/library-dependency-resolver.d.ts +1 -1
  39. package/dist/utilities/library-loader.d.ts +3 -3
  40. package/dist/utilities/library-loader.js +4 -4
  41. package/dist/utilities/standard-libraries.d.ts +1 -1
  42. package/package.json +7 -7
  43. package/src/compiler/component-compiler.ts +15 -20
  44. package/src/types/index.ts +2 -0
@@ -6,6 +6,7 @@ export interface CompiledComponent {
6
6
  name: string;
7
7
  compiledAt: Date;
8
8
  warnings?: string[];
9
+ sourceMap?: any;
9
10
  }
10
11
  export interface CompileOptions {
11
12
  componentName: string;
@@ -96,7 +97,7 @@ export interface ErrorBoundaryOptions {
96
97
  logErrors?: boolean;
97
98
  recovery?: 'retry' | 'reset' | 'none';
98
99
  }
99
- export * from './library-config';
100
- export * from './dependency-types';
100
+ export * from './library-config.js';
101
+ export * from './dependency-types.js';
101
102
  export { ComponentObject } from '@memberjunction/interactive-component-types';
102
103
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,0BAA0B,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAK3H,MAAM,WAAW,iBAAiB;IAEhC,OAAO,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,MAAM,CAAC,EAAE,eAAe,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,eAAe,CAAC;IAElH,EAAE,EAAE,MAAM,CAAC;IAEX,IAAI,EAAE,MAAM,CAAC;IAEb,UAAU,EAAE,IAAI,CAAC;IAEjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAKD,MAAM,WAAW,cAAc;IAE7B,aAAa,EAAE,MAAM,CAAC;IAEtB,aAAa,EAAE,MAAM,CAAC;IAEtB,MAAM,CAAC,EAAE,eAAe,CAAC;IAEzB,UAAU,CA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AS,EAAE,GAAG,KAAK,IAAI,CAAC;IAExD,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,YAAY,EAAE,GAAG,KAAK,IAAI,CAAC;IAE1D,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B;AAKD,MAAM,WAAW,oBAAoB;IAEnC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,IAAI,CAAC;IAEjD,QAAQ,CAAC,EAAE,GAAG,CAAC;IAEf,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;CACvC;AAGD,cAAc,kBAAkB,CAAC;AAGjC,cAAc,oBAAoB,CAAC;AAGnC,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC"}
@@ -1,3 +1,3 @@
1
- export * from './library-config';
2
- export * from './dependency-types';
1
+ export * from './library-config.js';
2
+ export * from './dependency-types.js';
3
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAkOA,cAAc,kBAAkB,CAAC;AAGjC,cAAc,oBAAoB,CAAC","sourcesContent":["/**\n * @fileoverview Core type definitions for the MemberJunction React Runtime.\n * These types are platform-agnostic and can be used in any JavaScript environment.\n * @module @memberjunction/react-runtime/types\n */\n\nimport { UserInfo } from '@memberjunction/core';\nimport { MJComponentLibraryEntity } from '@memberjunction/core-entities';\nimport { ComponentLibraryDependency, ComponentStyles, ComponentObject } from '@memberjunction/interactive-component-types';\n\n/**\n * Represents a compiled React component with its metadata\n */\nexport interface CompiledComponent {\n /** Factory function that creates a ComponentObject when called with context */\n factory: (context: RuntimeContext, styles?: ComponentStyles, components?: Record<string, any>) => ComponentObject;\n /** Unique identifier for the component */\n id: string;\n /** Original component name */\n name: string;\n /** Compilation timestamp */\n compiledAt: Date;\n /** Any compilation warnings */\n warnings?: string[];\n}\n\n/**\n * Options for compiling a React component\n */\nexport interface CompileOptions {\n /** Component name for identification */\n componentName: string;\n /** Raw component code to compile */\n componentCode: string;\n /** Optional styles to inject */\n styles?: ComponentStyles;\n /** Whether to use production mode optimizations */\n production?: boolean;\n /** Custom Babel plugins to use */\n babelPlugins?: string[];\n /** Custom Babel presets to use */\n babelPresets?: string[];\n\n /** Library dependencies that the component requires */\n libraries?: ComponentLibraryDependency[];\n \n /** Child component dependencies that the component requires */\n dependencies?: Array<{ name: string; code?: string }>;\n\n /**\n * Required, metadata for all possible libraries allowed by the system\n */\n allLibraries: MJComponentLibraryEntity[];\n}\n\n\n/**\n * Registry entry for a compiled component\n */\nexport interface RegistryEntry {\n /** The compiled component object with all methods */\n component: ComponentObject;\n /** Component metadata */\n metadata: ComponentMetadata;\n /** Last access time for LRU cache */\n lastAccessed: Date;\n /** Reference count for cleanup */\n refCount: number;\n}\n\n/**\n * Metadata about a registered component\n */\nexport interface ComponentMetadata {\n /** Unique component identifier */\n id: string;\n /** Component name */\n name: string;\n /** Component version */\n version: string;\n /** Namespace for organization */\n namespace: string;\n /** Registration timestamp */\n registeredAt: Date;\n /** Optional tags for categorization */\n tags?: string[];\n}\n\n/**\n * Error information from component execution\n */\nexport interface ComponentError {\n /** Error message */\n message: string;\n /** Error stack trace */\n stack?: string;\n /** Component name where error occurred */\n componentName: string;\n /** Error phase (compilation, render, etc.) */\n phase: 'compilation' | 'registration' | 'render' | 'runtime';\n /** Additional error details */\n details?: any;\n}\n\n/**\n * Props passed to React components\n */\nexport interface ComponentProps {\n /** Data object for the component */\n data: any;\n /** User-managed state */\n userState: any;\n /** Utility functions available to the component */\n utilities: any;\n /** Callback functions */\n callbacks: any;\n /** Child components available for use */\n components?: Record<string, any>;\n /** Component styles */\n styles?: ComponentStyles;\n /** Standard state change handler for controlled components */\n onStateChanged?: (stateUpdate: Record<string, any>) => void;\n}\n\n/**\n * Configuration for the component compiler\n */\nexport interface CompilerConfig {\n /** Babel configuration */\n babel: {\n /** Presets to use */\n presets: string[];\n /** Plugins to use */\n plugins: string[];\n };\n /** Whether to minify output */\n minify: boolean;\n /** Source map generation */\n sourceMaps: boolean;\n /** Cache compiled components */\n cache: boolean;\n /** Maximum cache size */\n maxCacheSize: number;\n /** Enable debug logging */\n debug?: boolean;\n}\n\n/**\n * Configuration for the component registry\n */\nexport interface RegistryConfig {\n /** Maximum number of components to keep in memory */\n maxComponents: number;\n /** Time in ms before removing unused components */\n cleanupInterval: number;\n /** Whether to use LRU eviction */\n useLRU: boolean;\n /** Namespace isolation */\n enableNamespaces: boolean;\n /** Enable debug logging */\n debug?: boolean;\n}\n\n/**\n * Result of a compilation operation\n */\nexport interface CompilationResult {\n /** Whether compilation succeeded */\n success: boolean;\n /** The compiled component if successful */\n component?: CompiledComponent;\n /** Error information if failed */\n error?: ComponentError;\n /** Compilation duration in ms */\n duration: number;\n /** Size of compiled code in bytes */\n size?: number;\n /** Libraries loaded during compilation */\n loadedLibraries?: Map<string, any>;\n}\n\n/**\n * Runtime context for component execution\n */\nexport interface RuntimeContext {\n /** React library reference */\n React: any;\n /** ReactDOM library reference */\n ReactDOM?: any;\n /** Additional libraries available */\n libraries?: Record<string, any>;\n /** Global utilities */\n utilities?: Record<string, any>;\n}\n\n/**\n * Component lifecycle events\n */\nexport interface ComponentLifecycle {\n /** Called before component mounts */\n beforeMount?: () => void;\n /** Called after component mounts */\n afterMount?: () => void;\n /** Called before component updates */\n beforeUpdate?: (prevProps: any, nextProps: any) => void;\n /** Called after component updates */\n afterUpdate?: (prevProps: any, currentProps: any) => void;\n /** Called before component unmounts */\n beforeUnmount?: () => void;\n}\n\n/**\n * Options for creating an error boundary\n */\nexport interface ErrorBoundaryOptions {\n /** Custom error handler */\n onError?: (error: Error, errorInfo: any) => void;\n /** Fallback UI to render on error */\n fallback?: any;\n /** Whether to log errors */\n logErrors?: boolean;\n /** Error recovery strategy */\n recovery?: 'retry' | 'reset' | 'none';\n}\n\n// Export library configuration types\nexport * from './library-config';\n\n// Export dependency types\nexport * from './dependency-types';\n\n// Re-export ComponentObject for convenience\nexport { ComponentObject } from '@memberjunction/interactive-component-types';"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAoOA,cAAc,kBAAkB,CAAC;AAGjC,cAAc,oBAAoB,CAAC","sourcesContent":["/**\n * @fileoverview Core type definitions for the MemberJunction React Runtime.\n * These types are platform-agnostic and can be used in any JavaScript environment.\n * @module @memberjunction/react-runtime/types\n */\n\nimport { UserInfo } from '@memberjunction/core';\nimport { MJComponentLibraryEntity } from '@memberjunction/core-entities';\nimport { ComponentLibraryDependency, ComponentStyles, ComponentObject } from '@memberjunction/interactive-component-types';\n\n/**\n * Represents a compiled React component with its metadata\n */\nexport interface CompiledComponent {\n /** Factory function that creates a ComponentObject when called with context */\n factory: (context: RuntimeContext, styles?: ComponentStyles, components?: Record<string, any>) => ComponentObject;\n /** Unique identifier for the component */\n id: string;\n /** Original component name */\n name: string;\n /** Compilation timestamp */\n compiledAt: Date;\n /** Any compilation warnings */\n warnings?: string[];\n /** Babel-generated sourcemap (raw V3 SourceMap object) when sourceMaps is enabled */\n sourceMap?: any;\n}\n\n/**\n * Options for compiling a React component\n */\nexport interface CompileOptions {\n /** Component name for identification */\n componentName: string;\n /** Raw component code to compile */\n componentCode: string;\n /** Optional styles to inject */\n styles?: ComponentStyles;\n /** Whether to use production mode optimizations */\n production?: boolean;\n /** Custom Babel plugins to use */\n babelPlugins?: string[];\n /** Custom Babel presets to use */\n babelPresets?: string[];\n\n /** Library dependencies that the component requires */\n libraries?: ComponentLibraryDependency[];\n \n /** Child component dependencies that the component requires */\n dependencies?: Array<{ name: string; code?: string }>;\n\n /**\n * Required, metadata for all possible libraries allowed by the system\n */\n allLibraries: MJComponentLibraryEntity[];\n}\n\n\n/**\n * Registry entry for a compiled component\n */\nexport interface RegistryEntry {\n /** The compiled component object with all methods */\n component: ComponentObject;\n /** Component metadata */\n metadata: ComponentMetadata;\n /** Last access time for LRU cache */\n lastAccessed: Date;\n /** Reference count for cleanup */\n refCount: number;\n}\n\n/**\n * Metadata about a registered component\n */\nexport interface ComponentMetadata {\n /** Unique component identifier */\n id: string;\n /** Component name */\n name: string;\n /** Component version */\n version: string;\n /** Namespace for organization */\n namespace: string;\n /** Registration timestamp */\n registeredAt: Date;\n /** Optional tags for categorization */\n tags?: string[];\n}\n\n/**\n * Error information from component execution\n */\nexport interface ComponentError {\n /** Error message */\n message: string;\n /** Error stack trace */\n stack?: string;\n /** Component name where error occurred */\n componentName: string;\n /** Error phase (compilation, render, etc.) */\n phase: 'compilation' | 'registration' | 'render' | 'runtime';\n /** Additional error details */\n details?: any;\n}\n\n/**\n * Props passed to React components\n */\nexport interface ComponentProps {\n /** Data object for the component */\n data: any;\n /** User-managed state */\n userState: any;\n /** Utility functions available to the component */\n utilities: any;\n /** Callback functions */\n callbacks: any;\n /** Child components available for use */\n components?: Record<string, any>;\n /** Component styles */\n styles?: ComponentStyles;\n /** Standard state change handler for controlled components */\n onStateChanged?: (stateUpdate: Record<string, any>) => void;\n}\n\n/**\n * Configuration for the component compiler\n */\nexport interface CompilerConfig {\n /** Babel configuration */\n babel: {\n /** Presets to use */\n presets: string[];\n /** Plugins to use */\n plugins: string[];\n };\n /** Whether to minify output */\n minify: boolean;\n /** Source map generation */\n sourceMaps: boolean;\n /** Cache compiled components */\n cache: boolean;\n /** Maximum cache size */\n maxCacheSize: number;\n /** Enable debug logging */\n debug?: boolean;\n}\n\n/**\n * Configuration for the component registry\n */\nexport interface RegistryConfig {\n /** Maximum number of components to keep in memory */\n maxComponents: number;\n /** Time in ms before removing unused components */\n cleanupInterval: number;\n /** Whether to use LRU eviction */\n useLRU: boolean;\n /** Namespace isolation */\n enableNamespaces: boolean;\n /** Enable debug logging */\n debug?: boolean;\n}\n\n/**\n * Result of a compilation operation\n */\nexport interface CompilationResult {\n /** Whether compilation succeeded */\n success: boolean;\n /** The compiled component if successful */\n component?: CompiledComponent;\n /** Error information if failed */\n error?: ComponentError;\n /** Compilation duration in ms */\n duration: number;\n /** Size of compiled code in bytes */\n size?: number;\n /** Libraries loaded during compilation */\n loadedLibraries?: Map<string, any>;\n}\n\n/**\n * Runtime context for component execution\n */\nexport interface RuntimeContext {\n /** React library reference */\n React: any;\n /** ReactDOM library reference */\n ReactDOM?: any;\n /** Additional libraries available */\n libraries?: Record<string, any>;\n /** Global utilities */\n utilities?: Record<string, any>;\n}\n\n/**\n * Component lifecycle events\n */\nexport interface ComponentLifecycle {\n /** Called before component mounts */\n beforeMount?: () => void;\n /** Called after component mounts */\n afterMount?: () => void;\n /** Called before component updates */\n beforeUpdate?: (prevProps: any, nextProps: any) => void;\n /** Called after component updates */\n afterUpdate?: (prevProps: any, currentProps: any) => void;\n /** Called before component unmounts */\n beforeUnmount?: () => void;\n}\n\n/**\n * Options for creating an error boundary\n */\nexport interface ErrorBoundaryOptions {\n /** Custom error handler */\n onError?: (error: Error, errorInfo: any) => void;\n /** Fallback UI to render on error */\n fallback?: any;\n /** Whether to log errors */\n logErrors?: boolean;\n /** Error recovery strategy */\n recovery?: 'retry' | 'reset' | 'none';\n}\n\n// Export library configuration types\nexport * from './library-config';\n\n// Export dependency types\nexport * from './dependency-types';\n\n// Re-export ComponentObject for convenience\nexport { ComponentObject } from '@memberjunction/interactive-component-types';"]}
@@ -1,4 +1,4 @@
1
- import { ExternalLibraryConfig } from '../types/library-config';
1
+ import { ExternalLibraryConfig } from '../types/library-config.js';
2
2
  export declare function getCoreRuntimeLibraries(debug?: boolean): ExternalLibraryConfig[];
3
3
  export declare function isCoreRuntimeLibrary(libraryId: string): boolean;
4
4
  //# sourceMappingURL=core-libraries.d.ts.map
@@ -1,10 +1,10 @@
1
- export * from './component-styles';
2
- export * from './standard-libraries';
3
- export * from './library-loader';
4
- export * from './library-registry';
5
- export * from './library-dependency-resolver';
6
- export * from './component-error-analyzer';
7
- export * from './resource-manager';
8
- export * from './cache-manager';
9
- export * from './component-unwrapper';
1
+ export * from './component-styles.js';
2
+ export * from './standard-libraries.js';
3
+ export * from './library-loader.js';
4
+ export * from './library-registry.js';
5
+ export * from './library-dependency-resolver.js';
6
+ export * from './component-error-analyzer.js';
7
+ export * from './resource-manager.js';
8
+ export * from './cache-manager.js';
9
+ export * from './component-unwrapper.js';
10
10
  //# sourceMappingURL=index.d.ts.map
@@ -1,10 +1,10 @@
1
- export * from './component-styles';
2
- export * from './standard-libraries';
3
- export * from './library-loader';
4
- export * from './library-registry';
5
- export * from './library-dependency-resolver';
6
- export * from './component-error-analyzer';
7
- export * from './resource-manager';
8
- export * from './cache-manager';
9
- export * from './component-unwrapper';
1
+ export * from './component-styles.js';
2
+ export * from './standard-libraries.js';
3
+ export * from './library-loader.js';
4
+ export * from './library-registry.js';
5
+ export * from './library-dependency-resolver.js';
6
+ export * from './component-error-analyzer.js';
7
+ export * from './resource-manager.js';
8
+ export * from './cache-manager.js';
9
+ export * from './component-unwrapper.js';
10
10
  //# sourceMappingURL=index.js.map
@@ -1,5 +1,5 @@
1
1
  import { MJComponentLibraryEntity } from '@memberjunction/core-entities';
2
- import { DependencyGraph, LoadOrderResult, ResolvedVersion, VersionRequirement, DependencyResolutionOptions } from '../types/dependency-types';
2
+ import { DependencyGraph, LoadOrderResult, ResolvedVersion, VersionRequirement, DependencyResolutionOptions } from '../types/dependency-types.js';
3
3
  export declare class LibraryDependencyResolver {
4
4
  private debug;
5
5
  constructor(options?: DependencyResolutionOptions);
@@ -1,7 +1,7 @@
1
- import { StandardLibraries } from './standard-libraries';
2
- import { LibraryConfiguration, ExternalLibraryConfig, LibraryLoadOptions as ConfigLoadOptions } from '../types/library-config';
1
+ import { StandardLibraries } from './standard-libraries.js';
2
+ import { LibraryConfiguration, ExternalLibraryConfig, LibraryLoadOptions as ConfigLoadOptions } from '../types/library-config.js';
3
3
  import { MJComponentLibraryEntity } from '@memberjunction/core-entities';
4
- import { LoadedLibraryState, DependencyResolutionOptions } from '../types/dependency-types';
4
+ import { LoadedLibraryState, DependencyResolutionOptions } from '../types/dependency-types.js';
5
5
  interface LoadedResource {
6
6
  element: HTMLScriptElement | HTMLLinkElement;
7
7
  promise: Promise<any>;
@@ -1,7 +1,7 @@
1
- import { StandardLibraryManager } from './standard-libraries';
2
- import { getCoreRuntimeLibraries, isCoreRuntimeLibrary } from './core-libraries';
3
- import { resourceManager } from './resource-manager';
4
- import { LibraryDependencyResolver } from './library-dependency-resolver';
1
+ import { StandardLibraryManager } from './standard-libraries.js';
2
+ import { getCoreRuntimeLibraries, isCoreRuntimeLibrary } from './core-libraries.js';
3
+ import { resourceManager } from './resource-manager.js';
4
+ import { LibraryDependencyResolver } from './library-dependency-resolver.js';
5
5
  const LIBRARY_LOADER_COMPONENT_ID = 'mj-react-runtime-library-loader-singleton';
6
6
  export class LibraryLoader {
7
7
  static { this.loadedResources = new Map(); }
@@ -1,4 +1,4 @@
1
- import { LibraryConfiguration, ExternalLibraryConfig } from '../types/library-config';
1
+ import { LibraryConfiguration, ExternalLibraryConfig } from '../types/library-config.js';
2
2
  export type StandardLibraries = Record<string, any>;
3
3
  export declare class StandardLibraryManager {
4
4
  private static configuration;
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@memberjunction/react-runtime",
3
- "version": "5.37.0",
3
+ "version": "5.39.0",
4
4
  "description": "Platform-agnostic React component runtime for MemberJunction. Provides core compilation, registry, and execution capabilities for React components in any JavaScript environment.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "scripts": {
9
9
  "build": "npm run build:node && npm run build:umd",
10
- "build:node": "tsc",
10
+ "build:node": "tsc && tsc-alias -f",
11
11
  "build:umd": "webpack --config webpack.umd.config.cjs",
12
12
  "build:clean": "rimraf ./dist && npm run build",
13
13
  "watch": "tsc -w",
@@ -29,11 +29,11 @@
29
29
  },
30
30
  "homepage": "https://github.com/MemberJunction/MJ#readme",
31
31
  "dependencies": {
32
- "@memberjunction/core": "5.37.0",
33
- "@memberjunction/global": "5.37.0",
34
- "@memberjunction/interactive-component-types": "5.37.0",
35
- "@memberjunction/core-entities": "5.37.0",
36
- "@memberjunction/graphql-dataprovider": "5.37.0",
32
+ "@memberjunction/core": "5.39.0",
33
+ "@memberjunction/global": "5.39.0",
34
+ "@memberjunction/interactive-component-types": "5.39.0",
35
+ "@memberjunction/core-entities": "5.39.0",
36
+ "@memberjunction/graphql-dataprovider": "5.39.0",
37
37
  "@babel/standalone": "^7.29.1",
38
38
  "rxjs": "^7.8.2"
39
39
  },
@@ -28,7 +28,7 @@ const DEFAULT_COMPILER_CONFIG: CompilerConfig = {
28
28
  plugins: []
29
29
  },
30
30
  minify: false,
31
- sourceMaps: false,
31
+ sourceMaps: true,
32
32
  cache: true,
33
33
  maxCacheSize: 100,
34
34
  debug: false
@@ -89,7 +89,7 @@ export class ComponentCompiler {
89
89
  const loadedLibraries = await this.loadRequiredLibraries(options.libraries!, options.allLibraries);
90
90
 
91
91
  // Transpile the component code
92
- const transpiledCode = this.transpileComponent(
92
+ const transpiled = this.transpileComponent(
93
93
  options.componentCode,
94
94
  options.componentName,
95
95
  options
@@ -97,7 +97,7 @@ export class ComponentCompiler {
97
97
 
98
98
  // Create the component factory with loaded libraries
99
99
  const componentFactory = this.createComponentFactory(
100
- transpiledCode,
100
+ transpiled.code,
101
101
  options.componentName,
102
102
  loadedLibraries,
103
103
  options
@@ -109,7 +109,8 @@ export class ComponentCompiler {
109
109
  id: this.generateComponentId(options.componentName),
110
110
  name: options.componentName,
111
111
  compiledAt: new Date(),
112
- warnings: []
112
+ warnings: [],
113
+ sourceMap: transpiled.map
113
114
  };
114
115
 
115
116
  // Cache if enabled
@@ -121,7 +122,7 @@ export class ComponentCompiler {
121
122
  success: true,
122
123
  component: compiledComponent,
123
124
  duration: Date.now() - startTime,
124
- size: transpiledCode.length,
125
+ size: transpiled.code.length,
125
126
  loadedLibraries: loadedLibraries
126
127
  };
127
128
 
@@ -145,7 +146,7 @@ export class ComponentCompiler {
145
146
  code: string,
146
147
  componentName: string,
147
148
  options: CompileOptions
148
- ): string {
149
+ ): { code: string; map?: any } {
149
150
  if (!this.babelInstance) {
150
151
  throw new Error('Babel instance not set. Call setBabelInstance() first.');
151
152
  }
@@ -161,7 +162,7 @@ export class ComponentCompiler {
161
162
  minified: this.config.minify
162
163
  });
163
164
 
164
- return result.code;
165
+ return { code: result.code, map: result.map };
165
166
  } catch (error: any) {
166
167
  throw new Error(`Transpilation failed: ${error.message}`);
167
168
  }
@@ -352,20 +353,14 @@ export class ComponentCompiler {
352
353
  // Create a fresh method registry for each factory call
353
354
  const methodRegistry = new Map();
354
355
 
355
- // Create a wrapper component that provides RegisterMethod in callbacks
356
+ // Create a wrapper component that provides RegisterMethod in callbacks.
357
+ // NOTE: Do NOT clear methodRegistry inside an effect here. React runs
358
+ // child effects before parent effects, so the user component's mount
359
+ // effect (which calls RegisterMethod) fires before this wrapper effect.
360
+ // A clear() here would wipe out the just-registered methods and break
361
+ // hasMethod()/invokeMethod(). Cleanup is handled by the component's own
362
+ // re-renders and by garbage collection when the factory closure is freed.
356
363
  const ComponentWithMethodRegistry = (props) => {
357
- // Register methods on mount
358
- React.useEffect(() => {
359
- // Clear previous methods
360
- methodRegistry.clear();
361
-
362
- // Provide RegisterMethod callback if callbacks exist
363
- if (props.callbacks && typeof props.callbacks.RegisterMethod === 'function') {
364
- // Component can now register its methods
365
- // This will be called from within the component
366
- }
367
- }, [props.callbacks]);
368
-
369
364
  // Create enhanced callbacks with RegisterMethod
370
365
  const enhancedCallbacks = React.useMemo(() => {
371
366
  if (!props.callbacks) return {};
@@ -22,6 +22,8 @@ export interface CompiledComponent {
22
22
  compiledAt: Date;
23
23
  /** Any compilation warnings */
24
24
  warnings?: string[];
25
+ /** Babel-generated sourcemap (raw V3 SourceMap object) when sourceMaps is enabled */
26
+ sourceMap?: any;
25
27
  }
26
28
 
27
29
  /**