Uh oh!
There was an error while loading. Please reload this page.
fix: pass transformers object to ts.transpileModule method (Fixes #1051) - #1054
Conversation
Codecov Report
@@ Coverage Diff @@## master #1054 +/- ##
=======================================
Coverage 74.83% 74.83% =======================================
Files 6 6 Lines 608 608 Branches 142 142 =======================================
Hits 455 455 Misses 100 100 Partials 53 53
Continue to review full report at Codecov.
|
cspotcode
commented
May 23, 2020
@thetutlage Thanks for the speedy PR! What is the reason for moving the assertion into |
thetutlage
commented
May 24, 2020
The main reason for moving the Inside Now, in order to narrow it down, we have two options
What you think? |
cspotcode
commented
May 24, 2020
via email
Using a type assertion makes more sense. We need to keep the assertion
where it was because that's the more intuitive place for a `TypeError` to
be thrown. It makes the API better. …On Sun, May 24, 2020, 2:06 AM Harminder Virk ***@***.***> wrote:
The main reason for moving the typeof transformers === 'function' check
inside the getOutputTranspileOnly method is to narrow down the
transformers type.
Inside getOutputTranspileOnly the transformers variable is typed as
follows
[image: Screen Shot 2020-05-24 at 11 33 36 AM]
<https://user-images.githubusercontent.com/1706381/82746917-7cb1fb80-9db2-11ea-8c72-1ab78ad0105e.png>
Now, in order to narrow it down, we have two options
- Move the if condition inside this method (like I did)
- Manually type cast transformers to Exclude the factory function
What you think?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1054 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAC35OBIUXYWDVYN6C4DIC3RTC2ORANCNFSM4NIPHT2Q>
.
|
thetutlage
commented
May 24, 2020
If I get it right, you are saying to move the Right? |
cspotcode
commented
May 24, 2020
via email
Correct. …On Sun, May 24, 2020, 5:05 AM Harminder Virk ***@***.***> wrote:
If I get it right, you are saying to move the typeof check to its
original place (where it was earlier) and instead go with 2nd option, ie: Manually
type cast transformers to Exclude the factory function
Right?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1054 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAC35OHXOUIKLUFQ5VVVA4TRTDPN3ANCNFSM4NIPHT2Q>
.
|
thetutlage
commented
May 24, 2020
Does it look fine now? |
blakeembrey
left a comment
There was a problem hiding this comment.
@cspotcode Is there any reason we shouldn't move the getOutputTranspileOnly function back within the else block?
cspotcode
commented
May 25, 2020
via email
No reason. Yeah, we should move it back. I'll do that here and merge. …On Mon, May 25, 2020, 1:02 PM Blake Embrey ***@***.***> wrote:
***@***.**** approved this pull request.
@cspotcode <https://github.com/cspotcode> Is there any reason we
shouldn't move the getOutputTranspileOnly function back within the else
block?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1054 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAC35OFF2NKXPZM37GR4T4LRTKQDRANCNFSM4NIPHT2Q>
.
|
cspotcode
commented
May 25, 2020
Nevermind, I'm going to do it as a separate PR, cuz it'll be clearer that way. |
thetutlage
commented
Jun 2, 2020
@cspotcode Any idea when this will be released? |
cspotcode
commented
Jun 2, 2020
via email
No set date; maybe this weekend? Depends when someone has time; work is
keeping me busy this month.
In the meantime, you can install off of master (npm can install straight
from git) or downgrade to an older version. …On Tue, Jun 2, 2020 at 10:49 AM Harminder Virk ***@***.***> wrote:
@cspotcode <https://github.com/cspotcode> Any idea when this will be
released?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1054 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAC35OAPTEUGJQJKV4XSTVDRUUGOPANCNFSM4NIPHT2Q>
.
|

As per the README, only the
transformers factory functionis not allowed during thetranspileOnlymodule. However, an object can still be passed.In this PR https://github.com/TypeStrong/ts-node/pull/879/files#diff-f41e9d04a45c83f3b6f6e630f10117feR383, the code already guards against the factory function, but doesn't pass the transformers to the
transpileModulemethod.Related issue #1051