Skip to content

Latest commit

 

History

History
104 lines (63 loc) · 3.57 KB

CHANGELOG.md

File metadata and controls

104 lines (63 loc) · 3.57 KB

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Added

  • New context API carries state down the tree without plumbing through arguments.
  • New ContextType<Handle> utility type which gets the value type of a context.

Changed

  • Renamed public type ResourceContext to ResourceScope.
  • destroy(...) is no longer allowed to destroy child resources, only roots.
  • Added tree-shaking metadata. This is useful for bundle analysis tools.

0.5.1 - 2023-08-12

Fixed

  • Added support for parametrized resources in ResourceHandle<T>.

0.5.0 - 2023-08-12

Changed

  • Wardens is now published with ESM (type=module). It should be backwards compatible.
  • Now destroy(...) throws if you pass an object that wasn't constructed with create(...).

Fixed

  • If a resource fails while initializing, now all intermediate child resources are destroyed as well.
  • If a resource fails while being destroyed, now its child resources are destroyed as well.
  • Resources can no longer provision child resources after teardown. This closes a loophole where resources could escape destruction.

Added

  • New ResourceHandle<T> utility type represents the value returned when creating a resource.

0.4.1 - 2023-01-14

Fixed

  • Newer versions of TypeScript complained about signatures in bindContext(...).

0.4.0 - 2022-06-19

Added

  • Support for provisioning resources through async functions instead of Resource subclasses. This offers better type safety around null conditions.
  • A new Resource utility type is exported. The new functional API expects you to return this interface.

Removed

  • The Resource abstract class was removed. Use async functions instead.
  • The Controls<...> utility type was removed. Import the type you need from the module instead.

0.3.0 - 2022-06-04

Changed

  • Prevent use of allocate(...)/deallocate(...) outside a resource subclass.
  • Renamed enter() and leave() to create() and destroy().
  • Renamed mount() and unmount() to create() and destroy().

Removed

  • Second type parameter to Resource is gone. Arguments to enter(...) are now inferred.
  • No more default implementations for enter(...)/leave(...) on resources.

0.2.0 - 2022-05-24

Fixed

  • mount(...) and allocate(...) no longer require a config argument if the resource doesn't explicitly define one.

Added

  • enter(...) now supports variable arguments.

Changed

  • The second generic parameter of Resource was a config parameter, but now it's an argument tuple.
  • The ExternalControls utility type was renamed to Controls.

0.1.0 - 2022-05-22

Added

  • Resource class for modeling asynchronously provisioned resources
  • mount/unmount hooks to provision resources
  • allocate/deallocate for creating hierarchies of resources