Skip to content
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

Switch to use nodenext module resolution #236640

Merged
merged 8 commits into from
Jan 22, 2025
Merged

Conversation

mjbvz
Copy link
Collaborator

@mjbvz mjbvz commented Dec 19, 2024

This better enforces that imports end with a file extension and also use relative paths

This better enforces that imports end with a file extension and also use relative paths
@mjbvz mjbvz added this to the January 2025 milestone Dec 19, 2024
@mjbvz mjbvz enabled auto-merge December 19, 2024 20:04
Yoyokrazy
Yoyokrazy previously approved these changes Dec 19, 2024
@BABA983
Copy link
Contributor

BABA983 commented Dec 21, 2024

It seems required to set option module to NodeNext. But if we set "module": "NodeNext" the tsc will generate export {} at the end of the file in preload.js which results in error syntax since electron does not support esm in sandboxed preload script.
CleanShot 2024-12-22 at 00 28 08@2x

@bpasero
Copy link
Member

bpasero commented Dec 21, 2024

It seems required to set option module to NodeNext. But if we set "module": "NodeNext" the tsc will generate export {} at the end of the file in preload.js which results in error syntax since electron does not support esm in sandboxed preload script.

Yes, thats a bug that I reported but was closed as "works as intended": microsoft/TypeScript#60074

@BABA983
Copy link
Contributor

BABA983 commented Dec 22, 2024

It seems required to set option module to NodeNext. But if we set "module": "NodeNext" the tsc will generate export {} at the end of the file in preload.js which results in error syntax since electron does not support esm in sandboxed preload script.

Yes, thats a bug that I reported but was closed as "works as intended": microsoft/TypeScript#60074

Even if you don't use an import statement when the module is set to NodeNext in tsconfig.json it still generates export {} at the end of the file.

CleanShot 2024-12-22 at 13 44 06@2x

mjbvz added 3 commits January 10, 2025 15:21
'
Merge branch 'main' into passive-penguin
@mjbvz mjbvz modified the milestones: January 2025, February 2025 Jan 15, 2025
@mjbvz
Copy link
Collaborator Author

mjbvz commented Jan 15, 2025

TS suggested add "moduleDetection": "legacy" which I think prevents export from being generated in non module files

This change also depend on merging #237989 to removed an old test file

@mjbvz mjbvz modified the milestones: February 2025, January 2025 Jan 15, 2025
@mjbvz mjbvz requested a review from bpasero January 21, 2025 18:43
@jakebailey
Copy link
Member

While you're in here, can you drop the use of paths? It's only a couple of mistakenly left over JSDoc comments that still use that, as far as I can tell.

@bpasero
Copy link
Member

bpasero commented Jan 22, 2025

Would be great if this could move along 👍

@mjbvz mjbvz merged commit b61a7f3 into microsoft:main Jan 22, 2025
7 checks passed
@jakebailey
Copy link
Member

While you're in here, can you drop the use of paths? It's only a couple of mistakenly left over JSDoc comments that still use that, as far as I can tell.

Sent #238475.

@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Mar 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants