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
Unknown Object (File)
Mon, Nov 11, 2:51 AM
Unknown Object (File)
Sat, Nov 9, 6:57 AM
Unknown Object (File)
Sat, Nov 9, 6:56 AM
Unknown Object (File)
Sat, Nov 9, 6:56 AM
Unknown Object (File)
Sat, Nov 9, 6:55 AM
Unknown Object (File)
Fri, Nov 8, 9:59 AM
Unknown Object (File)
Fri, Nov 8, 9:08 AM
Unknown Object (File)
Fri, Nov 8, 8:45 AM
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