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

Source maps? #452

Closed
drozzy opened this issue Jan 6, 2014 · 37 comments
Closed

Source maps? #452

drozzy opened this issue Jan 6, 2014 · 37 comments

Comments

@drozzy
Copy link

drozzy commented Jan 6, 2014

Forgive me if this is a repeat but I didn't find any issues about this.

Does LiveScript compiler support generating source maps?
The reason I ask is because both coffeescript and TypeScript seem to support it.

@zloirock
Copy link

zloirock commented Jan 6, 2014

#260
P.S. When can we expect it?

@jamesdwilson
Copy link

+1!

@benlesh
Copy link

benlesh commented Jan 29, 2014

👍 I was actually shocked that LiveScript didn't offer these... No source maps are a deal breaker in my workspace. CoffeeScript, TypeScript, and Traceur offer Source Maps. Source maps are the only reason I'd even consider a transpiled language.

@jamesdwilson
Copy link

Hope this helps someone somehow...

Says coffescript in the readme but I think they just didn't update it.
Note the source maps option.

https://npmjs.org/package/karma-livescript-preprocessor

James Wilson

On Wed, Jan 29, 2014 at 12:57 PM, Ben Lesh [email protected] wrote:

[image: 👍] I was actually shocked that LiveScript didn't offer
these... No source maps are a deal breaker in my workspace. CoffeeScript,
TypeScript, and Traceur offer Source Maps. Source maps are the only reason
I'd even consider a transpiled language.


Reply to this email directly or view it on GitHubhttps://github.com//issues/452#issuecomment-33617232
.

@vendethiel
Copy link
Contributor

@jamesdwilson unrelated. it was just forked from coffee which has that version

@vendethiel
Copy link
Contributor

Also, if somebody wants to take a stab at it, I believe an external library + a switch to disable it on the browser would be far easier

@Dessix
Copy link

Dessix commented Feb 5, 2014

This would be very useful, development is impeded somewhat by errors reported as occurring miles from the site of the problem.

@duralog
Copy link

duralog commented Feb 12, 2014

is anyone going to do this?

if not, I could probably do some work on it... I'll be using the following articles as reference:
https://www.npmjs.org/package/source-map-cjs
https://hacks.mozilla.org/2013/05/compiling-to-javascript-and-debugging-with-source-maps/

it seems pretty straightforward... the only problem being the column field but it seem this is easily enough added to lexer.ls

any takers? I'll be more than happy to do it. reason? I'm getting sick of doing the compile to js and look for the line to identify where in the .ls file it is, routine... :) I'm sure the time it'll take me to add it, will still be less than the time I'm spending daily searching for the errors

@vendethiel
Copy link
Contributor

If you're interested, you might also want to look at @jwalton's PRs on coffee (although we might want to use a library like mozilla/source-map, but this solution has problems too (BSD advertising clause, harder for browser-side)).
I really don't care enough to do it myself since I'd anyway spend most of my time looking at compiled JS, but I'm definitely open on a PR that does this :).

@duralog
Copy link

duralog commented Feb 12, 2014

BSD advertising clause:
https://www.gnu.org/philosophy/bsd.html

source-map license:
https://github.com/thlorenz/source-map-cjs/blob/master/LICENSE

I'm no lawyer, but it looks to me like they are using the revised license without the advertisng clause


I'll have a look at it a bit more, later when I get some spare time. It looks pretty straight-forward. and, looking at those pull requests helped - but not that much. right now with what I have, I'm just traversing the ast and building SourceNodes. got lots of debugging to do, and it's not integrated into LiveScript either. I just set all columns to 0. I wanted to set the columns correctly and do something like https://github.com/thlorenz/stack-mapper for the stack traces. later, I want to add long traces, because I'm doing a lot of setTimeout/nextTick type stuff...

@am11
Copy link

am11 commented Jun 10, 2014

Please add support for V3 source-map. To convince folks, @kizu shared some really interesting ideas here: markedjs/marked#382.

WE2013 has side-by-side preview support for LiveScript. Given the source-map, we can add features like "Go To Definition - F12" in context menu similar to those we have for CSS preprocessors. (despite the fact they all support source-maps; we haven't done that for Coffee, IcedCoffee SweetJS and TS yet as VS's JS lang service classes are internal atm).

@seanstrom
Copy link

Hey all, whats the status on this? @duralog @Nami-Doc

@mbrgm
Copy link

mbrgm commented Dec 15, 2014

+1 for source maps

@Diggsey
Copy link
Contributor

Diggsey commented Dec 15, 2014

+1

1 similar comment
@sng2c
Copy link

sng2c commented Dec 29, 2014

+1

@skovsgaard
Copy link
Contributor

+1'ing here too.

I just tried Coffeescript's maps and it is pretty much the best thing ever in my browser.

@mationai
Copy link

+1

2 similar comments
@demux
Copy link

demux commented Feb 16, 2015

+1

@modo-lv
Copy link

modo-lv commented Feb 20, 2015

+1

@vendethiel
Copy link
Contributor

"+1"s are not helping, really.

@blvz
Copy link
Contributor

blvz commented Feb 20, 2015

It's hard to express how "+1"s are a annoying and disrespectful, without sounding rude.
GitHub already have a "+1 button". It's on the right side of the Star/Unstar button.

@Diggsey
Copy link
Contributor

Diggsey commented Feb 20, 2015

Well with the lack of a voting system for issues, there's no other way to express community interest in a particular issue. Forking is not a solution.

Regardless, I'm going to take a stab at implementing this, since it's about time LiveScript got sourcemaps...

@vendethiel
Copy link
Contributor

If there's no developer interest in a specific feature, then community interest is a bit moot.

@seanstrom
Copy link

I believe this feature has been road mapped already. #260
I think part of the hold up is that LiveScript is/was meant to be re-written on top of CoffeeScript-Redux compiler which has source map support already. If anyone is interested in helping with source maps, looking into that would be helpful.

@vendethiel
Copy link
Contributor

f CoffeeScript-Redux compiler which has source map support already

If you have the energy to work on both, do it, no problem. I don't want to learn csr, or to have to start "from scratch" again, and I don't want to work on the current elxer because of how tangled everything is.

@seanstrom
Copy link

I thinks thats fair to feel that way, and I hear where you're coming from.
So what would be the best way for me to help the project?

We all keep asking for this feature, but there's all this underlining work that needs to be done before that can happen. What areas would ideally be addressed first before Source Map support?

I would be willing to work on various things if it meant we would eventually be able to add this.

@am11
Copy link

am11 commented Feb 22, 2015

My two cents here: Sweet.js is another superset language of JavaScript, which makes use of an npm module called source-map, which has all the mechanics to generate source-maps. If you want to consume that module to keep concerns separated, you would probably just need to hook it with your complier internals.

Sweet.js: https://github.com/mozilla/sweet.js.
source-map: https://github.com/mozilla/source-map.

@vendethiel
Copy link
Contributor

#481

@gkz
Copy link
Owner

gkz commented Feb 23, 2015

I don't mind the +1s.
I don't have the time to commit to work on this complicated feature, however, I think I'm pretty good at merging in pull requests, and if anyone would like to work on it and submit a pull request that would be great. The +1 just signify to any potential contributor that their work in creating a pull request would greatly be appreciated.

@igl
Copy link
Contributor

igl commented Feb 23, 2015

Isn't it about time to start on LS2 now that CSR is somewhat stable and ES6 is coming up?
Many breaking changes could be made. I am thinking about es6 modules, let and native const support.
Would it be clever to make such a heavy investment in 1.3 now?

@Diggsey
Copy link
Contributor

Diggsey commented Feb 23, 2015

As you can see, I've just submitted a PR which adds basic source-map support. It could do with a lot more testing though (hint hint, everyone who +1ed this!) and it's only fairly rough at the moment.

@demux
Copy link

demux commented Feb 23, 2015

👍 Suddenly this is all happening so fast! :D

@blvz
Copy link
Contributor

blvz commented Feb 23, 2015

👍 Suddenly this is all happening so fast! :D

That's why I think a fork is useful while +1s are just noise: They get things moving.

@demux
Copy link

demux commented Feb 23, 2015

Bitching about +1s is noise...

@blvz
Copy link
Contributor

blvz commented Feb 23, 2015

@demux No. Explaining why people should contribute more, with no fear, instead of just asking for things. You've missed my whole point.

@demux
Copy link

demux commented Feb 23, 2015

@blvz So you think that people are afraid to contribute? If that's the case at least some of the time, then obviously they shouldn't be afraid.
But I'm saying; asking for something isn't a bad thing. I believe that many of the people asking for features are them selves active, contributing members of the open source community.

@blvz
Copy link
Contributor

blvz commented Feb 23, 2015

@demux I think most people are. But maybe "fear" wasn't the right word to describe it. Most people in user-land don't have the motivation to give it a go. While I agree that asking isn't a bad thing, there are better ways to do it.

But hey, that's just my opinion, which I've thought it was worth sharing (while I do "bitch" about every +1s, in silence). Anyone's welcome to disagree and even gkz said he's ok with the +1s, so this discussion already did more noise than the +1s themselves.

@gkz gkz closed this as completed Apr 9, 2015
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