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

feat: Closer parity to Preact template on Preact Typescript template. #1996

Merged
merged 1 commit into from
Feb 12, 2021
Merged

feat: Closer parity to Preact template on Preact Typescript template. #1996

merged 1 commit into from
Feb 12, 2021

Conversation

kerimhudson
Copy link
Contributor

Having played with both the Preact and Preact TypeScript templates on Vite, I find that the vanilla Preact one offers a stronger starting point than the TypeScript one as it allows you to import { h, Fragment } from 'preact' automatically, and not have to add it to every file.

This could also be added to the TypeScript version to allow for a faster and nicer development experience. This PR attempts to implement that feature by using the same methods as the vanilla Preact template. It requires creating a preact.d.ts in the src directory to ensure code checking works in VS Code.

The change is fairly small so thought it better to make a PR than a discussion first as it'll be easier to just see the code.

(I tried to ensure following the contribution guidelines, but apologies if I missed anything).

@yyx990803 yyx990803 merged commit c2622de into vitejs:main Feb 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants