Skip to content

Add type definitions for Uint8Array to/from base64 methods - #61696

Merged
Jake Bailey (jakebailey) merged 21 commits into
microsoft:mainfrom
dontwanttothink:main
Oct 3, 2025
Merged

Add type definitions for Uint8Array to/from base64 methods#61696
Jake Bailey (jakebailey) merged 21 commits into
microsoft:mainfrom
dontwanttothink:main

Conversation

@dontwanttothink

@dontwanttothinkdontwanttothink commented May 13, 2025

Copy link
Copy Markdown
Contributor

See #61695, which this pull request attempts to fix

Fixes#61695

@github-project-automationgithub-project-automationBot moved this to Not started in PR BacklogMay 13, 2025
@typescript-botTypeScript Bot (typescript-bot) added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label May 13, 2025
@typescript-bot

Copy link
Copy Markdown
Contributor

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

@typescript-botTypeScript Bot (typescript-bot) added For Backlog Bug PRs that fix a backlog bug and removed For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels May 13, 2025
@dontwanttothink

Copy link
Copy Markdown
ContributorAuthor

@microsoft-github-policy-service agree

Comment threadsrc/lib/esnext.array.d.ts Outdated
Comment threadsrc/lib/esnext.array.d.ts Outdated
Comment threadsrc/lib/esnext.array.d.ts Outdated
@dontwanttothink

Copy link
Copy Markdown
ContributorAuthor

Chrome, the last browser to not support this feature by default, has been shipping it since M138 behind a flag. It is set to be enabled in M140, which lands in the Stable release channel by the end of next month. See this and this.

@filipesmedeiros

Copy link
Copy Markdown

Officially shipped in Chrome 140

@jakebailey

Copy link
Copy Markdown
Member

This PR needs a merge from main in order to be mergable.

Comment threadsrc/lib/esnext.array.d.ts
@jakebailey

Copy link
Copy Markdown
Member

This all seems fine, but, double checking:

TypeScript Bot (@typescript-bot) test it

@typescript-bot

TypeScript Bot (typescript-bot) commented Sep 30, 2025

Copy link
Copy Markdown
Contributor

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

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

@typescript-bot

Copy link
Copy Markdown
Contributor

Hey Jake Bailey (@jakebailey), the results of running the DT tests are ready.

Everything looks the same!

You can check the log here.

@typescript-bot

Copy link
Copy Markdown
Contributor

Jake Bailey (@jakebailey)
The results of the perf run you requested are in!

Here they are:

tsc

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
Compiler-Unions - node (v18.15.0, x64)
Errors3434~~~p=1.000 n=6
Symbols62,37062,370~~~p=1.000 n=6
Types50,38650,386~~~p=1.000 n=6
Memory used195,835k (± 0.73%)194,370k (± 1.02%)-1,465k (- 0.75%)192,489k196,277kp=0.020 n=6
Parse Time1.60s (± 1.09%)1.60s (± 0.94%)~1.59s1.63sp=0.802 n=6
Bind Time0.88s (± 1.61%)0.87s (± 1.39%)~0.85s0.88sp=0.493 n=6
Check Time11.76s (± 0.52%)11.76s (± 0.41%)~11.69s11.81sp=0.936 n=6
Emit Time3.39s (± 4.17%)3.54s (± 1.31%)~3.48s3.61sp=0.173 n=6
Total Time17.64s (± 0.85%)17.77s (± 0.46%)~17.66s17.85sp=0.093 n=6
angular-1 - node (v18.15.0, x64)
Errors11~~~p=1.000 n=6
Symbols948,812948,812~~~p=1.000 n=6
Types410,869410,869~~~p=1.000 n=6
Memory used1,245,565k (± 0.01%)1,245,668k (± 0.01%)+103k (+ 0.01%)1,245,584k1,245,779kp=0.031 n=6
Parse Time8.00s (± 0.74%)7.97s (± 1.01%)~7.85s8.07sp=0.421 n=6
Bind Time2.27s (± 0.61%)2.28s (± 0.62%)~2.26s2.30sp=0.623 n=6
Check Time38.26s (± 0.35%)38.27s (± 0.40%)~38.16s38.56sp=0.872 n=6
Emit Time17.83s (± 0.21%)17.93s (± 0.63%)~17.77s18.04sp=0.228 n=6
Total Time66.36s (± 0.19%)66.45s (± 0.30%)~66.19s66.79sp=0.810 n=6
mui-docs - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,545,3012,545,301~~~p=1.000 n=6
Types903,489903,489~~~p=1.000 n=6
Memory used2,830,481k (± 0.00%)2,830,467k (± 0.01%)~2,830,251k2,830,668kp=0.936 n=6
Parse Time10.56s (± 0.54%)10.55s (± 0.41%)~10.50s10.60sp=0.871 n=6
Bind Time2.69s (± 0.66%)2.68s (± 0.72%)~2.66s2.71sp=0.416 n=6
Check Time104.95s (± 1.91%)105.57s (± 1.97%)~102.69s108.42sp=0.471 n=6
Emit Time0.38s (± 1.46%)0.38s (± 1.99%)~0.37s0.39sp=0.476 n=6
Total Time118.58s (± 1.74%)119.19s (± 1.76%)~116.34s122.09sp=0.471 n=6
self-build-src - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,237,2001,237,210+10 (+ 0.00%)~~p=0.001 n=6
Types259,829259,849+20 (+ 0.01%)~~p=0.001 n=6
Memory used3,094,586k (± 0.03%)3,095,929k (± 0.03%)+1,344k (+ 0.04%)3,094,609k3,097,264kp=0.045 n=6
Parse Time6.64s (± 0.62%)6.61s (± 0.76%)~6.55s6.68sp=0.229 n=6
Bind Time2.10s (± 1.33%)2.12s (± 1.33%)~2.08s2.16sp=0.296 n=6
Check Time42.36s (± 0.27%)42.37s (± 0.26%)~42.15s42.46sp=0.689 n=6
Emit Time3.53s (± 1.69%)3.45s (± 2.49%)~3.35s3.58sp=0.149 n=6
Total Time54.63s (± 0.27%)54.56s (± 0.36%)~54.25s54.76sp=0.471 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,237,2001,237,210+10 (+ 0.00%)~~p=0.001 n=6
Types259,829259,849+20 (+ 0.01%)~~p=0.001 n=6
Memory used3,158,826k (± 0.04%)3,159,659k (± 0.04%)~3,158,641k3,161,832kp=0.298 n=6
Parse Time6.81s (± 0.46%)6.88s (± 0.47%)+0.06s (+ 0.93%)6.82s6.91sp=0.013 n=6
Bind Time2.17s (± 1.21%)2.15s (± 1.38%)~2.10s2.19sp=0.335 n=6
Check Time42.74s (± 0.34%)42.62s (± 0.19%)~42.49s42.73sp=0.128 n=6
Emit Time3.56s (± 3.30%)3.51s (± 1.26%)~3.45s3.57sp=0.521 n=6
Total Time55.28s (± 0.46%)55.16s (± 0.24%)~54.93s55.31sp=0.298 n=6
self-compiler - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols262,515262,525+10 (+ 0.00%)~~p=0.001 n=6
Types104,009104,029+20 (+ 0.02%)~~p=0.001 n=6
Memory used440,616k (± 0.01%)440,600k (± 0.01%)~440,558k440,631kp=1.000 n=6
Parse Time3.49s (± 0.48%)3.51s (± 1.27%)~3.47s3.57sp=0.732 n=6
Bind Time1.32s (± 1.12%)1.32s (± 1.14%)~1.30s1.34sp=0.462 n=6
Check Time18.98s (± 0.48%)18.99s (± 0.30%)~18.89s19.06sp=0.748 n=6
Emit Time1.54s (± 0.54%)1.53s (± 1.73%)~1.49s1.56sp=1.000 n=6
Total Time25.32s (± 0.43%)25.36s (± 0.15%)~25.32s25.41sp=0.470 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors7272~~~p=1.000 n=6
Symbols225,367225,367~~~p=1.000 n=6
Types94,29094,290~~~p=1.000 n=6
Memory used370,040k (± 0.04%)370,036k (± 0.04%)~369,882k370,326kp=1.000 n=6
Parse Time2.83s (± 0.76%)2.82s (± 0.93%)~2.80s2.87sp=0.373 n=6
Bind Time1.62s (± 1.21%)1.60s (± 1.50%)~1.58s1.64sp=0.126 n=6
Check Time16.46s (± 0.44%)16.52s (± 0.49%)~16.43s16.63sp=0.296 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time20.91s (± 0.36%)20.94s (± 0.53%)~20.81s21.07sp=0.810 n=6
vscode - node (v18.15.0, x64)
Errors11~~~p=1.000 n=6
Symbols3,897,3473,897,347~~~p=1.000 n=6
Types1,226,0931,226,093~~~p=1.000 n=6
Memory used3,709,660k (± 0.00%)3,709,882k (± 0.00%)+223k (+ 0.01%)3,709,743k3,710,049kp=0.045 n=6
Parse Time15.14s (± 0.34%)15.29s (± 0.42%)+0.15s (+ 0.97%)15.21s15.37sp=0.013 n=6
Bind Time5.00s (± 2.76%)4.89s (± 0.48%)~4.86s4.92sp=0.064 n=6
Check Time101.69s (± 3.76%)104.08s (± 3.74%)~99.57s110.21sp=0.230 n=6
Emit Time34.20s (±11.98%)31.91s (± 9.56%)~30.31s38.09sp=0.378 n=6
Total Time156.03s (± 4.77%)156.17s (± 4.18%)~150.02s168.57sp=0.689 n=6
webpack - node (v18.15.0, x64)
Errors3838~~~p=1.000 n=6
Symbols363,098363,098~~~p=1.000 n=6
Types159,255159,255~~~p=1.000 n=6
Memory used518,013k (± 0.02%)517,959k (± 0.02%)~517,889k518,150kp=0.378 n=6
Parse Time4.45s (± 0.44%)4.46s (± 0.48%)~4.43s4.48sp=0.195 n=6
Bind Time1.92s (± 0.43%)1.91s (± 0.63%)~1.90s1.93sp=0.677 n=6
Check Time21.72s (± 0.42%)21.72s (± 0.16%)~21.68s21.76sp=1.000 n=6
Emit Time0.00s (±154.76%)0.00s~~~p=0.174 n=6
Total Time28.09s (± 0.38%)28.10s (± 0.20%)~28.01s28.15sp=0.872 n=6
xstate-main - node (v18.15.0, x64)
Errors3030~~~p=1.000 n=6
Symbols672,790672,825+35 (+ 0.01%)~~p=0.001 n=6
Types201,962201,962~~~p=1.000 n=6
Memory used574,744k (± 0.05%)574,666k (± 0.00%)~574,655k574,689kp=0.298 n=6
Parse Time3.34s (± 0.35%)3.33s (± 0.41%)~3.31s3.35sp=0.099 n=6
Bind Time1.12s (± 0.49%)1.12s~~~p=0.071 n=6
Check Time17.54s (± 0.45%)17.54s (± 0.10%)~17.52s17.57sp=0.467 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time21.99s (± 0.33%)21.99s (± 0.07%)~21.97s22.01sp=0.936 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)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

Developer Information:

Download Benchmarks

@typescript-bot

Copy link
Copy Markdown
Contributor

Jake Bailey (@jakebailey) Here are the results of running the top 400 repos with tsc comparing main and refs/pull/61696/merge:

Everything looks good!

@github-project-automationgithub-project-automationBot moved this from Not started to Needs merge in PR BacklogOct 1, 2025

@jakebaileyJake Bailey (jakebailey) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorry, I missed something here; the options bags need to have explicit | undefined annotation in addition to ? to indicate that passing an explicit undefined is okay (versus requiring it be "missing").

Comment threadsrc/lib/esnext.typedarrays.d.ts Outdated
@github-project-automationgithub-project-automationBot moved this from Needs merge to Waiting on author in PR BacklogOct 2, 2025
Comment threadsrc/lib/esnext.typedarrays.d.ts Outdated
@dontwanttothink

Copy link
Copy Markdown
ContributorAuthor

Hopefully this is better. Thank you for taking the time to review the changes.

@jakebailey

Copy link
Copy Markdown
Member

FWIW we don't usually make tests for lib.d.ts contents, exactly for the reasons you're experiencing; it's super annoying with baselines and doesn't really catch regressions. It'd probably be okay to remove them.

@dontwanttothink

dontwanttothink commented Oct 3, 2025

Copy link
Copy Markdown
ContributorAuthor

I see. Should I? Out of curiosity, what is the 'cases/conformance/esnext' directory for (in that case)?

@jakebailey

Copy link
Copy Markdown
Member

It used to be for emit, but I think I missed the added test for Atomic in #61646.

@jakebaileyJake Bailey (jakebailey) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM but need to double check that the extra file is the right solution.

@github-project-automationgithub-project-automationBot moved this from Waiting on author to Needs merge in PR BacklogOct 3, 2025
@jakebailey

Copy link
Copy Markdown
Member

Going to just take this as-is. When they are in ES2025 (or later?), these files will get deleted anyway (see also #58573).

@jakebailey
Jake Bailey (jakebailey) merged commit 3a68348 into microsoft:mainOct 3, 2025
33 checks passed
@github-project-automationgithub-project-automationBot moved this from Needs merge to Done in PR BacklogOct 3, 2025
@JonathanLennox

Copy link
Copy Markdown

Can this be backported to release-5.9?

@jakebailey

Copy link
Copy Markdown
Member

No, we do not backport features to old versions in patches.

Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

For Backlog BugPRs that fix a backlog bug

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

base64/hex methods missing from Uint8Array

7 participants

@dontwanttothink@typescript-bot@filipesmedeiros@jakebailey@JonathanLennox@Renegade334@andrewbranch