website icon indicating copy to clipboard operation
website copied to clipboard

[Feature Request] Docs when getting started with TypeScript

Open htnabe opened this issue 1 year ago • 8 comments

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.

htnabe avatar Dec 11 '24 13:12 htnabe

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 avatar Dec 16 '24 18:12 Shashikumar-ezhilarasu

@Shashikumar-ezhilarasu I am not one of the main mainteners, so I can't assign you.

htnabe avatar Dec 16 '24 23:12 htnabe

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?

htnabe avatar Dec 17 '24 03:12 htnabe

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!!

Shashikumar-ezhilarasu avatar Dec 17 '24 06:12 Shashikumar-ezhilarasu

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 avatar Dec 26 '24 02:12 nikwen

@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 avatar Dec 26 '24 09:12 htnabe

@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 avatar Dec 26 '24 17:12 nikwen

@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 😊

htnabe avatar Jan 07 '25 04:01 htnabe