Skip to content

feat: expose host element from renderHook#5

Merged
cristinecula merged 11 commits intomasterfrom
fix/issue-4-host-element
Jan 22, 2026
Merged

feat: expose host element from renderHook#5
cristinecula merged 11 commits intomasterfrom
fix/issue-4-host-element

Conversation

@megheaiulian
Copy link
Contributor

@megheaiulian megheaiulian commented Jan 22, 2026

Expose host element from renderHook.

Fixes #4

Fixes #4

- Added RenderHookResult interface with host property
- Expose el (harness element) as host in renderHook return value
- Add comprehensive tests for host element functionality
- Update documentation with usage examples

This enables direct testing of hooks that depend on useHost() from
@neovici/cosmoz-utils, eliminating the need for wrapper components.
- Focus on event firing and listening in documentation and tests
- Remove specific references to external libraries
- Add comprehensive event handling test coverage
- Improve terminology to be more general and focused on host element access
@megheaiulian megheaiulian requested a review from a team January 22, 2026 05:05
@megheaiulian megheaiulian self-assigned this Jan 22, 2026
@megheaiulian megheaiulian added the enhancement New feature or request label Jan 22, 2026
- Remove hook and Hook imports from @pionjs/pion
- Replace custom hooks with simple useSimple hook
- Simplify tests to focus on host property functionality
- Maintain comprehensive event handling test coverage
- Export RenderResult type from result.ts
- Fix TypeScript type errors in test file
- Add lit-html as production dependency
- Replace single main.yml with modular workflow structure
- Add ci.yml for build/test automation
- Add automerge.yml for automatic PR merging
- Support both master and main branches
@cristinecula
Copy link
Contributor

@megheaiulian there is a build failure

The test incorrectly expected event listeners to be automatically removed
when unmounting. Event listeners on a DOM element persist after the element
is disconnected from the DOM. If automatic cleanup is needed, it should be
implemented explicitly in the renderHook function.
@cristinecula cristinecula merged commit d2d3c7a into master Jan 22, 2026
2 checks passed
@megheaiulian megheaiulian deleted the fix/issue-4-host-element branch January 22, 2026 08:10
github-actions bot pushed a commit that referenced this pull request Jan 22, 2026
## 2.1.0 (2026-01-22)

* feat: expose host element from renderHook (#5) ([d2d3c7a](d2d3c7a)), closes [#5](#5) [#4](#4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

renderHook should return host element for useHost() hooks

2 participants