@memberjunction/react-runtime 6.2.0-edge.0 → 6.2.0-edge.1

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 (149) hide show
  1. package/.turbo/turbo-build.log +12 -12
  2. package/CHANGELOG.md +61 -0
  3. package/dist/compiler/babel-config.d.ts +14 -0
  4. package/dist/compiler/babel-config.d.ts.map +1 -1
  5. package/dist/compiler/babel-config.js +12 -3
  6. package/dist/compiler/babel-config.js.map +1 -1
  7. package/dist/compiler/component-compiler.d.ts +5 -0
  8. package/dist/compiler/component-compiler.d.ts.map +1 -1
  9. package/dist/compiler/component-compiler.js +24 -9
  10. package/dist/compiler/component-compiler.js.map +1 -1
  11. package/dist/compiler/index.d.ts +1 -1
  12. package/dist/compiler/index.d.ts.map +1 -1
  13. package/dist/compiler/index.js +1 -1
  14. package/dist/compiler/index.js.map +1 -1
  15. package/dist/component-manager/component-manager.d.ts +8 -0
  16. package/dist/component-manager/component-manager.d.ts.map +1 -1
  17. package/dist/component-manager/component-manager.js +18 -6
  18. package/dist/component-manager/component-manager.js.map +1 -1
  19. package/dist/index.d.ts +21 -9
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +13 -10
  22. package/dist/index.js.map +1 -1
  23. package/dist/registry/component-registry-service.d.ts +18 -0
  24. package/dist/registry/component-registry-service.d.ts.map +1 -1
  25. package/dist/registry/component-registry-service.js +65 -23
  26. package/dist/registry/component-registry-service.js.map +1 -1
  27. package/dist/registry/component-registry.d.ts +24 -1
  28. package/dist/registry/component-registry.d.ts.map +1 -1
  29. package/dist/registry/component-registry.js +74 -23
  30. package/dist/registry/component-registry.js.map +1 -1
  31. package/dist/registry/component-resolver.d.ts +10 -0
  32. package/dist/registry/component-resolver.d.ts.map +1 -1
  33. package/dist/registry/component-resolver.js +30 -9
  34. package/dist/registry/component-resolver.js.map +1 -1
  35. package/dist/registry/registry-provider.js.map +1 -1
  36. package/dist/runtime/component-hierarchy.d.ts +15 -0
  37. package/dist/runtime/component-hierarchy.d.ts.map +1 -1
  38. package/dist/runtime/component-hierarchy.js +28 -10
  39. package/dist/runtime/component-hierarchy.js.map +1 -1
  40. package/dist/runtime/error-boundary.d.ts +4 -0
  41. package/dist/runtime/error-boundary.d.ts.map +1 -1
  42. package/dist/runtime/error-boundary.js +50 -20
  43. package/dist/runtime/error-boundary.js.map +1 -1
  44. package/dist/runtime/index.d.ts +3 -3
  45. package/dist/runtime/index.d.ts.map +1 -1
  46. package/dist/runtime/index.js +3 -3
  47. package/dist/runtime/index.js.map +1 -1
  48. package/dist/runtime/prop-builder.d.ts +8 -0
  49. package/dist/runtime/prop-builder.d.ts.map +1 -1
  50. package/dist/runtime/prop-builder.js +39 -11
  51. package/dist/runtime/prop-builder.js.map +1 -1
  52. package/dist/runtime/react-root-manager.d.ts +10 -0
  53. package/dist/runtime/react-root-manager.d.ts.map +1 -1
  54. package/dist/runtime/react-root-manager.js +27 -9
  55. package/dist/runtime/react-root-manager.js.map +1 -1
  56. package/dist/runtime.umd.js +72 -72
  57. package/dist/utilities/cache-manager.d.ts +13 -0
  58. package/dist/utilities/cache-manager.d.ts.map +1 -1
  59. package/dist/utilities/cache-manager.js +40 -16
  60. package/dist/utilities/cache-manager.js.map +1 -1
  61. package/dist/utilities/component-error-analyzer.d.ts +3 -0
  62. package/dist/utilities/component-error-analyzer.d.ts.map +1 -1
  63. package/dist/utilities/component-error-analyzer.js +12 -3
  64. package/dist/utilities/component-error-analyzer.js.map +1 -1
  65. package/dist/utilities/component-hash.d.ts +1 -0
  66. package/dist/utilities/component-hash.d.ts.map +1 -1
  67. package/dist/utilities/component-hash.js +4 -1
  68. package/dist/utilities/component-hash.js.map +1 -1
  69. package/dist/utilities/component-library-theming.d.ts +4 -0
  70. package/dist/utilities/component-library-theming.d.ts.map +1 -1
  71. package/dist/utilities/component-library-theming.js +12 -6
  72. package/dist/utilities/component-library-theming.js.map +1 -1
  73. package/dist/utilities/component-styles.d.ts +1 -0
  74. package/dist/utilities/component-styles.d.ts.map +1 -1
  75. package/dist/utilities/component-styles.js +2 -1
  76. package/dist/utilities/component-styles.js.map +1 -1
  77. package/dist/utilities/component-unwrapper.d.ts +8 -2
  78. package/dist/utilities/component-unwrapper.d.ts.map +1 -1
  79. package/dist/utilities/component-unwrapper.js +19 -7
  80. package/dist/utilities/component-unwrapper.js.map +1 -1
  81. package/dist/utilities/core-libraries.d.ts +2 -0
  82. package/dist/utilities/core-libraries.d.ts.map +1 -1
  83. package/dist/utilities/core-libraries.js +9 -3
  84. package/dist/utilities/core-libraries.js.map +1 -1
  85. package/dist/utilities/entity-record-key.d.ts +1 -0
  86. package/dist/utilities/entity-record-key.d.ts.map +1 -1
  87. package/dist/utilities/entity-record-key.js +4 -1
  88. package/dist/utilities/entity-record-key.js.map +1 -1
  89. package/dist/utilities/library-dependency-resolver.d.ts +8 -0
  90. package/dist/utilities/library-dependency-resolver.d.ts.map +1 -1
  91. package/dist/utilities/library-dependency-resolver.js +39 -15
  92. package/dist/utilities/library-dependency-resolver.js.map +1 -1
  93. package/dist/utilities/library-loader.d.ts +12 -0
  94. package/dist/utilities/library-loader.d.ts.map +1 -1
  95. package/dist/utilities/library-loader.js +46 -16
  96. package/dist/utilities/library-loader.js.map +1 -1
  97. package/dist/utilities/library-registry.d.ts +5 -0
  98. package/dist/utilities/library-registry.d.ts.map +1 -1
  99. package/dist/utilities/library-registry.js +20 -5
  100. package/dist/utilities/library-registry.js.map +1 -1
  101. package/dist/utilities/resource-manager.d.ts +19 -0
  102. package/dist/utilities/resource-manager.d.ts.map +1 -1
  103. package/dist/utilities/resource-manager.js +63 -18
  104. package/dist/utilities/resource-manager.js.map +1 -1
  105. package/dist/utilities/runtime-utilities.d.ts +9 -7
  106. package/dist/utilities/runtime-utilities.d.ts.map +1 -1
  107. package/dist/utilities/runtime-utilities.js +22 -16
  108. package/dist/utilities/runtime-utilities.js.map +1 -1
  109. package/dist/utilities/standard-libraries.d.ts +10 -0
  110. package/dist/utilities/standard-libraries.d.ts.map +1 -1
  111. package/dist/utilities/standard-libraries.js +40 -10
  112. package/dist/utilities/standard-libraries.js.map +1 -1
  113. package/dist/utilities/user-state.d.ts +5 -0
  114. package/dist/utilities/user-state.d.ts.map +1 -1
  115. package/dist/utilities/user-state.js +20 -5
  116. package/dist/utilities/user-state.js.map +1 -1
  117. package/package.json +7 -7
  118. package/src/__tests__/error-boundary.test.ts +80 -0
  119. package/src/__tests__/runtime-utilities-factory.test.ts +4 -4
  120. package/src/__tests__/user-state.test.ts +44 -44
  121. package/src/compiler/babel-config.ts +18 -3
  122. package/src/compiler/component-compiler.ts +34 -9
  123. package/src/compiler/index.ts +3 -3
  124. package/src/component-manager/component-manager.ts +36 -6
  125. package/src/index.ts +35 -21
  126. package/src/registry/component-registry-service.ts +126 -23
  127. package/src/registry/component-registry.ts +122 -24
  128. package/src/registry/component-resolver.ts +51 -9
  129. package/src/registry/registry-provider.ts +40 -40
  130. package/src/runtime/component-hierarchy.ts +61 -10
  131. package/src/runtime/error-boundary.ts +77 -22
  132. package/src/runtime/index.ts +16 -16
  133. package/src/runtime/prop-builder.ts +69 -11
  134. package/src/runtime/react-root-manager.ts +48 -10
  135. package/src/utilities/cache-manager.ts +61 -16
  136. package/src/utilities/component-error-analyzer.ts +18 -3
  137. package/src/utilities/component-hash.ts +6 -1
  138. package/src/utilities/component-library-theming.ts +24 -6
  139. package/src/utilities/component-styles.ts +4 -1
  140. package/src/utilities/component-unwrapper.ts +34 -7
  141. package/src/utilities/core-libraries.ts +13 -3
  142. package/src/utilities/entity-record-key.ts +11 -1
  143. package/src/utilities/library-dependency-resolver.ts +66 -15
  144. package/src/utilities/library-loader.ts +81 -17
  145. package/src/utilities/library-registry.ts +30 -5
  146. package/src/utilities/resource-manager.ts +126 -19
  147. package/src/utilities/runtime-utilities.ts +26 -16
  148. package/src/utilities/standard-libraries.ts +60 -10
  149. package/src/utilities/user-state.ts +40 -5
@@ -1,5 +1,5 @@
1
1
 
2
- > @memberjunction/react-runtime@6.2.0-edge.0 build /home/runner/work/MJ/MJ/packages/React/runtime
2
+ > @memberjunction/react-runtime@6.2.0-edge.1 build /home/runner/work/MJ/MJ/packages/React/runtime
3
3
  > npm run build:node && npm run build:umd
4
4
 
5
5
  npm warn Unknown env config "enable-pre-post-scripts". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
@@ -8,7 +8,7 @@ npm warn Unknown env config "npm-globalconfig". This will stop working in the ne
8
8
  npm warn Unknown env config "link-workspace-packages". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
9
9
  npm warn Unknown env config "_jsr-registry". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
10
10
 
11
- > @memberjunction/react-runtime@6.2.0-edge.0 build:node
11
+ > @memberjunction/react-runtime@6.2.0-edge.1 build:node
12
12
  > tsc && tsc-alias -f
13
13
 
14
14
  npm warn Unknown env config "enable-pre-post-scripts". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
@@ -17,26 +17,26 @@ npm warn Unknown env config "npm-globalconfig". This will stop working in the ne
17
17
  npm warn Unknown env config "link-workspace-packages". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
18
18
  npm warn Unknown env config "_jsr-registry". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
19
19
 
20
- > @memberjunction/react-runtime@6.2.0-edge.0 build:umd
20
+ > @memberjunction/react-runtime@6.2.0-edge.1 build:umd
21
21
  > webpack --config webpack.umd.config.cjs
22
22
 
23
23
  Browserslist: browsers data (caniuse-lite) is 8 months old. Please run:
24
24
  npx update-browserslist-db@latest
25
25
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
26
26
  [BABEL] Note: The code generator has deoptimised the styling of /home/runner/work/MJ/MJ/packages/MJCoreEntities/dist/generated/entities/__mj.js as it exceeds the max of 500KB.
27
- asset runtime.umd.js 4.88 MiB [emitted] [minimized] [big] (name: main) 1 related asset
28
- orphan modules 10.4 MiB [orphan] 621 modules
27
+ asset runtime.umd.js 4.93 MiB [emitted] [minimized] [big] (name: main) 1 related asset
28
+ orphan modules 10.5 MiB [orphan] 622 modules
29
29
  runtime modules 1010 bytes 5 modules
30
- cacheable modules 10.5 MiB
30
+ cacheable modules 10.6 MiB
31
31
  modules by path ../../../node_modules/.pnpm/ 598 KiB
32
32
  modules by path ../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/ 30.4 KiB 16 modules
33
33
  modules by path ../../../node_modules/.pnpm/debug@4.4.3_supports-color@5.5.0/node_modules/...(truncated) 12.7 KiB 2 modules
34
34
  + 4 modules
35
- modules by path ../../MJCoreEntities/dist/ 5.82 MiB
36
- ../../MJCoreEntities/dist/index.js + 69 modules 5.8 MiB [built] [code generated]
35
+ modules by path ../../MJCoreEntities/dist/ 5.86 MiB
36
+ ../../MJCoreEntities/dist/index.js + 69 modules 5.84 MiB [built] [code generated]
37
37
  ../../MJCoreEntities/dist/engines/UserViewEngine.js 19.6 KiB [built] [code generated]
38
- ./dist/index.js + 39 modules 635 KiB [built] [code generated]
39
- ../../MJCore/dist/index.js + 105 modules 2.53 MiB [built] [code generated]
40
- ../../MJGlobal/dist/index.js + 27 modules 592 KiB [built] [code generated]
38
+ ./dist/index.js + 39 modules 670 KiB [built] [code generated]
39
+ ../../MJCore/dist/index.js + 106 modules 2.59 MiB [built] [code generated]
40
+ ../../MJGlobal/dist/index.js + 27 modules 596 KiB [built] [code generated]
41
41
  ../../GraphQLDataProvider/dist/index.mjs + 37 modules 384 KiB [built] [code generated]
42
- webpack 5.105.0 compiled successfully in 46288 ms
42
+ webpack 5.105.0 compiled successfully in 82798 ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,66 @@
1
1
  # @memberjunction/react-runtime
2
2
 
3
+ ## 6.2.0-edge.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 80905a1: Rename public class members and exported functions to PascalCase, per MJ's naming convention,
8
+ **without breaking a single consumer**.
9
+
10
+ Every renamed symbol keeps its old name beside the new one as a `@deprecated` stub that forwards to
11
+ it — a delegating method or function, a getter/setter pair for a property, and for Angular a
12
+ readable accessor pair for an `@Input` and a second `@Output` sharing the same `EventEmitter`, so a
13
+ template still binding the old name keeps receiving events. Old names still compile, still resolve,
14
+ and still behave identically; the deprecation tag rides through to the published `.d.ts`, so editors
15
+ point callers at the replacement. Where a package re-exports through an explicit `export { … }`
16
+ list, the new name is added alongside the old, so the correct name is actually on the public surface
17
+ rather than merely declared.
18
+
19
+ The rename is deliberately refused wherever a mechanical stub would not be equivalent, because
20
+ several of those shapes change a type contract while still compiling in the package that declares
21
+ them:
22
+ - an **optional** property or parameter property — TypeScript has no optional accessor, so a stub
23
+ would promote `foo?` to a required member and break every object literal that omits it;
24
+ - a class that is a **data shape** (no methods, or `@ObjectType`/`@InputType`) — object literals are
25
+ assigned to it, and an accessor stub changes what they must supply;
26
+ - a property whose **subclass redeclares it**, since TypeScript forbids a property overriding an
27
+ accessor (TS2610);
28
+ - a name whose PascalCase form is **already bound** in that file or class;
29
+ - decorated members, `get`/`set` pairs behind a decorator, generators, destructured parameters,
30
+ overload sets and abstract members.
31
+
32
+ **One wire-visible consequence, for version skew only.** `BaseInfo.toJSON` walks `_`-prefixed
33
+ backing fields and emits them through their public getter, preferring the PascalCase one. Renaming
34
+ the 23 field aliases in `MJCore/src/generic` therefore changes what `AllMetadata` carries:
35
+ `EntityInfo.spCreate` and friends now serialize as `SpCreate`. A same-version client is unaffected —
36
+ `copyInitData` accepts a value through a settable accessor, so either spelling lands on the right
37
+ field. An OLDER client against a newer server has no such path in its `copyInitData` and drops those
38
+ fields silently. Same-version deployments, which is the supported configuration, see no change.
39
+
40
+ Each package was verified against its own pre-change baseline rather than against zero, because
41
+ several packages in this repo do not typecheck cleanly to begin with. Angular packages were verified
42
+ with `ngc`, not `tsc`: a plain typecheck does not compile templates, and an earlier write-only
43
+ `@Input` alias passed `tsc` while breaking six template reads.
44
+
45
+ - Updated dependencies [a50948e]
46
+ - Updated dependencies [0eeb89d]
47
+ - Updated dependencies [a3539d2]
48
+ - Updated dependencies [41274aa]
49
+ - Updated dependencies [67f6c85]
50
+ - Updated dependencies [eb3a8d3]
51
+ - Updated dependencies [e1dd673]
52
+ - Updated dependencies [307da67]
53
+ - Updated dependencies [a7da50b]
54
+ - Updated dependencies [17cc774]
55
+ - Updated dependencies [80905a1]
56
+ - Updated dependencies [6b08ebf]
57
+ - @memberjunction/core-entities@6.2.0-edge.1
58
+ - @memberjunction/core@6.2.0-edge.1
59
+ - @memberjunction/graphql-dataprovider@6.2.0-edge.1
60
+ - @memberjunction/global@6.2.0-edge.1
61
+ - @memberjunction/interactive-component-types@6.2.0-edge.1
62
+ - @memberjunction/ai-vectors-memory@6.2.0-edge.1
63
+
3
64
  ## 6.2.0-edge.0
4
65
 
5
66
  ### Patch Changes
@@ -13,12 +13,19 @@ export declare const DEVELOPMENT_CONFIG: {
13
13
  minified: boolean;
14
14
  comments: boolean;
15
15
  };
16
+ export declare function GetBabelConfig(production?: boolean): {
17
+ presets: string[];
18
+ plugins: string[];
19
+ minified: boolean;
20
+ comments: boolean;
21
+ };
16
22
  export declare function getBabelConfig(production?: boolean): {
17
23
  presets: string[];
18
24
  plugins: string[];
19
25
  minified: boolean;
20
26
  comments: boolean;
21
27
  };
28
+ export declare function ValidateBabelPresets(babel: any): boolean;
22
29
  export declare function validateBabelPresets(babel: any): boolean;
23
30
  export declare const JSX_PRAGMAS: {
24
31
  classic: {
@@ -30,6 +37,13 @@ export declare const JSX_PRAGMAS: {
30
37
  importSource: string;
31
38
  };
32
39
  };
40
+ export declare function GetJSXConfig(reactVersion?: string): {
41
+ pragma: string;
42
+ pragmaFrag: string;
43
+ } | {
44
+ runtime: string;
45
+ importSource: string;
46
+ };
33
47
  export declare function getJSXConfig(reactVersion?: string): {
34
48
  pragma: string;
35
49
  pragmaFrag: string;
@@ -1 +1 @@
1
- {"version":3,"file":"babel-config.d.ts","sourceRoot":"","sources":["../../src/compiler/babel-config.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,eAAe,UAE3B,CAAC;AAKF,eAAO,MAAM,eAAe,EAAE,MAAM,EAGnC,CAAC;AAKF,eAAO,MAAM,iBAAiB;;;;;CAQ7B,CAAC;AAKF,eAAO,MAAM,kBAAkB;;;;;;CAS9B,CAAC;AAOF,wBAAgB,cAAc,CAAC,UAAU,GAAE,OAAe;;;;;EAEzD;AAOD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAOxD;AAKD,eAAO,MAAM,WAAW;;;;;;;;;CASvB,CAAC;AAOF,wBAAgB,YAAY,CAAC,YAAY,CAAC,EAAE,MAAM;;;;;;EAMjD"}
1
+ {"version":3,"file":"babel-config.d.ts","sourceRoot":"","sources":["../../src/compiler/babel-config.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,eAAe,UAE3B,CAAC;AAKF,eAAO,MAAM,eAAe,EAAE,MAAM,EAGnC,CAAC;AAKF,eAAO,MAAM,iBAAiB;;;;;CAQ7B,CAAC;AAKF,eAAO,MAAM,kBAAkB;;;;;;CAS9B,CAAC;AAOF,wBAAgB,cAAc,CAAC,UAAU,GAAE,OAAe;;;;;EAEzD;AAGD,wBAAgB,cAAc,CAAC,UAAU,GAAE,OAAe;;;;;EAEzD;AAOD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAOxD;AAGD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAExD;AAKD,eAAO,MAAM,WAAW;;;;;;;;;CASvB,CAAC;AAOF,wBAAgB,YAAY,CAAC,YAAY,CAAC,EAAE,MAAM;;;;;;EAMjD;AAGD,wBAAgB,YAAY,CAAC,YAAY,CAAC,EAAE,MAAM;;;;;;EAEjD"}
@@ -19,15 +19,21 @@ export const DEVELOPMENT_CONFIG = {
19
19
  minified: false,
20
20
  comments: true
21
21
  };
22
- export function getBabelConfig(production = false) {
22
+ export function GetBabelConfig(production = false) {
23
23
  return production ? PRODUCTION_CONFIG : DEVELOPMENT_CONFIG;
24
24
  }
25
- export function validateBabelPresets(babel) {
25
+ export function getBabelConfig(production = false) {
26
+ return GetBabelConfig(production);
27
+ }
28
+ export function ValidateBabelPresets(babel) {
26
29
  if (!babel || !babel.availablePresets) {
27
30
  return false;
28
31
  }
29
32
  return 'react' in babel.availablePresets;
30
33
  }
34
+ export function validateBabelPresets(babel) {
35
+ return ValidateBabelPresets(babel);
36
+ }
31
37
  export const JSX_PRAGMAS = {
32
38
  classic: {
33
39
  pragma: 'React.createElement',
@@ -38,10 +44,13 @@ export const JSX_PRAGMAS = {
38
44
  importSource: 'react'
39
45
  }
40
46
  };
41
- export function getJSXConfig(reactVersion) {
47
+ export function GetJSXConfig(reactVersion) {
42
48
  if (reactVersion && parseInt(reactVersion.split('.')[0]) >= 17) {
43
49
  return JSX_PRAGMAS.automatic;
44
50
  }
45
51
  return JSX_PRAGMAS.classic;
46
52
  }
53
+ export function getJSXConfig(reactVersion) {
54
+ return GetJSXConfig(reactVersion);
55
+ }
47
56
  //# sourceMappingURL=babel-config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"babel-config.js","sourceRoot":"","sources":["../../src/compiler/babel-config.ts"],"names":[],"mappings":"AASA,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,OAAO;CACR,CAAC;AAKF,MAAM,CAAC,MAAM,eAAe,GAAa,EAGxC,CAAC;AAKF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,OAAO,EAAE,eAAe;IACxB,OAAO,EAAE;QACP,GAAG,eAAe;KAEnB;IACD,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,KAAK;CAChB,CAAC;AAKF,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,OAAO,EAAE,eAAe;IACxB,OAAO,EAAE;QACP,GAAG,eAAe;KAEnB;IACD,UAAU,EAAE,QAAQ;IACpB,QAAQ,EAAE,KAAK;IACf,QAAQ,EAAE,IAAI;CACf,CAAC;AAOF,MAAM,UAAU,cAAc,CAAC,aAAsB,KAAK;IACxD,OAAO,UAAU,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,kBAAkB,CAAC;AAC7D,CAAC;AAOD,MAAM,UAAU,oBAAoB,CAAC,KAAU;IAC7C,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC;QACtC,OAAO,KAAK,CAAC;IACf,CAAC;IAGD,OAAO,OAAO,IAAI,KAAK,CAAC,gBAAgB,CAAC;AAC3C,CAAC;AAKD,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,OAAO,EAAE;QACP,MAAM,EAAE,qBAAqB;QAC7B,UAAU,EAAE,gBAAgB;KAC7B;IACD,SAAS,EAAE;QACT,OAAO,EAAE,WAAW;QACpB,YAAY,EAAE,OAAO;KACtB;CACF,CAAC;AAOF,MAAM,UAAU,YAAY,CAAC,YAAqB;IAEhD,IAAI,YAAY,IAAI,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;QAC/D,OAAO,WAAW,CAAC,SAAS,CAAC;IAC/B,CAAC;IACD,OAAO,WAAW,CAAC,OAAO,CAAC;AAC7B,CAAC","sourcesContent":["/**\n * @fileoverview Babel configuration for React component compilation.\n * Provides default presets and plugins for transforming JSX and modern JavaScript.\n * @module @memberjunction/react-runtime/compiler\n */\n\n/**\n * Default Babel presets for React compilation\n */\nexport const DEFAULT_PRESETS = [\n 'react', // Transforms JSX\n];\n\n/**\n * Default Babel plugins for enhanced functionality\n */\nexport const DEFAULT_PLUGINS: string[] = [\n // Add plugins as needed for specific transformations\n // e.g., 'transform-class-properties', 'transform-optional-chaining'\n];\n\n/**\n * Production-specific Babel configuration\n */\nexport const PRODUCTION_CONFIG = {\n presets: DEFAULT_PRESETS,\n plugins: [\n ...DEFAULT_PLUGINS,\n // Production optimizations could go here\n ],\n minified: true,\n comments: false\n};\n\n/**\n * Development-specific Babel configuration\n */\nexport const DEVELOPMENT_CONFIG = {\n presets: DEFAULT_PRESETS,\n plugins: [\n ...DEFAULT_PLUGINS,\n // Development helpers could go here\n ],\n sourceMaps: 'inline',\n minified: false,\n comments: true\n};\n\n/**\n * Get Babel configuration based on environment\n * @param production - Whether to use production configuration\n * @returns Babel configuration object\n */\nexport function getBabelConfig(production: boolean = false) {\n return production ? PRODUCTION_CONFIG : DEVELOPMENT_CONFIG;\n}\n\n/**\n * Validates that required Babel presets are available\n * @param babel - Babel instance to check\n * @returns true if all required presets are available\n */\nexport function validateBabelPresets(babel: any): boolean {\n if (!babel || !babel.availablePresets) {\n return false;\n }\n\n // Check that React preset is available\n return 'react' in babel.availablePresets;\n}\n\n/**\n * Common JSX pragma options for different React versions\n */\nexport const JSX_PRAGMAS = {\n classic: {\n pragma: 'React.createElement',\n pragmaFrag: 'React.Fragment'\n },\n automatic: {\n runtime: 'automatic',\n importSource: 'react'\n }\n};\n\n/**\n * Get appropriate JSX configuration based on React version\n * @param reactVersion - React version (e.g., \"18.2.0\")\n * @returns JSX configuration options\n */\nexport function getJSXConfig(reactVersion?: string) {\n // React 17+ supports the new JSX transform\n if (reactVersion && parseInt(reactVersion.split('.')[0]) >= 17) {\n return JSX_PRAGMAS.automatic;\n }\n return JSX_PRAGMAS.classic;\n}"]}
1
+ {"version":3,"file":"babel-config.js","sourceRoot":"","sources":["../../src/compiler/babel-config.ts"],"names":[],"mappings":"AASA,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,OAAO;CACR,CAAC;AAKF,MAAM,CAAC,MAAM,eAAe,GAAa,EAGxC,CAAC;AAKF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,OAAO,EAAE,eAAe;IACxB,OAAO,EAAE;QACP,GAAG,eAAe;KAEnB;IACD,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,KAAK;CAChB,CAAC;AAKF,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,OAAO,EAAE,eAAe;IACxB,OAAO,E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n * Provides default presets and plugins for transforming JSX and modern JavaScript.\n * @module @memberjunction/react-runtime/compiler\n */\n\n/**\n * Default Babel presets for React compilation\n */\nexport const DEFAULT_PRESETS = [\n 'react', // Transforms JSX\n];\n\n/**\n * Default Babel plugins for enhanced functionality\n */\nexport const DEFAULT_PLUGINS: string[] = [\n // Add plugins as needed for specific transformations\n // e.g., 'transform-class-properties', 'transform-optional-chaining'\n];\n\n/**\n * Production-specific Babel configuration\n */\nexport const PRODUCTION_CONFIG = {\n presets: DEFAULT_PRESETS,\n plugins: [\n ...DEFAULT_PLUGINS,\n // Production optimizations could go here\n ],\n minified: true,\n comments: false\n};\n\n/**\n * Development-specific Babel configuration\n */\nexport const DEVELOPMENT_CONFIG = {\n presets: DEFAULT_PRESETS,\n plugins: [\n ...DEFAULT_PLUGINS,\n // Development helpers could go here\n ],\n sourceMaps: 'inline',\n minified: false,\n comments: true\n};\n\n/**\n * Get Babel configuration based on environment\n * @param production - Whether to use production configuration\n * @returns Babel configuration object\n */\nexport function GetBabelConfig(production: boolean = false) {\n return production ? PRODUCTION_CONFIG : DEVELOPMENT_CONFIG;\n}\n\n/** @deprecated Use {@link GetBabelConfig}. */\nexport function getBabelConfig(production: boolean = false) {\n return GetBabelConfig(production);\n}\n\n/**\n * Validates that required Babel presets are available\n * @param babel - Babel instance to check\n * @returns true if all required presets are available\n */\nexport function ValidateBabelPresets(babel: any): boolean {\n if (!babel || !babel.availablePresets) {\n return false;\n }\n\n // Check that React preset is available\n return 'react' in babel.availablePresets;\n}\n\n/** @deprecated Use {@link ValidateBabelPresets}. */\nexport function validateBabelPresets(babel: any): boolean {\n return ValidateBabelPresets(babel);\n}\n\n/**\n * Common JSX pragma options for different React versions\n */\nexport const JSX_PRAGMAS = {\n classic: {\n pragma: 'React.createElement',\n pragmaFrag: 'React.Fragment'\n },\n automatic: {\n runtime: 'automatic',\n importSource: 'react'\n }\n};\n\n/**\n * Get appropriate JSX configuration based on React version\n * @param reactVersion - React version (e.g., \"18.2.0\")\n * @returns JSX configuration options\n */\nexport function GetJSXConfig(reactVersion?: string) {\n // React 17+ supports the new JSX transform\n if (reactVersion && parseInt(reactVersion.split('.')[0]) >= 17) {\n return JSX_PRAGMAS.automatic;\n }\n return JSX_PRAGMAS.classic;\n}\n\n/** @deprecated Use {@link GetJSXConfig}. */\nexport function getJSXConfig(reactVersion?: string) {\n return GetJSXConfig(reactVersion);\n}"]}
@@ -5,7 +5,9 @@ export declare class ComponentCompiler {
5
5
  private cacheAccessOrder;
6
6
  private babelInstance;
7
7
  constructor(config?: Partial<CompilerConfig>);
8
+ SetBabelInstance(babel: any): void;
8
9
  setBabelInstance(babel: any): void;
10
+ Compile(options: CompileOptions): Promise<CompilationResult>;
9
11
  compile(options: CompileOptions): Promise<CompilationResult>;
10
12
  private transpileComponent;
11
13
  private readonly CORE_LIBRARIES;
@@ -20,8 +22,11 @@ export declare class ComponentCompiler {
20
22
  private createCacheKey;
21
23
  private cacheComponent;
22
24
  private createCompilationError;
25
+ ClearCache(): void;
23
26
  clearCache(): void;
27
+ GetCacheSize(): number;
24
28
  getCacheSize(): number;
29
+ UpdateConfig(config: Partial<CompilerConfig>): void;
25
30
  updateConfig(config: Partial<CompilerConfig>): void;
26
31
  }
27
32
  //# sourceMappingURL=component-compiler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"component-compiler.d.ts","sourceRoot":"","sources":["../../src/compiler/component-compiler.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,cAAc,EAEd,iBAAiB,EACjB,cAAc,EAGf,MAAM,UAAU,CAAC;AA0BlB,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,MAAM,CAAiB;IAC/B,OAAO,CAAC,gBAAgB,CAAiC;IACzD,OAAO,CAAC,gBAAgB,CAAW;IACnC,OAAO,CAAC,aAAa,CAAM;gBAMf,MAAM,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC;IAS5C,gBAAgB,CAAC,KAAK,EAAE,GAAG,GAAG,IAAI;IAS5B,OA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CAAC,iBAAiB;YA8RX,qBAAqB;YAqKrB,UAAU;IA+BxB,OAAO,CAAC,UAAU;IA0ElB,OAAO,CAAC,sBAAsB;IAkI9B,OAAO,CAAC,sBAAsB;IAiE9B,OAAO,CAAC,mBAAmB;IAU3B,OAAO,CAAC,kBAAkB;IAY1B,OAAO,CAAC,cAAc;IAgBtB,OAAO,CAAC,cAAc;IAmBtB,OAAO,CAAC,sBAAsB;IAa9B,UAAU,IAAI,IAAI;IAKlB,UAAU,IAAI,IAAI;IAQlB,YAAY,IAAI,MAAM;IAKtB,YAAY,IAAI,MAAM;IAQtB,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,IAAI;IAKnD,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,IAAI;CAGpD"}
@@ -1,6 +1,6 @@
1
1
  import { LibraryRegistry } from '../utilities/library-registry.js';
2
2
  import { LibraryLoader } from '../utilities/library-loader.js';
3
- import { unwrapLibraryComponent, unwrapLibraryComponents, unwrapAllLibraryComponents } from '../utilities/component-unwrapper.js';
3
+ import { UnwrapLibraryComponent, UnwrapLibraryComponents, UnwrapAllLibraryComponents } from '../utilities/component-unwrapper.js';
4
4
  const DEFAULT_COMPILER_CONFIG = {
5
5
  babel: {
6
6
  presets: ['react'],
@@ -18,10 +18,13 @@ export class ComponentCompiler {
18
18
  this.config = { ...DEFAULT_COMPILER_CONFIG, ...config };
19
19
  this.compilationCache = new Map();
20
20
  }
21
- setBabelInstance(babel) {
21
+ SetBabelInstance(babel) {
22
22
  this.babelInstance = babel;
23
23
  }
24
- async compile(options) {
24
+ setBabelInstance(babel) {
25
+ return this.SetBabelInstance(babel);
26
+ }
27
+ async Compile(options) {
25
28
  const startTime = Date.now();
26
29
  try {
27
30
  if (this.config.cache) {
@@ -65,6 +68,9 @@ export class ComponentCompiler {
65
68
  };
66
69
  }
67
70
  }
71
+ async compile(options) {
72
+ return this.Compile(options);
73
+ }
68
74
  transpileComponent(code, componentName, options) {
69
75
  if (!this.babelInstance) {
70
76
  throw new Error('Babel instance not set. Call setBabelInstance() first.');
@@ -566,9 +572,9 @@ export class ComponentCompiler {
566
572
  console.log(`⚠️ Filtering out dependency-only library: ${key}`);
567
573
  }
568
574
  });
569
- const boundUnwrapLibraryComponent = (lib, name) => unwrapLibraryComponent(lib, name, this.config.debug);
570
- const boundUnwrapLibraryComponents = (lib, ...names) => unwrapLibraryComponents(lib, ...names, this.config.debug);
571
- const boundUnwrapAllLibraryComponents = (lib) => unwrapAllLibraryComponents(lib, this.config.debug);
575
+ const boundUnwrapLibraryComponent = (lib, name) => UnwrapLibraryComponent(lib, name, this.config.debug);
576
+ const boundUnwrapLibraryComponents = (lib, ...names) => UnwrapLibraryComponents(lib, ...names, this.config.debug);
577
+ const boundUnwrapAllLibraryComponents = (lib) => UnwrapAllLibraryComponents(lib, this.config.debug);
572
578
  let createComponentFn;
573
579
  try {
574
580
  createComponentFn = factoryCreator(React, ReactDOM, React.useState, React.useEffect, React.useCallback, React.useMemo, React.useRef, React.useContext, React.useReducer, React.useLayoutEffect, mergedLibraries, styles, console, components, boundUnwrapLibraryComponent, boundUnwrapLibraryComponents, boundUnwrapAllLibraryComponents);
@@ -662,14 +668,23 @@ export class ComponentCompiler {
662
668
  details: error
663
669
  };
664
670
  }
665
- clearCache() {
671
+ ClearCache() {
666
672
  this.compilationCache.clear();
667
673
  }
668
- getCacheSize() {
674
+ clearCache() {
675
+ return this.ClearCache();
676
+ }
677
+ GetCacheSize() {
669
678
  return this.compilationCache.size;
670
679
  }
671
- updateConfig(config) {
680
+ getCacheSize() {
681
+ return this.GetCacheSize();
682
+ }
683
+ UpdateConfig(config) {
672
684
  this.config = { ...this.config, ...config };
673
685
  }
686
+ updateConfig(config) {
687
+ return this.UpdateConfig(config);
688
+ }
674
689
  }
675
690
  //# sourceMappingURL=component-compiler.js.map