[Feature Request] Docs when getting started with TypeScript
- [x] I have read the Contributing Guidelines for this project.
- [x] I agree to follow the Code of Conduct that this project adheres to.
- [x] I have searched the issue tracker for a feature request that matches the one I want to file, without success.
I have recently started using Electron and thought it would be nice if the tutorial included instructions on how to get started using TypeScript.
Proposed Solution
I think there is a way to write about how to get started in TS in a steady way.
However, to start small, I think it would be very meaningful for beginners just to introduce electron-vite, nextron, etc. and let them know that they can build a TS environment from scratch there.
Sorry if I have simply missed something.
Hi, I would like to work on this issue. Could you please assign it to me? @htnabe I plan to update the documentation to include instructions for getting started with TypeScript in Electron. This will cover: Setting up a basic Electron project with TypeScript Using electron-vite or nextron for a quicker setup Adding a section explaining the benefits of TypeScript with Electron. I'll ensure the changes align with the contributing guidelines.
@Shashikumar-ezhilarasu I am not one of the main mainteners, so I can't assign you.
Before we do that, we have to make it clear whether this topic is enough meaningful to the users of electron. How do you, the maintainers, think about this issue?
Hi @htnabe ,
Thank you for considering this! I believe that including instructions for getting started with TypeScript in Electron would be highly valuable for users.
Rationale:
TypeScript has become a popular choice for many developers as it adds type safety and better tooling to JavaScript. Providing beginners with clear documentation on integrating TypeScript will help lower the entry barrier for those wanting to use it with Electron. Tools like electron-vite and nextron streamline the setup process and can save users time. Introducing them would make it easier for developers to adopt TypeScript. Proposed Documentation Outline:
Setting up Electron with TypeScript: A step-by-step guide for creating a basic TypeScript environment. Using electron-vite/nextron: Quick-start options for those who prefer pre-configured solutions. Benefits of TypeScript in Electron: A brief explanation of why TypeScript can be helpful in Electron projects.
If the maintainers agree that this is a meaningful addition, I'd be happy to start working on it. Let me know your thoughts!!
An easy way to get started with Electron and TypeScript is to use Electron Forge with a TypeScript template.
Since you mentioned Vite, here's the Vite template: https://www.electronforge.io/templates/vite-+-typescript
@nikwen Thanks for the advice! The template you gave us is very useful as an official announcement!
As of Electron Forge v7.5.0, Vite support for Electron Forge has been marked as experimental... Future minor releases may contain breaking changes, but migration steps will be listed in release notes.
On the other hand, I still think it's important to introduce some stable ones like electron-vite, nextron.
@htnabe Check this for why the change was made: https://github.com/electron/forge/releases/tag/v7.5.0
I think it's totally fine to use the Vite plugin in Electron Forge despite the label that sounds scary.
@nikwen thank you for the reply! I have already cheacked the article.
I think it's totally fine to use the Vite plugin in Electron Forge despite the label that sounds scary.
I agree! I am not saying that we should not include a description of Electron Forge. What I am saying is that it would be better to show there are several options for beginners.
Of course, if the maintainers of Electron don't want to accept anything but Electron Forge, that's fine 😊