Unify debug.ts and useGlobalDebugValue into featureFlags.ts

Open
#3,215 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
52/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Quiet
Tech stack
typescript
Domain
tooling

Research direction

Start by comparing debug.ts, featureFlags.ts, and the useGlobalDebugValue implementation to trace how query parameters are read and when flags are initialized. Move the debug flags and global debug behavior into featureFlags.ts while preserving query-parameter support, then verify that featureFlags.ts does not throw errors in tests.

Written by the indexing model from the issue text.

Description

better engineering good first issue
  1. Move debug.ts flags into new feature flags in featureFlags.ts. These flags should still read from query params.
  2. Replace useGlobalDebugValue with a new feature flag.
  3. Ensure featureFlags.ts doesn't throw any errors in tests.

I think we should actually move all the debug.ts stuff into dynamic feature flags that check query params on module init, which will prevent pages that change the params (e.g. Venues, Module search) from flipping the debug flags. This can also replace useGlobalDebugValue, with the downside of losing the ability to flip flags after our JS loads.

Originally posted by @taneliang in https://github.com/nusmodifications/nusmods/pull/3212#discussion_r566568096

Dominant language
JavaScript
Stars
689
Forks
364
Avg merge
7h 5m
Merged PRs (30d)
14

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nusmodifications/nusmods

All issues in nusmodifications/nusmods

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.