Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

(feat) make it possible to pass additional file paths to emitDts#1412

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
dummdidumm wants to merge1 commit intosveltejs:master
base:master
Choose a base branch
Loading
fromdummdidumm:svelte2tsx-paths

Conversation

dummdidumm
Copy link
Member

Needed when someone uses the svelte.JSX typings.
Closes#1405

Other possibilities:

Needed when someone uses the svelte.JSX typings.Closessveltejs#1405
@dummdidummdummdidumm marked this pull request as draftMarch 14, 2022 15:45
@dummdidumm
Copy link
MemberAuthor

Marking this as draft because different thought just occured to me:

  • What if we add the ambient typings to the@types namespace? Would this be something we should do in the long run anyway?
  • Is this solvable by adding another reference to theapp.d.ts (/// <reference types="svelte2tsx/svelte-jsx" />,@rgossiaux does this work for you?) template in the case of SvelteKit?

cc@jasonlyu123

@rgossiaux
Copy link

  • Is this solvable by adding another reference to theapp.d.ts (/// <reference types="svelte2tsx/svelte-jsx" />,@rgossiaux does this work for you?) template in the case of SvelteKit?

From what I see theapp.d.ts is not passed to emitDts, since it lives outside thelib/ directory, so you'd still need a config change to solve that. But regardless, anything that solves the problem works for me, I'm not picky 😃

@dummdidumm
Copy link
MemberAuthor

Oh right you're correct, that wouldn't work for you in this case. You could add ad.ts file to the lib folder with the mentioned content and exclude it from being exported, maybe that works.

@fallaciousreasoning

Wondering if there was any movement on this, or did you end up solving this in a different way?

@fallaciousreasoning

FWIW, I'm working on a Svelte component library, and we're compiling the Svelte components to web-components. We're usingsvelte2tsx to generate the type definitions which we use to get intellisense & typings in a React wrapper. This works really well for most cases, but when the component is something primitive (like a button or a link) and we want to expose the props on the underlying HTML elementsvelte2tsx breaks.

Currently, I have a fork ofsvelte2tsx with this change, which I'm vendoring into the repository and it works really nicely. Any chance we could land this? It solves this really nicely 😄

@jasonlyu123
Copy link
Member

The plan is to move the element typing to the svelte core. You can see the roadmap here#1552

@fallaciousreasoning

Okay, got this working without thesvelte2tsx fork by bumping Svelte to 3.55.0 and usingSvelteHTMLElements['button'] instead of thesvelte2tsx typings. Thanks@jasonlyu123!

@dummdidumm
Copy link
MemberAuthor

Since Svelte 3.55 it's possible to enhance from HTML typings through thesvelte/elements import. I think this PR might be obsolete because of this.

fallaciousreasoning reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@dummdidumm@rgossiaux@fallaciousreasoning@jasonlyu123

[8]ページ先頭

©2009-2025 Movatter.jp