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

Development process is slow with webpack, is there a way to use ts-node instead? #997

Closed
hankadler opened this issue Feb 15, 2023 · 4 comments

Comments

@hankadler
Copy link

I love nodegui and been using it for months now. One thing that would vastly improve the developer experience is not waiting for compilation every time the code changes. ts-node seems like the perfect solution for this problem, it allows TypeScript code to run pretty much on the fly. Here's a TypeScript starter project for reference.

Is it possible to integrate qode and ts-node and not have to deal with webpack at all? It'd make for a much simpler nodegui starter project.

Thank you!

@sedwards2009
Copy link
Collaborator

Qode and NodeGui don't really support hot code reloading, so either way you will have to restart the app.

As for speeding up the dev process, do you realise that you don't need a bundler at all. You can compile to your TS code to JS files in a build folder and then run your build/main.js file to start your app.

My project Extraterm had zero bundling for a long time, even during packaging. I only just recently started bundling the code to bring down the final package/installer sizes. I went for esbuild though which is very fast and takes a tiny fraction of time compared to the normal TS compile phase. You can see this set up here: https://github.com/sedwards2009/extraterm/blob/master/main/package.json

@hankadler
Copy link
Author

@sedwards2009 Thank you so much for your quick reply! I will checkout your setup. I still think there should be a way to use ts-node, which is by far my preferred way of running TypeScript, it's super fast since it doesn't write/compile files and feels cleaner.

@vlovich
Copy link

vlovich commented Apr 9, 2023

For what it's worth I use esbuild before running qobe and it works well and is super fast to the point that I don't notice it. Might want to give that a try. I did have to tell esbuild to use external packages and to explicitly exclude all my node_modules dependencies, but totally reasonable and it's possible there are better ways (also I'm using ESM modules everywhere but dependencies are commonjs which is why I needed to do this weird dance I think).

For what it's worth this is waaay faster than ts-node. Tsx is typically faster because it uses esbuild under the hood which is much much faster than tsc.

@sedwards2009
Copy link
Collaborator

I've spent some time this week on a new starter project. The basics are in place and you can have a look at it here: https://github.com/sedwards2009/nodegui-simple-starter

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

No branches or pull requests

3 participants