Skip to content

Conversation

Copy link

Copilot AI commented Nov 2, 2025

Created interactive test suite in web/src/pug/reactive/ demonstrating the integration between ldreactive.ls (reactive data binding library) and ldview.ls (view template framework).

Tests Created

  • Test 1: Basic Counter - Property tracking with automatic re-render on value changes
  • Test 2: Nested Object Tracking - Deep property tracking (address.street, address.city, etc.) with multiple dependent handlers
  • Test 3: Array Operations - Array mutation tracking (push, pop, reassignment) with length and content updates
  • Test 4: Batch Updates - State modification with update tracking
  • Test 5: Manual Render Control - Selective reactive behavior via reactive: false flag

Usage Example

# Create reactive state
state = new ldreactive({count: 0})

# ldview automatically tracks dependencies in handlers
view = new ldview do
  ctx: state
  root: '[ld-scope=test]'
  handler:
    count: ({node, ctx}) ->
      node.textContent = ctx.count  # Tracks ctx.count dependency
    increment: ({node, ctx}) ->
      node.onclick = -> ctx.count++ # Auto-triggers count handler re-render

Key Behaviors Verified

  • Granular dependency tracking (only affected handlers re-render)
  • Deep nested object tracking with proxy-based observation
  • Array mutation detection via proxied array methods
  • Opt-out via reactive: false for manual control

Screenshots

Initial state:
Initial

Interactive demonstration:
Working

Tests accessible at /reactive/ after build.

Original prompt

create some tests under web/src/pug/reactive to test integration of ldreactive.ls and ldview.ls


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Create tests for integration of ldreactive.ls and ldview.ls Add integration tests for ldreactive and ldview reactive data binding Nov 2, 2025
Copilot AI requested a review from zbryikt November 2, 2025 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants