Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upsource map support #50
Conversation
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
travisbot
commented
Sep 4, 2012
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
michaelficarra
Sep 4, 2012
Member
@travisbot: The comment tests are failing. That's due to the code marked FIXME.
|
@travisbot: The comment tests are failing. That's due to the code marked FIXME. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Great work!! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
I've created pull request for your branch. michaelficarra#1 |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Waiting on mozilla/source-map#19 |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
michaelficarra
Sep 5, 2012
Member
Only one failing test remains, and this is due to running SourceNode.prototype.replaceRight on a SourceNode that looks like
{ children: [ '//A\n', '', '' ],
line: null,
column: null,
source: undefined }Since the rightmost strings are empty, replacing \s+$ does nothing. I'm going to change the mozilla source map code to ignore empty strings, guaranteeing that the rightmost string is non-empty.
|
Only one failing test remains, and this is due to running { children: [ '//A\n', '', '' ],
line: null,
column: null,
source: undefined }Since the rightmost strings are empty, replacing |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
michaelficarra
Sep 5, 2012
Member
Still TODO: I need to find a more efficient way to test the generated string than toSourceNode(X).toString() (or avoid the tests).
|
Still TODO: I need to find a more efficient way to test the generated string than |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
michaelficarra
Sep 5, 2012
Member
With mozilla/source-map#19 and now mozilla/source-map#20, all tests are passing.
|
With mozilla/source-map#19 and now mozilla/source-map#20, all tests are passing. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
michaelficarra
Sep 5, 2012
Member
Alright, this LGTM. Usage with source map generation will have to wait until those mozilla/source-map pulls are merged, but it's working fine as-is. Let's
Future work: optimise toSourceNode(X).toString() usage depending on how it is used.
|
Alright, this LGTM. Usage with source map generation will have to wait until those mozilla/source-map pulls are merged, but it's working fine as-is. Let's Future work: optimise |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Constellation
Sep 5, 2012
Member
Alright, this LGTM. Usage with source map generation will have to wait until those mozilla/source-map pulls are merged, but it's working fine as-is. Let's it.
Yes, I think so too. Merging this. Thanks for your great contribution :)
Future work: optimise toSourceNode(X).toString() usage depending on how it is used.
NOTE: In my environment (node version 0.8.8), npm test result is following.
- master branch
test: 312 tests. 0 failures. 72 ms
api: 7 tests. 0 failures. 1 ms
options: 468 tests. 0 failures. 92 ms
comment: 18 tests. 0 failures. 13 ms
compare: 6 tests. 0 failures. 11 ms
identity: 11 tests. 0 failures. 11064 ms - source-maps branch
test: 312 tests. 0 failures. 77 ms
api: 7 tests. 0 failures. 1 ms
options: 468 tests. 0 failures. 103 ms
comment: 18 tests. 0 failures. 17 ms
compare: 6 tests. 0 failures. 14 ms
identity: 11 tests. 0 failures. 13038 ms
Yes, I think so too. Merging this. Thanks for your great contribution :)
NOTE: In my environment (node version 0.8.8), npm test result is following.
|
added a commit
that referenced
this pull request
Sep 5, 2012
Constellation
merged commit 181dea1
into
estools:master
Sep 5, 2012
1 check passed
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
michaelficarra
Sep 5, 2012
Member
NOTE: In my environment (node version 0.8.8), npm test result is following.
Remember, that's using the SourceNodeMock constructor. I wouldn't expect that to be much slower. When actually generating source maps, we will see the biggest hit because we're flattening the entire tree structure into a string, usually just for a small portion of it.
Remember, that's using the |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
michaelficarra
Sep 5, 2012
Member
The mozilla/source-map pulls have been merged. Everything should be 100% operational.
|
The mozilla/source-map pulls have been merged. Everything should be 100% operational. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Constellation
Sep 5, 2012
Member
The mozilla/source-map pulls have been merged. Everything should be 100% operational.
Great. After source-map package is published, we can generate source-map easily.
Great. After source-map package is published, we can generate source-map easily. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
I just pushed source-map@0.1.2 to npm. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Constellation
Sep 5, 2012
Member
@fitzgen
Awesome!
Because this is big change, I'm also planning to publish this as version 0.0.7 soon.
|
@fitzgen |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
fitzgen
Sep 5, 2012
Contributor
I am very excited at the thought of many existing and new compilers which target JS using escodegen as a backend so that they can get source maps for free!
|
I am very excited at the thought of many existing and new compilers which target JS using escodegen as a backend so that they can get source maps for free! |
added a commit
that referenced
this pull request
Sep 5, 2012
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Constellation
Sep 5, 2012
Member
I've just published version 0.0.7, shipping source map option!
Thanks all :-)
|
I've just published version 0.0.7, shipping source map option! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
michaelficarra
Sep 5, 2012
Member
We should probably document the usage of the sourceMap option. Basically, if you provide a non-empty string value for options.sourceMap, escodegen will generate a source map, using the given string as the source map's source file name.
|
We should probably document the usage of the |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Constellation
Sep 5, 2012
Member
We should probably document the usage of the sourceMap option.
Yes. I've just updated API wiki page.
https://github.com/Constellation/escodegen/wiki/API
Please feel free to update wiki page.
Yes. I've just updated API wiki page. |
michaelficarra commentedSep 4, 2012
This adds source map support to escodegen through use of the Mozilla Source Map library.