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

build on node 18 #163334

Closed
wants to merge 179 commits into from
Closed

build on node 18 #163334

wants to merge 179 commits into from

Conversation

milahu
Copy link

@milahu milahu commented Oct 11, 2022

fix #149580

some dependencies are blocking node 18
so lets "bump all the deps" and downgrade when needed

work in progress ...

  • vscode/build
    • vscode/build/lib/nls.ts - handle position not found error
  • downgrade to avoid "pure ESM" modules, to avoid dynamic import.
    store the downgraded versions in resolutions to protect them from yarn upgrade --latest (this is not working with yarn 1)
    • vscode: p-all
    • vscode/build: got, node-fetch
  • use alternative to avoid "pure async" modules, to avoid API change to async
    • source-map-sync
  • vscode/extensions/extension-editing
  • todo: vscode/extensions/github-authentication
  • build all packages with swc
    Explore "transpile only" build  #150025 (comment)
    for me, transpile-client-swc is 14x faster than transpile-client (40 sec vs 570 sec)
    fast-compile (swc) is 12x faster than compile (120 sec vs 1470 sec)
    • todo: does transpile-client-swc run twice?
      40 sec compilation + 40 sec transpile-client-swc = 80 sec
  • rebase: update typescript in vscode/package.json (daily update)
typescript version error when directly running tsc

caused by calling typescript directly with npx tsc
fix: call typescript via gulp: npm run gulp compile etc

node_modules/@types/node/ts4.8/globals.d.ts:72:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'AbortSignal' must be of type '{ new (): AbortSignal; prototype: AbortSignal; abort(reason?: any): AbortSignal; }', but here has type '{ new (): AbortSignal; prototype: AbortSignal; }'.

72 declare var AbortSignal: {
               ~~~~~~~~~~~

  ../node_modules/typescript/lib/lib.webworker.d.ts:755:13
    755 declare var AbortSignal: {
                    ~~~~~~~~~~~
    'AbortSignal' was also declared here.

also seen in
https://issuehint.com/issue/microsoft/TypeScript/49283
microsoft/TypeScript#50948

fix? somehow disable @node/types for tsc

no fix: upgrade typescript to ^4.9.0-dev.20221005

not related? vscode-nls-dev@4.0.3 is using old versions of typescript

out of scope

@milahu
Copy link
Author

milahu commented Oct 11, 2022

@microsoft-github-policy-service agree

'resolution-mode' assertions are only supported when `moduleResolution` is `node16` or `nodenext`
Module x has no default export
Could not find a declaration file for module x
…ameter of type 'string | Options | ((path: ParsedPath, file: File) => void | ParsedPath)'.
…ameter of type 'string'.

  Type 'null' is not assignable to type 'string'.
TS1479: The current file is a CommonJS module
whose imports will produce 'require' calls;
however, the referenced file is an ECMAScript module
and cannot be imported with 'require'.
…ames: never[]; mappings: string; sources: string[]; sourcesContent: string[]; }' but required in type 'RawSourceMap'.
…issing the following properties from type 'Ruler<RuleBlock>':
@joaomoreno
Copy link
Member

Migrating to Node 18 is neither something we're currently interested on (because the Electron we're currently based on is based on Node 16 itself), nor something we'd accept as an external contribution.

If you'd like to make a contribution to VS Code, I suggest reading our Contribution Guide. Thanks for understanding.

@joaomoreno joaomoreno closed this Oct 12, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Nov 26, 2022
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.

wish support node.js 18
2 participants