Skip to content

Dec v0.1.3-alpha

Pre-release
Pre-release

Choose a tag to compare

@AmberGraceSoftware AmberGraceSoftware released this 03 Sep 23:52
· 55 commits to main since this release

This release is a major milestone for Dec! This version adds standardizing and unit testing for VirtualInstance Directives; removes some API/syntax sugar that was confusing, unsafe, or had uncommon use cases; and adds API for more common use cases.

Some API changes:

  • Added the MapChildren, MapChildrenByKey, and MapChildrenByValue directives which meet some common use cases of turning a state into a list of children reactively. See https://dec.ambergracesoftware.com/docs/Chapter1/MappingChildComponents for a usage guide.
  • Removed the ExtractChildTemplate directive in favor of the more straightforward DestroyPremadeChildren, which together with FindChild serve a similar use case.
  • Removed the instance parameter for OnMount/OnMount` callbacks to improve the safety of handling side effects with those directives.
  • Added support for having observables return observables, and so on, as an argument for attributes like SetProperties which accept observable values. Each chained observable value will be unwrapped and subscribed/unsubscribed until a terminal value is found.
  • Tested and added true support for the input types that were defined on a directive's API where some edge cases that were described in the API documentation were not actually supported before.
  • AddTags directive now behaves exactly as you would expect it to when calling AddTags with multiple directives on the same VirtualInstance, using an observable list of tags, or using a list of observable tags (and so on). So long as there is a mounted static/observable reference to a tag, it will remain on the instance until all references to the tag string are unmounted.
  • Correctly handles multiple :SetProperties()/:SetAttributes() directives on the same VirtualInstance, ignoring all but the last-defined value on the last directive for each key. Only exception to this rule is if two :SetProperties() directives connect to the same event, in which case both listeners from each directive will be handled. Covered by unit testing.
  • Removed "ChildPath" syntax sugar where you could do something like this: VirtualInstance:AddChild({"Child", "Descendant"}, ...) as sugar for VirtualInstance:AddChild("Child", Dec.Premade("Descendant", ...)),, as it was a confusing syntax that could go wrong in many ways.
  • Removed Copy and DeepCopy directives, which lack a very common use case.

Pull Requests

Full Changelog: v0.1.2-alpha...v0.1.3-alpha