monaco-editor icon indicating copy to clipboard operation
monaco-editor copied to clipboard

[Feature Request] Update TypeScript version

Open jonathan-codaio opened this issue 2 years ago • 3 comments

Context

  • [X] This issue is not a bug report. (please use a different template for reporting a bug)
  • [X] This issue is not a duplicate of an existing issue. (please use the search to find existing issues)

Description

Hello! If I'm reading this right, I think the standalone Monaco editor ships with a hardcoded version of TypeScript, and it's a few versions out of date?

Are there any plans to bump this to the latest version? There are some newer language features we'd like to use.

https://github.com/microsoft/monaco-editor/blob/3e9f3304ce010b125ab21031a0226c034b95b114/src/language/typescript/lib/typescriptServicesMetadata.ts#L5

jonathan-codaio avatar Sep 30 '22 15:09 jonathan-codaio

We also are facing some issues because an inference improvement in 4.7+

I've opened https://github.com/microsoft/monaco-editor/pull/3350, let's see if it gets through review soon™️

SferaDev avatar Oct 04 '22 14:10 SferaDev

Facing similar issues using the @overload to allow for documenting deprecated function signatures using JSDoc.

lougreenwood avatar Sep 15 '23 06:09 lougreenwood

I have also a type problem with the older TypeScript version.

Is it possible to manually set the TypeScript version that the editor uses in the frontend or update the TypeScript version to the latest? I use monaco-editor as a playground for react components. Some of my components return the type ReactNode, which is absolutely ok up from TypeScript 5.1 onwards (see this part in an article). However, this is currently highlighted as an type error with the following text:

'MyComponent' cannot be used as a JSX component. Its return type 'ReactNode' is not a valid JSX element. Type 'string' is not assignable to type 'ReactElement<any, any>'.(2786)

Describe the solution you'd like

  • Developer can set manually the wished TypeScript version
  • monaco-editor uses always the latest TypeScript version

MatchuPitchu avatar Jan 13 '24 09:01 MatchuPitchu