Releases: 0kku/destiny
0.7.0
Features
‣ ReadonlyReactiveValue
and ReadonlyReactiveArray
— a version of the reactive entity that can't be mutated externally. This can be used to pass a listenable reactive entity without letting the recipient mutate it themselves. Deriving ReactiveValue
and ReactiveArray
methods like map
and pipe
, and computed()
now return readonly variants. Both ReactiveValue
and ReactiveArray
now extend their respective readonly variant.
‣ 〈ReactiveValue, ReactiveArray〉.prototype.readonly
: a getter that returns a readonly version of the target reactive entity.
‣ ReadonlyReactiveValue.prototype.pass
: lets you pass a reactive value to a component in templates without binding.
‣ More descriptive error messages for TypeErrors and XML related errors.
‣ destiny:props
for assigning multiple properties at once.
‣ Node
s are now allowed in reactive()
.
‣ ReactiveValue.prototype.unbind()
is now chainable.
‣ Component.prototype.template
now accepts reactive values.
‣ DestinyFallback
now accepts fallback
and catch
properties, which can be used when loading components asynchronously.
‣ XHTML templates now accept Promise<Component>
in addition to Component
and Promise<{default: Component}>
at the element identifier position.
‣ Setter properties in classes that extend Component
are now upgraded automatically after the custom element gets upgraded.
‣ Safari support.
‣ The library can now be compiled with all pedantic TS checks enabled.
Fixes
‣ Computed, piped, and mapped reactive values will no longer implicitly leak memory. Also, some other memory management and performance improvements.
‣ Types should now work properly when importing via NPM.
‣ reactiveProperties()
now returns readonly objects.
‣ Indices given by ReadonlyReactiveArray.prototype.〈entries, keys〉()
are now correctly updated.
‣ Readonly objects and arrays are now allowed for reactive()
.
‣ Updates on ReactiveValue
s and ReactiveArray
s can now be forced. The option existed previously, but it didn't actually do anything.
BREAKING CHANGES
‣ ReactivePrimitive
renamed to ReactiveValue
.
‣ reactiveObject()
renamed to reactiveProperties()
.
‣ 〈ReactiveValue, ReactiveArray〉.prototype.set()
now takes an options object as the second argument with the previous second argument as the noUpdate
option.
‣ Components loaded asynchronously from a module will now need to be the default export of the module.
0.6.0
0.6.0
feat: computed()
overloaded to also be template tag for concatenating reactive strings (computed`…`;
).
feat: classNames()
for synchronizing element class names with reactive state.
feat: attachCSSProperties()
and Component.prototype.attachCSSProperties()
for synchronizing CSS properties with reactive state.
feat: css`…`;
template tags for creating stylesheets for components.
feat: Static styles for Component
s via Component.styles
.
feat: ReactiveArray.prototype.flat
and .flatMap
.
feat: Alias xml
to html
for better syntax highlighting support.
feat: Reactive entities can now be serialized using JSON.stringify()
.
fix: computed()
's return type is now Readonly<ReactivePrimitive<T>>
instead of ReactivePrimitive<T>
.
BREAKING CHANGE: Made ReactiveArray non-indexable. ReactiveArrays' items can no longer be accessed using bracket notation. Use ReactiveArray.prototype.get()
and .set()
instead.
BREAKING CHANGE: Simplified reactiveObject()
. This function now no longer supports unenumerable properties, getters, setters, or other complex object features and is to be only used with basic record-like objects.
BREAKING CHANGE: Replaced ReactiveArray.prototype.setValue
with value
setter.
BREAKING CHANGE: Removed ReactivePrimitive.prototype.ternary()
. Use computed()
instead.
BREAKING CHANGE: Removed partially applied slots. Use computed`…`;
instead.
BREAKING CHANGE: Removed need for quotes in slotted attribute values in templates. Quotes around slotted attribute values now throw an error.
BREAKING CHANGE: Removed the call:
attribute namespace. Use destiny:mount
instead.
BREAKING CHANGE: Renamed destiny:in
to destiny:mount
and destiny:out
to destiny:unmount
.
0.5.1
feat: Components are generic over their accepted props
feat: computed()
perf: Better ReactiveArryay::filter()
fix: Improved ReactiveArray indexing — this improves lookup performance and fixes some bugs when extending the class
fix: Components can be assed as props
fix: change watcher for input elements
BREAKING: removed ReactivePrimitive.from()
BREAKING: removed reactiveExpression
BREAKING: rename DestinyElement to Component
BREAKING: Removed HTML parser. Use the XML parser instead.
BREAKING: removed support for kebab-cased props — this is not needed when HTML parsing is not supported; just use camelCased properties.
0.4.1
0.4
feat: DestinyElement#out()
feat: component()
feat: XML templates
feat: Parser element constructor initializatioin
feat: Porperty forwarding for components
feat: Asyncronously loaded element constructors
fix: attribute capturing for slotless elements
fix: incorrect type for reactive<Promise>()
fix: ghost async components
BREAKING CHANGE: destiny:ref
now expects Ref
BREAKING CHANGE: replaced DestinyElement#render()
with DestinyElement#template
; it's also now optional