docs: restructure TypeScript event handling and JSX directive sections#1533
Open
harshagarwalnyu wants to merge 3 commits into
Open
docs: restructure TypeScript event handling and JSX directive sections#1533harshagarwalnyu wants to merge 3 commits into
harshagarwalnyu wants to merge 3 commits into
Conversation
- Move custom/native on: event docs into API types > Event handling - Add dedicated section for on: directive with subsections for custom and native events - Convert native events callout to a proper subsection - Promote Forcing properties and Custom directives headings to h3 so they appear in the page outline Closes solidjs#569
|
|
✅ Deploy Preview for solid-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the TypeScript documentation to better explain Solid’s on: directive and how to type custom/native events, while removing the older duplicated “Custom event handlers” section.
Changes:
- Added a dedicated “The
on:directive” section with examples for custom events and listener options. - Documented how to extend
CustomEventsto support native events (all or selected). - Reorganized “Advanced JSX attributes and directives” headings by removing the older custom-events subsection and promoting subsequent sections.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Use CustomEvent<{name: string}> generic instead of field declarations
- Fix semicolon and whitespace in EventHandlerWithOptions example
- Change on prefix to on: prefix for clarity
- Note that HTMLElementEventMap covers HTML element events only
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.
The TypeScript page had
on:___event handling docs split into two disconnected places, and some headings buried too deep to appear in the page outline. This PR fixes all the issues raised in #569.What changed:
Moved
on:docs into the Event handling section. The "Custom event handlers" content was living under "Advanced JSX attributes and directives" even though it's just another way to handle events. It's now anon:directive subsection directly under Event handling, where readers would expect to find it.Converted the native events callout to a real subsection. The guidance about extending
CustomEventswithHTMLElementEventMapwas buried inside a:::notecallout. It's now a proper "Using native events withon:" subsection, making it easier to discover and link to.Upgraded heading levels for Forcing properties and Custom directives. Both were at the
####level, which means they didn't show up in the page outline. They're now###so readers can navigate to them from the outline.Addresses all four items from #569.