road86 / bahis-desk

Desktop application for BAHIS2
GNU General Public License v3.0
2 stars 1 forks source link

feat: and boy, what a feat! #82

Closed ChasNelson1990 closed 1 year ago

ChasNelson1990 commented 1 year ago

Description

TL;DR - please clone this repository as a new folder on your computer, checkout this branch and test the app to hell and back (see Testing below). I totally expect there to be things that need fixing. Please raise issues for them and I will fix them. I will also be testing it myself but I am sure I will miss things.

This has been something I have wanted to do for a while and I finally got the time slash energy to do it.

Basically, we wave goodbye to webpack and hello to vite. We also wave goodbye to react-scripts as I have moved us over to the electron-vite template for a React + Electron app.

Benefits:

On top of this, I have added:

closes #32 closes #65 maybe?

Dependency Changes

I have added the following dependencies:

I have made major-version upgrades to the following dependencies (alongside lots of minor and patch version upgrades):

I have removed the following dependencies which (unless otherwise stated) appeared not to be being used:

And moved the following into devDependencies:

I have removed the following devDependencies which (unless otherwise stated) appeared not to be being used (I have also removed several "types" but not listed them here):

Testing

Things we should test:

Lol. That's very broad... because quite frankly everything needs testing.

Documentation

I have done a major update of the README.md file. Please let me know if anything doesn't make sense.

Database Changes

New databases will no longer be initialised with a mac address field - old databases should not be impacted by this change.

Checklist

ChasNelson1990 commented 1 year ago

Oh, just as a note - a fresh npm install takes a short while because we have two git repos in our dependencies. One can be removed when an upstream PR is merged (better-sqlite3). The other is our old friend odk-form-renderer-v2... which I dream to replace soon!

ChasNelson1990 commented 1 year ago

I have converted this to draft as I seem to have broken something during the PR creation process - it was all working fine earlier but now I have an inifinite rerendering issue

ChasNelson1990 commented 1 year ago

Fixed that issue!

ChasNelson1990 commented 1 year ago

BTW to test vite in production mode use npm run preview on a Windows PC

ChasNelson1990 commented 1 year ago
  • Massively improved logging - as well as console logging in dev mode we also have file logging in all modes that should make debugging people's field issues simpler

These are stored as electron-debug.log and react-debug.log at the root folder. Not sure where they are stored for a production build TBH.

ChasNelson1990 commented 1 year ago

Not sure how do I specify which version to build.

Vite has a --mode flag; however, that is not how I suggest you do it. To run dev use npm run dev; to preview prod use npm run preview; to build prod use npm run build. At the moment this set up doesn't really use staging but I would perhaps suggest that staging is npm run preview... one to discuss.

For some reason a built release didn't work on macos. But that might be specific to the os.

Uncaught Exception:
Error: Cannot find module '/node_modules/better-sqlite3/build/Release/better_sqlite3.node'

better_sqlite3 does have some know problems with electron so perhaps it's worse for the MacOS electron? However, I think I did see this at some point and resolved it on Linux... if it becomes a problem I will look into it.