-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
improve tsx
support
#1168
Merged
improve tsx
support
#1168
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
65b23e1
add `tsx` extension for tsconfig include
troy351 7bb17c1
Update tsconfig.json
troy351 242a682
add `jsxFactory` for tsconfig
troy351 7fd167d
declare global jsx namespace
troy351 e7f777b
add tslint disable to prevent log error
troy351 bd6fd40
remove unnecessary `jsxFactory`
troy351 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
17 changes: 15 additions & 2 deletions
17
packages/@vue/cli-plugin-typescript/generator/template/src/shims.d.ts
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,4 +1,17 @@ | ||
import Vue, { VNode } from 'vue' | ||
|
||
declare module '*.vue' { | ||
import Vue from 'vue'; | ||
export default Vue; | ||
export default Vue | ||
} | ||
|
||
declare global { | ||
namespace JSX { | ||
// tslint:disable no-empty-interface | ||
interface Element extends VNode {} | ||
// tslint:disable no-empty-interface | ||
interface ElementClass extends Vue {} | ||
interface IntrinsicElements { | ||
[elem: string]: any | ||
} | ||
} | ||
} |
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
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.
IMO, JSX declaration should be included in core lib’s declaration.
I remember @blake-newman was working on that?
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.
You are right, but it's not available right now.
Maybe we could use this until core lib's declaration released
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.
I am currently using this as a stop gap: https://github.com/wonderful-panda/vue-tsx-support (Some of the typing is wrong)
May be worth bringing some of this in, i think with some planning we should be able to get it all via types with no need for an API.