Skip to content

feat(7411): JSX namespaced attribute syntax not supported - #47356

Merged
Daniel Rosenwasser (DanielRosenwasser) merged 22 commits into
microsoft:mainfrom
a-tarasyuk:feat/7411
Apr 14, 2023
Merged

feat(7411): JSX namespaced attribute syntax not supported#47356
Daniel Rosenwasser (DanielRosenwasser) merged 22 commits into
microsoft:mainfrom
a-tarasyuk:feat/7411

Conversation

@a-tarasyuk

Copy link
Copy Markdown
Contributor

Fixes#7411
Fixes#47219

JSX Spec

JSXElementName:
- JSXIdentifier
- JSXNamespacedName
- JSXMemberExpression
JSXAttributeName:
- JSXIdentifier
- JSXNamespacedName
JSXNamespacedName:
- JSXIdentifier : JSXIdentifier

@typescript-botTypeScript Bot (typescript-bot) added the For Backlog Bug PRs that fix a backlog bug label Jan 9, 2022
@a-tarasyuk
Oleksandr Tarasiuk (a-tarasyuk) marked this pull request as ready for review January 10, 2022 20:04
@typescript-bot

Copy link
Copy Markdown
Contributor

The TypeScript team hasn't accepted the linked issue #7411. If you can get it accepted, this PR will have a better chance of being reviewed.

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.

Can we get tests with more variety of odd namespace names in both tag name and property name positions? Like Component:foo or some-thing:bar? Specifically, in the case of the first one, I'd like to know if it tries to somehow lookup a Component:foo local variable (which'd be odd) for the type of the tag. (You could technically make this with an assignment to globalThis["Component:foo"], except the lookup for the tag probably has no shot of resolving at runtime - do namespaced custom tags even work?) which I'm down with just looking up intrinsics named svg:path and so on and props named ns:prop and so on, so that part of the checking seems fine. But do we need errors when a react-ish emit mode is set? react doesn't use namespaces as far as I'm aware. Maybe this should be flagged in some way because of that? (it's flagged in babel afaik)

Additionally, ping Ryan Cavanaugh (@RyanCavanaugh) for the go/no go on this; we didn't want em for a long time, but I guess some framework (vue2?) uses the namespace syntax now, even though you have to silence an error in babel to use it.

@a-tarasyuk

Copy link
Copy Markdown
ContributorAuthor

Wesley Wigham (@weswigham) Thanks for the review.

Can we get tests with more variety of odd namespace names in both tag name and property name positions? Like Component:foo or some-thing:bar?

I'm not sure I fully understood the requested changes. Do you mean something like this? Or do you mean that I need to define global types to check name resolution?

// @jsx: preserve// @filename: a.tsx<A:foo></A:foo>;

Could you provide some examples that I can use as tests?

@weswigham

Wesley Wigham (weswigham) commented Mar 7, 2022

Copy link
Copy Markdown
Member

Do you mean something like this?

Yeah, with both capital-letter-starting and dash-containing names. (The first being an indication of function components and the later indicating non-identifier builtins). For checking intrinsics, adding namespaced dashed names to intrinsic tag names should be fine. For the capital-letter variant, I don't think there's any reasonable way to check it or even transpile it, after all React.createElement(Component:foo) is obviously invalid syntax, so it probably needs to be an error.

@a-tarasyuk

Oleksandr Tarasiuk (a-tarasyuk) commented Mar 7, 2022

Copy link
Copy Markdown
ContributorAuthor

For the capital-letter variant, I don't think there's any reasonable way to check it or even transpile it, after all React.createElement(Component:foo) is obviously invalid syntax, so it probably needs to be an error.

Shouldn't we transpile it as React.createElement("Component:foo")? Some bundles just emit it as React.createElement("Component:foo")

@weswigham

Copy link
Copy Markdown
Member

No - only intrinsic names do that, and only names starting with a lower case character are intrinsic names.

@a-tarasyuk

Oleksandr Tarasiuk (a-tarasyuk) commented Mar 7, 2022

Copy link
Copy Markdown
ContributorAuthor

Wesley Wigham (@weswigham) Oke. Should TS parse it as JSXNamespacedName and throw an error in the checker? Or at the parser stage?

@weswigham

Copy link
Copy Markdown
Member

Mmmm, checker is better for error recovery, usually.

@a-tarasyuk

Copy link
Copy Markdown
ContributorAuthor

Additionally, ping Ryan Cavanaugh (@RyanCavanaugh) for the go/no go on this; we didn't want em for a long time, but I guess some framework (vue2?) uses the namespace syntax now, even though you have to silence an error in babel to use it.

Ryan Cavanaugh (@RyanCavanaugh) What do you think about JSXNamespacedName support?

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 OK to me, but I'm going to kick it over to Ryan Cavanaugh (@RyanCavanaugh) for final approval and merging after community tests have come back, since it's up to him if this much support for namespace names is actually what we wanted (or if we just wanted better parser recovery).

@weswigham

Copy link
Copy Markdown
Member

@typescript-bot

TypeScript Bot (typescript-bot) commented Mar 20, 2023

Copy link
Copy Markdown
Contributor

Heya Wesley Wigham (@weswigham), I've started to run the diff-based top-repos suite on this PR at 23379dd. You can monitor the build here.

Update: The results are in!

@typescript-bot

TypeScript Bot (typescript-bot) commented Mar 20, 2023

Copy link
Copy Markdown
Contributor

Heya Wesley Wigham (@weswigham), I've started to run the extended test suite on this PR at 23379dd. You can monitor the build here.

@typescript-bot

TypeScript Bot (typescript-bot) commented Mar 20, 2023

Copy link
Copy Markdown
Contributor

Heya Wesley Wigham (@weswigham), I've started to run the perf test suite on this PR at 23379dd. You can monitor the build here.

Update: The results are in!

@typescript-bot

TypeScript Bot (typescript-bot) commented Mar 20, 2023

Copy link
Copy Markdown
Contributor

Heya Wesley Wigham (@weswigham), I've started to run the parallelized Definitely Typed test suite on this PR at 23379dd. You can monitor the build here.

Update: The results are in!

@typescript-bot

TypeScript Bot (typescript-bot) commented Mar 20, 2023

Copy link
Copy Markdown
Contributor

Heya Wesley Wigham (@weswigham), I've started to run the tarball bundle task on this PR at 23379dd. You can monitor the build here.

@typescript-bot

TypeScript Bot (typescript-bot) commented Mar 20, 2023

Copy link
Copy Markdown
Contributor

Hey Wesley Wigham (@weswigham), 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/150274/artifacts?artifactName=tgz&fileId=AE5479640F8658C66EE2CB5865EE83E8322E764552171451F22E07134C18045802&fileName=/typescript-5.1.0-insiders.20230320.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.1.0-pr-47356-14".;

@typescript-bot

Copy link
Copy Markdown
Contributor

Wesley Wigham (@weswigham) Here are the results of running the top-repos suite comparing main and refs/pull/47356/merge:

Everything looks good!

@typescript-bot

Copy link
Copy Markdown
Contributor

Hey Wesley Wigham (@weswigham), the results of running the DT tests are ready.
There were interesting changes:

Branch only errors:

Package: fbt
Error:

Error: /home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/fbt/fbt-tests.tsx:406:13
ERROR: 406:13 expect TypeScript@local compile error: Unused '@ts-expect-error' directive.
ERROR: 416:13 expect TypeScript@local compile error: Unused '@ts-expect-error' directive.
ERROR: 427:13 expect TypeScript@local compile error: Unused '@ts-expect-error' directive.
ERROR: 433:1 expect TypeScript@local compile error: Unused '@ts-expect-error' directive.
ERROR: 458:10 expect TypeScript@local compile error: Unused '@ts-expect-error' directive.
ERROR: 465:10 expect TypeScript@local compile error: Unused '@ts-expect-error' directive.
ERROR: 527:13 expect TypeScript@local compile error: Unused '@ts-expect-error' directive.
ERROR: 537:13 expect TypeScript@local compile error: Unused '@ts-expect-error' directive.
ERROR: 548:13 expect TypeScript@local compile error: Unused '@ts-expect-error' directive.
ERROR: 554:1 expect TypeScript@local compile error: Unused '@ts-expect-error' directive.
at testTypesVersion (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:194:15)
at async runTests (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:151:9)

You can check the log here.

@typescript-bot

Copy link
Copy Markdown
Contributor

Wesley Wigham (@weswigham)
The results of the perf run you requested are in!

Here they are:

Compiler

Comparison Report - main..47356
Metricmain47356DeltaBestWorstp-value
Angular - node (v18.10.0, x64)
Memory used361,721k (± 0.01%)361,709k (± 0.01%)~361,684k361,730kp=0.335 n=6
Parse Time3.38s (± 0.61%)3.39s (± 0.40%)~3.37s3.41sp=0.317 n=6
Bind Time1.12s (± 1.08%)1.12s (± 0.49%)~1.11s1.12sp=0.855 n=6
Check Time8.67s (± 0.38%)8.70s (± 0.34%)~8.66s8.74sp=0.169 n=6
Emit Time7.44s (± 0.69%)7.45s (± 0.77%)~7.38s7.53sp=0.687 n=6
Total Time20.60s (± 0.35%)20.66s (± 0.45%)~20.51s20.76sp=0.296 n=6
Compiler-Unions - node (v18.10.0, x64)
Memory used192,677k (± 1.53%)192,835k (± 1.54%)~190,893k196,779kp=0.173 n=6
Parse Time1.49s (± 1.82%)1.52s (± 0.99%)~1.50s1.53sp=0.099 n=6
Bind Time0.77s (± 0.00%)0.77s (± 0.82%)~0.76s0.78sp=1.000 n=6
Check Time9.44s (± 0.86%)9.49s (± 0.65%)~9.38s9.54sp=0.229 n=6
Emit Time2.73s (± 1.33%)2.73s (± 0.79%)~2.70s2.76sp=0.808 n=6
Total Time14.42s (± 0.70%)14.50s (± 0.61%)~14.37s14.60sp=0.228 n=6
Monaco - node (v18.10.0, x64)
Memory used346,260k (± 0.01%)346,316k (± 0.01%)+56k (+ 0.02%)346,253k346,372kp=0.045 n=6
Parse Time2.59s (± 0.97%)2.61s (± 0.80%)~2.59s2.64sp=0.090 n=6
Bind Time1.01s (± 1.02%)1.01s (± 0.40%)~1.01s1.02sp=0.268 n=6
Check Time7.03s (± 0.62%)7.06s (± 0.50%)~7.02s7.10sp=0.293 n=6
Emit Time4.24s (± 1.18%)4.26s (± 0.74%)~4.22s4.31sp=0.469 n=6
Total Time14.87s (± 0.69%)14.95s (± 0.51%)~14.87s15.07sp=0.126 n=6
TFS - node (v18.10.0, x64)
Memory used300,459k (± 0.01%)300,459k (± 0.01%)~300,420k300,487kp=0.936 n=6
Parse Time2.06s (± 1.09%)2.09s (± 1.19%)+0.04s (+ 1.78%)2.07s2.13sp=0.038 n=6
Bind Time1.14s (± 0.86%)1.14s (± 0.91%)~1.12s1.15sp=0.591 n=6
Check Time6.52s (± 0.50%)6.53s (± 0.31%)~6.50s6.56sp=0.686 n=6
Emit Time3.88s (± 0.45%)3.88s (± 0.72%)~3.84s3.92sp=1.000 n=6
Total Time13.61s (± 0.36%)13.64s (± 0.20%)~13.60s13.67sp=0.260 n=6
material-ui - node (v18.10.0, x64)
Memory used477,159k (± 0.01%)477,152k (± 0.01%)~477,110k477,186kp=1.000 n=6
Parse Time2.99s (± 2.16%)3.02s (± 2.63%)~2.93s3.10sp=0.513 n=6
Bind Time0.99s (± 8.57%)0.99s (± 9.07%)~0.90s1.08sp=0.935 n=6
Check Time16.93s (± 0.46%)16.93s (± 0.68%)~16.81s17.12sp=0.935 n=6
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)~0.00s0.00sp=1.000 n=6
Total Time20.90s (± 0.40%)20.93s (± 0.54%)~20.84s21.13sp=0.936 n=6
xstate - node (v18.10.0, x64)
Memory used552,968k (± 0.02%)552,908k (± 0.01%)~552,878k552,959kp=0.378 n=6
Parse Time3.77s (± 0.83%)3.81s (± 0.27%)~3.80s3.83sp=0.052 n=6
Bind Time1.70s (± 0.53%)1.71s (± 0.60%)~1.70s1.73sp=0.054 n=6
Check Time2.74s (± 0.85%)2.76s (± 0.54%)~2.75s2.78sp=0.101 n=6
Emit Time0.08s (± 4.99%)0.08s (± 4.99%)~0.08s0.09sp=1.000 n=6
Total Time8.31s (± 0.39%)8.38s (± 0.27%)+0.07s (+ 0.82%)8.36s8.42sp=0.005 n=6
Angular - node (v16.17.1, x64)
Memory used361,038k (± 0.01%)361,021k (± 0.01%)~360,984k361,051kp=0.471 n=6
Parse Time3.52s (± 0.21%)3.55s (± 0.81%)+0.04s (+ 1.04%)3.52s3.59sp=0.018 n=6
Bind Time1.18s (± 0.44%)1.18s (± 0.44%)~1.18s1.19sp=1.000 n=6
Check Time9.50s (± 0.57%)9.49s (± 0.43%)~9.44s9.55sp=0.872 n=6
Emit Time7.94s (± 0.62%)7.97s (± 1.17%)~7.86s8.13sp=0.630 n=6
Total Time22.14s (± 0.30%)22.20s (± 0.50%)~22.07s22.40sp=0.470 n=6
Compiler-Unions - node (v16.17.1, x64)
Memory used193,705k (± 0.89%)193,604k (± 0.85%)~192,533k195,800kp=0.378 n=6
Parse Time1.58s (± 1.01%)1.60s (± 1.36%)~1.56s1.62sp=0.191 n=6
Bind Time0.82s (± 1.27%)0.83s (± 0.49%)~0.82s0.83sp=0.528 n=6
Check Time10.11s (± 0.57%)10.24s (± 0.63%)+0.13s (+ 1.32%)10.18s10.32sp=0.016 n=6
Emit Time2.98s (± 0.55%)2.98s (± 0.54%)~2.96s3.00sp=0.737 n=6
Total Time15.49s (± 0.35%)15.65s (± 0.44%)+0.15s (+ 0.99%)15.57s15.73sp=0.008 n=6
Monaco - node (v16.17.1, x64)
Memory used345,561k (± 0.00%)345,541k (± 0.00%)-20k (- 0.01%)345,532k345,555kp=0.013 n=6
Parse Time2.73s (± 0.55%)2.75s (± 0.78%)~2.73s2.78sp=0.157 n=6
Bind Time1.09s (± 0.96%)1.09s (± 0.69%)~1.08s1.10sp=0.273 n=6
Check Time7.73s (± 0.54%)7.73s (± 0.61%)~7.66s7.79sp=1.000 n=6
Emit Time4.47s (± 0.28%)4.48s (± 0.92%)~4.43s4.55sp=0.870 n=6
Total Time16.02s (± 0.36%)16.05s (± 0.61%)~15.92s16.21sp=0.809 n=6
TFS - node (v16.17.1, x64)
Memory used299,817k (± 0.01%)299,794k (± 0.01%)~299,765k299,824kp=0.378 n=6
Parse Time2.18s (± 0.95%)2.17s (± 0.75%)~2.15s2.19sp=0.745 n=6
Bind Time1.24s (± 1.10%)1.24s (± 0.97%)~1.23s1.26sp=1.000 n=6
Check Time7.18s (± 0.38%)7.22s (± 0.53%)~7.16s7.25sp=0.147 n=6
Emit Time4.34s (± 0.86%)4.36s (± 0.82%)~4.31s4.41sp=0.519 n=6
Total Time14.95s (± 0.51%)14.99s (± 0.52%)~14.88s15.08sp=0.336 n=6
material-ui - node (v16.17.1, x64)
Memory used476,401k (± 0.00%)476,465k (± 0.01%)+65k (+ 0.01%)476,396k476,557kp=0.020 n=6
Parse Time3.21s (± 0.42%)3.21s (± 1.10%)~3.15s3.24sp=0.933 n=6
Bind Time0.96s (± 0.54%)0.97s (± 1.80%)+0.02s (+ 1.74%)0.96s1.00sp=0.040 n=6
Check Time18.01s (± 0.70%)18.02s (± 0.40%)~17.96s18.15sp=0.686 n=6
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)~0.00s0.00sp=1.000 n=6
Total Time22.18s (± 0.65%)22.21s (± 0.32%)~22.15s22.34sp=0.419 n=6
xstate - node (v16.17.1, x64)
Memory used550,557k (± 0.02%)550,631k (± 0.03%)~550,519k550,887kp=0.336 n=6
Parse Time3.95s (± 0.46%)3.97s (± 0.49%)~3.95s4.00sp=0.062 n=6
Bind Time1.80s (± 0.45%)1.79s (± 0.67%)~1.78s1.81sp=0.677 n=6
Check Time2.99s (± 0.82%)2.98s (± 0.81%)~2.96s3.03sp=0.869 n=6
Emit Time0.09s (± 0.00%)0.09s (± 0.00%)~0.09s0.09sp=1.000 n=6
Total Time8.83s (± 0.35%)8.84s (± 0.43%)~8.80s8.90sp=0.629 n=6
Angular - node (v14.15.1, x64)
Memory used354,900k (± 0.01%)354,926k (± 0.01%)~354,889k354,978kp=0.173 n=6
Parse Time3.59s (± 0.63%)3.64s (± 0.79%)+0.05s (+ 1.39%)3.61s3.69sp=0.012 n=6
Bind Time1.23s (± 0.84%)1.23s (± 0.42%)~1.23s1.24sp=0.928 n=6
Check Time9.81s (± 0.40%)9.84s (± 0.36%)~9.78s9.88sp=0.126 n=6
Emit Time8.38s (± 0.63%)8.43s (± 0.97%)~8.31s8.51sp=0.335 n=6
Total Time23.01s (± 0.26%)23.14s (± 0.50%)~22.96s23.29sp=0.065 n=6
Compiler-Unions - node (v14.15.1, x64)
Memory used187,774k (± 0.02%)187,649k (± 0.08%)~187,471k187,799kp=0.336 n=6
Parse Time1.59s (± 0.77%)1.61s (± 0.61%)+0.02s (+ 1.04%)1.60s1.63sp=0.027 n=6
Bind Time0.85s (± 0.61%)0.85s (± 0.60%)~0.85s0.86sp=0.069 n=6
Check Time10.29s (± 0.40%)10.29s (± 0.47%)~10.24s10.38sp=0.936 n=6
Emit Time3.13s (± 0.82%)3.32s (± 6.23%)~3.12s3.58sp=0.076 n=6
Total Time15.86s (± 0.32%)16.07s (± 1.51%)~15.83s16.37sp=0.226 n=6
Monaco - node (v14.15.1, x64)
Memory used340,548k (± 0.01%)340,539k (± 0.01%)~340,517k340,573kp=0.521 n=6
Parse Time2.83s (± 0.57%)2.85s (± 0.57%)~2.82s2.87sp=0.182 n=6
Bind Time1.10s (± 0.68%)1.10s (± 0.47%)~1.10s1.11sp=0.241 n=6
Check Time8.08s (± 0.33%)8.10s (± 0.34%)~8.08s8.15sp=0.225 n=6
Emit Time4.70s (± 1.16%)4.70s (± 0.77%)~4.64s4.74sp=1.000 n=6
Total Time16.71s (± 0.52%)16.75s (± 0.26%)~16.70s16.80sp=0.260 n=6
TFS - node (v14.15.1, x64)
Memory used294,888k (± 0.00%)294,895k (± 0.00%)~294,880k294,909kp=0.422 n=6
Parse Time2.39s (± 0.51%)2.42s (± 0.73%)+0.03s (+ 1.19%)2.39s2.43sp=0.022 n=6
Bind Time1.06s (± 0.49%)1.08s (± 1.14%)~1.06s1.09sp=0.069 n=6
Check Time7.49s (± 0.26%)7.54s (± 0.60%)~7.47s7.59sp=0.091 n=6
Emit Time4.28s (± 0.48%)4.30s (± 1.16%)~4.24s4.39sp=0.373 n=6
Total Time15.23s (± 0.23%)15.33s (± 0.61%)+0.11s (+ 0.69%)15.21s15.50sp=0.020 n=6
material-ui - node (v14.15.1, x64)
Memory used471,968k (± 0.01%)471,981k (± 0.01%)~471,943k472,022kp=0.575 n=6
Parse Time3.37s (± 0.58%)3.37s (± 0.62%)~3.33s3.39sp=0.464 n=6
Bind Time1.01s (± 0.00%)1.00s (± 0.83%)~0.99s1.01sp=0.176 n=6
Check Time18.90s (± 0.32%)18.91s (± 0.61%)~18.77s19.05sp=0.810 n=6
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)~0.00s0.00sp=1.000 n=6
Total Time23.28s (± 0.29%)23.28s (± 0.54%)~23.13s23.44sp=1.000 n=6
xstate - node (v14.15.1, x64)
Memory used539,108k (± 0.00%)539,153k (± 0.00%)+45k (+ 0.01%)539,115k539,179kp=0.013 n=6
Parse Time4.21s (± 0.46%)4.24s (± 0.35%)+0.03s (+ 0.67%)4.22s4.25sp=0.028 n=6
Bind Time1.66s (± 0.90%)1.68s (± 0.24%)~1.67s1.68sp=0.066 n=6
Check Time3.14s (± 1.04%)3.16s (± 0.47%)~3.14s3.18sp=0.126 n=6
Emit Time0.09s (± 0.00%)0.09s (± 0.00%)~0.09s0.09sp=1.000 n=6
Total Time9.10s (± 0.74%)9.18s (± 0.13%)~9.16s9.19sp=0.065 n=6
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v18.10.0, x64)
  • node (v16.17.1, x64)
  • node (v14.15.1, x64)
Scenarios
  • Angular - node (v18.10.0, x64)
  • Angular - node (v16.17.1, x64)
  • Angular - node (v14.15.1, x64)
  • Compiler-Unions - node (v18.10.0, x64)
  • Compiler-Unions - node (v16.17.1, x64)
  • Compiler-Unions - node (v14.15.1, x64)
  • Monaco - node (v18.10.0, x64)
  • Monaco - node (v16.17.1, x64)
  • Monaco - node (v14.15.1, x64)
  • TFS - node (v18.10.0, x64)
  • TFS - node (v16.17.1, x64)
  • TFS - node (v14.15.1, x64)
  • material-ui - node (v18.10.0, x64)
  • material-ui - node (v16.17.1, x64)
  • material-ui - node (v14.15.1, x64)
  • xstate - node (v18.10.0, x64)
  • xstate - node (v16.17.1, x64)
  • xstate - node (v14.15.1, x64)
BenchmarkNameIterations
Current473566
Baselinemain6

TSServer

Comparison Report - main..47356
Metricmain47356DeltaBestWorstp-value
Compiler-UnionsTSServer - node (v18.10.0, x64)
Req 1 - updateOpen2,396ms (± 0.75%)2,416ms (± 0.51%)~2,400ms2,434msp=0.078 n=6
Req 2 - geterr5,412ms (± 0.80%)5,451ms (± 0.56%)~5,415ms5,490msp=0.173 n=6
Req 3 - references337ms (± 0.56%)339ms (± 0.36%)~337ms340msp=0.251 n=6
Req 4 - navto280ms (± 0.52%)282ms (± 0.37%)~280ms283msp=0.084 n=6
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)~1,3561,356p=1.000 n=6
Req 5 - completionInfo80ms (± 3.58%)77ms (± 7.24%)~71ms84msp=0.514 n=6
CompilerTSServer - node (v18.10.0, x64)
Req 1 - updateOpen2,519ms (± 0.71%)2,541ms (± 1.84%)~2,464ms2,591msp=0.298 n=6
Req 2 - geterr4,040ms (± 0.46%)4,051ms (± 0.61%)~4,017ms4,080msp=0.471 n=6
Req 3 - references351ms (± 1.23%)349ms (± 1.68%)~341ms358msp=0.573 n=6
Req 4 - navto291ms (± 0.79%)295ms (± 1.44%)~291ms301msp=0.126 n=6
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)~1,5181,518p=1.000 n=6
Req 5 - completionInfo77ms (± 6.15%)77ms (± 8.45%)~69ms85msp=1.000 n=6
xstateTSServer - node (v18.10.0, x64)
Req 1 - updateOpen3,032ms (± 0.47%)3,046ms (± 0.51%)~3,018ms3,064msp=0.173 n=6
Req 2 - geterr1,572ms (± 0.94%)1,585ms (± 1.24%)~1,570ms1,616msp=0.376 n=6
Req 3 - references107ms (± 0.38%)107ms (± 0.98%)~105ms108msp=0.528 n=6
Req 4 - navto355ms (± 0.63%)357ms (± 0.75%)~353ms361msp=0.677 n=6
Req 5 - completionInfo count2,861 (± 0.00%)2,861 (± 0.00%)~2,8612,861p=1.000 n=6
Req 5 - completionInfo383ms (± 1.20%)382ms (± 1.63%)~372ms389msp=0.872 n=6
Compiler-UnionsTSServer - node (v16.17.1, x64)
Req 1 - updateOpen2,515ms (± 0.71%)2,516ms (± 0.86%)~2,491ms2,542msp=0.936 n=6
Req 2 - geterr5,791ms (± 0.72%)5,779ms (± 0.69%)~5,727ms5,827msp=0.809 n=6
Req 3 - references348ms (± 1.04%)348ms (± 1.13%)~342ms352msp=0.936 n=6
Req 4 - navto280ms (± 1.57%)278ms (± 0.50%)~275ms279msp=0.256 n=6
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)~1,3561,356p=1.000 n=6
Req 5 - completionInfo74ms (± 0.85%)74ms (± 1.40%)~72ms75msp=0.654 n=6
CompilerTSServer - node (v16.17.1, x64)
Req 1 - updateOpen2,686ms (± 0.63%)2,666ms (± 0.79%)-21ms (- 0.77%)2,634ms2,700msp=0.045 n=6
Req 2 - geterr4,388ms (± 0.47%)4,391ms (± 0.51%)~4,355ms4,424msp=0.810 n=6
Req 3 - references357ms (± 0.72%)357ms (± 0.54%)~354ms359msp=1.000 n=6
Req 4 - navto291ms (± 0.14%)292ms (± 0.52%)~290ms294msp=0.863 n=6
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)~1,5181,518p=1.000 n=6
Req 5 - completionInfo78ms (± 6.46%)76ms (± 2.55%)~75ms80msp=1.000 n=6
xstateTSServer - node (v16.17.1, x64)
Req 1 - updateOpen3,180ms (± 0.38%)3,180ms (± 0.41%)~3,167ms3,201msp=1.000 n=6
Req 2 - geterr1,753ms (± 1.86%)1,752ms (± 1.65%)~1,708ms1,784msp=1.000 n=6
Req 3 - references114ms (± 1.21%)114ms (± 1.74%)~111ms117msp=1.000 n=6
Req 4 - navto340ms (± 0.64%)341ms (± 0.91%)~339ms345msp=0.560 n=6
Req 5 - completionInfo count2,861 (± 0.00%)2,861 (± 0.00%)~2,8612,861p=1.000 n=6
Req 5 - completionInfo395ms (± 0.94%)394ms (± 0.44%)~393ms397msp=0.870 n=6
Compiler-UnionsTSServer - node (v14.15.1, x64)
Req 1 - updateOpen2,604ms (± 0.44%)2,618ms (± 0.28%)+14ms (+ 0.54%)2,609ms2,629msp=0.045 n=6
Req 2 - geterr6,192ms (± 0.64%)6,193ms (± 0.32%)~6,162ms6,215msp=0.810 n=6
Req 3 - references366ms (± 0.71%)366ms (± 0.88%)~362ms371msp=1.000 n=6
Req 4 - navto277ms (± 0.46%)279ms (± 0.48%)~278ms281msp=0.054 n=6
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)~1,3561,356p=1.000 n=6
Req 5 - completionInfo102ms (± 0.50%)102ms (± 0.88%)~101ms103msp=0.541 n=6
CompilerTSServer - node (v14.15.1, x64)
Req 1 - updateOpen2,820ms (± 0.46%)2,825ms (± 0.67%)~2,791ms2,848msp=0.378 n=6
Req 2 - geterr4,598ms (± 2.72%)4,543ms (± 2.14%)~4,478ms4,738msp=1.000 n=6
Req 3 - references395ms (± 8.40%)418ms (± 5.68%)~370ms430msp=0.688 n=6
Req 4 - navto293ms (± 1.31%)287ms (± 0.64%)-6ms (- 1.88%)285ms290msp=0.010 n=6
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)~1,5181,518p=1.000 n=6
Req 5 - completionInfo79ms (± 8.99%)88ms (± 6.94%)+9ms (+11.68%)76ms92msp=0.036 n=6
xstateTSServer - node (v14.15.1, x64)
Req 1 - updateOpen3,444ms (± 0.69%)3,476ms (± 0.49%)+31ms (+ 0.91%)3,448ms3,493msp=0.045 n=6
Req 2 - geterr1,870ms (± 0.40%)1,881ms (± 0.90%)~1,851ms1,894msp=0.173 n=6
Req 3 - references127ms (± 1.16%)129ms (± 1.96%)~126ms132msp=0.256 n=6
Req 4 - navto370ms (± 0.37%)373ms (± 0.77%)+3ms (+ 0.86%)370ms378msp=0.028 n=6
Req 5 - completionInfo count2,861 (± 0.00%)2,861 (± 0.00%)~2,8612,861p=1.000 n=6
Req 5 - completionInfo409ms (± 0.47%)412ms (± 1.15%)~407ms420msp=0.332 n=6
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v18.10.0, x64)
  • node (v16.17.1, x64)
  • node (v14.15.1, x64)
Scenarios
  • Compiler-UnionsTSServer - node (v18.10.0, x64)
  • Compiler-UnionsTSServer - node (v16.17.1, x64)
  • Compiler-UnionsTSServer - node (v14.15.1, x64)
  • CompilerTSServer - node (v18.10.0, x64)
  • CompilerTSServer - node (v16.17.1, x64)
  • CompilerTSServer - node (v14.15.1, x64)
  • xstateTSServer - node (v18.10.0, x64)
  • xstateTSServer - node (v16.17.1, x64)
  • xstateTSServer - node (v14.15.1, x64)
BenchmarkNameIterations
Current473566
Baselinemain6

Startup

Comparison Report - main..47356
Metricmain47356DeltaBestWorstp-value
tsc-startup - node (v16.17.1, x64)
Execution time141.35ms (± 0.16%)142.27ms (± 0.20%)+0.92ms (+ 0.65%)141.21ms145.55msp=0.000 n=600
tsserver-startup - node (v16.17.1, x64)
Execution time226.36ms (± 0.17%)228.94ms (± 0.41%)+2.58ms (+ 1.14%)226.72ms236.56msp=0.000 n=600
tsserverlibrary-startup - node (v16.17.1, x64)
Execution time228.49ms (± 0.21%)230.02ms (± 0.32%)+1.54ms (+ 0.67%)228.20ms236.66msp=0.000 n=600
typescript-startup - node (v16.17.1, x64)
Execution time209.45ms (± 0.23%)212.08ms (± 0.39%)+2.63ms (+ 1.26%)209.37ms217.26msp=0.000 n=600
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v16.17.1, x64)
Scenarios
  • tsc-startup - node (v16.17.1, x64)
  • tsserver-startup - node (v16.17.1, x64)
  • tsserverlibrary-startup - node (v16.17.1, x64)
  • typescript-startup - node (v16.17.1, x64)
BenchmarkNameIterations
Current473566
Baselinemain6

Developer Information:

Download Benchmark

Comment threadsrc/compiler/checker.ts
Comment threadsrc/compiler/diagnosticMessages.json
@eps1lon

Copy link
Copy Markdown
Contributor

It's not really clear to me whether this was targetted just at attributes or also element names. The spec does allow namespaced names as far as I can tell so TypeScript should allow it. And considering @types/fbt has been out for a while using namespaced element names, it seems to have worked in the past. But maybe how it worked in the past was not intended?

Either way, can somebody take a look at the test added in https://github.com/microsoft/TypeScript/pull/53784/files since that should resolve the element type to fbt:enum and not treat fbt and enum as different types. Bisected with the test added in #53784 and this PR is the first one to break that test.

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

Archived in project

Development

Successfully merging this pull request may close these issues.

JSX: <svg : path /> parsed incorrectly JSX namespaced attribute syntax not supported

7 participants

@a-tarasyuk@typescript-bot@weswigham@eps1lon@DanielRosenwasser@sandersn@RyanCavanaugh