0.1.5
Pre-release
Pre-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.writeas a corollary toElementAccessor.prototype.read. Useful for non-reactive / one-time writes to the DOM. - 55f3344 - Added
AttrAccessor.prototype.writeas a corollary toAttrAccess.prototype.read. Useful for non-reactive / one-time writes to the DOM. - 027fccd - Deletes
ElementRef. PreferElementAccessororComponentAccessor. - e26e4d8 - Adds
Connectable. This is an interface which declaresConnectable.prototype.connected, used byComponentAccessorto bind to the lifecycle of a component. - d96979b - Adds
ReactiveRoot. This is an interface which declaresReactiveRoot.prototype.effect, used bySignalComponentAccessorto bind effects to a component's lifecycle. - 3f9a622 - Adds
SignalComponentAccessor. This is a subclass ofComponentAccessorbut with knowledge of signals, meaning it implementsReactiveRootand provides.effect. - 194b010 - Updates
defineComponentto provide aSignalComponentAccessor. This means you can callhost.effect(() => { /* ... */ })inside a component. - 709874c - Deletes
ComponentRef. In general you can usehost/SignalComponentAccessorto fill the same need. However if you only need.connectedyou should accept aConnectableand if you only need.effectyou should accept aReactiveRoot. - 0050cfe - Renames
defineComponenttodefineSignalComponentto make clear the dependency on signals. - 8d5012b - Adds
defineBaseComponentas a corollary todefineSignalComponentbut which provides aComponentAccessor(as opposed to aSignalComponentAccessor) which does not implementReactiveRoot(no.effect) and therefore has no dependency on signals. If a component is simple enough to not require signals, preferdefineBaseComponentfor an even smaller bundle size. - 5114b34 - Sets
sideEffects: falseinpackage.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.