-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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: move JSX DOM types back to @vue/runtime-dom
#7979
Merged
Merged
Changes from 6 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
e54dde1
fix: copy-paste jsx-runtime types for global JSX namespace registration
haoqunjiang 5d36547
fix: re-export all jsx dom types
haoqunjiang bd45800
fix: re-export in the `jsx-register` module
haoqunjiang 5088bd4
fix: augment JSX types from `@vue/runtime-dom` should work
haoqunjiang 0dc1894
fix: add `jsx.d.ts` to `files`
haoqunjiang 241d222
fix(wip): move JSX DOM types back to `@vue/runtime-dom`
haoqunjiang 5566fc0
Merge branch 'main' into fix-jsx-dom-augmentation
haoqunjiang 429717f
wip: save
yyx990803 042e9d7
refactor: move shared types
yyx990803 1e04aae
fix: VNodeRef
yyx990803 ba9a2d5
refactor: move jsx to source
yyx990803 08fd197
build: fix dts rewrite to avoid exporting non-exported types
yyx990803 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
File renamed without changes.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,37 @@ | ||
// global JSX namespace registration | ||
import { JSX as JSXInternal } from './jsx-runtime' | ||
// somehow we have to copy=pase the jsx-runtime types here to make TypeScript happy | ||
import type { | ||
VNode, | ||
VNodeRef, | ||
IntrinsicElementAttributes | ||
} from '@vue/runtime-dom/dist/runtime-dom' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here |
||
|
||
export type ReservedProps = { | ||
key?: string | number | symbol | ||
ref?: VNodeRef | ||
ref_for?: boolean | ||
ref_key?: string | ||
} | ||
|
||
export type NativeElements = { | ||
[K in keyof IntrinsicElementAttributes]: IntrinsicElementAttributes[K] & | ||
ReservedProps | ||
} | ||
|
||
declare global { | ||
namespace JSX { | ||
interface Element extends JSXInternal.Element {} | ||
interface ElementClass extends JSXInternal.ElementClass {} | ||
interface ElementAttributesProperty | ||
extends JSXInternal.ElementAttributesProperty {} | ||
interface IntrinsicElements extends JSXInternal.IntrinsicElements {} | ||
interface IntrinsicAttributes extends JSXInternal.IntrinsicAttributes {} | ||
export interface Element extends VNode {} | ||
export interface ElementClass { | ||
$props: {} | ||
} | ||
export interface ElementAttributesProperty { | ||
$props: {} | ||
} | ||
export interface IntrinsicElements extends NativeElements { | ||
// allow arbitrary elements | ||
// @ts-ignore suppress ts:2374 = Duplicate string index signature. | ||
[name: string]: any | ||
} | ||
export interface IntrinsicAttributes extends ReservedProps {} | ||
} | ||
} | ||
|
||
export {} |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be just
@vue/runtime-dom
right?