Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

JavaScript JavaScript application: Electron, Tauri or something else?

Exabyte

New Coder
I am not sure whether this is the correct forum to post in, but I am working on a project that is essentially a collection of JavaScript files that run in the local browser. There is no server backend. I am not sure why the project was written using JavaScript rather than a more traditional programming language, but it is what it is. There is a requirement for the project to have access to the local file system so as to be able work with files using program calls without user intervention. Obviously, as we know, browser security prevents this. My initial thought was to create an Electron project. It should be relatively simple to port the existing JavaScript code and then develop it further as required. Unfortunately I then started to come across comments like 'Electron is obsolete!', 'No one develops Electron applications anymore' etc Yet the Electron project website displays a number of large corporate projects, such as e.g. Discord? It also seems to be the simplest solution.

Perhaps the nearest alternative is Tauri, however using this would be a somewhat greater challenge as it apparently does not support all JavaScript libraries available via npm and the application code will need to take care of cross-browser issues. Quite how much of a problem that might be, I am not sure of at the moment. Another alternative would be to re-write the whole thing using a traditional language such as C++ (or maybe Python) which would be a huge task!

Before I invest any significant time in Electron, I would like to ask whether the statements above regarding Electron are true? Should I abandon Electron in favour of something else? If so, then for what reason and what is the best alternative?
 
I am not sure whether this is the correct forum to post in, but I am working on a project that is essentially a collection of JavaScript files that run in the local browser. There is no server backend. I am not sure why the project was written using JavaScript rather than a more traditional programming language, but it is what it is. There is a requirement for the project to have access to the local file system so as to be able work with files using program calls without user intervention. Obviously, as we know, browser security prevents this. My initial thought was to create an Electron project. It should be relatively simple to port the existing JavaScript code and then develop it further as required. Unfortunately I then started to come across comments like 'Electron is obsolete!', 'No one develops Electron applications anymore' etc Yet the Electron project website displays a number of large corporate projects, such as e.g. Discord? It also seems to be the simplest solution.

Perhaps the nearest alternative is Tauri, however using this would be a somewhat greater challenge as it apparently does not support all JavaScript libraries available via npm and the application code will need to take care of cross-browser issues. Quite how much of a problem that might be, I am not sure of at the moment. Another alternative would be to re-write the whole thing using a traditional language such as C++ (or maybe Python) which would be a huge task!

Before I invest any significant time in Electron, I would like to ask whether the statements above regarding Electron are true? Should I abandon Electron in favour of something else? If so, then for what reason and what is the best alternative?
Hi there,
Best bet is to use Visual Studio Code. Easier to deal with js files
 
Well, javascript is exellent programming language and i dont see any reason to change it atleast from what you wrote. It is used as backbone for threejs 3D library as well for many applications for gaming or such.

See my latest post from subforum where projects are shared. As you can see, you can use javascript as backbone for user input, file reading and writing and much else. There is also GUI's to build GUI apps with javascript. You can use SQL, http and so much more with javascript which is pretty darn good backbone for app developement these days. What comes for electron, ignore what some comments claims. Use the tool what does the job you need it to do instead of fixing your behaviour or attitude by other peoples comments.
 
What comes for electron, ignore what some comments claims. Use the tool what does the job you need it to do instead of fixing your behaviour or attitude by other peoples comments.
I was staring to come to that conclusion myself. Electron has some downsides including a larger package because it bungles Chromium, resource usage, and application startup time. However it would also appear to have its detractors who post negative comments. As regards resource usage, would it be any worse than running the code in the Chromium browser? Would the startup time be any worse than launching Chrom(e/ium)? Could I not display a splash screen while launch was in progress?
 
I dont think there is significant difference in resources usage and app start-up time depends do you also need to open chromium browser each time. Of course, lots of is up to what kind of program you have there and what it does. But in general, if the the program allready works as is, i would continue developing it instead of making huge modifications.

When starting to make big modifications to workable program, you should gain pretty much to bother. In the end, 99% peoples does not care how the program works if it just works.
 
I managed to get the application working pretty much as is in Electron. There are a couple of caveats, for example, not being able to resize (scale) the page and there being no debugger like you have accessible in a browser by just pressing F12. The main .html file has some JavaScript in it and it seemed like a good idea to separate this from the HTML markup by placing it into the main.js file. However, I ran into difficulties with being able to call the other JavaScripts from the main file. I gather I need to use either CommonJS or ECXMA modules, but I haven't been able to get this to work yet. I am however curious as to what the convention is? It is not uncommon to find JavaScript snippets HTML files. There is a school of thought that says to keep the formatting separatre from content, hence the existence of CSS. Not so sure about HTML/markup and functional code?
 
Yes, it is good practise to seperate html, css and js for each on its own file. Still, if there is not significant amount of js nor css in your html file, i would not bother myself too much for adding it there.

CommonJS is for front-end and EXMA modules are for backend, or client-side and server-side as often referred. Depending of which one you want to debug, its possible that you cant do it from browser.

Not so sure about HTML/markup and functional code?

I would seperate codes so, that what is working for front-end, can be in same file and vice verse for back-end. Instead of sharing everything in their own files, i would instead make the logic of code clear and comment it as well as i could. But this is just my opinion and lots of depends the size of your program etc etc.
 

New Threads

Latest posts

Buy us a coffee!

Back
Top Bottom