@memberjunction/react-runtime 5.36.0 → 5.38.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 (41) hide show
  1. package/.turbo/turbo-build.log +12 -12
  2. package/CHANGELOG.md +35 -0
  3. package/dist/324.runtime.umd.js +89 -89
  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 +10 -16
  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 +3056 -2292
  31. package/dist/types/index.d.ts +2 -2
  32. package/dist/types/index.js +2 -2
  33. package/dist/utilities/core-libraries.d.ts +1 -1
  34. package/dist/utilities/index.d.ts +9 -9
  35. package/dist/utilities/index.js +9 -9
  36. package/dist/utilities/library-dependency-resolver.d.ts +1 -1
  37. package/dist/utilities/library-loader.d.ts +3 -3
  38. package/dist/utilities/library-loader.js +4 -4
  39. package/dist/utilities/standard-libraries.d.ts +1 -1
  40. package/package.json +7 -7
  41. package/src/compiler/component-compiler.ts +7 -13
@@ -96,7 +96,7 @@ export interface ErrorBoundaryOptions {
96
96
  logErrors?: boolean;
97
97
  recovery?: 'retry' | 'reset' | 'none';
98
98
  }
99
- export * from './library-config';
100
- export * from './dependency-types';
99
+ export * from './library-config.js';
100
+ export * from './dependency-types.js';
101
101
  export { ComponentObject } from '@memberjunction/interactive-component-types';
102
102
  //# sourceMappingURL=index.d.ts.map
@@ -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,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.36.0",
3
+ "version": "5.38.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.36.0",
33
- "@memberjunction/global": "5.36.0",
34
- "@memberjunction/interactive-component-types": "5.36.0",
35
- "@memberjunction/core-entities": "5.36.0",
36
- "@memberjunction/graphql-dataprovider": "5.36.0",
32
+ "@memberjunction/core": "5.38.0",
33
+ "@memberjunction/global": "5.38.0",
34
+ "@memberjunction/interactive-component-types": "5.38.0",
35
+ "@memberjunction/core-entities": "5.38.0",
36
+ "@memberjunction/graphql-dataprovider": "5.38.0",
37
37
  "@babel/standalone": "^7.29.1",
38
38
  "rxjs": "^7.8.2"
39
39
  },
@@ -352,20 +352,14 @@ export class ComponentCompiler {
352
352
  // Create a fresh method registry for each factory call
353
353
  const methodRegistry = new Map();
354
354
 
355
- // Create a wrapper component that provides RegisterMethod in callbacks
355
+ // Create a wrapper component that provides RegisterMethod in callbacks.
356
+ // NOTE: Do NOT clear methodRegistry inside an effect here. React runs
357
+ // child effects before parent effects, so the user component's mount
358
+ // effect (which calls RegisterMethod) fires before this wrapper effect.
359
+ // A clear() here would wipe out the just-registered methods and break
360
+ // hasMethod()/invokeMethod(). Cleanup is handled by the component's own
361
+ // re-renders and by garbage collection when the factory closure is freed.
356
362
  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
363
  // Create enhanced callbacks with RegisterMethod
370
364
  const enhancedCallbacks = React.useMemo(() => {
371
365
  if (!props.callbacks) return {};