Open
Conversation
Signal: reactive value container with .value getter/setter, subscribe(), EventTarget (change events), and overridable equals(). Computed: lazy, auto-tracking signal — intercepts Signal.value reads during compute to discover deps at runtime. Re-tracks each recomputation so dynamic/conditional dependencies work correctly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace regex-based inferDependencies() and manual dependency cascade with signals-based auto-tracking: - Prop: add getSignal(element) to lazily create Signal (plain props) or Computed (spec.get props) per element. Reads go through signal.value for auto-tracking; writes update signal.value to propagate to dependents. Remove: dependencies field, dependsOn(), update(). - Props: remove dependents graph and updateDependents()/topological sort. propChanged() now only fires events — signals handle propagation. - util.js: remove inferDependencies() and sortObject() (no longer needed). - test/Prop.js: remove dependency inference tests, update defaults test for new computed-prop-based function defaults. Fixes #79 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
✅ Deploy Preview for nude-element ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces fragile regex-based static dependency inference (
inferDependencies()) and manual dependency cascade (Props.updateDependents()/ topological sort) with a signals-based auto-tracking system.src/signals.js(new): minimalSignalandComputedclasses.Computedauto-discovers dependencies by intercepting.valuereads during its compute function — no explicit dep declaration needed. Re-tracks each recomputation, so dynamic/conditional deps work.Prop.js: addsgetSignal(element)returning aSignal(plain props) orComputed(computed props) per element. Reads go throughsignal.valuefor auto-tracking; writes updatesignal.valueto propagate automatically. Removesdependencies,dependsOn(),update().Props.js: removesdependentsgraph,updateDependents(), and topological sort.propChanged()now only fires events — signals handle propagation.util.js: removesinferDependencies()andsortObject().test/Prop.js: removes dep inference tests, updates defaults test.Authors writing computed props just use
this.fooinget— deps are discovered at runtime with no extra configuration.Test plan
npm test)if (this.foo) return this.bar) work correctlypropchangeevents still fire for both plain and computed props🤖 Generated with Claude Code