Largely found with a sourcegraph search. Maybe there are more?
| API | Why? | Workaround? |
|---|---|---|
ts.createLanguageServiceSourceFile |
Providing a d.ts file for css | Proxy the LS host (what vue does)? |
ts.updateLanguageServiceSourceFile |
Providing a d.ts file for css | Proxy the LS host (what vue does)? |
Being tested weekend of 5.0 RC, potentially.
| API | Why? | Workaround? |
|---|---|---|
ts.resolveModuleName |
"If vue file and resolutionMode == ESNext, replace with CommonJS" to silence Node16/NodeNext extensions | Use moduleResolution=bundler, or if really needed, providie resolveModuleNameLiterals |
ts.__VLS_pitched_resolveModuleNames |
Marker to not double patch | Not needed if they don't patch. Otherwise, store elsewhere? |
Should this plugin instead provide .d.vue.ts files?
| API | Why? | Workaround? |
|---|---|---|
ts.createProgram |
Replaces program.emit with a wrapper which adds customTransformers |
? |
Reads TypeScript's source, loads via new Module, then patches it, so other
imports are not patched.
| API | Why? | Workaround? |
|---|---|---|
ts.createProgram |
Replaces program.emit with a wrapper which adds customTransformers |
? |
ts.* |
Adds extra top-level properties for caching, markers | Put state somewhere else. |
Same as ttypescript, except that it patches node_modules; "seamless"
experience if you are using other tools with TypeScript as they also get patched
version.
| API | Why? | Workaround? |
|---|---|---|
ts.sys |
No sys in the browser by default; sets them to a shim | ts.setSys (internal) |
ts.sys.* |
New FS implementation | No need, or ts.setSys (internal) |
ts.resolveModuleName |
To add new module resolution. | ? |
There are some other functions overriden I've missed, though.
| API | Why? | Workaround? |
|---|---|---|
ts.readJson |
Caching | No need; we cache now, can be removed. |
ts.emitFiles |
Proxy, then rerun the original emitFiles up to 4 times per module target | Run tsc multiple times? Or, modify compiler options and rerun emit; will be just as unsafe. |
They say that this actually is safe, they've been "doing it for years". Are they right?
PR is not up to date; maintained on a fork instead.
Their patch builds TS from source, then diffs the output packages, which are then applied on user machines. This is not a runtime patch applied onto the TS API.
- PnP resolutions need to change on update
- File watching for PnP resolution file
- New reload mode to clear
resolutionCache
- Completions
- Module name resolver / specifiers
- Forcing case sensitive file accesses (pretty sure this is wrong, becuase not every file has to go via PnP)
- Passing PnP into watchGuard and typingsInstaller
Also above this patch is the fact that TypeScript is run via a Node process with
modifications applied at runtime, including an extra API on node:module,
node:fs modifications for zipfile support, etc. (So, if we are "just using"
what appear to be the builtins, are we really doing code execution? Probably
still not convenient for users because it has to be run specially.)
But, this has no impact for 5.0.
