Skip to content

Conversation

@AndreyYolkin
Copy link
Contributor

use registrar and single event listener to listen to keydown in a more performant way

@AndreyYolkin AndreyYolkin marked this pull request as draft July 2, 2025 18:21
@AndreyYolkin AndreyYolkin marked this pull request as ready for review July 2, 2025 18:30
Copy link
Member

@johnleider johnleider left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may be reading this wrong, but I really thing you might benefit from using useRegistry instead of managing handlerMap.

@vercel
Copy link

vercel bot commented Aug 31, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
vuetify0 Ready Ready Preview Comment Aug 31, 2025 3:51pm

@pkg-pr-new
Copy link

pkg-pr-new bot commented Aug 31, 2025

Open in StackBlitz

commit: 772cd49

@AndreyYolkin AndreyYolkin force-pushed the refactor/ae-keydown-with-registrar branch from 242bb48 to 24efe46 Compare November 10, 2025 13:49
@AndreyYolkin AndreyYolkin marked this pull request as ready for review November 10, 2025 13:52
@johnleider
Copy link
Member

johnleider commented Nov 13, 2025

Looks good but I don't quite understand exporting the handlerMap, what's the use case?

AndreyYolkin and others added 3 commits November 13, 2025 22:25
…lated instances

- Implement trinity pattern (createKeydown, createKeydownContext, createKeydownPlugin)
- Move document listener inside each instance for proper isolation
- Remove module-level global state (globalListener, handlerRegistry)
- Update useKeydown() to consume context instead of accepting handlers directly
- Refactor tests to work with new isolated architecture
- Update documentation to reflect plugin-first approach and instance isolation

Breaking changes:
- useKeydown() now returns context instance instead of accepting handlers
- Use createKeydown() for standalone instances
- Use createKeydownPlugin() for app-level installation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
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.

5 participants