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 928 forks source link

feat(hack): in app storage buster #6886

Closed tonypls closed 3 months ago

tonypls commented 3 months ago

Issue

The dev process on feature flagged stuff can be quite slow to delete local storage keys

Description

This PR adds a new button to the featureflags manager (find with the ff query param, app.el...com/map?ff)

The button clears all local storage and reloads the page.

VIKTORVAV99 commented 3 months ago

This is not related to your changes directly but how do we feel about limiting these dev features to only dev environments and stripping it from production builds?

tonypls commented 3 months ago

This is not related to your changes directly but how do we feel about limiting these dev features to only dev environments and stripping it from production builds?

It can be nice for us to be able to test this stuff on production if we are debugging.

Are you thinking to limit users or for reducing bundle size?

VIKTORVAV99 commented 3 months ago

This is not related to your changes directly but how do we feel about limiting these dev features to only dev environments and stripping it from production builds?

It can be nice for us to be able to test this stuff on production if we are debugging.

Are you thinking to limit users or for reducing bundle size?

Mostly reducing the bundle size, but it's only a 5 kB change so far so it's fine for now, but if we add more dev tools it might be nice to limit them.

tonypls commented 3 months ago

This is not related to your changes directly but how do we feel about limiting these dev features to only dev environments and stripping it from production builds?

It can be nice for us to be able to test this stuff on production if we are debugging. Are you thinking to limit users or for reducing bundle size?

Mostly reducing the bundle size, but it's only a 5 kB change so far so it's fine for now, but if we add more dev tools it might be nice to limit them.

Is there a way we could only download them if the query param is active?

VIKTORVAV99 commented 3 months ago

This is not related to your changes directly but how do we feel about limiting these dev features to only dev environments and stripping it from production builds?

It can be nice for us to be able to test this stuff on production if we are debugging.

Are you thinking to limit users or for reducing bundle size?

Mostly reducing the bundle size, but it's only a 5 kB change so far so it's fine for now, but if we add more dev tools it might be nice to limit them.

Is there a way we could only download them if the query param is active?

Maybe with a dynamic import, I can give it a try later on and if it works I can open a PR?