-
Notifications
You must be signed in to change notification settings - Fork 12.8k
(WiP) Working .cjs, .mjs interop for tsc, tsserver #40068
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thanks for the PR! It looks like you've changed the TSServer protocol in some way. Please ensure that any changes here don't break consumers of the current TSServer API. For some extra review, we'll ping @sheetalkamat, @amcasey, @mjbvz, @minestarks for you. Feel free to loop in other consumers/maintainers if necessary |
Test itPreBuild Version npm i -g vscode-typescript@https://github.com/stealify/typescript
# Getting global path
npm root -g Hit f1 on keyboard open user settings and set "typescript.tsdk": "{your_global_npm_path}/vscode-typescript/lib" restart is not needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is largely incorrect, as auto‑import will still implicitly produce require(…)
calls in *.mjs
files and won’t treat ES Module syntax as invalid in *.cjs
files.
And that is the major reason why https://gist.github.com/robertrossmann/0fb8b22341dcd83f37522ee654b0fb68 wasn’t merged.
Also, #39840 should be left open, as it adds compiler checks to ensure that the resulting *.mjs
and *.cjs
files are valid.
@ExE-Boss your total correct there is the label WiP that means Work in Progress but it is at last a working version this version handels every extension as JS so it decides if it is module or commonjs via the first import or require call you know all tha internals this will be a lot of work it is only to get something going. and let the community provide feedback i will put that also into the market place as extension and then we can all move on. I am Mainly working on replacing typescript complet with rollup to do Project and Package Analyze at the same place maybe you could add some tests feel free to create pull requests to this pr. |
@frank-dspeed, is there an extension already available? |
@matths nope there was not much interrest for that before you did post that message i am still working on automated builds but i will focus this week on the marketplace extension also and ping you here. this is the current repo https://github.com/stealify/typescript/releases it builds the current nightly and patches it and includes in the readme a easy way to set it up for one or more workspaces. |
Any notices? |
…ft#43718) Previously, getExternalModuleMember passed through its received value of `dontResolveAlias` to every function that accepted it. That includes (1) resolution of the module symbol and (2) resolution of the module specifier. However, in TS, the module symbol is never an alias anyway, so dontResolveAlias doesn't make a difference. In JS, the module symbol *can* be an alias, and it should always be resolved. That's what this PR does. Fixes microsoft#43713
…nment (microsoft#43851) * Handle localness in special cases by checking exported variable assignment Fixes microsoft#42976 * Fix existing tests where arrow now behaves similar to function expression * Update src/services/goToDefinition.ts
* Test where relative import isnt ideal in the declaration emit * use project relative preference for declaration emit Fixes microsoft#39117 * Fix incorrect path matching when calculating module specifier * Use correct baseUrl for the module specifier
Previously, the name resolution for link tags in displaypart generation mistakenly required a valueDeclaration. Now it uses the first declaration if there is no valueDeclaration, so that types and namespaces will also resolve. This is another instance of using valueDeclaration as "the default declaration", which doesn't apply to types. Fixes microsoft#43868
… the file when using sources of project reference (microsoft#43914) * Test where allowJs present in referenced project affects picking up right set of import files * use options from referened project for including resolved imports in the file when using sources of project reference Fixes microsoft#43909
…n determining never-ness (microsoft#43763) * Allow filterType to consider union constraints of non-union types when determining never-ness * Move impl to callback * Baseline change in narrowing behavior into test, fix post-LKG build
assigment -> assignment
…kage, invalidate for file paths in that package (microsoft#43974) Co-authored-by: Daniel Rosenwasser <[email protected]>
…soft#43707)" (microsoft#43983) This reverts commit db09cb5.
…crosoft#43892) * Fix package.json auto imports for pnpm without project references * Make property optional * Revert unnecessary unnittest change * Set symlinked files when setting symlinked directories * Update `typeDirectiveIsEqualTo` * Consider symlinks found during type reference directive resolution into `discoverProbableSymlinks` * Rename `originalFileName` to `originalPath`, make internal
* Update LKG. * Remove unnecessary assertions.
…PropertyTypes'. (microsoft#44854) * Check for optionality in 'delete'. * Accepted baselines.
* Add more tests. * Accepted baselines. * Switch to testing the symbol's flags. * Accepted baselines.
…4816) * Add some failing tests around transient symbols * Working, but slower * A class is much faster, apparently * This is probably best? * Back to multimap * Go back to single symbol cache * Revert now-unnecessary generics * Rename and reorganize * Fix weird compound condition * Clean up
…t#44873) * Consistently skip attributes with hyphenated names in JSX * Add regression test * Accept new baselines * Fix tests * Accept new baselines
…iguredProject (microsoft#44836) * Apply disableReferencedProjectLoad to getOriginalLocationEnsuringConfiguredProject * Reuse previously computed values and refine comments * Add baselines for test matrix
) * fix(35050): fix decorated block-scoped class emit * Only use internal name when targeting ES5/3 Co-authored-by: Ron Buckton <[email protected]>
…zers (microsoft#44876) * Add collision check for 'Reflect' when using super in static initializers * PR feedback * Accept baseline for new failing test
It looks like you've sent a pull request to update our 'lib' files. These files aren't meant to be edited by hand, as they consist of last-known good states of the compiler and are generated from 'src'. Unless this is necessary, consider closing the pull request and sending a separate PR to update 'src'. |
Fixed in #45884 (TypeScript 4.5) |
.cjs
files #38784.cjs
and.mjs
input files #39840