Skip to content

Releases: iTwin/presentation

@itwin/[email protected]

07 Jan 14:09
936d7e1
Compare
Choose a tag to compare

Patch Changes

  • #828: Polyfill Symbol.dispose and Symbol.asyncDispose to make sure that code using the upcoming JS recource management API works in all environments.

@itwin/[email protected]

07 Jan 14:09
936d7e1
Compare
Choose a tag to compare

Patch Changes

  • #810: Fix the package not being usable in cjs builds due to usage of import.meta.
  • Updated dependencies:

@itwin/[email protected]

07 Jan 14:09
936d7e1
Compare
Choose a tag to compare

Patch Changes

  • #828: Polyfill Symbol.dispose and Symbol.asyncDispose to make sure that code using the upcoming JS recource management API works in all environments.

@itwin/[email protected]

07 Jan 14:09
936d7e1
Compare
Choose a tag to compare

Minor Changes

  • #827: Changed onHierarchyLoadError callback in UseTreeProps, it now accepts error as one of the props arguments.

Patch Changes

  • #828: Polyfill Symbol.dispose and Symbol.asyncDispose to make sure that code using the upcoming JS recource management API works in all environments.
  • Updated dependencies:

@itwin/[email protected]

07 Jan 14:09
936d7e1
Compare
Choose a tag to compare

Minor Changes

  • #814: Add a createIModelKey function to safely create an identifier for an IModel in different situations.

    Example:

    import { IModelConnection } from "@itwin/core-frontend";
    import { createIModelKey } from "@itwin/presentation-core-interop";
    
    IModelConnection.onOpen.addListener((imodel: IModelConnection) => {
      const key = createIModelKey(imodel);
      console.log(`IModel opened: "${key}"`);
    });

@itwin/[email protected]

07 Jan 14:09
936d7e1
Compare
Choose a tag to compare

Minor Changes

  • #825: PresentationInstanceFilterDialog and PresentationInstanceFilterBuilder: Fix classes selector not being updated with all classes that contain selected property. PresentationInstanceFilterPropertyInfo now has sourceClassIds and sourceClassId is deprecated.

Patch Changes

  • #828: Polyfill Symbol.dispose and Symbol.asyncDispose to make sure that code using the upcoming JS recource management API works in all environments.

@itwin/[email protected]

16 Dec 16:10
6150d75
Compare
Choose a tag to compare

Minor Changes

  • #800: Add support for Models and SubCategories selection that's going to be available in @itwin/core-frontend version 5.

    The changes in @itwin/core-frontend allow us to stop manually syncing HiliteSet with SelectionSet and rely on automatic syncing instead.

  • #800: computeSelection: Broadened the type of elementIds prop from Id64String[] to Id64Arg.

  • #802: Prefer Symbol.dispose over dispose for disposable objects.

    The package contained a number of types for disposable objects, that had a requirement of dispose method being called on them after they are no longer needed. In conjunction with the using utility from @itwin/core-bentley, usage of such objects looked like this:

    class MyDisposable() {
      dispose() {
        // do some cleanup
      }
    }
    using(new MyDisposable(), (obj) => {
      // do something with obj, it'll get disposed when the callback returns
    });

    In version 5.2, TypeScript introduced Disposable type and using declarations (from the upcoming Explicit Resource Management feature in ECMAScript). Now we're making use of those new utilities in this package (while still supporting the old dispose method), which allows using MyDisposable from the above snippet like this:

    using obj = new MyDisposable();
    // do something with obj, it'll get disposed when it goes out of scope

@itwin/[email protected]

16 Dec 16:10
6150d75
Compare
Choose a tag to compare

Minor Changes

  • #804: Deprecated all tree-related APIs.

    As the new generation hierarchy building APIs are now available, the old tree-related APIs are now deprecated. See reasoning and migration guide here.

Patch Changes

@itwin/[email protected]

16 Dec 16:10
6150d75
Compare
Choose a tag to compare

Minor Changes

  • #802: Prefer Symbol.dispose over dispose for disposable objects.

    The package contained a number of types for disposable objects, that had a requirement of dispose method being called on them after they are no longer needed. In conjunction with the using utility from @itwin/core-bentley, usage of such objects looked like this:

    class MyDisposable() {
      dispose() {
        // do some cleanup
      }
    }
    using(new MyDisposable(), (obj) => {
      // do something with obj, it'll get disposed when the callback returns
    });

    In version 5.2, TypeScript introduced Disposable type and using declarations (from the upcoming Explicit Resource Management feature in ECMAScript). Now we're making use of those new utilities in this package (while still supporting the old dispose method), which allows using MyDisposable from the above snippet like this:

    using obj = new MyDisposable();
    // do something with obj, it'll get disposed when it goes out of scope

@itwin/[email protected]

16 Dec 16:10
6150d75
Compare
Choose a tag to compare

Minor Changes

  • #807: Added getNode function to tree state hooks to allow getting a node by id.

    Example usage:

    function MyTreeComponentInternal({ imodelAccess }: { imodelAccess: IModelAccess }) {
      const {
        rootNodes,
        getNode,
        expandNode: doExpandNode,
        ...state
      } = useTree({
        // tree props
      });
    
      // enhance the default `expandNode` handler to log the action to console
      const expandNode = React.useCallback(
        async (nodeId: string, isExpanded: boolean) => {
          const node = getNode(nodeId);
          if (node) {
            console.log(`${isExpanded ? "Expanding" : "Collapsing"} node: ${node.label}`);
          }
          doExpandNode(nodeId, isExpanded);
        },
        [getNode, doExpandNode],
      );
    
      // render the tree
      if (!rootNodes || !rootNodes.length) {
        return "No data to display";
      }
      return <TreeRenderer {...state} expandNode={expandNode} rootNodes={rootNodes} />;
    }
  • #802: Prefer Symbol.dispose over dispose for disposable objects.

    The package contained a number of types for disposable objects, that had a requirement of dispose method being called on them after they are no longer needed. In conjunction with the using utility from @itwin/core-bentley, usage of such objects looked like this:

    class MyDisposable() {
      dispose() {
        // do some cleanup
      }
    }
    using(new MyDisposable(), (obj) => {
      // do something with obj, it'll get disposed when the callback returns
    });

    In version 5.2, TypeScript introduced Disposable type and using declarations (from the upcoming Explicit Resource Management feature in ECMAScript). Now we're making use of those new utilities in this package (while still supporting the old dispose method), which allows using MyDisposable from the above snippet like this:

    using obj = new MyDisposable();
    // do something with obj, it'll get disposed when it goes out of scope

Patch Changes