Skip to content
This repository has been archived by the owner on Nov 5, 2021. It is now read-only.

Expose TypeScript version in public API #27

Closed
wants to merge 1 commit into from
Closed

Expose TypeScript version in public API #27

wants to merge 1 commit into from

Conversation

agentcooper
Copy link

As discussed in microsoft/monaco-editor#1047.

Copy link
Member

@alexdima alexdima left a comment

Choose a reason for hiding this comment

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

It makes sense to add a getVersion method, but perhaps that method can be generated automatically when we import a new TypeScript version...

This is a clean way to do it, but it has the side-effect of bringing in >1MB of code in the main thread to simply get the version...

We could write here a placeholder getVersion kind of like:

getVersion: function() { return /*TSVERSION*/"1.2.3"/*TSVERSION*/; }

We could then adapt the import script to always replace that string with the current TS version...

@@ -9,6 +9,7 @@ import * as mode from './tsMode';
import Emitter = monaco.Emitter;
import IEvent = monaco.IEvent;
import IDisposable = monaco.IDisposable;
import { getVersion } from './languageFeatures';
Copy link
Member

Choose a reason for hiding this comment

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

This ends up dragging the entire TS compiler to get loaded into the main thread.

@alexdima
Copy link
Member

Done via #31

@alexdima alexdima closed this Aug 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants