Skip to content

feat(framework): add interactivity inference (#22)#46

Merged
qantrepreneur merged 2 commits into
mainfrom
22-interactivity-inference
May 14, 2026
Merged

feat(framework): add interactivity inference (#22)#46
qantrepreneur merged 2 commits into
mainfrom
22-interactivity-inference

Conversation

@qantrepreneur
Copy link
Copy Markdown
Contributor

Summary

  • Adds isInteractive(source, importGraph?) for static analysis
  • Detects React hooks, event handler JSX props, browser APIs
  • Walks import graph transitively with cycle detection
  • Regex-based v1, upgradeable to AST later

Test plan

  • useState, useEffect detection
  • onClick, onChange, onSubmit detection
  • window, document, navigator detection
  • Static component returns false
  • Transitive: static importing interactive → true
  • Transitive: static importing static → false
  • Deeply nested transitive detection

Closes #22

🤖 Generated with Claude Code

Lorenzo and others added 2 commits May 14, 2026 18:45
…#22)

Implement static analysis module that determines whether a component is
interactive by detecting React hooks, event handler props, and browser
API usage. Walks the import tree for transitive dependency analysis.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@qantrepreneur qantrepreneur force-pushed the 22-interactivity-inference branch from 5938768 to 08c5b19 Compare May 14, 2026 16:45
@qantrepreneur qantrepreneur merged commit 075d70f into main May 14, 2026
2 checks passed
@qantrepreneur qantrepreneur deleted the 22-interactivity-inference branch May 14, 2026 16:46
@github-actions github-actions Bot mentioned this pull request May 14, 2026
qantrepreneur added a commit that referenced this pull request May 21, 2026
* feat(framework): add interactivity inference via regex-based analysis (#22)

Implement static analysis module that determines whether a component is
interactive by detecting React hooks, event handler props, and browser
API usage. Walks the import tree for transitive dependency analysis.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: use .at() instead of bracket notation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Lorenzo <lorenzofkramer@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This was referenced May 23, 2026
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.

Interactivity inference: AST analysis for hooks + event handlers

1 participant