-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
refactor: remove SourceMap dependency from dep-graph #1908
refactor: remove SourceMap dependency from dep-graph #1908
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, Lrc<SourceMap>
implements Send + Sync
if you enable concurrent
feature of swc_common
.
Interesting. I feel like I knew that, but forgot and that's good to know! I don't want to turn on that feature because it would be a global change, would most likely be slower in our case, and introduces the possibility of a new class of bugs. I think I will be able to manage by only holding onto things like |
I see. I'm okay with current changes, but I'm not sure if you want me to merge it. |
@kdy1 yeah, not yet. I want to look into fixing this possible race condition. I'm just looking into your comments. |
…rret/swc into dep-graph-remove-source-map
Is this PR ready? If not, please ping me when you are done :) |
Hey @kdy1, yeah, it is now. I’m just not sure about the changes to the comments trait and what would be best there. |
There isn't any need for
analyze_dependencies
to use a SourceMap. Instead it can stay working with span/byte pos units so it's the same as the AST (that way, we don't mix units).Additionally, it doesn't need to be limited to
SingleThreadedComments
and can instead take anything that implements theComments
trait.What I'm trying to do is hold onto swc ASTs in Deno's language server, but I need everything to be
Send
in order to do that. Source map doesn't allow that, so it's up on the chopping block right now. Next will beSourceFile
andSingleThreadedComments
.