Skip to content

Do not use const enums

Administrator requested to merge no-const-enum into master

Created by: felixfbecker

Const enums have several disadvantages:

  • They don't work with babel-typescript (used by Parcel)
  • They don't work well with Webpack (no isolated file-by-file transpilation possible)
  • They are slower to compile (need type info)
  • They can't be accessed dynamically
  • They cannot be stubbed
  • We provide them as runtime values anyway

The only advantage they have is slighter faster access and bundle size, but that is absolutely negligible.

Extension API stubs depend on this.

Merge request reports

Loading