Skip to content

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

Merged
yyx990803 merged 1 commit intovitejs:mainfrom
kerimhudson:closer-parity-to-preact-template
Feb 12, 2021
Merged

feat: Closer parity to Preact template on Preact Typescript template.#1996
yyx990803 merged 1 commit intovitejs:mainfrom
kerimhudson:closer-parity-to-preact-template

Conversation

@kerimhudson
Copy link
Copy Markdown
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