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

Deprecate module keyword for namespace declarations #58007

Merged
merged 8 commits into from
Jul 24, 2024

Conversation

Zzzen
Copy link
Contributor

@Zzzen Zzzen commented Mar 30, 2024

Fixes #57913

@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Mar 30, 2024
@jakebailey
Copy link
Member

@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
Copy link
Collaborator

typescript-bot commented Apr 2, 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
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
Angular - node (v18.15.0, x64)
Memory used 295,739k (± 0.01%) 295,725k (± 0.01%) ~ 295,705k 295,759k p=0.378 n=6
Parse Time 2.64s (± 0.59%) 2.65s (± 0.57%) ~ 2.63s 2.67s p=0.139 n=6
Bind Time 0.84s (± 1.17%) 0.83s (± 0.98%) ~ 0.83s 0.85s p=0.144 n=6
Check Time 8.23s (± 0.24%) 8.24s (± 0.32%) ~ 8.21s 8.28s p=0.289 n=6
Emit Time 7.04s (± 0.21%) 7.05s (± 0.39%) ~ 7.02s 7.09s p=0.466 n=6
Total Time 18.75s (± 0.21%) 18.79s (± 0.26%) ~ 18.71s 18.84s p=0.228 n=6
Compiler-Unions - node (v18.15.0, x64)
Memory used 192,254k (± 0.11%) 192,739k (± 0.79%) ~ 192,106k 195,838k p=0.689 n=6
Parse Time 1.36s (± 0.86%) 1.36s (± 0.86%) ~ 1.35s 1.38s p=0.868 n=6
Bind Time 0.73s (± 0.56%) 0.72s (± 0.75%) ~ 0.72s 0.73s p=0.282 n=6
Check Time 9.52s (± 0.22%) 9.56s (± 0.66%) ~ 9.49s 9.65s p=0.332 n=6
Emit Time 2.63s (± 0.52%) 2.63s (± 0.65%) ~ 2.61s 2.66s p=0.622 n=6
Total Time 14.23s (± 0.14%) 14.28s (± 0.46%) ~ 14.20s 14.37s p=0.295 n=6
Monaco - node (v18.15.0, x64)
Memory used 347,404k (± 0.00%) 347,440k (± 0.00%) +36k (+ 0.01%) 347,427k 347,467k p=0.005 n=6
Parse Time 2.48s (± 0.66%) 2.49s (± 0.49%) ~ 2.47s 2.50s p=0.934 n=6
Bind Time 0.93s (± 0.00%) 0.93s (± 0.00%) ~ 0.93s 0.93s p=1.000 n=6
Check Time 6.99s (± 0.48%) 6.99s (± 0.42%) ~ 6.96s 7.03s p=1.000 n=6
Emit Time 4.07s (± 0.40%) 4.07s (± 0.21%) ~ 4.05s 4.07s p=1.000 n=6
Total Time 14.47s (± 0.22%) 14.47s (± 0.17%) ~ 14.43s 14.50s p=1.000 n=6
TFS - node (v18.15.0, x64)
Memory used 302,806k (± 0.01%) 302,833k (± 0.01%) ~ 302,807k 302,854k p=0.092 n=6
Parse Time 2.43s (± 1.24%) 2.41s (± 1.06%) ~ 2.39s 2.45s p=0.221 n=6
Bind Time 1.20s (± 0.68%) 1.20s (± 1.29%) ~ 1.19s 1.23s p=0.787 n=6
Check Time 7.53s (± 0.36%) 7.56s (± 0.56%) ~ 7.50s 7.62s p=0.195 n=6
Emit Time 4.28s (± 0.39%) 4.27s (± 0.60%) ~ 4.22s 4.29s p=0.682 n=6
Total Time 15.44s (± 0.35%) 15.44s (± 0.51%) ~ 15.35s 15.54s p=0.936 n=6
material-ui - node (v18.15.0, x64)
Memory used 510,029k (± 0.00%) 510,067k (± 0.00%) +38k (+ 0.01%) 510,047k 510,094k p=0.020 n=6
Parse Time 2.66s (± 0.31%) 2.67s (± 0.64%) ~ 2.64s 2.69s p=0.345 n=6
Bind Time 0.98s (± 0.64%) 0.98s (± 0.85%) ~ 0.97s 0.99s p=0.226 n=6
Check Time 17.29s (± 0.59%) 17.27s (± 0.26%) ~ 17.20s 17.33s p=1.000 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 20.94s (± 0.53%) 20.92s (± 0.23%) ~ 20.86s 21.00s p=1.000 n=6
mui-docs - node (v18.15.0, x64)
Memory used 1,745,002k (± 0.00%) 1,744,989k (± 0.00%) ~ 1,744,953k 1,745,032k p=0.575 n=6
Parse Time 7.79s (± 0.52%) 7.81s (± 0.61%) ~ 7.76s 7.89s p=0.520 n=6
Bind Time 2.81s (± 1.11%) 2.82s (± 0.29%) ~ 2.81s 2.83s p=0.796 n=6
Check Time 66.86s (± 0.27%) 66.98s (± 0.37%) ~ 66.72s 67.40s p=0.630 n=6
Emit Time 0.16s (± 3.29%) 0.16s (± 0.00%) ~ 0.16s 0.16s p=0.174 n=6
Total Time 77.62s (± 0.22%) 77.77s (± 0.34%) ~ 77.47s 78.18s p=0.470 n=6
self-build-src - node (v18.15.0, x64)
Memory used 2,400,665k (± 0.05%) 2,400,936k (± 0.04%) ~ 2,399,299k 2,402,024k p=0.575 n=6
Parse Time 7.47s (± 1.34%) 7.49s (± 1.32%) ~ 7.30s 7.59s p=0.688 n=6
Bind Time 2.77s (± 1.21%) 2.76s (± 0.81%) ~ 2.74s 2.79s p=0.627 n=6
Check Time 49.39s (± 0.31%) 49.37s (± 0.45%) ~ 49.07s 49.71s p=0.936 n=6
Emit Time 3.99s (± 4.33%) 3.95s (± 1.19%) ~ 3.89s 4.01s p=1.000 n=6
Total Time 63.65s (± 0.36%) 63.57s (± 0.32%) ~ 63.35s 63.91s p=0.575 n=6
self-compiler - node (v18.15.0, x64)
Memory used 416,147k (± 0.01%) 416,320k (± 0.01%) +172k (+ 0.04%) 416,272k 416,387k p=0.005 n=6
Parse Time 3.32s (± 1.09%) 3.33s (± 0.62%) ~ 3.30s 3.36s p=0.871 n=6
Bind Time 1.28s (± 1.18%) 1.30s (± 0.31%) ~ 1.29s 1.30s p=0.073 n=6
Check Time 18.17s (± 0.25%) 18.13s (± 0.50%) ~ 18.00s 18.21s p=0.686 n=6
Emit Time 1.34s (± 2.13%) 1.33s (± 1.50%) ~ 1.32s 1.37s p=0.742 n=6
Total Time 24.13s (± 0.27%) 24.09s (± 0.27%) ~ 24.01s 24.16s p=0.521 n=6
vscode - node (v18.15.0, x64)
Memory used 2,899,569k (± 0.00%) 2,899,546k (± 0.01%) ~ 2,899,316k 2,899,670k p=0.689 n=6
Parse Time 12.90s (± 0.18%) 12.91s (± 0.42%) ~ 12.86s 13.00s p=0.936 n=6
Bind Time 4.14s (± 0.18%) 4.15s (± 0.28%) ~ 4.13s 4.16s p=0.279 n=6
Check Time 71.92s (± 0.27%) 72.19s (± 0.54%) ~ 71.74s 72.70s p=0.298 n=6
Emit Time 19.39s (± 0.56%) 20.79s (± 9.99%) ~ 19.34s 23.51s p=0.093 n=6
Total Time 108.35s (± 0.18%) 110.04s (± 2.06%) ~ 108.23s 113.07s p=0.172 n=6
webpack - node (v18.15.0, x64)
Memory used 408,922k (± 0.01%) 408,911k (± 0.02%) ~ 408,819k 409,013k p=0.810 n=6
Parse Time 4.77s (± 0.80%) 4.82s (± 0.95%) ~ 4.77s 4.90s p=0.147 n=6
Bind Time 2.06s (± 0.20%) 2.05s (± 0.84%) ~ 2.02s 2.07s p=0.103 n=6
Check Time 20.83s (± 0.52%) 20.78s (± 0.18%) ~ 20.74s 20.84s p=0.199 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 27.67s (± 0.36%) 27.65s (± 0.26%) ~ 27.56s 27.76s p=0.687 n=6
xstate - node (v18.15.0, x64)
Memory used 513,515k (± 0.01%) 513,490k (± 0.02%) ~ 513,427k 513,717k p=0.128 n=6
Parse Time 3.99s (± 0.63%) 3.96s (± 0.52%) ~ 3.94s 3.99s p=0.142 n=6
Bind Time 1.88s (± 0.82%) 1.89s (± 1.04%) ~ 1.87s 1.91s p=0.558 n=6
Check Time 3.44s (± 0.83%) 3.44s (± 0.34%) ~ 3.42s 3.45s p=0.629 n=6
Emit Time 0.08s (± 6.44%) 0.08s (± 6.19%) ~ 0.08s 0.09s p=0.855 n=6
Total Time 9.40s (± 0.42%) 9.38s (± 0.31%) ~ 9.33s 9.42s p=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)
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 user tests comparing main and refs/pull/58007/merge:

Everything looks good!

@typescript-bot
Copy link
Collaborator

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

Everything looks the same!

You can check the log here.

@typescript-bot
Copy link
Collaborator

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

Everything looks good!

@jakebailey
Copy link
Member

Seems like it works? #58040 (comment)

Copy link
Member

@jakebailey jakebailey left a comment

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 @DanielRosenwasser / @RyanCavanaugh for final wording.

@DanielRosenwasser
Copy link
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?

@@ -46365,6 +46366,14 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {

if (isIdentifier(node.name)) {
checkCollisionsForDeclarationName(node, node.name);
if (!(node.flags & (NodeFlags.Namespace | NodeFlags.GlobalAugmentation))) {
Copy link
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
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
Contributor Author

Zzzen commented May 31, 2024

Tests added.

@DanielRosenwasser
Copy link
Member

@typescript-bot pack this

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 31, 2024

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

Command Status Results
pack this ✅ Started ✅ Results

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 31, 2024

Hey @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/[email protected]".;

@typescript-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
@DanielRosenwasser DanielRosenwasser merged commit ab7b624 into microsoft:main Jul 24, 2024
32 checks passed
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: Done
Development

Successfully merging this pull request may close these issues.

Mark ~module~ namespace as deprecated via LS strikethrough
5 participants