TheThingsNetwork / lorawan-stack

The Things Stack, an Open Source LoRaWAN Network Server
https://www.thethingsindustries.com/stack/
Apache License 2.0
936 stars 302 forks source link

Replace `react-ace` editor with leaner code editor component #4195

Open kschiffer opened 3 years ago

kschiffer commented 3 years ago

Summary

We should replace react-ace or at least provide a secondary code editor component that is more lightweight and which we can use for simpler use cases that don't need the overhead of a full-fledged code editor.

Why do we need this?

  1. react-ace is huge and one of the main contributors to the size of our webui bundles. See https://github.com/TheThingsNetwork/lorawan-stack/issues/359#issuecomment-514206612
  2. We have had memory issues when using our react-ace powered <CodeEditor /> component for simple read-only display tasks. See #4178 and #4192
  3. We cannot currently update react-ace to the latest version due to a an issue with how it interfaces with ace. See #4150
  4. It is currently not feasible to assert on values of the <CodeEditor /> component in our end-to-end testing due to the way that react-ace stores the input value

What is already there? What do you see now?

What is missing? What do you want to see?

A replacement that is more lightweight in terms of file size, memory usage and provided functionality.

How do you propose to implement this?

I don't have time right now to research viable alternatives, but I'm sure there is something out there.

How do you propose to test this?

Manual testing and updating end-to-end tests

Can you do this yourself and submit a Pull Request?

It's probably best if we first discuss the possible options here. Then either @bafonins or me can pick this up.

kschiffer commented 1 year ago

There are also errors logged on sentry related to react ace: https://sentry.io/organizations/the-things-industries/issues/2678712029