Commit graph

77 commits

Author SHA1 Message Date
Manav Rathi 3dbf82552d
Use the web native cache only - desktop side changes 2024-03-22 17:28:05 +05:30
Manav Rathi 22e57669fb
[photos-desktop] Disable node integration - Part x/x (#1176)
This continues the refactoring to disable node integration in our
rendered process. The code is still in a WIP state, and more PRs in this
series will come.
2024-03-22 16:06:16 +05:30
Manav Rathi f083f0633d
Remove electron-reload
It reloads the BrowserWindow, but that already has HMR since we're connecting to
a Next dev server on localhost.

What we want is the main process to reload if the files for the main process are
changed. All options I've found so far just restart the main app on changes to
the main process code. I'm not sure that'll be useful, so not adding them right
now (and in any case, this is not a regression, it just wasn't working with
electron-reload either). For future reference if I need to revisit this, these
are the things I scouted:

- https://www.electronforge.io/config/plugins/webpack
- https://github.com/sindresorhus/electron-reloader
- https://electron-vite.org/guide/hot-reloading.html
2024-03-22 15:55:25 +05:30
Manav Rathi f2c288bdab
Remove promise-fs
Unnecessary, and unmaintained (since now node offers it natively)
2024-03-22 15:54:18 +05:30
Mathieu Velten 87de9e2afa Fix an error in the order of the arguments for imagemagick 2024-03-22 11:21:36 +01:00
Manav Rathi 1830a1b931
Let fs.readFile throw on non-existent files 2024-03-22 15:39:05 +05:30
Manav Rathi b6b4ee7e3a
recursive: true is mkdir -p 2024-03-22 15:31:45 +05:30
Manav Rathi c41bb571f6
Convert more promise-fs 2024-03-22 15:23:41 +05:30
Manav Rathi 94ac21950d
Convert to Electron's native fetch 2024-03-22 15:21:27 +05:30
Manav Rathi 8c40b950c7
Remove old and no longer necessary desktop cutoff version flag
It's been more than an 1.5 years since this was needed, everyone should've
updated by now.
2024-03-22 15:17:59 +05:30
Manav Rathi 8391e7edfc
Start migrating from promise-fs 2024-03-22 15:13:37 +05:30
Manav Rathi d98c3686c5
Inline 2024-03-22 11:33:24 +05:30
Manav Rathi 025ef4e1d9
Shorten 2024-03-22 11:26:04 +05:30
Manav Rathi 18deac3a41
Document 2024-03-22 11:21:05 +05:30
Manav Rathi b1f45c8602
Move export functions to preload 2024-03-22 09:49:11 +05:30
Manav Rathi 3c4619e5e4
Add a notice 2024-03-21 12:13:39 +05:30
Manav Rathi 4ea43e619b
More docs 2024-03-21 10:54:32 +05:30
Manav Rathi cd1d22cdfb
Shorten 2024-03-21 10:45:48 +05:30
Manav Rathi cc623e5010
Remove unnecessary steps
I'm not sure how it is happening, but both ffmpeg-static and onnx get to their
correct path without this configuration. the paths it gets to is also slightly
different, so it seems that this snippet does not have any effect (at best):

    ente.app/Contents/Resources/app.asar.unpacked/node_modules
2024-03-21 10:43:33 +05:30
Manav Rathi bb865a7b15
Add documentation about ffmpeg
https://alexandercleasby.dev/blog/use-ffmpeg-electron
2024-03-21 10:16:21 +05:30
Manav Rathi 7b1b6bf88f
Document a better, more explicit, reference 2024-03-20 13:47:38 +05:30
Manav Rathi 4c651da244
Document my current understanding 2024-03-20 13:17:41 +05:30
Manav Rathi 467acf2b8e
Remove old migration path
This migration path was in the last release v1.6.63, and it has now been out
there for a couple of months so apart from some outliers the migration should've
already happened. Even for the outliers, this will increase their cache size but
won't have a functional impact.

Cleaning this code now to reduce the amount that needs to be changed to support
a contextBridge aware cache.
2024-03-20 12:29:58 +05:30
Manav Rathi 0eedd5e57f
Add deprecation notice to ElectronFile 2024-03-20 10:52:31 +05:30
Manav Rathi 0634727ef3
Remove unused file
From my understanding, this was accidentally leftover from 3c8af97f69
2024-03-20 10:34:17 +05:30
Manav Rathi 8b0ce5d521
Add documentation links 2024-03-20 10:32:29 +05:30
Manav Rathi 8f2bb9c861
Add note about custom errors 2024-03-19 19:18:05 +05:30
Manav Rathi 83477cfe37
Forward clearElectronStore 2024-03-19 19:18:05 +05:30
Manav Rathi 3ce8513e48
Move more standalone methods to preload 2024-03-19 19:18:05 +05:30
Manav Rathi b3289f2b8d
Remove (kindof) unused reloadWindow IPC
We now bundle the renderer code within the app. So a load-fail indicates
something really wrong, not something we can deal with upfront (the code wasn't
probably even working - e.g. it was assigning to a function parameter
mainWindow, not the actual global var behind it).
2024-03-19 19:18:05 +05:30
Manav Rathi 3a6c7b2dcd
Remove unused sendNotification IPC 2024-03-19 19:18:05 +05:30
Manav Rathi 502469e97f
Move some non-duplicated FS related functions to preload 2024-03-19 19:18:05 +05:30
Manav Rathi c98762b448
Inline ML related functions 2024-03-19 19:18:05 +05:30
Manav Rathi e00b8fd2f1
Remove unused IPC for getPlatform 2024-03-19 19:18:05 +05:30
Manav Rathi eeaa5165ab
Remove custom cache directory
From discussions, it seems that it was pre-emptively added but not specifically
requested by a customer. We can bring this back later if needed, or at least
offer better options to clean it, but for now I'm pruning the IPC surface to
reduce the amount of work needed for handling contextIsolation and sandboxing.
2024-03-19 19:18:04 +05:30
Manav Rathi e4684b22df
Move out the electron-builder config to separate file 2024-03-19 19:17:01 +05:30
Manav Rathi d80fad6cf1
Remove unused vscode extension support
This doesn't belong in the repo even if were used
https://github.com/standard/vscode-standard
2024-03-19 19:17:01 +05:30
Manav Rathi a8de049519
Update concurrently's major version
No breaking changes that impact us - https://github.com/open-cli-tools/concurrently/releases
2024-03-19 19:17:01 +05:30
Manav Rathi e9fa525fe9
Remove unused electron-download
It was used for downloading symbols
2024-03-19 19:17:01 +05:30
Manav Rathi bff58f7b78
Update eslint settings to match main project 2024-03-19 19:17:01 +05:30
Manav Rathi a0f95b6080
Settle on a tsconfig for now
Electron also comes with its own type definitions, and from a (possibly dated)
blog post announcing this I got that we should not be overriding it with
@types/node: https://www.electronjs.org/pt/blog/typescript
2024-03-19 19:17:01 +05:30
Manav Rathi c19370ec51
Outline an ideal tsconfig.json 2024-03-19 19:17:01 +05:30
Manav Rathi 341f0fa559
Upgrade TypeScript 2024-03-19 19:17:01 +05:30
Manav Rathi e64d44639d
Document the conceputal way forward
Alternatives considered:

- https://github.com/alex8088/electron-toolkit
- https://electron-vite.org/
- https://github.com/cawa-93/vite-electron-builder/
2024-03-19 19:17:01 +05:30
Manav Rathi 04b9966425
Quicker quick
Ref: https://webpack.electron.build/building
2024-03-19 19:17:01 +05:30
Manav Rathi 0e861d5c48
Add some notes
The helpful snippet about the purpose of install-app-deps taken from
https://webpack.electron.build/dependency-management
2024-03-19 19:17:01 +05:30
Manav Rathi b7b33eba4a
Switch to contextBridge - Part 1 2024-03-19 19:17:01 +05:30
Manav Rathi 1266648562
Merge docs 2024-03-19 19:17:01 +05:30
Manav Rathi eb4f9402db
Enable prose-wrap 2024-03-19 19:17:01 +05:30
Manav Rathi 983beb89dc
Enable prose-wrap 2024-03-19 19:17:01 +05:30