Skip to content
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

Fix to use string literal type in ArrayBuffer's Symbol.toStringTag #60150

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

petamoriken
Copy link
Contributor

Fixes #60149

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Oct 6, 2024
@jakebailey
Copy link
Member

@typescript-bot test it

@typescript-bot
Copy link
Collaborator

typescript-bot commented Oct 8, 2024

Starting jobs; this comment will be updated as builds start and complete.

Command Status Results
test top400 ✅ Started 👀 Results
user test this ✅ Started 👀 Results
run dt ✅ Started 👀 Results
perf test this faster ✅ Started 👀 Results

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the user tests with tsc comparing main and refs/pull/60150/merge:

Something interesting changed - please have a look.

Details

effect

tsconfig.json

puppeteer

test/tsconfig.json

packages/testserver/tsconfig.json

packages/puppeteer-core/tsconfig.json

pyright

/mnt/ts_downloads/_/m/pyright/build.sh

  • [NEW] error TS2345: Argument of type 'Buffer' is not assignable to parameter of type 'Uint8Array<ArrayBufferLike>'.
    • /mnt/ts_downloads/_/m/pyright/pyright: ../pyright-internal/src/common/realFileSystem.ts(98,32)
    • /mnt/ts_downloads/_/m/pyright/pyright-internal: src/common/realFileSystem.ts(98,32)
    • /mnt/ts_downloads/_/m/pyright/pyright-internal: src/tests/harness/vfs/filesystem.ts(1202,28)
    • /mnt/ts_downloads/_/m/pyright/vscode-pyright: ../pyright-internal/src/common/realFileSystem.ts(98,32)
  • [NEW] error TS2345: Argument of type 'string | Buffer' is not assignable to parameter of type 'string | ArrayBufferView'.
    • /mnt/ts_downloads/_/m/pyright/pyright: ../pyright-internal/src/common/realFileSystem.ts(299,36)
    • /mnt/ts_downloads/_/m/pyright/pyright-internal: src/common/realFileSystem.ts(299,36)
    • /mnt/ts_downloads/_/m/pyright/vscode-pyright: ../pyright-internal/src/common/realFileSystem.ts(299,36)

webpack

tsconfig.types.json

tsconfig.json

xterm.js

src/tsconfig-library-base.json

  • [NEW] error TS2430: Interface 'Buffer' incorrectly extends interface 'Uint8Array<ArrayBufferLike>'.
  • [NEW] error TS2344: Type 'Buffer' does not satisfy the constraint 'ArrayBufferView'.

@typescript-bot
Copy link
Collaborator

Hey @jakebailey, the results of running the DT tests are ready.

There were interesting changes:

Changes are too big to display here, please check the log.

You can check the log here.

@typescript-bot
Copy link
Collaborator

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

Here they are:

tsc

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Compiler-Unions - node (v18.15.0, x64)
Errors 31 31 ~ ~ ~ p=1.000 n=6
Symbols 62,340 62,340 ~ ~ ~ p=1.000 n=6
Types 50,379 50,379 ~ ~ ~ p=1.000 n=6
Memory used 195,694k (± 0.76%) 195,781k (± 0.72%) ~ 192,921k 196,537k p=0.689 n=6
Parse Time 1.61s (± 1.77%) 1.61s (± 0.68%) ~ 1.59s 1.62s p=0.460 n=6
Bind Time 0.88s (± 1.38%) 0.87s (± 1.03%) ~ 0.86s 0.88s p=0.362 n=6
Check Time 11.72s (± 0.57%) 11.74s (± 0.38%) ~ 11.66s 11.78s p=0.470 n=6
Emit Time 3.43s (± 5.31%) 3.36s (± 3.23%) ~ 3.24s 3.54s p=0.630 n=6
Total Time 17.63s (± 0.91%) 17.57s (± 0.76%) ~ 17.39s 17.79s p=0.630 n=6
angular-1 - node (v18.15.0, x64)
Errors 33 52 🔻+19 (+57.58%) ~ ~ p=0.001 n=6
Symbols 947,886 948,069 +183 (+ 0.02%) ~ ~ p=0.001 n=6
Types 410,840 410,781 -59 (- 0.01%) ~ ~ p=0.001 n=6
Memory used 1,224,780k (± 0.00%) 1,224,987k (± 0.01%) +208k (+ 0.02%) 1,224,908k 1,225,111k p=0.005 n=6
Parse Time 8.03s (± 1.21%) 8.14s (± 1.15%) +0.11s (+ 1.41%) 7.97s 8.24s p=0.044 n=6
Bind Time 2.27s (± 1.10%) 2.27s (± 0.77%) ~ 2.25s 2.30s p=1.000 n=6
Check Time 37.94s (± 0.26%) 38.03s (± 0.51%) ~ 37.80s 38.29s p=0.470 n=6
Emit Time 18.22s (± 0.34%) 18.38s (± 0.34%) +0.16s (+ 0.85%) 18.33s 18.50s p=0.005 n=6
Total Time 66.47s (± 0.30%) 66.82s (± 0.38%) ~ 66.52s 67.19s p=0.078 n=6
mui-docs - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,529,678 2,529,678 ~ ~ ~ p=1.000 n=6
Types 916,161 916,161 ~ ~ ~ p=1.000 n=6
Memory used 2,341,165k (± 0.00%) 2,341,212k (± 0.00%) ~ 2,341,101k 2,341,339k p=0.298 n=6
Parse Time 11.27s (± 1.44%) 11.17s (± 0.41%) ~ 11.12s 11.24s p=0.109 n=6
Bind Time 2.61s (± 2.10%) 2.62s (± 1.01%) ~ 2.57s 2.65s p=1.000 n=6
Check Time 90.78s (± 1.17%) 90.51s (± 0.37%) ~ 89.98s 90.87s p=0.936 n=6
Emit Time 0.35s (± 3.04%) 0.35s (± 3.61%) ~ 0.33s 0.36s p=0.456 n=6
Total Time 105.02s (± 0.98%) 104.66s (± 0.34%) ~ 104.11s 105.05s p=0.810 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,258,109 1,258,107 -2 (- 0.00%) ~ ~ p=0.001 n=6
Types 266,266 266,267 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 3,146,257k (± 0.02%) 3,146,922k (± 0.04%) ~ 3,145,628k 3,148,186k p=0.471 n=6
Parse Time 8.18s (± 0.61%) 8.24s (± 1.15%) ~ 8.12s 8.36s p=0.297 n=6
Bind Time 2.87s (± 1.11%) 2.75s (± 5.51%) ~ 2.52s 2.88s p=0.109 n=6
Check Time 53.14s (± 0.10%) 53.05s (± 0.33%) ~ 52.85s 53.32s p=0.226 n=6
Emit Time 4.37s (± 2.27%) 4.29s (± 2.15%) ~ 4.18s 4.42s p=0.173 n=6
Total Time 68.57s (± 0.22%) 68.32s (± 0.20%) -0.25s (- 0.36%) 68.09s 68.45s p=0.031 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,258,109 1,258,107 -2 (- 0.00%) ~ ~ p=0.001 n=6
Types 266,266 266,267 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 3,005,080k (±11.14%) 2,498,993k (± 0.04%) 🟩-506,086k (-16.84%) 2,497,159k 2,499,861k p=0.045 n=6
Parse Time 8.50s (± 1.95%) 8.18s (± 0.31%) 🟩-0.33s (- 3.82%) 8.13s 8.20s p=0.005 n=6
Bind Time 2.63s (± 2.14%) 2.68s (± 1.66%) ~ 2.63s 2.74s p=0.149 n=6
Check Time 53.39s (± 0.39%) 53.55s (± 0.25%) ~ 53.34s 53.68s p=0.173 n=6
Emit Time 4.34s (± 3.06%) 4.39s (± 3.42%) ~ 4.18s 4.57s p=0.521 n=6
Total Time 68.87s (± 0.48%) 68.81s (± 0.27%) ~ 68.62s 69.10s p=1.000 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 261,786 261,786 ~ ~ ~ p=1.000 n=6
Types 106,508 106,508 ~ ~ ~ p=1.000 n=6
Memory used 438,785k (± 0.01%) 438,754k (± 0.02%) ~ 438,678k 438,848k p=0.471 n=6
Parse Time 3.54s (± 1.36%) 3.53s (± 0.91%) ~ 3.50s 3.58s p=0.936 n=6
Bind Time 1.32s (± 0.80%) 1.32s (± 1.04%) ~ 1.30s 1.34s p=1.000 n=6
Check Time 18.91s (± 0.54%) 18.85s (± 0.49%) ~ 18.71s 18.98s p=0.335 n=6
Emit Time 1.54s (± 0.95%) 1.53s (± 1.14%) ~ 1.51s 1.56s p=0.417 n=6
Total Time 25.30s (± 0.37%) 25.23s (± 0.39%) ~ 25.06s 25.35s p=0.261 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 68 69 +1 (+ 1.47%) ~ ~ p=0.001 n=6
Symbols 225,919 225,788 -131 (- 0.06%) ~ ~ p=0.001 n=6
Types 94,415 94,293 -122 (- 0.13%) ~ ~ p=0.001 n=6
Memory used 371,109k (± 0.01%) 370,941k (± 0.01%) -169k (- 0.05%) 370,889k 371,010k p=0.005 n=6
Parse Time 2.90s (± 0.53%) 2.88s (± 0.98%) ~ 2.85s 2.93s p=0.086 n=6
Bind Time 1.58s (± 1.76%) 1.58s (± 0.74%) ~ 1.57s 1.60s p=0.460 n=6
Check Time 16.36s (± 0.51%) 16.36s (± 0.36%) ~ 16.27s 16.42s p=0.936 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 20.84s (± 0.30%) 20.83s (± 0.39%) ~ 20.70s 20.93s p=1.000 n=6
vscode - node (v18.15.0, x64)
Errors 3 8 🔻+5 (+166.67%) ~ ~ p=0.001 n=6
Symbols 3,113,231 3,113,202 -29 (- 0.00%) ~ ~ p=0.001 n=6
Types 1,073,156 1,073,145 -11 (- 0.00%) ~ ~ p=0.001 n=6
Memory used 3,206,566k (± 0.00%) 3,206,667k (± 0.00%) ~ 3,206,501k 3,206,765k p=0.471 n=6
Parse Time 14.18s (± 3.01%) 13.98s (± 0.29%) ~ 13.92s 14.03s p=0.421 n=6
Bind Time 4.50s (± 2.83%) 4.39s (± 0.45%) ~ 4.35s 4.41s p=0.103 n=6
Check Time 84.08s (± 2.42%) 84.74s (± 1.18%) ~ 83.81s 86.69s p=0.230 n=6
Emit Time 24.68s (± 9.16%) 23.70s (± 8.76%) ~ 22.24s 26.60s p=0.093 n=6
Total Time 127.44s (± 2.20%) 126.80s (± 2.25%) ~ 124.67s 131.66s p=0.378 n=6
webpack - node (v18.15.0, x64)
Errors 0 28 🔻+28 (+ ∞%) ~ ~ p=0.001 n=6
Symbols 285,172 285,552 +380 (+ 0.13%) ~ ~ p=0.001 n=6
Types 115,780 116,512 +732 (+ 0.63%) ~ ~ p=0.001 n=6
Memory used 434,858k (± 0.01%) 435,970k (± 0.03%) +1,112k (+ 0.26%) 435,873k 436,231k p=0.005 n=6
Parse Time 3.31s (± 0.65%) 3.30s (± 0.80%) ~ 3.27s 3.33s p=1.000 n=6
Bind Time 1.46s (± 0.28%) 1.46s (± 0.28%) ~ 1.46s 1.47s p=0.218 n=6
Check Time 15.26s (± 0.45%) 15.54s (± 0.34%) +0.28s (+ 1.81%) 15.48s 15.61s p=0.005 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 20.03s (± 0.32%) 20.30s (± 0.39%) +0.28s (+ 1.38%) 20.21s 20.41s p=0.005 n=6
xstate-main - node (v18.15.0, x64)
Errors 3 3 ~ ~ ~ p=1.000 n=6
Symbols 540,222 540,222 ~ ~ ~ p=1.000 n=6
Types 181,145 181,145 ~ ~ ~ p=1.000 n=6
Memory used 483,875k (± 0.02%) 483,862k (± 0.01%) ~ 483,797k 483,910k p=0.936 n=6
Parse Time 3.36s (± 0.87%) 3.37s (± 0.99%) ~ 3.32s 3.42s p=0.568 n=6
Bind Time 1.18s (± 1.84%) 1.17s (± 0.89%) ~ 1.16s 1.19s p=0.806 n=6
Check Time 19.11s (± 0.09%) 19.09s (± 0.24%) ~ 19.03s 19.15s p=0.570 n=6
Emit Time 0.00s 0.00s (±244.70%) ~ 0.00s 0.01s p=0.405 n=6
Total Time 23.65s (± 0.18%) 23.64s (± 0.32%) ~ 23.52s 23.73s p=0.747 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Compiler-Unions - node (v18.15.0, x64)
  • angular-1 - node (v18.15.0, x64)
  • mui-docs - node (v18.15.0, x64)
  • self-build-src - node (v18.15.0, x64)
  • self-build-src-public-api - node (v18.15.0, x64)
  • self-compiler - node (v18.15.0, x64)
  • ts-pre-modules - node (v18.15.0, x64)
  • vscode - node (v18.15.0, x64)
  • webpack - node (v18.15.0, x64)
  • xstate-main - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the top 400 repos with tsc comparing main and refs/pull/60150/merge:

Something interesting changed - please have a look.

Details

actualbudget/actual

2 of 5 projects failed to build with the old tsc and were ignored

packages/loot-core/tsconfig.api.json

angular/angular-cli

8 of 24 projects failed to build with the old tsc and were ignored

tests/legacy-cli/tsconfig.json

apollographql/apollo-client

2 of 12 projects failed to build with the old tsc and were ignored

config/tsconfig.json

  • error TS2345: Argument of type 'Buffer' is not assignable to parameter of type 'InputType'.

blakeblackshear/frigate

web/tsconfig.json

Chocobozzz/PeerTube

6 of 12 projects failed to build with the old tsc and were ignored

packages/types-generator/tsconfig.types.json

packages/types-generator/tsconfig.json

packages/tests/tsconfig.json

continuedev/continue

6 of 9 projects failed to build with the old tsc and were ignored

extensions/vscode/tsconfig.json

@typescript-bot
Copy link
Collaborator

@jakebailey Here are some more interesting changes from running the top 400 repos suite

Details

Eugeny/tabby

11 of 29 projects failed to build with the old tsc and were ignored

tabby-web-demo/tsconfig.json

tabby-web/tsconfig.json

tabby-terminal/tsconfig.json

tabby-ssh/tsconfig.json

tabby-settings/tsconfig.json

tabby-plugin-manager/tsconfig.json

tabby-local/tsconfig.json

tabby-linkifier/tsconfig.json

tabby-electron/tsconfig.json

tabby-core/tsconfig.typings.json

tabby-core/tsconfig.json

tabby-community-color-schemes/tsconfig.json

app/tsconfig.main.json

app/tsconfig.json

FlowiseAI/Flowise

1 of 3 projects failed to build with the old tsc and were ignored

packages/components/tsconfig.json

FuelLabs/fuels-ts

34 of 58 projects failed to build with the old tsc and were ignored

packages/crypto/tsconfig.dts.json

packages/abi-typegen/tsconfig.json

packages/abi-typegen/tsconfig.dts.json

gitpod-io/gitpod

12 of 20 projects failed to build with the old tsc and were ignored

components/gitpod-db/tsconfig.json

hexojs/hexo

tsconfig.json

  • error TS2345: Argument of type 'Buffer' is not assignable to parameter of type 'string | ArrayBufferView | Iterable<string | ArrayBufferView> | AsyncIterable<string | ArrayBufferView> | Stream'.

homebridge/homebridge

tsconfig.json

  • error TS2345: Argument of type 'string | Buffer | TypedArray | DataView<ArrayBufferLike>' is not assignable to parameter of type 'BinaryLike'.

honojs/hono

7 of 8 projects failed to build with the old tsc and were ignored

tsconfig.json

@typescript-bot
Copy link
Collaborator

@jakebailey Here are some more interesting changes from running the top 400 repos suite

Details

jupyterlab/jupyterlab

46 of 59 projects failed to build with the old tsc and were ignored

packages/ui-components/examples/simple-windowed-list/tsconfig.json

@typescript-bot
Copy link
Collaborator

@jakebailey Here are some more interesting changes from running the top 400 repos suite

Details

lerna/lerna

1 of 42 projects failed to build with the old tsc and were ignored

tools/scripts/tsconfig.scripts.json

tools/scripts/tsconfig.e2e.json

microsoft/vscode

5 of 53 projects failed to build with the old tsc and were ignored

src/tsconfig.tsec.json

src/tsconfig.monaco.json

extensions/vscode-test-resolver/tsconfig.json

extensions/vscode-api-tests/tsconfig.json

extensions/typescript-language-features/tsconfig.json

extensions/tunnel-forwarding/tsconfig.json

extensions/ipynb/tsconfig.json

extensions/html-language-features/client/tsconfig.json

extensions/git/tsconfig.json

extensions/emmet/tsconfig.json

extensions/debug-auto-launch/tsconfig.json

extensions/css-language-features/client/tsconfig.json

build/tsconfig.build.json

neoclide/coc.nvim

tsconfig.json

nexe/nexe

1 of 2 projects failed to build with the old tsc and were ignored

tsconfig.json

omnivore-app/omnivore

5 of 22 projects failed to build with the old tsc and were ignored

packages/rss-handler/tsconfig.json

openai-translator/openai-translator

tsconfig.json

peers/peerjs

tsconfig.json

puppeteer/puppeteer

7 of 14 projects failed to build with the old tsc and were ignored

packages/testserver/tsconfig.json

redis/node-redis

6 of 8 projects failed to build with the old tsc and were ignored

packages/client/tsconfig.json

socketio/socket.io

12 of 30 projects failed to build with the old tsc and were ignored

packages/engine.io/tsconfig.json

subquery/subql

4 of 6 projects failed to build with the old tsc and were ignored

packages/query/tsconfig.json

Tonejs/Tone.js

tsconfig.json

uuidjs/uuid

tsconfig.json

tsconfig.cjs.json

video-dev/hls.js

tsconfig.json

VSCodeVim/Vim

tsconfig.json

@petamoriken
Copy link
Contributor Author

I haven't figured it out yet, but maybe we need to update the Buffer type in @types/node.

@petamoriken
Copy link
Contributor Author

petamoriken commented Oct 10, 2024

Comment on lines -635 to -640
/**
* Read from a file.
*
* NOTE: do not rename this method as it is intended to align with the same named export of the "fs" module.
*/
public readFileSync(path: string, encoding?: null): Buffer; // eslint-disable-line no-restricted-syntax
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I deleted this type because CI failed, but it might be better to revert it.

@petamoriken
Copy link
Contributor Author

@rbuckton IMO, this PR should be included in TypeScript 5.7, but is it possible?

@rbuckton
Copy link
Member

No, this will need to wait for 5.8

@typescript-bot typescript-bot added For Milestone Bug PRs that fix a bug with a specific milestone and removed For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Milestone Bug PRs that fix a bug with a specific milestone
Projects
Status: Not started
Development

Successfully merging this pull request may close these issues.

Use string literal type in ArrayBuffer's Symbol.toStringTag
4 participants