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

Debugging feature request: marker comments in output #823

Closed
TehShrike opened this issue Sep 6, 2017 · 5 comments
Closed

Debugging feature request: marker comments in output #823

TehShrike opened this issue Sep 6, 2017 · 5 comments

Comments

@TehShrike
Copy link
Member

It's been talked about in Gitter, but I couldn't find an issue for it yet:

debugging Svelte output in bundles would be way easier if each component had marker comments around its code indicating which component the code belonged to.

This would make it easier to Cmd+F for the code you wanted, and reduce the amount of thinking you'd have to do to find out which component this create_main_fragment function belonged to.

@Rich-Harris
Copy link
Member

Yes, I've been meaning to do this. Good idea

@Rich-Harris
Copy link
Member

Related suggestion from Gitter — include a comment showing the version of the compiler

Rich-Harris added a commit that referenced this issue Sep 17, 2017
@TehShrike
Copy link
Member Author

Does #853 really close this? I'm just going by the changes to the test output - I didn't see component name anywhere

@Rich-Harris
Copy link
Member

Rich-Harris commented Sep 17, 2017

@TehShrike it uses options.filename if available, like

/* /path/to/project/components/Thing.html generated by Svelte v1.39.3 */

options.filename isn't present in the tests, but it is if you're using a bundler integration. Though I'm wondering about maybe making it relative to process.cwd(), so it's more like this:

/* components/Thing.html generated by Svelte v1.39.3 */

@TehShrike
Copy link
Member Author

Oh, brilliant. process.cwd() sounds like a good idea to me, but filename alone will help immensely for the vast majority of the cases where I'm looking at the output.

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