Skip to content

0.1.5

Pre-release
Pre-release

Choose a tag to compare

@dgp1130 dgp1130 released this 11 Sep 03:49
· 32 commits to main since this release

https://www.npmjs.com/package/hydroactive/v/0.1.5

This release lands a number of changes focused on providing stronger abstractions. Notably, ComponentRef and ElementRef have been removed and host has been upgraded to a SignalComponentAccessor which supports .connected and .effect.

  • 07e5ffc - Added ElementAccessor.prototype.write as a corollary to ElementAccessor.prototype.read. Useful for non-reactive / one-time writes to the DOM.
  • 55f3344 - Added AttrAccessor.prototype.write as a corollary to AttrAccess.prototype.read. Useful for non-reactive / one-time writes to the DOM.
  • 027fccd - Deletes ElementRef. Prefer ElementAccessor or ComponentAccessor.
  • e26e4d8 - Adds Connectable. This is an interface which declares Connectable.prototype.connected, used by ComponentAccessor to bind to the lifecycle of a component.
  • d96979b - Adds ReactiveRoot. This is an interface which declares ReactiveRoot.prototype.effect, used by SignalComponentAccessor to bind effects to a component's lifecycle.
  • 3f9a622 - Adds SignalComponentAccessor. This is a subclass of ComponentAccessor but with knowledge of signals, meaning it implements ReactiveRoot and provides .effect.
  • 194b010 - Updates defineComponent to provide a SignalComponentAccessor. This means you can call host.effect(() => { /* ... */ }) inside a component.
  • 709874c - Deletes ComponentRef. In general you can use host / SignalComponentAccessor to fill the same need. However if you only need .connected you should accept a Connectable and if you only need .effect you should accept a ReactiveRoot.
  • 0050cfe - Renames defineComponent to defineSignalComponent to make clear the dependency on signals.
  • 8d5012b - Adds defineBaseComponent as a corollary to defineSignalComponent but which provides a ComponentAccessor (as opposed to a SignalComponentAccessor) which does not implement ReactiveRoot (no .effect) and therefore has no dependency on signals. If a component is simple enough to not require signals, prefer defineBaseComponent for an even smaller bundle size.
  • 5114b34 - Sets sideEffects: false in package.json. This should improve bundle sizes as HydroActive does not rely on top-level side effects and bundlers can take advantage of that to more aggressively eliminate unused code.