@adaptabletools/adaptable 24.0.1 → 24.0.3

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 (331) hide show
  1. package/devtools.d.ts +506 -5
  2. package/devtools.js +11 -1
  3. package/index.css +15 -5
  4. package/package.json +1 -1
  5. package/src/AdaptableInterfaces/IAdaptable.d.ts +6 -1
  6. package/src/AdaptableOptions/DataImportOptions.d.ts +1 -1
  7. package/src/AdaptableOptions/ExportOptions.d.ts +2 -2
  8. package/src/AdaptableState/Common/AdaptableFormat.d.ts +2 -10
  9. package/src/AdaptableState/Common/RowSummary.d.ts +2 -0
  10. package/src/AdaptableState/LayoutState.d.ts +1 -1
  11. package/src/Api/Implementation/AlertApiImpl.js +2 -0
  12. package/src/Api/Internal/CalculatedColumnInternalApi.js +25 -3
  13. package/src/Api/Internal/ExportInternalApi.d.ts +2 -0
  14. package/src/Api/Internal/ExportInternalApi.js +39 -3
  15. package/src/Api/Internal/FormatColumnInternalApi.d.ts +3 -2
  16. package/src/Api/Internal/FormatColumnInternalApi.js +15 -7
  17. package/src/Api/Internal/LayoutInternalApi.d.ts +11 -1
  18. package/src/Api/Internal/LayoutInternalApi.js +34 -3
  19. package/src/Api/Internal/NoteInternalApi.d.ts +12 -0
  20. package/src/Api/Internal/NoteInternalApi.js +11 -0
  21. package/src/EnvVars.d.ts +1 -0
  22. package/src/EnvVars.js +1 -0
  23. package/src/Redux/Store/AdaptableStore.js +4 -7
  24. package/src/Strategy/FlashingCellModule.js +2 -0
  25. package/src/Utilities/Services/CalculatedColumnExpressionService.d.ts +1 -0
  26. package/src/Utilities/Services/CalculatedColumnExpressionService.js +15 -0
  27. package/src/Utilities/Services/Interface/ICalculatedColumnExpressionService.d.ts +7 -0
  28. package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +17 -1
  29. package/src/Utilities/Services/QueryLanguageService.d.ts +11 -1
  30. package/src/Utilities/Services/QueryLanguageService.js +47 -2
  31. package/src/Utilities/Services/RowSummaryService.d.ts +2 -0
  32. package/src/Utilities/Services/RowSummaryService.js +6 -1
  33. package/src/Utilities/license/instanceLicense.d.ts +12 -0
  34. package/src/Utilities/license/instanceLicense.js +10 -0
  35. package/src/Utilities/license/licenseStatus.d.ts +26 -0
  36. package/src/Utilities/license/licenseStatus.js +72 -0
  37. package/src/View/Components/CellPopup/index.js +15 -10
  38. package/src/View/GridInfo/GridInfoPopup.js +6 -1
  39. package/src/View/Layout/TransposedPopup.js +1 -0
  40. package/src/View/Layout/Wizard/sections/AggregationsSection.d.ts +3 -5
  41. package/src/View/Layout/Wizard/sections/AggregationsSection.js +10 -24
  42. package/src/View/Layout/Wizard/sections/RowSummarySection.js +5 -1
  43. package/src/View/ObjectItemViews/Layout/aggregationSummaryHelpers.d.ts +5 -1
  44. package/src/View/ObjectItemViews/Layout/aggregationSummaryHelpers.js +6 -3
  45. package/src/agGrid/AdaptableAgGrid.d.ts +7 -3
  46. package/src/agGrid/AdaptableAgGrid.js +144 -78
  47. package/src/agGrid/AdaptableFilterHandler.d.ts +2 -0
  48. package/src/agGrid/AdaptableFilterHandler.js +34 -0
  49. package/src/agGrid/AgGridAdapter.d.ts +9 -0
  50. package/src/agGrid/AgGridAdapter.js +23 -12
  51. package/src/agGrid/AgGridColumnAdapter.d.ts +2 -0
  52. package/src/agGrid/AgGridColumnAdapter.js +124 -78
  53. package/src/agGrid/AgGridExportAdapter.d.ts +5 -0
  54. package/src/agGrid/AgGridExportAdapter.js +31 -0
  55. package/src/agGrid/AgGridMenuAdapter.js +1 -1
  56. package/src/agGrid/applyGlobalGridOptions.d.ts +9 -0
  57. package/src/agGrid/applyGlobalGridOptions.js +36 -0
  58. package/src/agGrid/cellRenderers/BadgeRenderer.js +22 -0
  59. package/src/agGrid/columnMinMaxCache.d.ts +33 -0
  60. package/src/agGrid/columnMinMaxCache.js +50 -0
  61. package/src/devTools/PerfStore.d.ts +218 -0
  62. package/src/devTools/PerfStore.js +717 -0
  63. package/src/devTools/index.d.ts +33 -0
  64. package/src/devTools/index.js +132 -56
  65. package/src/devTools/logBuffer.d.ts +17 -0
  66. package/src/devTools/logBuffer.js +33 -0
  67. package/src/devTools/memoryInfo.d.ts +15 -0
  68. package/src/devTools/memoryInfo.js +229 -0
  69. package/src/devTools/memoryRoots.d.ts +41 -0
  70. package/src/devTools/memoryRoots.js +136 -0
  71. package/src/devTools/perfContext.d.ts +5 -0
  72. package/src/devTools/perfContext.js +155 -0
  73. package/src/devTools/perfInstrumentation.d.ts +13 -0
  74. package/src/devTools/perfInstrumentation.js +78 -0
  75. package/src/env.js +2 -2
  76. package/src/layout-manager/src/LayoutManagerModel.d.ts +3 -1
  77. package/src/layout-manager/src/expandAllRowGroups.d.ts +6 -0
  78. package/src/layout-manager/src/expandAllRowGroups.js +13 -0
  79. package/src/layout-manager/src/index.js +18 -10
  80. package/src/setupDevTools.js +560 -106
  81. package/tsconfig.esm.tsbuildinfo +1 -1
  82. package/vendor/aql/api/QueryLanguageApi.d.ts +2 -1
  83. package/vendor/aql/api/QueryLanguageApi.d.ts.map +1 -1
  84. package/vendor/aql/api/QueryLanguageApi.js +28 -108
  85. package/vendor/aql/api/QueryLanguageApi.js.map +1 -1
  86. package/vendor/aql/contract/index.js +0 -34
  87. package/vendor/aql/contract/index.js.map +1 -1
  88. package/vendor/aql/corpus/corpusExpressions.js +0 -13
  89. package/vendor/aql/corpus/corpusExpressions.js.map +1 -1
  90. package/vendor/aql/corpus/corpusFixture.js +0 -7
  91. package/vendor/aql/corpus/corpusFixture.js.map +1 -1
  92. package/vendor/aql/draft/index.js +0 -4
  93. package/vendor/aql/draft/index.js.map +1 -1
  94. package/vendor/aql/evaluate.js +0 -22
  95. package/vendor/aql/evaluate.js.map +1 -1
  96. package/vendor/aql/evaluator/ExpressionEvaluationError.js +0 -4
  97. package/vendor/aql/evaluator/ExpressionEvaluationError.js.map +1 -1
  98. package/vendor/aql/evaluator/ExpressionNaError.js +0 -4
  99. package/vendor/aql/evaluator/ExpressionNaError.js.map +1 -1
  100. package/vendor/aql/evaluator/evaluateNode.js +0 -23
  101. package/vendor/aql/evaluator/evaluateNode.js.map +1 -1
  102. package/vendor/aql/functions/dateUtils.js +0 -63
  103. package/vendor/aql/functions/dateUtils.js.map +1 -1
  104. package/vendor/aql/functions/numberUtils.js +0 -12
  105. package/vendor/aql/functions/numberUtils.js.map +1 -1
  106. package/vendor/aql/functions/operatorFunctions.js +0 -13
  107. package/vendor/aql/functions/operatorFunctions.js.map +1 -1
  108. package/vendor/aql/functions/scalar/functions/AND.js +0 -5
  109. package/vendor/aql/functions/scalar/functions/AND.js.map +1 -1
  110. package/vendor/aql/functions/scalar/functions/ANY_CHANGE.js +0 -4
  111. package/vendor/aql/functions/scalar/functions/ANY_CHANGE.js.map +1 -1
  112. package/vendor/aql/functions/scalar/functions/ANY_CONTAINS.js +0 -4
  113. package/vendor/aql/functions/scalar/functions/ANY_CONTAINS.js.map +1 -1
  114. package/vendor/aql/functions/scalar/functions/AVG.js +0 -1
  115. package/vendor/aql/functions/scalar/functions/AVG.js.map +1 -1
  116. package/vendor/aql/functions/scalar/functions/CASE.js +2 -2
  117. package/vendor/aql/functions/scalar/functions/CASE.js.map +1 -1
  118. package/vendor/aql/functions/scalar/functions/COL.js +0 -2
  119. package/vendor/aql/functions/scalar/functions/COL.js.map +1 -1
  120. package/vendor/aql/functions/scalar/functions/CONTAINS.js +0 -3
  121. package/vendor/aql/functions/scalar/functions/CONTAINS.js.map +1 -1
  122. package/vendor/aql/functions/scalar/functions/DATE.js +0 -2
  123. package/vendor/aql/functions/scalar/functions/DATE.js.map +1 -1
  124. package/vendor/aql/functions/scalar/functions/ENDS_WITH.js +0 -1
  125. package/vendor/aql/functions/scalar/functions/ENDS_WITH.js.map +1 -1
  126. package/vendor/aql/functions/scalar/functions/EQ.js +0 -5
  127. package/vendor/aql/functions/scalar/functions/EQ.js.map +1 -1
  128. package/vendor/aql/functions/scalar/functions/GT.js +0 -3
  129. package/vendor/aql/functions/scalar/functions/GT.js.map +1 -1
  130. package/vendor/aql/functions/scalar/functions/GTE.js +0 -3
  131. package/vendor/aql/functions/scalar/functions/GTE.js.map +1 -1
  132. package/vendor/aql/functions/scalar/functions/IF.js +0 -5
  133. package/vendor/aql/functions/scalar/functions/IF.js.map +1 -1
  134. package/vendor/aql/functions/scalar/functions/IFERROR.js +0 -4
  135. package/vendor/aql/functions/scalar/functions/IFERROR.js.map +1 -1
  136. package/vendor/aql/functions/scalar/functions/IFNA.js +0 -5
  137. package/vendor/aql/functions/scalar/functions/IFNA.js.map +1 -1
  138. package/vendor/aql/functions/scalar/functions/IN.d.ts.map +1 -1
  139. package/vendor/aql/functions/scalar/functions/IN.js +54 -11
  140. package/vendor/aql/functions/scalar/functions/IN.js.map +1 -1
  141. package/vendor/aql/functions/scalar/functions/IS_BLANK.js +0 -1
  142. package/vendor/aql/functions/scalar/functions/IS_BLANK.js.map +1 -1
  143. package/vendor/aql/functions/scalar/functions/IS_DIFFERENT_DAY.js +0 -1
  144. package/vendor/aql/functions/scalar/functions/IS_DIFFERENT_DAY.js.map +1 -1
  145. package/vendor/aql/functions/scalar/functions/IS_NOT_BLANK.js +0 -1
  146. package/vendor/aql/functions/scalar/functions/IS_NOT_BLANK.js.map +1 -1
  147. package/vendor/aql/functions/scalar/functions/LT.js +0 -3
  148. package/vendor/aql/functions/scalar/functions/LT.js.map +1 -1
  149. package/vendor/aql/functions/scalar/functions/LTE.js +0 -3
  150. package/vendor/aql/functions/scalar/functions/LTE.js.map +1 -1
  151. package/vendor/aql/functions/scalar/functions/NA.js +0 -3
  152. package/vendor/aql/functions/scalar/functions/NA.js.map +1 -1
  153. package/vendor/aql/functions/scalar/functions/NOT_CONTAINS.js +0 -1
  154. package/vendor/aql/functions/scalar/functions/NOT_CONTAINS.js.map +1 -1
  155. package/vendor/aql/functions/scalar/functions/NOT_IN.js +0 -3
  156. package/vendor/aql/functions/scalar/functions/NOT_IN.js.map +1 -1
  157. package/vendor/aql/functions/scalar/functions/OR.js +0 -4
  158. package/vendor/aql/functions/scalar/functions/OR.js.map +1 -1
  159. package/vendor/aql/functions/scalar/functions/PRODUCT.js +0 -6
  160. package/vendor/aql/functions/scalar/functions/PRODUCT.js.map +1 -1
  161. package/vendor/aql/functions/scalar/functions/QUERY.js +0 -1
  162. package/vendor/aql/functions/scalar/functions/QUERY.js.map +1 -1
  163. package/vendor/aql/functions/scalar/functions/REGEX.js +0 -1
  164. package/vendor/aql/functions/scalar/functions/REGEX.js.map +1 -1
  165. package/vendor/aql/functions/scalar/functions/SCOPE.js +0 -4
  166. package/vendor/aql/functions/scalar/functions/SCOPE.js.map +1 -1
  167. package/vendor/aql/functions/scalar/functions/STARTS_WITH.js +0 -1
  168. package/vendor/aql/functions/scalar/functions/STARTS_WITH.js.map +1 -1
  169. package/vendor/aql/functions/scalar/functions/SUB.js +0 -1
  170. package/vendor/aql/functions/scalar/functions/SUB.js.map +1 -1
  171. package/vendor/aql/functions/scalar/functions/SUM.js +0 -5
  172. package/vendor/aql/functions/scalar/functions/SUM.js.map +1 -1
  173. package/vendor/aql/functions/scalar/helpers.js +0 -3
  174. package/vendor/aql/functions/scalar/helpers.js.map +1 -1
  175. package/vendor/aql/functions/shared/FIELD.js +0 -3
  176. package/vendor/aql/functions/shared/FIELD.js.map +1 -1
  177. package/vendor/aql/functions/shared/VAR.js +0 -4
  178. package/vendor/aql/functions/shared/VAR.js.map +1 -1
  179. package/vendor/aql/functions/shared/index.js +0 -9
  180. package/vendor/aql/functions/shared/index.js.map +1 -1
  181. package/vendor/aql/functions/stringUtils.js +0 -25
  182. package/vendor/aql/functions/stringUtils.js.map +1 -1
  183. package/vendor/aql/functions/utils.js +0 -20
  184. package/vendor/aql/functions/utils.js.map +1 -1
  185. package/vendor/aql/host/access.js +0 -2
  186. package/vendor/aql/host/access.js.map +1 -1
  187. package/vendor/aql/host/createHostExpressionContext.js +0 -25
  188. package/vendor/aql/host/createHostExpressionContext.js.map +1 -1
  189. package/vendor/aql/host/createObjectDataHost.js +0 -9
  190. package/vendor/aql/host/createObjectDataHost.js.map +1 -1
  191. package/vendor/aql/index.js +0 -2
  192. package/vendor/aql/index.js.map +1 -1
  193. package/vendor/aql/normalize/canonicalize.js +0 -7
  194. package/vendor/aql/normalize/canonicalize.js.map +1 -1
  195. package/vendor/aql/normalize/migrateExpression.js +0 -8
  196. package/vendor/aql/normalize/migrateExpression.js.map +1 -1
  197. package/vendor/aql/normalize/names.js +0 -72
  198. package/vendor/aql/normalize/names.js.map +1 -1
  199. package/vendor/aql/normalize/normalizeAst.js +0 -102
  200. package/vendor/aql/normalize/normalizeAst.js.map +1 -1
  201. package/vendor/aql/normalize/print.js +0 -35
  202. package/vendor/aql/normalize/print.js.map +1 -1
  203. package/vendor/aql/operator/primitiveSlots.js +0 -4
  204. package/vendor/aql/operator/primitiveSlots.js.map +1 -1
  205. package/vendor/aql/operator/resolve.js +0 -18
  206. package/vendor/aql/operator/resolve.js.map +1 -1
  207. package/vendor/aql/parser/parser.js +4 -125
  208. package/vendor/aql/parser/parser.js.map +1 -1
  209. package/vendor/aql/plan/catalogue.js +0 -35
  210. package/vendor/aql/plan/catalogue.js.map +1 -1
  211. package/vendor/aql/plan/compile.js +0 -68
  212. package/vendor/aql/plan/compile.js.map +1 -1
  213. package/vendor/aql/plan/deepMap.js +0 -16
  214. package/vendor/aql/plan/deepMap.js.map +1 -1
  215. package/vendor/aql/plan/execute.js +0 -91
  216. package/vendor/aql/plan/execute.js.map +1 -1
  217. package/vendor/aql/plan/magnitudeLiteral.js +0 -29
  218. package/vendor/aql/plan/magnitudeLiteral.js.map +1 -1
  219. package/vendor/aql/plan/observable.js +0 -31
  220. package/vendor/aql/plan/observable.js.map +1 -1
  221. package/vendor/aql/plan/observableFixture.js +0 -3
  222. package/vendor/aql/plan/observableFixture.js.map +1 -1
  223. package/vendor/aql/plan/operators.js +0 -35
  224. package/vendor/aql/plan/operators.js.map +1 -1
  225. package/vendor/aql/plan/outer.js +0 -16
  226. package/vendor/aql/plan/outer.js.map +1 -1
  227. package/vendor/aql/predicate/mapExpressionToQlPredicate.js +1 -46
  228. package/vendor/aql/predicate/mapExpressionToQlPredicate.js.map +1 -1
  229. package/vendor/aql/predicate/mapQlPredicateToExpression.js +0 -13
  230. package/vendor/aql/predicate/mapQlPredicateToExpression.js.map +1 -1
  231. package/vendor/aql/store/computedValueStore.js +0 -35
  232. package/vendor/aql/store/computedValueStore.js.map +1 -1
  233. package/vendor/aql/store/history/clock.js +0 -1
  234. package/vendor/aql/store/history/clock.js.map +1 -1
  235. package/vendor/aql/store/history/historyStore.js +0 -14
  236. package/vendor/aql/store/history/historyStore.js.map +1 -1
  237. package/vendor/aql/store/history/monotonicDeque.js +0 -9
  238. package/vendor/aql/store/history/monotonicDeque.js.map +1 -1
  239. package/vendor/aql/store/history/operators.js +0 -13
  240. package/vendor/aql/store/history/operators.js.map +1 -1
  241. package/vendor/aql/store/history/ringBuffer.js +0 -12
  242. package/vendor/aql/store/history/ringBuffer.js.map +1 -1
  243. package/vendor/aql/store/history/rowSeries.js +0 -17
  244. package/vendor/aql/store/history/rowSeries.js.map +1 -1
  245. package/vendor/aql/store/history/types.js +0 -18
  246. package/vendor/aql/store/history/types.js.map +1 -1
  247. package/vendor/aql/tokenizer/tokenizer.js +0 -3
  248. package/vendor/aql/tokenizer/tokenizer.js.map +1 -1
  249. package/vendor/aql/types.js +0 -27
  250. package/vendor/aql/types.js.map +1 -1
  251. package/vendor/aql/utils/astUtils.js +0 -1
  252. package/vendor/aql/utils/astUtils.js.map +1 -1
  253. package/vendor/aql/utils/dependencyCycle.js +0 -5
  254. package/vendor/aql/utils/dependencyCycle.js.map +1 -1
  255. package/vendor/aql/validation/classifyExpression.js +0 -4
  256. package/vendor/aql/validation/classifyExpression.js.map +1 -1
  257. package/vendor/aql/validation/functionMetadata.js +0 -31
  258. package/vendor/aql/validation/functionMetadata.js.map +1 -1
  259. package/vendor/aql/validation/validateAqlExpression.js +2 -81
  260. package/vendor/aql/validation/validateAqlExpression.js.map +1 -1
  261. package/vendor/aql/validation/validateExpressionTypes.js +0 -64
  262. package/vendor/aql/validation/validateExpressionTypes.js.map +1 -1
  263. package/vendor/components/Button/index.js +0 -6
  264. package/vendor/components/Button/index.js.map +1 -1
  265. package/vendor/components/ColorField/index.js +0 -18
  266. package/vendor/components/ColorField/index.js.map +1 -1
  267. package/vendor/components/ColorPicker/colorPickerTab.js +0 -6
  268. package/vendor/components/ColorPicker/colorPickerTab.js.map +1 -1
  269. package/vendor/components/ColorPicker/index.js +1 -66
  270. package/vendor/components/ColorPicker/index.js.map +1 -1
  271. package/vendor/components/ColorPicker/themeColors.js +0 -55
  272. package/vendor/components/ColorPicker/themeColors.js.map +1 -1
  273. package/vendor/components/Combobox/VirtualizedList.js +0 -5
  274. package/vendor/components/Combobox/VirtualizedList.js.map +1 -1
  275. package/vendor/components/Combobox/comboboxUtils.js +0 -5
  276. package/vendor/components/Combobox/comboboxUtils.js.map +1 -1
  277. package/vendor/components/Combobox/index.js +7 -106
  278. package/vendor/components/Combobox/index.js.map +1 -1
  279. package/vendor/components/Combobox/useScrollNearEnd.js +0 -6
  280. package/vendor/components/Combobox/useScrollNearEnd.js.map +1 -1
  281. package/vendor/components/DropdownButton/index.js +0 -5
  282. package/vendor/components/DropdownButton/index.js.map +1 -1
  283. package/vendor/components/NumberInput/index.js +0 -10
  284. package/vendor/components/NumberInput/index.js.map +1 -1
  285. package/vendor/components/Radio/index.d.ts.map +1 -1
  286. package/vendor/components/Radio/index.js +1 -1
  287. package/vendor/components/Radio/index.js.map +1 -1
  288. package/vendor/components/Resizable/index.d.ts +14 -9
  289. package/vendor/components/Resizable/index.d.ts.map +1 -1
  290. package/vendor/components/Resizable/index.js +26 -26
  291. package/vendor/components/Resizable/index.js.map +1 -1
  292. package/vendor/components/Resizable/resizableUtils.d.ts +24 -13
  293. package/vendor/components/Resizable/resizableUtils.d.ts.map +1 -1
  294. package/vendor/components/Resizable/resizableUtils.js +13 -27
  295. package/vendor/components/Resizable/resizableUtils.js.map +1 -1
  296. package/vendor/components/SearchInput/index.js +0 -5
  297. package/vendor/components/SearchInput/index.js.map +1 -1
  298. package/vendor/components/Tree/TreeDropdown/index.js +3 -139
  299. package/vendor/components/Tree/TreeDropdown/index.js.map +1 -1
  300. package/vendor/components/Tree/treeUtils.js +0 -4
  301. package/vendor/components/Tree/treeUtils.js.map +1 -1
  302. package/vendor/components/index.css +12 -5
  303. package/vendor/components/index.js +0 -5
  304. package/vendor/components/index.js.map +1 -1
  305. package/vendor/components/lib/useProperty.js +0 -18
  306. package/vendor/components/lib/useProperty.js.map +1 -1
  307. package/vendor/components/twMerge.js +0 -2
  308. package/vendor/components/twMerge.js.map +1 -1
  309. package/vendor/components/twUtils.js +3 -12
  310. package/vendor/components/twUtils.js.map +1 -1
  311. package/vendor/components/ui/alert-dialog.js +0 -4
  312. package/vendor/components/ui/alert-dialog.js.map +1 -1
  313. package/vendor/components/ui/calendar.js +1 -9
  314. package/vendor/components/ui/calendar.js.map +1 -1
  315. package/vendor/components/ui/combobox.js +3 -39
  316. package/vendor/components/ui/combobox.js.map +1 -1
  317. package/vendor/components/ui/dialog.js +0 -4
  318. package/vendor/components/ui/dialog.js.map +1 -1
  319. package/vendor/components/ui/input-group.js +3 -12
  320. package/vendor/components/ui/input-group.js.map +1 -1
  321. package/vendor/components/ui/input.js +1 -1
  322. package/vendor/components/ui/input.js.map +1 -1
  323. package/vendor/components/ui/select.js +1 -1
  324. package/vendor/components/ui/select.js.map +1 -1
  325. package/vendor/components/ui/tabs.js +0 -3
  326. package/vendor/components/ui/tabs.js.map +1 -1
  327. package/vendor/components/ui/textarea.js +1 -1
  328. package/vendor/components/ui/textarea.js.map +1 -1
  329. package/vendor/components/ui/tooltip.d.ts.map +1 -1
  330. package/vendor/components/ui/tooltip.js +3 -1
  331. package/vendor/components/ui/tooltip.js.map +1 -1
@@ -17,14 +17,23 @@ type HasRequiredProps<T> = T extends Record<string, never> ? false : {
17
17
  type EndMethod<T extends Omit<DevToolsMarkerDetails, 'track' | 'label'>> = HasRequiredProps<T> extends true ? (markerDetails: T) => DevToolsMarker : (markerDetails?: T) => DevToolsMarker;
18
18
  export declare class DevToolsMarker implements PerfMarker {
19
19
  readonly adaptableId: string;
20
+ private readonly noop;
20
21
  static create(adaptableId: string): DevToolsMarker;
22
+ /** A marker that records nothing; see {@link NOOP_MARKER} */
23
+ static createNoop(): DevToolsMarker;
21
24
  private markerDetails;
22
25
  private stopped;
23
26
  private constructor();
27
+ /**
28
+ * `false` for the marker that records nothing: skip building `details` that are expensive to
29
+ * compute when it is `false`
30
+ */
31
+ get isActive(): boolean;
24
32
  start: (startDetails?: {
25
33
  details?: DevToolsMarkerDetails["details"];
26
34
  }) => this;
27
35
  get startTimestamp(): number;
36
+ private trackAccessors?;
28
37
  get track(): {
29
38
  readonly Init: {
30
39
  start: DevToolsMarker["start"];
@@ -119,8 +128,32 @@ export declare class DevToolsMarker implements PerfMarker {
119
128
  };
120
129
  };
121
130
  };
131
+ private buildTrackAccessors;
132
+ /** Also write a `performance.measure` (Chrome Performance panel track entry) */
133
+ tracksEnabled: boolean;
122
134
  end: (markerDetails?: Partial<DevToolsMarkerDetails>) => this;
123
135
  }
124
136
  export declare function areAdaptableProfileTracksEnabled(adaptableId: string | undefined): boolean;
137
+ /** Call after changing `localStorage.adaptableProfileTracks` or `localStorage.debug` */
138
+ export declare function resetProfileTracksCache(): void;
139
+ /**
140
+ * Whether operations of the instance are timed: during a Performance recording (kept for
141
+ * AdapTable DevTools and written as Chrome Performance panel tracks), or when profile tracks are
142
+ * enabled (`localStorage.adaptableProfileTracks = 'true'`, written as tracks only).
143
+ */
144
+ export declare function shouldTimeOperations(adaptableId: string | undefined): boolean;
145
+ /**
146
+ * Times an AdapTable operation (a Layout change, a column-model refresh, a Redux action). While
147
+ * nothing records and profile tracks are off, returns a shared marker that does nothing (see
148
+ * {@link shouldTimeOperations}). Use {@link getStartupMarker} for the initialisation phases.
149
+ */
125
150
  export declare function getMarker(adaptableId: string): DevToolsMarker;
151
+ /**
152
+ * Times an initialisation phase. These are always kept for AdapTable DevTools (4 timings per
153
+ * instance per page load) and written as Chrome Performance panel tracks during a recording or
154
+ * when profile tracks are enabled. Creates the instance's store first, so a Record and reload
155
+ * request starts recording before the first phase.
156
+ */
157
+ export declare function getStartupMarker(adaptableId: string): DevToolsMarker;
126
158
  export type { PerfMarker };
159
+ export { getPerfStore, getPerfRecorder, isPerfRecording, isRecordingPerformance, deletePerfStore, PerfRecorder, PerfStore, } from './PerfStore';
@@ -1,5 +1,6 @@
1
1
  import { debug } from '@infinite-table/infinite-react';
2
2
  import { DevToolsTracks } from './DevToolsTracks';
3
+ import { getPerfStore, isRecordingPerformance, isRecordingTracks, shouldKeepOperation, } from './PerfStore';
3
4
  const AVAILABLE_COLORS = [
4
5
  'primary',
5
6
  'primary-light',
@@ -22,9 +23,13 @@ function getColor(identifier) {
22
23
  }
23
24
  export class DevToolsMarker {
24
25
  adaptableId;
26
+ noop;
25
27
  static create(adaptableId) {
26
28
  return new DevToolsMarker(adaptableId);
27
29
  }
30
+ static createNoop() {
31
+ return new DevToolsMarker('', true);
32
+ }
28
33
  markerDetails = {
29
34
  label: '',
30
35
  track: '',
@@ -34,12 +39,16 @@ export class DevToolsMarker {
34
39
  tooltip: undefined,
35
40
  };
36
41
  stopped = false;
37
- constructor(adaptableId) {
42
+ constructor(adaptableId, noop = false) {
38
43
  this.adaptableId = adaptableId;
44
+ this.noop = noop;
39
45
  this.adaptableId = adaptableId;
40
46
  }
47
+ get isActive() {
48
+ return !this.noop;
49
+ }
41
50
  start = (startDetails) => {
42
- if (this.markerDetails.startTs) {
51
+ if (this.noop || this.markerDetails.startTs) {
43
52
  return this;
44
53
  }
45
54
  const start = performance.now();
@@ -50,7 +59,12 @@ export class DevToolsMarker {
50
59
  get startTimestamp() {
51
60
  return this.markerDetails.startTs;
52
61
  }
62
+ trackAccessors;
53
63
  get track() {
64
+ this.trackAccessors ??= this.buildTrackAccessors();
65
+ return this.trackAccessors;
66
+ }
67
+ buildTrackAccessors() {
54
68
  const self = this;
55
69
  return Object.keys(DevToolsTracks).reduce((acc, track) => {
56
70
  const trackObj = {
@@ -63,29 +77,34 @@ export class DevToolsMarker {
63
77
  });
64
78
  },
65
79
  get label() {
66
- const currentTrack = DevToolsTracks[track];
67
- return Object.keys(currentTrack.labels).reduce((labelAcc, label) => {
68
- const labelObj = {
69
- start: self.start,
70
- end: (markerDetails) => {
71
- return self.end({
72
- ...markerDetails,
73
- track: currentTrack.track,
74
- label: currentTrack.labels[label],
75
- });
76
- },
77
- };
78
- Object.defineProperty(labelAcc, label, {
79
- get: () => {
80
- self.markerDetails.label =
81
- currentTrack.labels[label];
82
- return labelObj;
83
- },
84
- });
85
- return labelAcc;
86
- }, {});
80
+ labelAccessors ??= buildLabelAccessors();
81
+ return labelAccessors;
87
82
  },
88
83
  };
84
+ let labelAccessors;
85
+ const buildLabelAccessors = () => {
86
+ const currentTrack = DevToolsTracks[track];
87
+ return Object.keys(currentTrack.labels).reduce((labelAcc, label) => {
88
+ const labelObj = {
89
+ start: self.start,
90
+ end: (markerDetails) => {
91
+ return self.end({
92
+ ...markerDetails,
93
+ track: currentTrack.track,
94
+ label: currentTrack.labels[label],
95
+ });
96
+ },
97
+ };
98
+ Object.defineProperty(labelAcc, label, {
99
+ get: () => {
100
+ self.markerDetails.label =
101
+ currentTrack.labels[label];
102
+ return labelObj;
103
+ },
104
+ });
105
+ return labelAcc;
106
+ }, {});
107
+ };
89
108
  Object.defineProperty(acc, track, {
90
109
  get: () => {
91
110
  const currentTrack = DevToolsTracks[track];
@@ -96,64 +115,121 @@ export class DevToolsMarker {
96
115
  return acc;
97
116
  }, {});
98
117
  }
118
+ tracksEnabled = false;
99
119
  end = (markerDetails = {}) => {
100
- if (this.stopped) {
120
+ if (this.noop || this.stopped) {
101
121
  return this;
102
122
  }
103
123
  this.stopped = true;
104
124
  const start = markerDetails.startTs ?? this.markerDetails.startTs;
125
+ if (start == null) {
126
+ return this;
127
+ }
105
128
  const end = markerDetails.endTs ?? this.markerDetails.endTs ?? performance.now();
106
- let color = markerDetails.color || this.markerDetails.color || '';
107
- const trackGroup = markerDetails.trackGroup ||
108
- this.markerDetails.trackGroup ||
109
- `AdapTable (${this.adaptableId})`;
110
129
  const details = [...(this.markerDetails.details || []), ...(markerDetails.details || [])];
111
130
  const tooltip = markerDetails.tooltip || this.markerDetails.tooltip;
112
131
  const label = markerDetails.label || this.markerDetails.label || 'Unknown';
113
132
  const track = markerDetails.track || this.markerDetails.track || 'Unknown';
133
+ if (shouldKeepOperation(this.adaptableId, track)) {
134
+ getPerfStore(this.adaptableId).addMeasure({
135
+ track,
136
+ label,
137
+ start,
138
+ duration: end - start,
139
+ details,
140
+ tooltip,
141
+ });
142
+ }
143
+ if (!this.tracksEnabled) {
144
+ return this;
145
+ }
146
+ let color = markerDetails.color || this.markerDetails.color || '';
147
+ const trackGroup = markerDetails.trackGroup ||
148
+ this.markerDetails.trackGroup ||
149
+ `AdapTable (${this.adaptableId})`;
114
150
  if (!color) {
115
151
  const identifier = `${trackGroup}:${track}:${label}`;
116
152
  color = getColor(identifier);
117
153
  }
118
- performance.measure(label, {
119
- start,
120
- end,
121
- detail: {
122
- devtools: {
123
- dataType: 'track-entry',
124
- trackGroup,
125
- track,
126
- color: color || 'primary',
127
- properties: details.length > 0 ? details.map((detail) => [detail.name, detail.value]) : undefined,
128
- tooltipText: tooltip,
154
+ try {
155
+ performance.measure(label, {
156
+ start,
157
+ end,
158
+ detail: {
159
+ devtools: {
160
+ dataType: 'track-entry',
161
+ trackGroup,
162
+ track,
163
+ color: color || 'primary',
164
+ properties: details.length > 0 ? details.map((detail) => [detail.name, detail.value]) : undefined,
165
+ tooltipText: tooltip,
166
+ },
129
167
  },
130
- },
131
- });
168
+ });
169
+ }
170
+ catch {
171
+ }
132
172
  return this;
133
173
  };
134
174
  }
135
- export function areAdaptableProfileTracksEnabled(adaptableId) {
136
- const trakcsSupported = typeof performance !== 'undefined' &&
175
+ function areTracksSupported() {
176
+ return (typeof performance !== 'undefined' &&
137
177
  typeof performance.now === 'function' &&
138
- typeof performance.measure === 'function';
139
- if (!trakcsSupported) {
178
+ typeof performance.measure === 'function');
179
+ }
180
+ function readProfileTracksEnabled(adaptableId) {
181
+ if (!areTracksSupported()) {
140
182
  return false;
141
183
  }
142
- if (typeof localStorage !== 'undefined' &&
143
- debug.isChannelEnabled(adaptableId ? `Adaptable:${adaptableId}:perf` : 'Adaptable:*:perf', typeof localStorage !== 'undefined' ? localStorage.debug || '' : '')) {
144
- return true;
184
+ try {
185
+ if (typeof localStorage === 'undefined') {
186
+ return false;
187
+ }
188
+ if (debug.isChannelEnabled(adaptableId ? `Adaptable:${adaptableId}:perf` : 'Adaptable:*:perf', localStorage.debug || '')) {
189
+ return true;
190
+ }
191
+ return localStorage.adaptableProfileTracks == 'true';
145
192
  }
146
- if (typeof localStorage !== 'undefined' && localStorage.adaptableProfileTracks == 'true') {
147
- return true;
193
+ catch {
194
+ return false;
148
195
  }
149
- return false;
196
+ }
197
+ const PROFILE_TRACKS_CACHE_MS = 1000;
198
+ const profileTracksCache = new Map();
199
+ export function areAdaptableProfileTracksEnabled(adaptableId) {
200
+ const cacheKey = adaptableId ?? '*';
201
+ const now = Date.now();
202
+ const cached = profileTracksCache.get(cacheKey);
203
+ if (cached && now - cached.readAt < PROFILE_TRACKS_CACHE_MS) {
204
+ return cached.enabled;
205
+ }
206
+ const enabled = readProfileTracksEnabled(adaptableId);
207
+ profileTracksCache.set(cacheKey, { enabled, readAt: now });
208
+ return enabled;
209
+ }
210
+ export function resetProfileTracksCache() {
211
+ profileTracksCache.clear();
212
+ }
213
+ const NOOP_MARKER = DevToolsMarker.createNoop();
214
+ export function shouldTimeOperations(adaptableId) {
215
+ return isRecordingPerformance(adaptableId) || areAdaptableProfileTracksEnabled(adaptableId);
150
216
  }
151
217
  export function getMarker(adaptableId) {
152
- const enabled = areAdaptableProfileTracksEnabled(adaptableId);
153
- const marker = DevToolsMarker.create(adaptableId);
154
- if (!enabled) {
155
- marker.start = () => marker;
156
- marker.end = () => marker;
218
+ const recording = isRecordingPerformance(adaptableId);
219
+ const tracksEnabled = areAdaptableProfileTracksEnabled(adaptableId);
220
+ if (!recording && !tracksEnabled) {
221
+ return NOOP_MARKER;
157
222
  }
223
+ const marker = DevToolsMarker.create(adaptableId);
224
+ marker.tracksEnabled = tracksEnabled || (isRecordingTracks(adaptableId) && areTracksSupported());
225
+ return marker;
226
+ }
227
+ export function getStartupMarker(adaptableId) {
228
+ getPerfStore(adaptableId);
229
+ const marker = DevToolsMarker.create(adaptableId);
230
+ marker.tracksEnabled =
231
+ areAdaptableProfileTracksEnabled(adaptableId) ||
232
+ (isRecordingTracks(adaptableId) && areTracksSupported());
158
233
  return marker;
159
234
  }
235
+ export { getPerfStore, getPerfRecorder, isPerfRecording, isRecordingPerformance, deletePerfStore, PerfRecorder, PerfStore, } from './PerfStore';
@@ -0,0 +1,17 @@
1
+ import type { DevToolsLogEntry } from '../../devtools';
2
+ /**
3
+ * The log messages a page keeps per AdapTable instance, whether or not the DevTools extension is
4
+ * installed: the extension receives the ones written before it connected (start-up), and agents
5
+ * read them with `window.__ADAPTABLE_DEVTOOLS__.getLogs()`.
6
+ */
7
+ export declare const MAX_LOG_ENTRIES_PER_INSTANCE = 250;
8
+ export type BufferedLogEntry = DevToolsLogEntry & {
9
+ /** Increasing over all instances; tells which entries the extension has not received yet */
10
+ seq: number;
11
+ color: string;
12
+ };
13
+ /** Keyed by adaptableId; log messages can arrive before the instance registers. */
14
+ export declare const LOG_BUFFERS: Map<string, BufferedLogEntry[]>;
15
+ /** A log argument as text: objects as JSON */
16
+ export declare function formatLogArg(value: any): string;
17
+ export declare function bufferLogEntry(entry: Omit<BufferedLogEntry, 'seq'>): BufferedLogEntry;
@@ -0,0 +1,33 @@
1
+ export const MAX_LOG_ENTRIES_PER_INSTANCE = 250;
2
+ export const LOG_BUFFERS = new Map();
3
+ let LOG_SEQ = 0;
4
+ export function formatLogArg(value) {
5
+ if (typeof value === 'string') {
6
+ return value;
7
+ }
8
+ if (value == null) {
9
+ return String(value);
10
+ }
11
+ if (typeof value === 'object') {
12
+ try {
13
+ return JSON.stringify(value, null, 2);
14
+ }
15
+ catch {
16
+ return String(value);
17
+ }
18
+ }
19
+ return String(value);
20
+ }
21
+ export function bufferLogEntry(entry) {
22
+ let buffer = LOG_BUFFERS.get(entry.adaptableId);
23
+ if (!buffer) {
24
+ buffer = [];
25
+ LOG_BUFFERS.set(entry.adaptableId, buffer);
26
+ }
27
+ const buffered = { ...entry, seq: ++LOG_SEQ };
28
+ buffer.push(buffered);
29
+ if (buffer.length > MAX_LOG_ENTRIES_PER_INSTANCE) {
30
+ buffer.splice(0, buffer.length - MAX_LOG_ENTRIES_PER_INSTANCE);
31
+ }
32
+ return buffered;
33
+ }
@@ -0,0 +1,15 @@
1
+ import type { DevToolsMemoryInfo } from '../../devtools';
2
+ import type { AdaptableAgGrid } from '../agGrid/AdaptableAgGrid';
3
+ import type { AdaptableApi } from '../Api/AdaptableApi';
4
+ type SizeEstimate = {
5
+ bytes: number;
6
+ truncated: boolean;
7
+ };
8
+ export declare function estimateSize(value: unknown): SizeEstimate;
9
+ export declare function buildMemoryInfo(adaptableId: string, api: AdaptableApi, instance: AdaptableAgGrid | undefined, devToolsBuffers: {
10
+ logEntries: number;
11
+ maxLogEntries: number;
12
+ actionEntries: number;
13
+ maxActionEntries: number;
14
+ }): DevToolsMemoryInfo;
15
+ export {};
@@ -0,0 +1,229 @@
1
+ import { getPageBufferSizes, getPerfStore, readHeap } from './PerfStore';
2
+ const MAX_VISITED_NODES = 200_000;
3
+ function isPlainObject(value) {
4
+ const prototype = Object.getPrototypeOf(value);
5
+ return prototype === Object.prototype || prototype === null;
6
+ }
7
+ export function estimateSize(value) {
8
+ const seen = new WeakSet();
9
+ let visited = 0;
10
+ let truncated = false;
11
+ const visit = (node) => {
12
+ if (truncated) {
13
+ return 0;
14
+ }
15
+ if (++visited > MAX_VISITED_NODES) {
16
+ truncated = true;
17
+ return 0;
18
+ }
19
+ switch (typeof node) {
20
+ case 'string':
21
+ return node.length + 2;
22
+ case 'number':
23
+ return 8;
24
+ case 'boolean':
25
+ return 5;
26
+ case 'undefined':
27
+ case 'function':
28
+ case 'symbol':
29
+ return 0;
30
+ case 'bigint':
31
+ return 8;
32
+ }
33
+ if (node === null) {
34
+ return 4;
35
+ }
36
+ const object = node;
37
+ if (seen.has(object)) {
38
+ return 0;
39
+ }
40
+ seen.add(object);
41
+ if (Array.isArray(object)) {
42
+ let total = 2;
43
+ for (let index = 0; index < object.length; index++) {
44
+ total += visit(object[index]) + 1;
45
+ }
46
+ return total;
47
+ }
48
+ if (object instanceof Date) {
49
+ return 26;
50
+ }
51
+ if (object instanceof Map || object instanceof Set) {
52
+ let total = 2;
53
+ object.forEach((entryValue, entryKey) => {
54
+ total += visit(entryKey) + visit(entryValue) + 2;
55
+ });
56
+ return total;
57
+ }
58
+ if (!isPlainObject(object)) {
59
+ return 8;
60
+ }
61
+ let total = 2;
62
+ for (const key of Object.keys(object)) {
63
+ total += key.length + 3 + visit(object[key]);
64
+ }
65
+ return total;
66
+ };
67
+ const bytes = visit(value);
68
+ return { bytes, truncated };
69
+ }
70
+ function safe(fn, fallback) {
71
+ try {
72
+ return fn();
73
+ }
74
+ catch {
75
+ return fallback;
76
+ }
77
+ }
78
+ export function buildMemoryInfo(adaptableId, api, instance, devToolsBuffers) {
79
+ const items = [];
80
+ const state = safe(() => api.stateApi.getAllState(), {});
81
+ for (const [key, value] of Object.entries(state)) {
82
+ if (key === 'Internal' && value && typeof value === 'object') {
83
+ for (const [internalKey, internalValue] of Object.entries(value)) {
84
+ const estimate = estimateSize(internalValue);
85
+ items.push({
86
+ key: `state.Internal.${internalKey}`,
87
+ label: `Internal.${internalKey}`,
88
+ group: 'State',
89
+ approxBytes: estimate.bytes,
90
+ count: Array.isArray(internalValue) ? internalValue.length : undefined,
91
+ note: estimate.truncated ? 'Very large; the estimate stopped early' : undefined,
92
+ });
93
+ }
94
+ continue;
95
+ }
96
+ const estimate = estimateSize(value);
97
+ items.push({
98
+ key: `state.${key}`,
99
+ label: key,
100
+ group: 'State',
101
+ approxBytes: estimate.bytes,
102
+ note: estimate.truncated ? 'Very large; the estimate stopped early' : undefined,
103
+ });
104
+ }
105
+ const dataChangeHistory = safe(() => api.dataChangeHistoryApi.getDataChangeHistoryLog(), []);
106
+ const maxDataChanges = safe(() => api.optionsApi.getDataChangeHistoryOptions().maxDataChangesInStore, undefined);
107
+ items.push({
108
+ key: 'runtime.dataChangeHistory',
109
+ label: 'Data Change History log',
110
+ group: 'Runtime',
111
+ count: dataChangeHistory.length,
112
+ limit: maxDataChanges,
113
+ note: maxDataChanges == null && dataChangeHistory.length > 0
114
+ ? 'No limit: set dataChangeHistoryOptions.maxDataChangesInStore'
115
+ : undefined,
116
+ });
117
+ items.push({
118
+ key: 'runtime.alerts',
119
+ label: 'Fired Alerts',
120
+ group: 'Runtime',
121
+ count: safe(() => api.alertApi.internalApi.getAdaptableAlerts().length, 0),
122
+ });
123
+ const diagnostics = safe(() => api.internalApi.getQueryLanguageService().getDiagnostics(), undefined);
124
+ if (diagnostics?.history) {
125
+ const maxPerCell = safe(() => api.optionsApi.getExpressionOptions().maxHistoryPerCell, undefined);
126
+ items.push({
127
+ key: 'runtime.observableHistory',
128
+ label: 'Observable expression history (entries)',
129
+ group: 'Runtime',
130
+ count: diagnostics.history.entries,
131
+ approxBytes: diagnostics.history.entries * 32,
132
+ note: `${diagnostics.history.series} cell series, ${diagnostics.history.rowSeries} row series, ${diagnostics.history.dropped} dropped${maxPerCell ? `; up to ${maxPerCell} entries per cell` : ''}`,
133
+ });
134
+ }
135
+ const minMaxCache = safe(() => instance
136
+ ?.columnMinMaxValuesCache, undefined);
137
+ if (minMaxCache) {
138
+ items.push({
139
+ key: 'runtime.columnMinMax',
140
+ label: 'Column min/max cache (Styled Columns)',
141
+ group: 'Runtime',
142
+ count: Object.values(minMaxCache).filter(Boolean).length,
143
+ });
144
+ }
145
+ if (diagnostics) {
146
+ items.push({
147
+ key: 'cache.rowEvaluators',
148
+ label: 'Prepared expression evaluators',
149
+ group: 'Caches',
150
+ count: diagnostics.rowEvaluatorCache,
151
+ limit: diagnostics.rowEvaluatorCacheLimit,
152
+ }, {
153
+ key: 'cache.validation',
154
+ label: 'Expression validation results',
155
+ group: 'Caches',
156
+ count: diagnostics.validationCache,
157
+ }, {
158
+ key: 'cache.dependencies',
159
+ label: 'Expression dependency summaries',
160
+ group: 'Caches',
161
+ count: diagnostics.dependenciesCache,
162
+ }, {
163
+ key: 'cache.expressionKind',
164
+ label: 'Expression kinds',
165
+ group: 'Caches',
166
+ count: diagnostics.expressionKindCache,
167
+ }, {
168
+ key: 'cache.engines',
169
+ label: 'Expression engines',
170
+ group: 'Caches',
171
+ count: diagnostics.engineCache,
172
+ }, {
173
+ key: 'cache.canonicalText',
174
+ label: 'Canonical expression text',
175
+ group: 'Caches',
176
+ count: diagnostics.canonicalTextCache,
177
+ limit: diagnostics.canonicalTextCacheLimit,
178
+ });
179
+ }
180
+ const perfSizes = getPerfStore(adaptableId).getBufferSizes();
181
+ const pageSizes = getPageBufferSizes();
182
+ items.push({
183
+ key: 'devtools.logs',
184
+ label: 'Buffered log messages',
185
+ group: 'DevTools',
186
+ count: devToolsBuffers.logEntries,
187
+ limit: devToolsBuffers.maxLogEntries,
188
+ }, {
189
+ key: 'devtools.actions',
190
+ label: 'Recent actions',
191
+ group: 'DevTools',
192
+ count: devToolsBuffers.actionEntries,
193
+ limit: devToolsBuffers.maxActionEntries,
194
+ }, {
195
+ key: 'devtools.measures',
196
+ label: 'Timings',
197
+ group: 'DevTools',
198
+ count: perfSizes.measures,
199
+ limit: 500,
200
+ }, {
201
+ key: 'devtools.hotPaths',
202
+ label: 'Recorded hot paths',
203
+ group: 'DevTools',
204
+ count: perfSizes.hotPaths,
205
+ }, {
206
+ key: 'devtools.longFrames',
207
+ label: 'Long animation frames (page)',
208
+ group: 'DevTools',
209
+ count: pageSizes.longFrames,
210
+ }, {
211
+ key: 'devtools.heapPoints',
212
+ label: 'JS heap readings (recording)',
213
+ group: 'DevTools',
214
+ count: perfSizes.heapPoints,
215
+ limit: 600,
216
+ }, {
217
+ key: 'devtools.inventorySamples',
218
+ label: 'Structure size readings (recording)',
219
+ group: 'DevTools',
220
+ count: perfSizes.inventorySamples,
221
+ limit: 120,
222
+ });
223
+ return {
224
+ adaptableId,
225
+ timestamp: Date.now(),
226
+ items,
227
+ heap: readHeap(),
228
+ };
229
+ }
@@ -0,0 +1,41 @@
1
+ import type { AdaptableAgGrid } from '../agGrid/AdaptableAgGrid';
2
+ import type { AdaptableApi } from '../Api/AdaptableApi';
3
+ /**
4
+ * Tags AdapTable's main structures so that a heap snapshot (Chrome Memory panel) can be broken
5
+ * down by structure in the AdapTable DevTools Memory tab.
6
+ *
7
+ * `globalThis.__ADAPTABLE_MEMORY_ROOTS__ = { [adaptableId]: { [key]: WeakRef } }`
8
+ *
9
+ * - Property names survive production minification (class names usually do not), so the
10
+ * analysis finds the registry, and each structure, by name.
11
+ * - The references are weak: they keep nothing alive, and retained sizes ignore weak edges, so
12
+ * tagging changes no number in the snapshot.
13
+ * - Keys starting with `boundary.` are not AdapTable's (AG Grid's API): the analysis stops there.
14
+ * - State sections are replaced on every change. While tagging is on, the tags are refreshed on
15
+ * every State change, so a snapshot taken at any moment points at the current objects.
16
+ *
17
+ * Tagging is on only while DevTools asks for it (the Memory tab, every few seconds) and stops
18
+ * {@link TAGGING_TIMEOUT_MS} after the last request. Off, it costs one number comparison per
19
+ * State change.
20
+ */
21
+ export declare const MEMORY_ROOTS_GLOBAL = "__ADAPTABLE_MEMORY_ROOTS__";
22
+ /** How long `__ADAPTABLE_DEVTOOLS__.tagMemoryRoots()` keeps the tags current */
23
+ export declare const API_TAGGING_TIMEOUT_MS: number;
24
+ /**
25
+ * Tags the instance's structures now and keeps the tags current for `durationMs`.
26
+ * @param extra more structures to tag (e.g. DevTools' own buffers), read on every refresh
27
+ */
28
+ export declare function tagMemoryRoots(adaptableId: string, api: AdaptableApi, instance: AdaptableAgGrid | undefined, extra?: () => Record<string, unknown>, durationMs?: number): boolean;
29
+ /** Call on every State change; a number comparison unless tagging is on */
30
+ export declare function onStateChangedForMemoryRoots(adaptableId: string): void;
31
+ export declare function untagMemoryRoots(adaptableId: string): void;
32
+ /** Seconds of tagging left, for DevTools */
33
+ export declare function getMemoryTaggingInfo(adaptableId: string): {
34
+ tagging: boolean;
35
+ until: number;
36
+ structures: number;
37
+ } | {
38
+ tagging: boolean;
39
+ until?: undefined;
40
+ structures?: undefined;
41
+ };