Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Update type-only import semantics to allow type queries#36092

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
andrewbranch merged 27 commits intomicrosoft:masterfromandrewbranch:type-only-2
Jan 23, 2020

Conversation

@andrewbranch
Copy link
Member

@andrewbranchandrewbranch commentedJan 9, 2020
edited
Loading

In#35200, a type-only import or export created a synthetic symbol which reflected only the type-side meaning of its target. This meant that the imported names were unusable in any value position. This PR removes the intermediate synthetic symbol and instead issues an error if the imported names appear in any non-ambient expression context. Namely, this allows for:

importtype{BaseClass}from'./base';// 1. Type queriesletConstructorType:typeofBaseClass;// 2. Ambient contexts that require value meaningsdeclareclassSubClassextendsBaseClass{}

One oddity that arises with this approach is how to treat a namespace import that includes type-only exports:

// a.tsclassA{}exporttype{A}// b.tsimport*asafrom'./a';console.log(a);// Empty object, because the export type was erasedtypeT=keyoftypeofa;// `never` - because `typeof a` must be an empty object typeleta:a.A;// This is okletA:typeofa.A;// This doesn’t work because `typeof a` is an empty object :(

Essentially, there is a limitation that if you need to access thevalue meaning of a type-onlyexport, you can’t do so through a namespace import—you have to use a named (or default) import.

The distinction is subtle and confusing, but I think internally consistent, and unlikely to come up much in real code. At least, I think it’s better to start with this limitation than to be overly permissive in a way that could make the type system misrepresent the reality of the shape of a module.


Fixes#36040
Fixes#36003 (the part I said was a bug)
Fixes#36004

klimashkin, vilicvane, ExE-Boss, strelga, MattiasBuelens, and liuliangsir reacted with thumbs up emojivilicvane and liuliangsir reacted with rocket emoji
Copy link
Member

@sandersnsandersn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The change looks OK to me, but with the caveat the I didn't review the original code so this is the first time for me to look at it.@weswigham should probably answer your question about whether there's a better way to finagle const enum references.

@andrewbranch
Copy link
MemberAuthor

@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commentedJan 9, 2020
edited
Loading

Heya@andrewbranch, I've started to run the perf test suite on this PR at124dcd6. You can monitor the buildhere. It should now contribute to this PR's status checks.

Update:The results are in!

@typescript-bot
Copy link
Collaborator

@andrewbranch
The results of the perf run you requested are in!

Here they are:

Comparison Report - master..36092

Metricmaster36092DeltaBestWorst
Angular - node (v10.16.3, x64)
Memory used356,335k (± 0.02%)358,325k (± 0.02%)+1,990k (+ 0.56%)358,120k358,466k
Parse Time1.61s (± 0.52%)1.62s (± 0.41%)+0.01s (+ 0.56%)1.60s1.63s
Bind Time0.87s (± 1.17%)0.88s (± 0.96%)+0.01s (+ 0.92%)0.86s0.89s
Check Time4.59s (± 0.45%)4.76s (± 0.49%)+0.17s (+ 3.77%)4.71s4.82s
Emit Time5.29s (± 0.99%)5.27s (± 0.87%)-0.02s (- 0.47%)5.13s5.38s
Total Time12.36s (± 0.51%)12.53s (± 0.57%)+0.17s (+ 1.35%)12.32s12.71s
Monaco - node (v10.16.3, x64)
Memory used367,758k (± 0.02%)367,890k (± 0.01%)+132k (+ 0.04%)367,799k368,006k
Parse Time1.26s (± 0.59%)1.25s (± 0.80%)-0.01s (- 0.56%)1.23s1.28s
Bind Time0.76s (± 0.48%)0.76s (± 0.53%)-0.01s (- 0.65%)0.75s0.77s
Check Time4.71s (± 0.51%)4.83s (± 0.61%)+0.12s (+ 2.55%)4.76s4.88s
Emit Time2.95s (± 0.56%)2.97s (± 0.90%)+0.02s (+ 0.58%)2.91s3.02s
Total Time9.68s (± 0.44%)9.81s (± 0.49%)+0.13s (+ 1.33%)9.69s9.89s
TFS - node (v10.16.3, x64)
Memory used323,446k (± 0.02%)323,642k (± 0.02%)+196k (+ 0.06%)323,477k323,795k
Parse Time0.95s (± 0.61%)0.94s (± 0.50%)-0.00s (- 0.42%)0.93s0.95s
Bind Time0.74s (± 0.88%)0.73s (± 1.09%)-0.01s (- 0.81%)0.71s0.75s
Check Time4.17s (± 0.32%)4.29s (± 0.35%)+0.12s (+ 2.90%)4.26s4.33s
Emit Time3.03s (± 0.88%)3.04s (± 0.88%)+0.01s (+ 0.16%)2.98s3.09s
Total Time8.89s (± 0.34%)9.01s (± 0.45%)+0.12s (+ 1.32%)8.94s9.10s
Angular - node (v12.1.0, x64)
Memory used331,969k (± 0.03%)333,964k (± 0.05%)+1,996k (+ 0.60%)333,295k334,170k
Parse Time1.56s (± 0.74%)1.57s (± 0.61%)+0.00s (+ 0.19%)1.55s1.59s
Bind Time0.84s (± 0.81%)0.86s (± 0.68%)+0.01s (+ 1.42%)0.84s0.87s
Check Time4.54s (± 0.45%)4.72s (± 0.47%)+0.17s (+ 3.83%)4.66s4.76s
Emit Time5.52s (± 0.95%)5.50s (± 0.55%)-0.02s (- 0.45%)5.45s5.58s
Total Time12.47s (± 0.41%)12.64s (± 0.33%)+0.16s (+ 1.29%)12.55s12.74s
Monaco - node (v12.1.0, x64)
Memory used347,547k (± 0.02%)347,684k (± 0.01%)+137k (+ 0.04%)347,559k347,781k
Parse Time1.22s (± 0.39%)1.23s (± 0.99%)+0.00s (+ 0.41%)1.20s1.26s
Bind Time0.73s (± 0.91%)0.73s (± 0.79%)+0.00s (+ 0.00%)0.72s0.75s
Check Time4.55s (± 0.51%)4.67s (± 0.60%)+0.12s (+ 2.52%)4.59s4.73s
Emit Time2.99s (± 0.67%)3.03s (± 0.62%)+0.05s (+ 1.57%)2.99s3.07s
Total Time9.50s (± 0.31%)9.66s (± 0.34%)+0.17s (+ 1.75%)9.57s9.73s
TFS - node (v12.1.0, x64)
Memory used305,787k (± 0.01%)305,917k (± 0.02%)+131k (+ 0.04%)305,711k306,046k
Parse Time0.94s (± 1.00%)0.93s (± 0.40%)-0.01s (- 0.53%)0.93s0.94s
Bind Time0.69s (± 0.65%)0.70s (± 2.66%)+0.01s (+ 1.60%)0.68s0.76s
Check Time4.12s (± 0.41%)4.21s (± 0.61%)+0.09s (+ 2.28%)4.16s4.27s
Emit Time3.07s (± 0.66%)3.11s (± 0.77%)+0.04s (+ 1.37%)3.05s3.16s
Total Time8.81s (± 0.37%)8.95s (± 0.55%)+0.14s (+ 1.58%)8.84s9.04s
Angular - node (v8.9.0, x64)
Memory used351,256k (± 0.02%)353,222k (± 0.01%)+1,965k (+ 0.56%)353,132k353,317k
Parse Time2.11s (± 0.65%)2.11s (± 0.45%)+0.00s (+ 0.05%)2.09s2.13s
Bind Time0.91s (± 0.83%)0.93s (± 0.81%)+0.01s (+ 1.42%)0.91s0.94s
Check Time5.40s (± 0.55%)5.58s (± 0.35%)+0.18s (+ 3.28%)5.50s5.60s
Emit Time6.30s (± 0.82%)6.29s (± 0.92%)-0.01s (- 0.19%)6.16s6.45s
Total Time14.71s (± 0.59%)14.90s (± 0.44%)+0.19s (+ 1.26%)14.78s15.08s
Monaco - node (v8.9.0, x64)
Memory used365,985k (± 0.01%)366,116k (± 0.01%)+132k (+ 0.04%)365,987k366,218k
Parse Time1.56s (± 0.41%)1.56s (± 0.36%)-0.00s (- 0.26%)1.55s1.57s
Bind Time0.95s (± 0.74%)0.94s (± 0.90%)-0.01s (- 0.84%)0.92s0.96s
Check Time5.44s (± 1.61%)5.64s (± 1.40%)+0.21s (+ 3.83%)5.51s5.81s
Emit Time3.34s (± 4.58%)3.28s (± 4.43%)-0.06s (- 1.91%)3.01s3.45s
Total Time11.29s (± 0.81%)11.43s (± 0.74%)+0.14s (+ 1.20%)11.24s11.56s
TFS - node (v8.9.0, x64)
Memory used322,752k (± 0.01%)322,828k (± 0.01%)+76k (+ 0.02%)322,733k322,914k
Parse Time1.27s (± 0.29%)1.26s (± 0.54%)-0.00s (- 0.08%)1.25s1.28s
Bind Time0.75s (± 0.78%)0.75s (± 1.09%)0.00s ( 0.00%)0.73s0.77s
Check Time4.78s (± 0.84%)4.88s (± 0.75%)+0.10s (+ 2.09%)4.80s4.95s
Emit Time3.22s (± 0.71%)3.22s (± 0.48%)-0.00s (- 0.06%)3.19s3.27s
Total Time10.01s (± 0.57%)10.11s (± 0.50%)+0.10s (+ 0.99%)10.00s10.21s
Angular - node (v8.9.0, x86)
Memory used199,561k (± 0.02%)200,605k (± 0.03%)+1,044k (+ 0.52%)200,428k200,737k
Parse Time2.04s (± 0.56%)2.03s (± 0.47%)-0.00s (- 0.20%)2.02s2.06s
Bind Time1.02s (± 0.47%)1.03s (± 0.74%)+0.01s (+ 0.88%)1.01s1.05s
Check Time4.91s (± 0.68%)5.08s (± 0.62%)+0.16s (+ 3.32%)5.01s5.16s
Emit Time6.15s (± 1.43%)6.19s (± 1.98%)+0.03s (+ 0.55%)6.01s6.48s
Total Time14.12s (± 0.59%)14.32s (± 0.96%)+0.20s (+ 1.44%)14.11s14.65s
Monaco - node (v8.9.0, x86)
Memory used205,223k (± 0.02%)205,326k (± 0.02%)+103k (+ 0.05%)205,233k205,452k
Parse Time1.61s (± 0.81%)1.60s (± 0.57%)-0.01s (- 0.62%)1.59s1.63s
Bind Time0.76s (± 1.19%)0.75s (± 1.10%)-0.01s (- 0.66%)0.74s0.77s
Check Time5.36s (± 2.05%)5.60s (± 1.07%)+0.24s (+ 4.51%)5.39s5.68s
Emit Time3.02s (± 4.43%)2.90s (± 3.26%)-0.12s (- 4.04%)2.80s3.27s
Total Time10.74s (± 0.46%)10.85s (± 0.51%)+0.11s (+ 1.02%)10.72s11.03s
TFS - node (v8.9.0, x86)
Memory used182,069k (± 0.03%)182,139k (± 0.02%)+70k (+ 0.04%)182,065k182,202k
Parse Time1.30s (± 0.73%)1.30s (± 0.68%)-0.00s (- 0.31%)1.29s1.33s
Bind Time0.70s (± 0.42%)0.71s (± 1.32%)+0.01s (+ 1.14%)0.70s0.74s
Check Time4.54s (± 0.73%)4.63s (± 0.85%)+0.08s (+ 1.78%)4.56s4.75s
Emit Time2.98s (± 0.92%)2.99s (± 0.70%)+0.00s (+ 0.17%)2.94s3.02s
Total Time9.53s (± 0.38%)9.62s (± 0.56%)+0.09s (+ 0.94%)9.52s9.79s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-166-generic
Architecturex64
Available Memory16 GB
Available Memory5 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v10.16.3, x64)
  • node (v12.1.0, x64)
  • node (v8.9.0, x64)
  • node (v8.9.0, x86)
Scenarios
  • Angular - node (v10.16.3, x64)
  • Angular - node (v12.1.0, x64)
  • Angular - node (v8.9.0, x64)
  • Angular - node (v8.9.0, x86)
  • Monaco - node (v10.16.3, x64)
  • Monaco - node (v12.1.0, x64)
  • Monaco - node (v8.9.0, x64)
  • Monaco - node (v8.9.0, x86)
  • TFS - node (v10.16.3, x64)
  • TFS - node (v12.1.0, x64)
  • TFS - node (v8.9.0, x64)
  • TFS - node (v8.9.0, x86)
BenchmarkNameIterations
Current3609210
Baselinemaster10

@andrewbranch
Copy link
MemberAuthor

Check time appears up ~2–4%. I thinkthis discussion will have some bearing on what we can do, so I’ll hold off on doing anything specifically for perf until we make some other decisions.

@andrewbranch

This comment has been minimized.

@typescript-bot

This comment has been minimized.

@typescript-bot

This comment has been minimized.

@andrewbranch

This comment has been minimized.

@andrewbranchandrewbranch changed the titleUpdate type-only import semantics to allow type queriesWIP(perf): Update type-only import semantics to allow type queriesJan 10, 2020
@andrewbranchandrewbranch changed the titleWIP(perf): Update type-only import semantics to allow type queriesWIP (perf): Update type-only import semantics to allow type queriesJan 10, 2020
@typescript-bot

This comment has been minimized.

@andrewbranch
Copy link
MemberAuthor

For a moment I thought we could also allow type-only imports in class property declarations without initializers:

classC{[onInit]:any;}

But that’s actually a problem for ES class field semantics if I understand correctly.declare property declarations should Just Work™ because the ambient node flag will propagate down.

It’s also maybe worth noting that at this point, it would be very easy to allow people to use const enums as type-only imports (#36003), even though I think it’s pretty unintuitive.

@DanielRosenwasser
Copy link
Member

DanielRosenwasser commentedJan 15, 2020
edited
Loading

Yeah, that's definitely an error. Here's another fun case now that you mention non-emitted members in classes:abstract members!

importtype{onInit}from"./framework-hooks";abstractclassComponent{abstract[onInit]():void;}
andrewbranch and liuliangsir reacted with thumbs up emojiweswigham and liuliangsir reacted with eyes emoji

@andrewbranch
Copy link
MemberAuthor

andrewbranch commentedJan 15, 2020
edited
Loading

@DanielRosenwasser I’ve just updated to include those cases, and switched to a NodeFlag-based approach as@weswigham suggested earlier since the list of syntactic forms to check for in a hot path was growing.

Edit: NodeFlag approach was terrible for incremental parsing. Reverted.

@andrewbranch
Copy link
MemberAuthor

@typescript-bot perf-test this

@DanielRosenwasser
Copy link
Member

Looks like there's diagnostic conflicts

@andrewbranch
Copy link
MemberAuthor

@typescript-bot perf test this again for good measure please

@typescript-bot
Copy link
Collaborator

typescript-bot commentedJan 23, 2020
edited
Loading

Heya@andrewbranch, I've started to run the perf test suite on this PR atbe5f50f. You can monitor the buildhere. It should now contribute to this PR's status checks.

Update:The results are in!

@typescript-bot
Copy link
Collaborator

@andrewbranch
The results of the perf run you requested are in!

Here they are:

Comparison Report - master..36092

Metricmaster36092DeltaBestWorst
Angular - node (v10.16.3, x64)
Memory used355,798k (± 0.02%)357,379k (± 0.03%)+1,581k (+ 0.44%)357,006k357,550k
Parse Time1.60s (± 0.50%)1.61s (± 0.74%)+0.01s (+ 0.88%)1.59s1.64s
Bind Time0.88s (± 0.78%)0.87s (± 0.85%)-0.00s (- 0.23%)0.85s0.89s
Check Time4.56s (± 0.52%)4.60s (± 0.29%)+0.03s (+ 0.66%)4.57s4.63s
Emit Time5.24s (± 0.61%)5.28s (± 0.54%)+0.05s (+ 0.94%)5.21s5.34s
Total Time12.28s (± 0.34%)12.37s (± 0.24%)+0.09s (+ 0.73%)12.30s12.44s
Monaco - node (v10.16.3, x64)
Memory used364,353k (± 0.01%)364,286k (± 0.02%)-67k (- 0.02%)364,169k364,422k
Parse Time1.25s (± 0.61%)1.25s (± 0.67%)+0.01s (+ 0.48%)1.24s1.28s
Bind Time0.77s (± 0.90%)0.76s (± 0.29%)-0.01s (- 0.78%)0.75s0.76s
Check Time4.61s (± 0.59%)4.62s (± 0.38%)+0.02s (+ 0.35%)4.59s4.66s
Emit Time2.96s (± 1.05%)2.94s (± 0.88%)-0.01s (- 0.47%)2.88s2.99s
Total Time9.57s (± 0.53%)9.58s (± 0.36%)+0.01s (+ 0.07%)9.50s9.66s
TFS - node (v10.16.3, x64)
Memory used323,555k (± 0.02%)323,498k (± 0.01%)-57k (- 0.02%)323,425k323,569k
Parse Time0.94s (± 0.53%)0.95s (± 0.79%)+0.00s (+ 0.21%)0.94s0.97s
Bind Time0.74s (± 1.37%)0.73s (± 1.11%)-0.00s (- 0.27%)0.71s0.75s
Check Time4.17s (± 0.52%)4.20s (± 0.36%)+0.03s (+ 0.84%)4.16s4.23s
Emit Time3.03s (± 1.04%)3.03s (± 1.15%)-0.00s (- 0.16%)2.96s3.13s
Total Time8.88s (± 0.58%)8.91s (± 0.50%)+0.03s (+ 0.35%)8.83s9.04s
Angular - node (v12.1.0, x64)
Memory used331,487k (± 0.02%)332,950k (± 0.07%)+1,462k (+ 0.44%)331,978k333,117k
Parse Time1.56s (± 0.61%)1.56s (± 0.33%)+0.01s (+ 0.32%)1.55s1.57s
Bind Time0.85s (± 0.78%)0.86s (± 0.60%)+0.01s (+ 1.29%)0.85s0.87s
Check Time4.51s (± 0.42%)4.52s (± 0.61%)+0.01s (+ 0.11%)4.46s4.59s
Emit Time5.45s (± 0.84%)5.45s (± 0.80%)+0.00s (+ 0.02%)5.38s5.57s
Total Time12.37s (± 0.45%)12.39s (± 0.55%)+0.02s (+ 0.18%)12.28s12.54s
Monaco - node (v12.1.0, x64)
Memory used344,133k (± 0.02%)344,080k (± 0.02%)-53k (- 0.02%)343,894k344,248k
Parse Time1.21s (± 0.58%)1.22s (± 0.67%)+0.01s (+ 0.50%)1.20s1.24s
Bind Time0.74s (± 0.68%)0.73s (± 1.06%)-0.00s (- 0.54%)0.72s0.75s
Check Time4.47s (± 0.16%)4.48s (± 0.58%)+0.00s (+ 0.11%)4.42s4.52s
Emit Time3.02s (± 1.08%)3.00s (± 0.53%)-0.01s (- 0.43%)2.96s3.04s
Total Time9.44s (± 0.40%)9.43s (± 0.35%)-0.01s (- 0.11%)9.34s9.47s
TFS - node (v12.1.0, x64)
Memory used305,807k (± 0.02%)305,787k (± 0.01%)-20k (- 0.01%)305,675k305,843k
Parse Time0.94s (± 1.12%)0.94s (± 1.08%)-0.01s (- 0.85%)0.91s0.96s
Bind Time0.69s (± 0.52%)0.69s (± 0.50%)-0.01s (- 1.01%)0.68s0.69s
Check Time4.12s (± 0.40%)4.12s (± 0.39%)-0.00s (- 0.12%)4.09s4.16s
Emit Time3.09s (± 0.95%)3.06s (± 0.61%)-0.03s (- 0.81%)3.03s3.11s
Total Time8.84s (± 0.39%)8.80s (± 0.32%)-0.04s (- 0.44%)8.76s8.88s
Angular - node (v8.9.0, x64)
Memory used350,760k (± 0.01%)352,342k (± 0.01%)+1,582k (+ 0.45%)352,281k352,463k
Parse Time2.10s (± 0.33%)2.10s (± 0.39%)-0.00s (- 0.10%)2.08s2.11s
Bind Time0.91s (± 0.77%)0.92s (± 0.94%)+0.01s (+ 1.43%)0.91s0.95s
Check Time5.37s (± 0.65%)5.34s (± 0.66%)-0.03s (- 0.47%)5.28s5.42s
Emit Time6.29s (± 0.70%)6.22s (± 1.52%)-0.07s (- 1.08%)5.92s6.40s
Total Time14.67s (± 0.43%)14.58s (± 0.76%)-0.08s (- 0.57%)14.33s14.84s
Monaco - node (v8.9.0, x64)
Memory used362,547k (± 0.01%)362,452k (± 0.01%)-95k (- 0.03%)362,387k362,522k
Parse Time1.56s (± 0.32%)1.56s (± 0.78%)+0.01s (+ 0.39%)1.54s1.59s
Bind Time0.94s (± 0.88%)0.95s (± 0.70%)+0.01s (+ 0.64%)0.93s0.96s
Check Time5.33s (± 1.90%)5.30s (± 1.65%)-0.02s (- 0.39%)5.20s5.54s
Emit Time3.30s (± 5.24%)3.38s (± 4.02%)+0.08s (+ 2.43%)3.01s3.50s
Total Time11.12s (± 0.82%)11.19s (± 0.67%)+0.07s (+ 0.62%)11.02s11.36s
TFS - node (v8.9.0, x64)
Memory used322,838k (± 0.01%)322,771k (± 0.02%)-67k (- 0.02%)322,669k322,901k
Parse Time1.26s (± 0.49%)1.26s (± 0.49%)0.00s ( 0.00%)1.24s1.27s
Bind Time0.75s (± 0.53%)0.75s (± 0.80%)-0.00s (- 0.40%)0.73s0.76s
Check Time4.75s (± 0.56%)4.78s (± 0.45%)+0.04s (+ 0.76%)4.74s4.83s
Emit Time3.19s (± 0.63%)3.21s (± 0.49%)+0.01s (+ 0.34%)3.17s3.25s
Total Time9.95s (± 0.34%)9.99s (± 0.38%)+0.04s (+ 0.41%)9.90s10.09s
Angular - node (v8.9.0, x86)
Memory used199,344k (± 0.02%)200,156k (± 0.03%)+812k (+ 0.41%)200,027k200,294k
Parse Time2.02s (± 0.59%)2.03s (± 0.54%)+0.01s (+ 0.35%)2.01s2.06s
Bind Time1.03s (± 0.74%)1.02s (± 0.69%)-0.01s (- 0.49%)1.01s1.04s
Check Time4.89s (± 0.51%)4.90s (± 0.66%)+0.01s (+ 0.27%)4.83s4.97s
Emit Time6.08s (± 2.03%)6.17s (± 1.68%)+0.09s (+ 1.43%)6.00s6.38s
Total Time14.02s (± 0.85%)14.12s (± 0.88%)+0.11s (+ 0.75%)13.88s14.38s
Monaco - node (v8.9.0, x86)
Memory used203,498k (± 0.02%)203,438k (± 0.02%)-60k (- 0.03%)203,344k203,583k
Parse Time1.60s (± 0.82%)1.60s (± 1.09%)0.00s ( 0.00%)1.58s1.66s
Bind Time0.76s (± 1.06%)0.76s (± 0.65%)-0.00s (- 0.26%)0.75s0.77s
Check Time5.11s (± 2.57%)5.11s (± 1.46%)+0.00s (+ 0.06%)5.04s5.39s
Emit Time3.18s (± 3.06%)3.21s (± 2.30%)+0.03s (+ 0.94%)2.93s3.30s
Total Time10.65s (± 0.49%)10.68s (± 0.38%)+0.03s (+ 0.25%)10.63s10.82s
TFS - node (v8.9.0, x86)
Memory used182,139k (± 0.02%)182,159k (± 0.03%)+20k (+ 0.01%)182,064k182,269k
Parse Time1.30s (± 0.53%)1.30s (± 0.67%)+0.01s (+ 0.46%)1.28s1.32s
Bind Time0.70s (± 0.88%)0.70s (± 0.48%)+0.00s (+ 0.29%)0.70s0.71s
Check Time4.54s (± 0.81%)4.53s (± 0.50%)-0.00s (- 0.04%)4.49s4.59s
Emit Time2.96s (± 0.72%)2.98s (± 0.59%)+0.02s (+ 0.81%)2.95s3.03s
Total Time9.49s (± 0.42%)9.52s (± 0.28%)+0.03s (+ 0.31%)9.45s9.57s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-166-generic
Architecturex64
Available Memory16 GB
Available Memory5 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v10.16.3, x64)
  • node (v12.1.0, x64)
  • node (v8.9.0, x64)
  • node (v8.9.0, x86)
Scenarios
  • Angular - node (v10.16.3, x64)
  • Angular - node (v12.1.0, x64)
  • Angular - node (v8.9.0, x64)
  • Angular - node (v8.9.0, x86)
  • Monaco - node (v10.16.3, x64)
  • Monaco - node (v12.1.0, x64)
  • Monaco - node (v8.9.0, x64)
  • Monaco - node (v8.9.0, x86)
  • TFS - node (v10.16.3, x64)
  • TFS - node (v12.1.0, x64)
  • TFS - node (v8.9.0, x64)
  • TFS - node (v8.9.0, x86)
BenchmarkNameIterations
Current3609210
Baselinemaster10

andrewbranch and liuliangsir reacted with hooray emoji

@michael-land
Copy link

michael-land commentedMar 8, 2022
edited
Loading

Is there any settings could disable this??

It's so annoying when use DI framework like nest.js. I want it always import value not type.

image

image

it will raise runtime error for imports statement likes this, and hard to catch during build.

@andrewbranch
Copy link
MemberAuthor

It doesn’t do this unless you setimportsNotUsedAsValues: "error" or"preserve" in your tsconfig.

ExE-Boss reacted with thumbs up emoji

@microsoftmicrosoft locked asresolvedand limited conversation to collaboratorsOct 21, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@DanielRosenwasserDanielRosenwasserDanielRosenwasser left review comments

@sandersnsandersnsandersn approved these changes

@RyanCavanaughRyanCavanaughRyanCavanaugh approved these changes

@weswighamweswighamAwaiting requested review from weswigham

Assignees

@andrewbranchandrewbranch

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

import type cannot be used on classes? Go to definition: not working with type-only imports 'const enum' conflict with 'importsNotUsedAsValue''

7 participants

@andrewbranch@typescript-bot@DanielRosenwasser@michael-land@sandersn@weswigham@RyanCavanaugh

[8]ページ先頭

©2009-2025 Movatter.jp