Releases: PsychoLlama/wardens
Releases · PsychoLlama/wardens
v0.5.1
v0.5.0
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 withcreate(...)
.
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.
v0.4.1
Fixed
- Newer versions of TypeScript complained about signatures in
bindContext(...)
.
v0.4.0
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.
v0.3.0
Changed
- Prevent use of
allocate(...)
/deallocate(...)
outside a resource subclass. - Renamed
enter()
andleave()
tocreate()
anddestroy()
. - Renamed
mount()
andunmount()
tocreate()
anddestroy()
.
Removed
- Second type parameter to
Resource
is gone. Arguments toenter(...)
are now inferred. - No more default implementations for
enter(...)
/leave(...)
on resources.
v0.2.0
Fixed
mount(...)
andallocate(...)
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 toControls
.
v0.1.0
Added
- Resource class for modeling asynchronously provisioned resources
mount
/unmount
hooks to provision resourcesallocate
/deallocate
for creating hierarchies of resources