-
Notifications
You must be signed in to change notification settings - Fork 81
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
Allow controlling linker re-use on Scala.js #456
Conversation
6f02c30
to
c9f6ccb
Compare
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.
LGTM 👍
It might be good to document the existence of this option on the website.
@keynmol i really appreciate your contributions to mdoc. I just sent you a collaborator invitation so that you can merge PRs and cut new releases. I may be slow to respond sometimes so don’t hesitate to merge and release without waiting for me.
@@ -165,7 +165,9 @@ class JsModifier extends mdoc.PreModifier { | |||
} else { | |||
val output = MemOutputFile.apply() | |||
|
|||
val linking = linker.link(virtualIrFiles ++ sjsir, Nil, LinkerOutput.apply(output), sjsLogger) | |||
val currentLinker = if (config.reuseLinker) linker else newLinker() |
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.
Does the linker have some shutdown/cleanup method that we should call when we initialize a new linker?
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.
I'm not seeing any in the interface, but there's something like ClearableLinker
that seems to just manage an internal _linker
state and setting it to null
when .clear()
is called
I'll check with Scala.js folks on whether I should use that, or just set batch mode on the linker which should achieve the same results without this if condition
just sent you a collaborator invitation
Thank you, appreciate it :)
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.
321db8a should be better - clearable linker + batch mode means no manual management of linker lifecycle and the same results
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.
The last commit looks great!
Gonna merge this and test Laminar with the snapshot version before releasing a new tag 👍 |
This allows users to work around #454 (which is just scala-js/scala-js#4416 wearing a fake mustache) at the cost of some speed penalty
How did I test this?
pre-req: Publish this branch locally
js-batch-mode=true
js-batch-mode=false (default)