You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In TypeScript 5.0, libraries can no longer override properties of our API.
Language service plugins
typescript-plugin-css-modules
Can no longer patch createLanguageServiceSourceFile and updateLanguageServiceSourceFile
Make ones up with CSS.
Should be proxying the language service host
vuejs/language-tools
Same deal with resolveModuleName
The new 5.0 resolution modes are better fits.
--moduleResolution bundler
--allowArbitraryExtensions
Use .d.vue.ts files.
There's really no host-level function they can override? Surprising.
Seems like no?
But resolveModuleName takes a ModuleResolutionHost - is there a way to control that?
Seems fairly file-system-oriented.
Actually some hosts do have a resolveModuleNames
proxyPluginHost should set host.resolveModuleNameLiterals.
Still, using the new resolution modes is recommended, but if they're determined to support node16/nodenext (they shouldn't, we don't believe it's actually the the right thing to use), patching resolveModuleNameLiterals is the right thing.
Libraries Patching TypeScript's API
https://gist.github.com/jakebailey/3e73c7aab4da2044a95121467aa3b4e9
createLanguageServiceSourceFileandupdateLanguageServiceSourceFileresolveModuleName--moduleResolution bundler--allowArbitraryExtensions.d.vue.tsfiles.ModuleResolutionHost- is there a way to control that?resolveModuleNamesproxyPluginHostshould sethost.resolveModuleNameLiterals.resolveModuleNameLiteralsis the right thing.createProgramcreateProgram, lots of other top-level stuff to enable caching.executeCommandLinepublic?program.emitis overridable fromexecuteCommandLinenoEmitand then force emit.ts.sys/* @internal */ function setSysthat they can use.resolveModuleName- they should be passing this into theCompilerHostthey createCompilerHostreadJson- only reason for this is caching.emitFiles- patched so that they can support multiple emit targets.CompilerHost, just patch it every time and re-run emit.Comparing Wrapper Objects
1is anumberNumber(1)is anumbernew Number(1)is aNumber- a wrapper object.===is suspect though.number < Numberis disallowedvalueOf(Stricter relational comparisons checkingvalueOf#52807) - which re-allowsnumber < Number!ban-typeswhich stops these.number < Numberin 5.0 - it's too late in the game regardless of what happens in 5.1.NaNchecks.