@praxisjs/decorators
0.7.2
Patch Changes
2c61a25: Refresh dependencies across workspace to improve stability and security.
Bumped versions of several packages, including @types/node, eslint, and unocss, to enhance compatibility and security.
0.7.1
Patch Changes
- Updated dependencies [6c353ba]
- @praxisjs/core@1.2.0
0.7.0
Minor Changes
2b8c768: Redesign
@Historyas a field decorator withHistoryOftype helper@Historynow decorates a separate field (not the@Statefield itself). The first argument is the name of the field to track, the second is the optional limit. Type the field withHistoryOf<Class, 'field'>for full intellisense.WithHistorytype helper has been removed in favour ofHistoryOf.createFieldDecoratoris now generic and works on any class, not justStatefulComponent.ts// Before @History(100) @State() text = '' // this.textHistory — no intellisense, required interface merging // After @State() text = '' @History('text', 100) textHistory!: HistoryOf<MyClass, 'text'> // this.textHistory.undo() ✓ // this.textHistory.canUndo() ✓
0.6.1
Patch Changes
72cd9a8: Fix method decorators rejecting typed parameters
createMethodDecoratorusedunknown[]for the method value type, which caused TypeScript to reject decorated methods with typed parameters (e.g.async loadUser(id: number)). Changed toany[]so the decorator accepts any async method signature. Updated theTask,Queue, andPooldecorator casts in@praxisjs/concurrentaccordingly.
0.6.0
Minor Changes
- 029ef04: Add
@Until(propName)decorator. Replaces the decorated method with one that returns aPromiseresolving to the first truthy value of the named signal or computed property.
Patch Changes
- 029ef04:
@Memofalls back to object identity for non-JSON-serializable arguments (circular references, class instances).@Debouncecancels its pending timer on component unmount.@Throttleclamps negativemsvalues to0.@Virtualthrows whenitemHeightis0or negative. - Updated dependencies [029ef04]
- Updated dependencies [029ef04]
- Updated dependencies [029ef04]
- @praxisjs/core@1.1.0
0.5.0
Minor Changes
feaa478: Add decorator factory helpers and new built-in decorators.
Decorator factories — low-level building blocks for authoring custom decorators:
createFieldDecorator/FieldBehavior/FieldBindingcreateClassDecorator/ClassBehavior/ClassEnhancementcreateMethodDecorator/MethodBehaviorcreateLifecycleMethodDecorator/LifecycleMethodBehaviorcreateGetterDecorator/GetterBehaviorcreateGetterObserverDecorator/GetterObserverBehavior
New built-in decorators:
@Compose— mixes aComposableclass into a component, binding its reactive properties and lifecycle hooks@Resource— declares an async resource on a component field, replacing the standaloneresource()function from@praxisjs/core
Patch Changes
- Updated dependencies [3372878]
- @praxisjs/core@1.0.0
0.4.3
Patch Changes
ea59035: Fix three bugs in
Lazy,Virtual, andWatchdecoratorsLazy/Virtual— incompatible type constraint Both decorators constrained their generic tonew (...args: any[]) => RootComponent, where the bareRootComponentdefaults toRootComponent<Record<string, never>>. This made the constraint incompatible withStatefulComponent, whose_rawPropsis typed asRecord<string, unknown>, causing a TypeScript error at the call site. Changed the constraint toRootComponent<Record<string, any>>so any component subclass is accepted.Lazy— infinite recursion on render after becoming visible_originalRenderwas initialized tothis.render.bind(this), which at instance-creation time resolves toLazyWrapper.render(the override itself). Callingrender()after the component became visible would then recurse infinitely. Fixed by capturingconstructor.prototype.render— the parent class's render method — instead.Watch— reactive effect leaked after component unmount The decorator created a reactiveeffect()ononMountbut never called the returned stop function on unmount. This caused the effect to keep running and the handler to keep firing even after the component was unmounted, resulting in a memory leak and stale callbacks. The decorator now hooks intoonUnmountto stop the effect and preserves any existingonUnmountimplementation on the instance.Updated dependencies [d11a10a]
- @praxisjs/core@0.4.2
0.4.2
Patch Changes
fe39901: fix(decorators): fix infinite recursion in
@Historydecoratorundo()/redo()originalUndoandoriginalRedowere closures that capturedhby reference. By the time they were called,h.undoandh.redohad already been overwritten by the augmented versions, creating an infinite cycle that resulted in a stack overflow.The fix captures the original methods by value using
.bind(h)(const _undo = h.undo.bind(h)) before overwriting them, breaking the cycle and satisfying theunbound-methodlint rule.Updated dependencies [fe39901]
- @praxisjs/core@0.4.1
0.4.1
Patch Changes
966efdc: Fix JSX prop typing for
StatelessComponentto automatically accept reactive values (() => T) without requiring manual declaration.LibraryManagedAttributesnow usesInstancePropsOfdirectly instead of intersecting with the raw constructor props, preventing the erroneousT | (T & (() => T))type expansion.InstancePropsOfnow uses_rawPropsto infer props for class components decorated with@Prop(), providing accurate JSX prop types without manual interface declarations.The
@Emitdecorator type signature was relaxed fromunknowntoanyto allow broader method compatibility. DevtoolsPanelandDevToolsAppcomponents were refactored to use@Prop()and@Emit()decorators instead of manual props casting.
0.4.0
Minor Changes
f52354d: Add
@Computed()decorator to@praxisjs/decoratorsfor declaring read-only reactive getters backed by a cachedcomputed()signal. The getter recomputes automatically when any@Stateor@Propdependency changes, and the result is cached until a dependency is invalidated — unlike a plain getter which recalculates on every read.@Debug()in@praxisjs/devtoolsnow supports@Computed()getters (ClassGetterDecoratorContext) in addition to fields and methods, allowing computed values to be tracked and historized in the devtools panel.Also fixes a bug in the
computed()primitive where an erroneoustrack(recompute)call caused premature dependency tracking on signal creation.
Patch Changes
- Updated dependencies [f52354d]
- @praxisjs/core@0.4.0
0.3.0
Minor Changes
bb0d4f8: Refactor decorator system and component architecture across PraxisJS packages
- Replaced legacy decorator signatures (
constructor,target,propertyKey, method descriptor) with the standard TC39 decorator context API (ClassDecoratorContext,ClassFieldDecoratorContext,ClassMethodDecoratorContext) across@praxisjs/decorators,@praxisjs/store,@praxisjs/concurrent,@praxisjs/router,@praxisjs/motion,@praxisjs/di, and@praxisjs/fsm. - Introduced
StatefulComponentandStatelessComponentas the new base classes, replacing the deprecatedBaseComponent/Function Componentpattern, across@praxisjs/core,@praxisjs/runtime,@praxisjs/devtools, and templates. - Implemented core rendering functionality in
@praxisjs/runtime(mountChildren,mountComponent, reactive scope management) and removed the deprecatedrenderer.ts. - Refactored
@praxisjs/jsxto delegate rendering to@praxisjs/runtimeand improved type safety withflattenChildrenandisComponentutilities. - Updated internal module structure with new
internalexports inpackage.jsonfiles for shared utilities and types. - Removed
experimentalDecorators/emitDecoratorMetadatafromtsconfig.jsonin favor of native decorator support.
- Replaced legacy decorator signatures (
Patch Changes
- Updated dependencies [bb0d4f8]
- @praxisjs/core@0.3.0
- @praxisjs/shared@0.2.0
0.2.0
Minor Changes
f48dbc4: Introduce WithHistory<T, K> utility type for better TypeScript inference when using the @History decorator, and fix performance issues in the history() primitive.
Changes:
@praxisjs/decorators: Added WithHistory<T, K> type that maps a property key to its corresponding *History accessor type, enabling proper type-checking on decorated classes. @praxisjs/decorators: Simplified @History decorator internals — replaced verbose getOwnPropertyDescriptor lookups with direct property access (this[propertyKey]), reducing complexity. @praxisjs/core: Fixed history() to use peek() when reading _past and _current inside the tracking effect, preventing unnecessary re-runs caused by reactive reads during history recording. @praxisjs/core: Added an _initialized guard so the first value is captured without pushing an empty entry into the past stack.
Patch Changes
- Updated dependencies [f48dbc4]
- @praxisjs/core@0.2.0
0.1.0
Minor Changes
- aaf7dab: Initial beta release
Patch Changes
- Updated dependencies [aaf7dab]
- @praxisjs/core@0.1.0
- @praxisjs/jsx@0.1.0
- @praxisjs/shared@0.1.0