Skip to content

Do not emit names and name index mapping in source map - #5713

Merged
Sheetal Nandi (sheetalkamat) merged 4 commits into
masterfrom
noSourcemapNames
Dec 1, 2015
Merged

Do not emit names and name index mapping in source map#5713
Sheetal Nandi (sheetalkamat) merged 4 commits into
masterfrom
noSourcemapNames

Conversation

@sheetalkamat

Copy link
Copy Markdown
Member

Since source map spec isn't clear about use of names, removing names entry all together. We can look at the symbol mapping once there is update to the spec about it.

Since sourcemap spec is not very clear about symbol translation and
use of nameIndex of the mapping, dont emit it
@develar

Copy link
Copy Markdown

Hi, what do you mean? Spec is clear and IntelliJ Platform uses it. Please don't break debug!

  1. Find mapping entry.
  2. Get mapping entry name
  3. Name is missed (unnamed entry) - use generated element name. name is presented - use it.

Please don't break existing funcitonality and fix #5224. I will answer to any question and can provide closed source code (partially opened - see https://github.com/JetBrains/intellij-community/blob/master/platform/script-debugger/debugger-ui/src/com/jetbrains/javascript/debugger/NameMapper.kt) As you can see in the provided NameMapper, there is a flag js.debugger.name.mappings.by.source.code as a workaround of 5224.

Our users happy to use TypeScript and debug it.

@asvetliakov

Copy link
Copy Markdown

Please do not merge this at least until implementing another solution for debugging
Thanks

@sheetalkamat

Copy link
Copy Markdown
Member Author

Vladimir Krivosheev (@develar) we have never emitted variable names in the source map. We were emitting the callstack name it belonged too.. So functionality you are talking about is anyways broken and unsupported without this change.

@develar

Copy link
Copy Markdown

Sheetal Nandi (@sheetalkamat) So, if you don't mangle names, it is ok (nothing to map). Thanks for clarification.

@mhegazy

Copy link
Copy Markdown
Contributor

can you coordinate this with #5780

@mhegazy

Copy link
Copy Markdown
Contributor

The easiest is to wait for Ron Buckton (@rbuckton) to merge #5780 and then apply the change on top, the tests should be unchanged.

@rbuckton

Copy link
Copy Markdown
Contributor

Sheetal Nandi (@sheetalkamat) Do you have a preference?

@sheetalkamat

Copy link
Copy Markdown
Member Author

Ron Buckton (@rbuckton), Probably you should go first as my changes are small, I think it would be easier if I have to merge.

@rbuckton

Copy link
Copy Markdown
Contributor

Sheetal Nandi (@sheetalkamat): Alright, I've gone ahead and merged my change.

Sheetal Nandi (sheetalkamat) added a commit that referenced this pull request Dec 1, 2015
Do not emit names and name index mapping in source map
@sheetalkamat
Sheetal Nandi (sheetalkamat) deleted the noSourcemapNames branch December 1, 2015 00:45
@mhegazy Mohamed Hegazy (mhegazy) added the Breaking Change Would introduce errors in existing code label Dec 1, 2015
@mhegazy

Copy link
Copy Markdown
Contributor

@develar

Copy link
Copy Markdown

Without name mappings it is not possible to debug this in the lambdas — https://youtrack.jetbrains.com/issue/WEB-20340#comment=27-1372090

_this is generated but TS sourcemap doesn't contain name mappings and, obviously, IDEA cannot remap it to real this...

screen shot 2016-03-26 at 15 50 03

{"version":3,"file":"myclass1_spec.js","sourceRoot":"","sources":["../../src/__tests__/myclass1_spec.ts"],"names":[],"mappings":"AAAA,IAAI,GAAG,GAAG,EAET,CAAA;AAED;IAAA;QACE,QAAG,GAAG,IAAI,CAAA;IAOZ,CAAC;IALC,oBAAG,GAAH;QAAA,iBAIC;QAHC,UAAU,CAAC;YACT,OAAO,CAAC,GAAG,CAAC,KAAI,CAAC,GAAG,CAAC,CAAA;QACvB,CAAC,EAAE,EAAE,CAAC,CAAA;IACR,CAAC;IACH,aAAC;AAAD,CAAC,AARD,IAQC;AAED,IAAI,MAAM,EAAE,CAAC,GAAG,EAAE,CAAA"}

@born2net

Copy link
Copy Markdown

+1

@microsoft Microsoft (microsoft) locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Breaking Change Would introduce errors in existing code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants