Closed ericmorand closed 2 years ago
The benefit of packing them is step-through debugging. This does come at a minor package-size cost, but imho it's worth having!
Does it mean that it is a temporary situation until first stable release?
No, this is useful for end-users as well as core developers. More complex issues might require a developer to trace exactly the path the interpreter takes. Especially when for example dealing with higher-order functions, you might need to see when/why Curveball calls one of your functions.
Given that the cost is relatively low, I don't see a huge problem with this. Don't get me wrong, I love a small node_modules
, but I think the best lever to achieve this is to have shallow dependency trees. I'm not too worried about a few extra files.
I'm not sure I understand your point. The TypeScript code present in src
is not executed, hence it doesn't serve any purpose for debugging. The JavaScript code is executed and this one can be used for debugging purpose.
Most debuggers can take the .map
files and let you step through the original pre-compiled source. One way to do this with node
is to start node with --inspect-brk
, and open about:inspect
in chrome. It works quite nicely, and would recommend you give it a shot if you haven't seen this in action!
The purpose of the .map
files is to create a byte-by-byte mapping of the original source and compiled source.
Do you mean that the source maps are included in the distributed npm package?
Yep!
I think I will close this ticket, but happy to discuss further if you feel like it.
Current
@curveball/core
package comes with the compiled artifacts (the JavaScript files and the type definitions, insidedist
) but also comes with the TypeScript sources (insidesrc
). It looks like a deliberate move since thesrc
directory is explicitly present in thefiles
property of the project manifest.@curveball/core
is a runtime dependency for most projects, which means that its sources are present in the deployed environments even though they are totally useless there.I suggest that they are removed from the distributed package.