Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix use:inertia action event listeners types #2003

Merged
merged 3 commits into from
Oct 9, 2024
Merged

Conversation

pedroborges
Copy link
Collaborator

@pedroborges pedroborges commented Oct 9, 2024

Commit 69292ef already took care of the type issue reported in #2001. While looking into the type error, I noticed the custom events needed some adjustment for better type safety.

I also realized the action wasn’t supporting the new Svelte 5 event listener syntax (onbefore), so I’ve added support for both on:before and onstart (and all other events) in this PR.

Before

Svelte 4 syntax (incorrect)

Screen Shot 2024-10-09 at 11 19 49

Svelte 5 syntax (missing)

Screen Shot 2024-10-09 at 11 20 31

After

Svelte 4 syntax

Screen Shot 2024-10-09 at 11 21 01

Svelte 5 syntax

Screen Shot 2024-10-09 at 11 21 10

Closes #2001

@pedroborges pedroborges added the svelte Related to the svelte adapter label Oct 9, 2024
@pedroborges pedroborges changed the title Fix use:inertia action types Fix use:inertia action event listeners types Oct 9, 2024
@reinink reinink merged commit 3bae128 into master Oct 9, 2024
3 of 7 checks passed
@reinink reinink deleted the fix-link-action-ts branch October 9, 2024 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
svelte Related to the svelte adapter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect types for use:inertia action
2 participants