electricitymaps / electricitymaps-contrib

A real-time visualisation of the CO2 emissions of electricity consumption
https://app.electricitymaps.com
GNU Affero General Public License v3.0
3.49k stars 927 forks source link

[EPIC] Remove the NodeJS server used in frontend #3837

Closed madsnedergaard closed 2 years ago

madsnedergaard commented 2 years ago

Description

The server complicates the build and local development, while impacting performance and SEO. It mainly exists because of localisation, which should/could be improved and replaced on client-side anyway :)

See further discussions here: https://github.com/electricitymap/electricitymap-contrib/issues/3262

I've started the work here, but realised there's several areas needed to be addressed here. See list below.

Tasks in this

VIKTORVAV99 commented 2 years ago

Not sure if this is helpful or not but the HtmlWebpackPlugin can (and should) be used for generating the index.html, it also supports ejs templates so we can mostly use the current template without huge changes, it's just the facebook specific stuff that will need to have a solution.

We should also change how we handle the page title as it currently using the index.ejs to be generated, we should switch this to a static electricityMap title and then update it using client side JS. (this can be done already if we want)

madsnedergaard commented 2 years ago

Let's try replacing this issue with a Project: https://github.com/orgs/electricitymap/projects/29/ :)