Page MenuHomeElementl

[dagit] Clean up feature flag code
ClosedPublic

Authored by dish on Jun 16 2021, 3:27 PM.

Details

Summary

Update how we define and access feature flags in Dagit JS.

  • Add a flag prefix to all feature flag names. This makes the naming a bit more consistent, so we can have better expectations about how these values are referenced (and what they represent) in code.
  • Create useFeatureFlags, which returns a map of flag:boolean. This is basically the same as what we're doing with permissions, which means that the callsite can just extract the desired value from the returned map.
  • Memoize a little more aggressively so that we aren't always parsing from localStorage JSON.
  • Update callsites.

I also removed an outdated flag (LeftNav).

Test Plan

Buildkite. Run Dagit to sanity check behavior.

Diff Detail

Repository
R1 dagster
Branch
dish-use-flags
Lint
Lint Passed
Unit
No Test Coverage

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Jun 16 2021, 3:37 PM
Harbormaster failed remote builds in B32161: Diff 39621!
Harbormaster returned this revision to the author for changes because remote builds failed.Jun 16 2021, 4:19 PM
Harbormaster failed remote builds in B32175: Diff 39636!

Update newly introduced callsites

dish requested review of this revision.Jun 16 2021, 5:05 PM

Ahh this looks great! Want to go ahead and merge this and i'll update the icons diff?

This revision is now accepted and ready to land.Jun 16 2021, 5:07 PM
This revision was automatically updated to reflect the committed changes.