bogeeee/restfuncs

Source maps are broken for user's ServerSession subclasses

Closed this issue ยท 3 comments

Occurs for all files with a @remote decorator (those are modified in the restfuncs-transformer stage).
I think, there won't be an easy fix for this soon, or we need someone who's really familiar with the tsc compiler internals.
See this discussion.

I think, the precise problem is in: transformer/index.ts:
compilerHost.fileCache.set(sourceFile.fileName, updatedSourceFile);

from there on, the compiler takes this as the original file and i think, there's no way, you could provide a (let's say:) originalSourceFile.ts -> updatedSourceFile.ts source map there. So you'd kind of have the grab the generated code (either from the generated AST, during visiting, or by a diff afterwards) and squeeze all that code into one line inside the original file content at the correct position. Not quiet easy...

/reward 200

How to earn this $200.00 reward?
๐Ÿ’ช Comment /try and start working on solving the issue!
๐Ÿ™Œ And when you open the PR, comment /claim #2 either in the PR description or in a PR's comment

Bugfix was released in restfuncs-transformer 1.1.0