Skip to content

Commit 470034d

Browse files
PaulHaxfinetjul
authored andcommitted
feat(macros)!: remove getStateArrayMapFunc
BREAKING CHANGE: getStateArrayMapFunc has been removed from macros. It was a map callback that called getState() on vtkObject items and passed primitives through unchanged. Inline the equivalent where needed, e.g. arr.map((item) => (item && item.isA ? item.getState() : item)).
1 parent c0d9887 commit 470034d

3 files changed

Lines changed: 1 addition & 16 deletions

File tree

BREAKING_CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## From 35.x to 36
22

33
- **`vtk-lite.js` deprecated.** The UMD build previously produced a slimmed-down companion bundle `dist/umd/vtk-lite.js` (curated ColorMaps subset; `PDBReader`, `MoleculeToRepresentation`, `MobileVR`, and `webvr-polyfill` stubbed out). The Vite build pipeline no longer produces a distinct lite bundle; `vtk-lite.js` now ships as a byte-identical alias of `vtk.js` so existing `<script src=…/vtk-lite.js>` and CDN consumers continue to load. Consumers should migrate to `vtk.js` directly — the alias will be removed in a future major. Note that anything that indexed into the `ColorMaps` array by position will now see the full preset set, not the lite subset.
4+
- **macros**: `getStateArrayMapFunc` has been removed. Inline the equivalent where needed, e.g. `arr.map((item) => (item && item.isA ? item.getState() : item))`.
45

56

67
## From 34.x to 35

Sources/macros.d.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,6 @@ declare function safeArrays(model: object): void;
140140
*/
141141
declare function enumToString(e: object, value: any): string;
142142

143-
/**
144-
* If item is a VtkObject, return its getState() otherwise return itself.
145-
*
146-
* @param item object to extract its state from
147-
*/
148-
declare function getStateArrayMapFunc(item: any): any;
149-
150143
/**
151144
* Call provided function on the next EDT pass
152145
*
@@ -725,7 +718,6 @@ declare const Macro: {
725718
get: typeof get;
726719
getArray: typeof getArray;
727720
getCurrentGlobalMTime(): number;
728-
getStateArrayMapFunc: typeof getStateArrayMapFunc;
729721
isVtkObject: typeof isVtkObject;
730722
keystore: typeof keystore;
731723
measurePromiseExecution: typeof measurePromiseExecution;

Sources/macros.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -212,13 +212,6 @@ function enumToString(e, value) {
212212
return Object.keys(e).find((key) => e[key] === value);
213213
}
214214

215-
function getStateArrayMapFunc(item) {
216-
if (item && item.isA) {
217-
return item.getState();
218-
}
219-
return item;
220-
}
221-
222215
// ----------------------------------------------------------------------------
223216
// setImmediate
224217
// ----------------------------------------------------------------------------
@@ -1797,7 +1790,6 @@ export default {
17971790
get,
17981791
getArray,
17991792
getCurrentGlobalMTime,
1800-
getStateArrayMapFunc,
18011793
isVtkObject,
18021794
keystore,
18031795
measurePromiseExecution,

0 commit comments

Comments
 (0)