While the micro scheme is fine, it lacks a proper repository structuring.
As an example, not aggregating the source code in a src directory is a huge misstep. You might want to use TypeScript or some other tooling (e.g., a bundler) to process your code for performance benefits. As such putting everything into the root / mixing with your tooling and tests is something you want to avoid strongly.
(You should not use CommonJS - use ESModules; especially if you really care about "maintainability, scalability, and collaboration".)
Electron.js understands ESM (electronjs.org/docs/latest/tutoria...) - but if you want to only use ESM in development and another format (e.g., CommonJS) at runtime I recommend using a tool such as esbuild (which can bundle and transform).
I agree, this is fine for JS, but any serious project should really be using Typescript as you said, type-safe SDKs are super powerful, see Tanstack Router or others that are built with this in mind.
That’s well said but if we are really aiming that big and complex applications, then we should use another frameworks like nestjs which provide all these things out of the box.
Just put everything in a source and write the code as-is. (e.g., then src/index.tsx instead of a index.js or src/index.js). Use a tool such as esbuild to consume the source files and transform (+ bundle) them into a dist folder (src/index.tsx and related files -> dist/app.js).
It's a standard practice that pretty much all applications today follow.
My comment was independent if you like or want to use TypeScript. That was one example. Having a src directory is pretty much always helpful (as you might want to bundle for performance reasons).
Maybe instead of making useless comments it would be great to improve your knowledge about JS and its ecosystem from time to time. Might help.
If you had a good understanding of js you wouldn't have to use typescript in the first place, and secondly you've obviously never worked on any big enough project where the ShitTypescript spends 2 hours making bundles for perforance reasons at every line change
Working on a big project without needing Typescript? You are the one who sounds like you have never worked on any big one. That is Typescript's purpose: to add typing syntax for js, to let the code document itself. So when the project is scaled up, people can join and easily follow up the codebase.
While the micro scheme is fine, it lacks a proper repository structuring.
As an example, not aggregating the source code in a
srcdirectory is a huge misstep. You might want to use TypeScript or some other tooling (e.g., a bundler) to process your code for performance benefits. As such putting everything into the root / mixing with your tooling and tests is something you want to avoid strongly.(You should not use CommonJS - use ESModules; especially if you really care about "maintainability, scalability, and collaboration".)
if i want to convert the javascript application in ES module to a desktop application using electronjs, how do i do it?
using tools like Electron Packager or Electron Builder.
Electron.js understands ESM (electronjs.org/docs/latest/tutoria...) - but if you want to only use ESM in development and another format (e.g., CommonJS) at runtime I recommend using a tool such as esbuild (which can bundle and transform).
Thanks for the new insight.
I agree, this is fine for JS, but any serious project should really be using Typescript as you said, type-safe SDKs are super powerful, see Tanstack Router or others that are built with this in mind.
That’s well said but if we are really aiming that big and complex applications, then we should use another frameworks like nestjs which provide all these things out of the box.
nice work, thank you for this, for a react frontend that has typescript in it, how should the folder structure be arranged?
Just put everything in a source and write the code as-is. (e.g., then src/index.tsx instead of a index.js or src/index.js). Use a tool such as esbuild to consume the source files and transform (+ bundle) them into a dist folder (src/index.tsx and related files -> dist/app.js).
It's a standard practice that pretty much all applications today follow.
I will share soon!
you are wrong since the moment you want to put types to a non typed language, if want types go and do you stuff in c# or java
My comment was independent if you like or want to use TypeScript. That was one example. Having a
srcdirectory is pretty much always helpful (as you might want to bundle for performance reasons).Maybe instead of making useless comments it would be great to improve your knowledge about JS and its ecosystem from time to time. Might help.
If you had a good understanding of js you wouldn't have to use typescript in the first place, and secondly you've obviously never worked on any big enough project where the ShitTypescript spends 2 hours making bundles for perforance reasons at every line change
Working on a big project without needing Typescript? You are the one who sounds like you have never worked on any big one. That is Typescript's purpose: to add typing syntax for js, to let the code document itself. So when the project is scaled up, people can join and easily follow up the codebase.
Yeah , you are right , I'm solo freelancer! but it will help who is new in this field.