Re:Ask HN: How do you relate rendered HTML to the TypeScript...
by solardev on Monday September 11, 2023 @01:42PM
(#37470774)
This is where the debugger comes in. You can use the one built in to Chrome if you have your source maps set up, but it's often easier to use the IDE one (VScode and Webstorm both have it built in). You might have to set up ignored files (like the generic Next stuff and the node modules and whatnot), then set breakpoints either in the files you're working with (if you know) or at some sane entry point to your app in general (if you don't know exactly), then carefully step through the lines of code.
It's a bit of a learning curve but really powerful once you learn it.
Is that what you mean, or did I misunderstand? Like if you were thinking about it in terms of scraping someone else's code that you can't as easily debug, that's harder (you can still do it to some degree in Chrome, but it may be minified etc). Probably a lot of regex, assuming the string isn't obfuscated in code.
It's a bit of a learning curve but really powerful once you learn it.
Is that what you mean, or did I misunderstand? Like if you were thinking about it in terms of scraping someone else's code that you can't as easily debug, that's harder (you can still do it to some degree in Chrome, but it may be minified etc). Probably a lot of regex, assuming the string isn't obfuscated in code.