digidem / mapeo-desktop

Local-first mapping and monitoring in remote environments
https://mapeo.app
GNU General Public License v3.0
261 stars 33 forks source link

Upgrage Electron and Bundler #715

Closed ErikSin closed 1 year ago

ErikSin commented 1 year ago

To be compatible with the new Mapeo Core, the Electron version needs to be upgraded to version 22.0.3

As well, the current bundler (webpack) can be replaced with Vite-Electron.

Requirements

This electron version requires node v 16.17.1

ErikSin commented 1 year ago

Upgrading Electron

ErikSin commented 1 year ago

Electron breaking changes from v9 to v22

v10

v11

v12

v13

v14

v15

v16

v17

v18

v19

v20

v21

v22

ErikSin commented 1 year ago

Work started on this branch

achou11 commented 1 year ago

after pairing with Erik yesterday, the following issues were addressed:

achou11 commented 1 year ago

another pairing session with Erik today. the following issues were addressed:

the app runs locally now! was even able to sync a small amount of data with my phone.

next steps are more thorough testing and figuring out what's broken.

image

separately, wondering if the map server directory background-maps/ should not be living in the user data directory when in development mode (instead be in temp-resources/), or if that's okay. could be pretty catastrophic for people who use the map server in production mapeo and also develop Mapeo locally, which is an almost-zero number of people right now 😅

achou11 commented 1 year ago

after playing around with Vite and some vite electron plugins, thinking that this issue should be split into two items:

  1. Electron upgrade
  2. Bundler upgrade

To my knowledge, upgrading Electron can be done independently without requiring major changes to our frontend setup. For the sake of better isolating these major changes, doing them separately will be easier to manage and review.

Additionally, thinking that Vite may not be the option we want to use after my explorations. There's some deceptive complexity with it (maybe because of Electron) that I haven't fully managed to wrap my head around. Wondering if we can achieve 80% with just using Rollup and relevant plugins with the goal of creating a setup that

  1. Improves the dev experience compared to what we currently have
  2. Something that is maintainable and doesn't rely too much on magic from external deps

at the expense of some of the dev experience that Vite provides (when it works). Something to discuss in more detail

ErikSin commented 1 year ago

Closing ticket, and replacing with #726