Fix failed builds when using thread-loader#1207
Fix failed builds when using thread-loader#1207johnnyreilly merged 3 commits intoTypeStrong:masterfrom
Conversation
johnnyreilly
left a comment
There was a problem hiding this comment.
This looks great! Thank you!
Now I must reveal a prejudice of mine... I don't really like classes. It's not an accident that ts-loader is pretty much a class free codebase.
From the looks of it, class InstanceCache is a class that is instantiated just the once. I wonder if it would be straightforward to switch over to the revealing module pattern here perhaps?
No worries if you don't have time now, this looks functionally completely correct.
Fair point! Switching to that should be fairly easy, I'll make the change 👌 |
|
Awesome - you want to include the |
Done! I'll also take a look at the other error that I saw when using |
|
@johnnyreilly I've unlinked this PR from the original issue (#1206), so that it can be closed after users report that it's fixed, but feel free to close it if you prefer handling it that way. |
|
Travis is stuck - going to override and merge. |
|
v8.0.9 should be out in the next 20 mins or so - thanks for the quick turnaround @valerio! |
Possible fix for #1206
When using
thread-loader, theloader._compilerfield isundefined, this causes a runtime error when trying to use it as a key in a WeakMap.This PR changes the instance cache so that it now uses a dummy "marker" object as reference when the compiler instance is undefined.