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

Experiment with sourceURLs for better Underscore Template Debugging #1973

Open
jashkenas opened this issue Dec 10, 2014 · 3 comments
Open

Experiment with sourceURLs for better Underscore Template Debugging #1973

jashkenas opened this issue Dec 10, 2014 · 3 comments
Labels
enhancement starter good choice for new contributors

Comments

@jashkenas
Copy link
Owner

Could this be helpful?

http://fitzgeraldnick.com/weblog/59/

@jdalton
Copy link
Contributor

jdalton commented Dec 10, 2014

Devs find it helpful. I do this in the dev builds of my implementation. I remove them from the minified build. Chrome has supported sourceURLs in Function for a long time now. I believe Firefox used to only support it in eval, when it used an @ instead of an #, so yay Firefox 36 for joining the Function sourceURL party.

Some have also found it useful to be able to set the sourceURL via a template option,
{sourceURL: ...}, too.

@akre54
Copy link
Collaborator

akre54 commented Dec 10, 2014

Chrome gives you access to the eval'd VM instance and its line numbers anyways. What's the benefit of naming the instance?

screen shot 2014-12-10 at 12 03 46 pm

@jdalton
Copy link
Contributor

jdalton commented Dec 10, 2014

I find it useful to have them in the sources view for a quick at-a-glance to make sure logic is right without having to instrument the code, even in the absence of a thrown error. Having the sourceURL configurable also allows organizing template sources which is nice.

Related Firefox issue #1107541.

@jgonggrijp jgonggrijp added the starter good choice for new contributors label Dec 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement starter good choice for new contributors
Projects
None yet
Development

No branches or pull requests

4 participants