-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
module: add sourceURL magic comment hinting generated source #54402
Conversation
Review requested:
|
Source map is not necessary in strip-only mode. However, to map the source file in debuggers to the original TypeScript source, add a sourceURL magic comment to hint that it is a generated source.
a6a10cf
to
38302fc
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #54402 +/- ##
==========================================
+ Coverage 87.08% 87.31% +0.23%
==========================================
Files 648 648
Lines 182341 182362 +21
Branches 34982 34984 +2
==========================================
+ Hits 158783 159224 +441
+ Misses 16831 16392 -439
- Partials 6727 6746 +19
|
Stress test on rhel8-arm64: https://ci.nodejs.org/job/node-stress-single-test/523 |
Improving the test case to be more stable on inspector disconnection. It should be a separate issue (with about 1/20 reproduce rate). backtrace of SEGVThread 7 Crashed: 0 node 0x100e99604 node::inspector::TcpHolder::WriteRaw(std::__1::vector> const&, void (*)(uv_write_s*, int)) + 48 (inspector_socket.cc:733) 1 node 0x100e9b798 node::inspector::ProtocolHandler::WriteRaw(std::__1::vector> const&, void (*)(uv_write_s*, int)) + 20 (inspector_socket.cc:666) [inlined] 2 node 0x100e9b798 node::inspector::(anonymous namespace)::WsHandler::Write(std::__1::vector>) + 276 (inspector_socket.cc:406) 3 node 0x100e99d24 node::inspector::InspectorSocket::Write(char const*, unsigned long) + 104 (inspector_socket.cc:819) 4 node 0x100e90830 node::inspector::(anonymous namespace)::RequestToServer::Dispatch(node::inspector::InspectorSocketServer*) const + 52 (inspector_io.cc:83) [inlined] 5 node 0x100e90830 node::inspector::(anonymous namespace)::RequestQueueData::DoDispatch() + 232 (inspector_io.cc:153) [inlined] 6 node 0x100e90830 node::inspector::(anonymous namespace)::RequestQueueData::RequestQueueData(uv_loop_s*)::'lambda'(uv_async_s*)::operator()(uv_async_s*) const + 244 (inspector_io.cc:105) [inlined] 7 node 0x100e90830 node::inspector::(anonymous namespace)::RequestQueueData::RequestQueueData(uv_loop_s*)::'lambda'(uv_async_s*)::__invoke(uv_async_s*) + 272 (inspector_io.cc:102) 8 node 0x101ac2c04 uv__async_io + 276 (async.c:176) 9 node 0x101ad5ef4 uv__io_poll + 1032 (kqueue.c:385) 10 node 0x101ac319c uv_run + 412 (core.c:448) 11 node 0x100e8fe54 node::inspector::InspectorIo::ThreadMain() + 1632 (inspector_io.cc:319) 12 libsystem_pthread.dylib 0x18d571f94 _pthread_start + 136 13 libsystem_pthread.dylib 0x18d56cd34 thread_start + 8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Landed in 5376e69 |
Source map is not necessary in strip-only mode. However, to map the source file in debuggers to the original TypeScript source, add a sourceURL magic comment to hint that it is a generated source. PR-URL: #54402 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Kohei Ueno <kohei.ueno119@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Source map is not necessary in strip-only mode. However, to map the
source file in debuggers to the original TypeScript source, add a
sourceURL magic comment to hint that it is a generated source.
This has no runtime side-effects.
--enable-source-maps
will skipsources without sourceMappingURL magic comments since error stack
remapping is not needed.
This improves debugger experiences like VSCode JS Debugger allowing
setting breakpoints on the original typescript source files, instead
of popping up the stripped source contents.