Skip to content
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

Consider not releasing the sources as part of the package #185

Closed
ericmorand opened this issue Nov 9, 2021 · 8 comments
Closed

Consider not releasing the sources as part of the package #185

ericmorand opened this issue Nov 9, 2021 · 8 comments

Comments

@ericmorand
Copy link

Current @curveball/core package comes with the compiled artifacts (the JavaScript files and the type definitions, inside dist) but also comes with the TypeScript sources (inside src). It looks like a deliberate move since the src directory is explicitly present in the files property of the project manifest.

"files": [
    "package.json",
    "README.md",
    "dist",
    "LICENSE",
    "src"
]

@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.

@evert
Copy link
Member

evert commented Nov 9, 2021

The benefit of packing them is step-through debugging. This does come at a minor package-size cost, but imho it's worth having!

@ericmorand
Copy link
Author

Does it mean that it is a temporary situation until first stable release?

@evert
Copy link
Member

evert commented Nov 9, 2021

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.

@ericmorand
Copy link
Author

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.

@evert
Copy link
Member

evert commented Nov 9, 2021

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.

@ericmorand
Copy link
Author

Do you mean that the source maps are included in the distributed npm package?

@evert
Copy link
Member

evert commented Dec 10, 2021

Yep!

@evert
Copy link
Member

evert commented Dec 10, 2021

I think I will close this ticket, but happy to discuss further if you feel like it.

@evert evert closed this as completed Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants