Page MenuHomePhabricator

[keyserver] Add `--source-maps` flag to `babel-build` for more sane debugging experience
ClosedPublic

Authored by atul on Aug 30 2022, 11:56 AM.
Tags
None
Referenced Files
F1697809: D4984.id16125.diff
Fri, May 3, 8:36 PM
Unknown Object (File)
Fri, Apr 26, 7:26 AM
Unknown Object (File)
Sat, Apr 13, 5:00 AM
Unknown Object (File)
Mar 14 2024, 3:02 PM
Unknown Object (File)
Mar 8 2024, 6:46 PM
Unknown Object (File)
Mar 8 2024, 4:52 PM
Unknown Object (File)
Mar 8 2024, 4:52 PM
Unknown Object (File)
Mar 8 2024, 4:52 PM
Subscribers

Details

Summary

We previously weren't generating source maps when running babel-build in dev.

This led to a pretty painful debugging experience for keyserver in VSCode/WebStorm/etc. If the developer wanted to set breakpoints they'd need to

  1. Navigate out of the src file to the corresponding file in dist (tedious/context switch/etc)
  2. Set breakpoints in transpiled output which often looked pretty different from source

In addition, the developer would need to keep hopping between the files because dist got rewritten on changes to src which meant the developer couldn't just iterate within dist either.

This diff adds the --source-maps flag to babel-build for dev which enables a much smoother debugging experience. Breakpoints can be set directly in source and iteration can happen in realtime.

I should have investigated this much much earlier...

Test Plan

Worked in VSCode and WebStorm out of the box:

Screen Shot 2022-08-30 at 2.40.47 PM.png (1×3 px, 883 KB)

Screen Shot 2022-08-30 at 2.43.52 PM.png (1×3 px, 935 KB)

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

atul published this revision for review.Aug 30 2022, 11:57 AM
atul edited the test plan for this revision. (Show Details)
atul edited the summary of this revision. (Show Details)
atul edited the summary of this revision. (Show Details)

Patched this and tried it. Wow this should have been done long ago. Makes debugging keyserver so much easier

This revision is now accepted and ready to land.Aug 31 2022, 4:25 AM

rebase around other diffs before landing