Skip to content

Deprecate module keyword for namespace declarations - #58007

Merged
Daniel Rosenwasser (DanielRosenwasser) merged 8 commits into
microsoft:mainfrom
Zzzen:deprecated-module-declaration
Jul 24, 2024
Merged

Deprecate module keyword for namespace declarations#58007
Daniel Rosenwasser (DanielRosenwasser) merged 8 commits into
microsoft:mainfrom
Zzzen:deprecated-module-declaration

Conversation

@Zzzen

Copy link
Copy Markdown
Contributor

Fixes#57913

@typescript-botTypeScript Bot (typescript-bot) added the For Backlog Bug PRs that fix a backlog bug label Mar 30, 2024
@jakebailey

Copy link
Copy Markdown
Member

TypeScript Bot (@typescript-bot) test it

I'm going to make a second PR that uses this to issue a full error so we can gauge how bad things are at the moment (and verify that this is working).

@typescript-bot

TypeScript Bot (typescript-bot) commented Apr 2, 2024

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

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

Here they are:

tsc

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
Angular - node (v18.15.0, x64)
Memory used295,739k (± 0.01%)295,725k (± 0.01%)~295,705k295,759kp=0.378 n=6
Parse Time2.64s (± 0.59%)2.65s (± 0.57%)~2.63s2.67sp=0.139 n=6
Bind Time0.84s (± 1.17%)0.83s (± 0.98%)~0.83s0.85sp=0.144 n=6
Check Time8.23s (± 0.24%)8.24s (± 0.32%)~8.21s8.28sp=0.289 n=6
Emit Time7.04s (± 0.21%)7.05s (± 0.39%)~7.02s7.09sp=0.466 n=6
Total Time18.75s (± 0.21%)18.79s (± 0.26%)~18.71s18.84sp=0.228 n=6
Compiler-Unions - node (v18.15.0, x64)
Memory used192,254k (± 0.11%)192,739k (± 0.79%)~192,106k195,838kp=0.689 n=6
Parse Time1.36s (± 0.86%)1.36s (± 0.86%)~1.35s1.38sp=0.868 n=6
Bind Time0.73s (± 0.56%)0.72s (± 0.75%)~0.72s0.73sp=0.282 n=6
Check Time9.52s (± 0.22%)9.56s (± 0.66%)~9.49s9.65sp=0.332 n=6
Emit Time2.63s (± 0.52%)2.63s (± 0.65%)~2.61s2.66sp=0.622 n=6
Total Time14.23s (± 0.14%)14.28s (± 0.46%)~14.20s14.37sp=0.295 n=6
Monaco - node (v18.15.0, x64)
Memory used347,404k (± 0.00%)347,440k (± 0.00%)+36k (+ 0.01%)347,427k347,467kp=0.005 n=6
Parse Time2.48s (± 0.66%)2.49s (± 0.49%)~2.47s2.50sp=0.934 n=6
Bind Time0.93s (± 0.00%)0.93s (± 0.00%)~0.93s0.93sp=1.000 n=6
Check Time6.99s (± 0.48%)6.99s (± 0.42%)~6.96s7.03sp=1.000 n=6
Emit Time4.07s (± 0.40%)4.07s (± 0.21%)~4.05s4.07sp=1.000 n=6
Total Time14.47s (± 0.22%)14.47s (± 0.17%)~14.43s14.50sp=1.000 n=6
TFS - node (v18.15.0, x64)
Memory used302,806k (± 0.01%)302,833k (± 0.01%)~302,807k302,854kp=0.092 n=6
Parse Time2.43s (± 1.24%)2.41s (± 1.06%)~2.39s2.45sp=0.221 n=6
Bind Time1.20s (± 0.68%)1.20s (± 1.29%)~1.19s1.23sp=0.787 n=6
Check Time7.53s (± 0.36%)7.56s (± 0.56%)~7.50s7.62sp=0.195 n=6
Emit Time4.28s (± 0.39%)4.27s (± 0.60%)~4.22s4.29sp=0.682 n=6
Total Time15.44s (± 0.35%)15.44s (± 0.51%)~15.35s15.54sp=0.936 n=6
material-ui - node (v18.15.0, x64)
Memory used510,029k (± 0.00%)510,067k (± 0.00%)+38k (+ 0.01%)510,047k510,094kp=0.020 n=6
Parse Time2.66s (± 0.31%)2.67s (± 0.64%)~2.64s2.69sp=0.345 n=6
Bind Time0.98s (± 0.64%)0.98s (± 0.85%)~0.97s0.99sp=0.226 n=6
Check Time17.29s (± 0.59%)17.27s (± 0.26%)~17.20s17.33sp=1.000 n=6
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)~0.00s0.00sp=1.000 n=6
Total Time20.94s (± 0.53%)20.92s (± 0.23%)~20.86s21.00sp=1.000 n=6
mui-docs - node (v18.15.0, x64)
Memory used1,745,002k (± 0.00%)1,744,989k (± 0.00%)~1,744,953k1,745,032kp=0.575 n=6
Parse Time7.79s (± 0.52%)7.81s (± 0.61%)~7.76s7.89sp=0.520 n=6
Bind Time2.81s (± 1.11%)2.82s (± 0.29%)~2.81s2.83sp=0.796 n=6
Check Time66.86s (± 0.27%)66.98s (± 0.37%)~66.72s67.40sp=0.630 n=6
Emit Time0.16s (± 3.29%)0.16s (± 0.00%)~0.16s0.16sp=0.174 n=6
Total Time77.62s (± 0.22%)77.77s (± 0.34%)~77.47s78.18sp=0.470 n=6
self-build-src - node (v18.15.0, x64)
Memory used2,400,665k (± 0.05%)2,400,936k (± 0.04%)~2,399,299k2,402,024kp=0.575 n=6
Parse Time7.47s (± 1.34%)7.49s (± 1.32%)~7.30s7.59sp=0.688 n=6
Bind Time2.77s (± 1.21%)2.76s (± 0.81%)~2.74s2.79sp=0.627 n=6
Check Time49.39s (± 0.31%)49.37s (± 0.45%)~49.07s49.71sp=0.936 n=6
Emit Time3.99s (± 4.33%)3.95s (± 1.19%)~3.89s4.01sp=1.000 n=6
Total Time63.65s (± 0.36%)63.57s (± 0.32%)~63.35s63.91sp=0.575 n=6
self-compiler - node (v18.15.0, x64)
Memory used416,147k (± 0.01%)416,320k (± 0.01%)+172k (+ 0.04%)416,272k416,387kp=0.005 n=6
Parse Time3.32s (± 1.09%)3.33s (± 0.62%)~3.30s3.36sp=0.871 n=6
Bind Time1.28s (± 1.18%)1.30s (± 0.31%)~1.29s1.30sp=0.073 n=6
Check Time18.17s (± 0.25%)18.13s (± 0.50%)~18.00s18.21sp=0.686 n=6
Emit Time1.34s (± 2.13%)1.33s (± 1.50%)~1.32s1.37sp=0.742 n=6
Total Time24.13s (± 0.27%)24.09s (± 0.27%)~24.01s24.16sp=0.521 n=6
vscode - node (v18.15.0, x64)
Memory used2,899,569k (± 0.00%)2,899,546k (± 0.01%)~2,899,316k2,899,670kp=0.689 n=6
Parse Time12.90s (± 0.18%)12.91s (± 0.42%)~12.86s13.00sp=0.936 n=6
Bind Time4.14s (± 0.18%)4.15s (± 0.28%)~4.13s4.16sp=0.279 n=6
Check Time71.92s (± 0.27%)72.19s (± 0.54%)~71.74s72.70sp=0.298 n=6
Emit Time19.39s (± 0.56%)20.79s (± 9.99%)~19.34s23.51sp=0.093 n=6
Total Time108.35s (± 0.18%)110.04s (± 2.06%)~108.23s113.07sp=0.172 n=6
webpack - node (v18.15.0, x64)
Memory used408,922k (± 0.01%)408,911k (± 0.02%)~408,819k409,013kp=0.810 n=6
Parse Time4.77s (± 0.80%)4.82s (± 0.95%)~4.77s4.90sp=0.147 n=6
Bind Time2.06s (± 0.20%)2.05s (± 0.84%)~2.02s2.07sp=0.103 n=6
Check Time20.83s (± 0.52%)20.78s (± 0.18%)~20.74s20.84sp=0.199 n=6
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)~0.00s0.00sp=1.000 n=6
Total Time27.67s (± 0.36%)27.65s (± 0.26%)~27.56s27.76sp=0.687 n=6
xstate - node (v18.15.0, x64)
Memory used513,515k (± 0.01%)513,490k (± 0.02%)~513,427k513,717kp=0.128 n=6
Parse Time3.99s (± 0.63%)3.96s (± 0.52%)~3.94s3.99sp=0.142 n=6
Bind Time1.88s (± 0.82%)1.89s (± 1.04%)~1.87s1.91sp=0.558 n=6
Check Time3.44s (± 0.83%)3.44s (± 0.34%)~3.42s3.45sp=0.629 n=6
Emit Time0.08s (± 6.44%)0.08s (± 6.19%)~0.08s0.09sp=0.855 n=6
Total Time9.40s (± 0.42%)9.38s (± 0.31%)~9.33s9.42sp=0.296 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Angular - node (v18.15.0, x64)
  • Compiler-Unions - node (v18.15.0, x64)
  • Monaco - node (v18.15.0, x64)
  • TFS - node (v18.15.0, x64)
  • material-ui - node (v18.15.0, x64)
  • mui-docs - node (v18.15.0, x64)
  • self-build-src - node (v18.15.0, x64)
  • self-compiler - node (v18.15.0, x64)
  • vscode - node (v18.15.0, x64)
  • webpack - node (v18.15.0, x64)
  • xstate - 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 user tests comparing main and refs/pull/58007/merge:

Everything looks good!

@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) Here are the results of running the top 400 repos comparing main and refs/pull/58007/merge:

Everything looks good!

@jakebailey

Copy link
Copy Markdown
Member

Seems like it works? #58040 (comment)

@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.

This looks good to me, but deferring to Daniel Rosenwasser (@DanielRosenwasser) / Ryan Cavanaugh (@RyanCavanaugh) for final wording.

@DanielRosenwasser

Copy link
Copy Markdown
Member

One thing I'd like to check is whether module gets a strikeout when a user has just written declare module with no identifier or string following.

Can you ensure that it doesn't, and provide a test as well?


if (isIdentifier(node.name)) {
checkCollisionsForDeclarationName(node, node.name);
if (!(node.flags & (NodeFlags.Namespace | NodeFlags.GlobalAugmentation))) {

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.

This will only report errors in editor and there is no way to report these errors on command line. I think we need to handle "deprecation" version here instead to issue error

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.

The intent is to not report the in tsc yet, per #57913

@Zzzen

Copy link
Copy Markdown
ContributorAuthor

Tests added.

@DanielRosenwasser

Copy link
Copy Markdown
Member

TypeScript Bot (@typescript-bot) pack this

@typescript-bot

TypeScript Bot (typescript-bot) commented May 31, 2024

Copy link
Copy Markdown
Contributor

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

CommandStatusResults
pack this✅ Started✅ Results

@typescript-bot

TypeScript Bot (typescript-bot) commented May 31, 2024

Copy link
Copy Markdown
Contributor

Hey Daniel Rosenwasser (@DanielRosenwasser), I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
"devDependencies": {
"typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/162023/artifacts?artifactName=tgz&fileId=4C696B8DD8AD7BE042E1BFD6B2862915D9A6673F879C79EDF1344C0E12B4D0E102&fileName=/typescript-5.5.0-insiders.20240531.tgz"
}
}

and then running npm install.


There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/pr-build@5.5.0-pr-58007-11".;

@typescript-botTypeScript Bot (typescript-bot) added For Milestone Bug PRs that fix a bug with a specific milestone and removed For Backlog Bug PRs that fix a backlog bug labels Jul 23, 2024
@microsoftMicrosoft (microsoft) locked as resolved and limited conversation to collaborators Oct 16, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

For Milestone BugPRs that fix a bug with a specific milestone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mark ~module~ namespace as deprecated via LS strikethrough

6 participants

@Zzzen@jakebailey@typescript-bot@DanielRosenwasser@sheetalkamat@sandersn