Skip to content

feat(DEP0064): handle tls.createSecurePair deprecation#266

Merged
brunocroh merged 21 commits intonodejs:mainfrom
technologic-technologic:feat(`tls-createSecurePair-deprecation`)
Mar 22, 2026
Merged

feat(DEP0064): handle tls.createSecurePair deprecation#266
brunocroh merged 21 commits intonodejs:mainfrom
technologic-technologic:feat(`tls-createSecurePair-deprecation`)

Conversation

@technologic-technologic
Copy link
Contributor

This pull request implements the codemod to replace deprecated tls.createSecurePair() with TLSSocket, addressing DEP0064.

Changes included:

  • Updated the codemod workflow to transform createSecurePair(...) into new TLSSocket(underlyingSocket, {...}), preserving tls.TLSSocket for namespace usage.
  • Rewrote imports to replace { createSecurePair } with { TLSSocket } in CJS/ESM (keeps namespace imports intact).
  • Renamed assigned variables pairsocket where applicable.
  • Added tests for cjs/esm (destructured, namespace, flags, and mixed symbols).
  • Ensured idempotent runs and minimal, repo-style edits.
  • Added README.md and package.json metadata.
  • Added tests for assigned variables, destructured imports.

This PR is part of the feature branch feat/tls-createSecurePair-to-TLSSocket.

@AugustinMauroy
Copy link
Member

AugustinMauroy commented Nov 6, 2025

npm i on root should update the lock file and fix the ci

Missing import test case

  • défaut import ESM
  • ESM dynamic import

…uded default and dynamic ESM imports + needed refactors as PR comments)

WHAT Changed:
- AST-based migration
- ESM/default/dynamic cases
- Normalize rewritten CJS requires to `node:tls` as suggested to code section
- Remove duplicated `getNodeImportStatements/getNodeRequireCalls` invocations
  that attempted to handle `'node:tls'` vs `'tls'`
…d dynamic import (await/then)

WHAT :
- ESM default import
- ESM dynamic import (await assignment)
- ESM dynamic import (then callback)
…cation`)' into feat(`tls-createSecurePair-deprecation`)
@JakobJingleheimer
Copy link
Member

Thanks for this!

@AugustinMauroy
Copy link
Member

bump @technologic-technologic 👋

@AugustinMauroy AugustinMauroy added the awaiting author Reviewer has requested something from the author label Dec 13, 2025
@AugustinMauroy AugustinMauroy force-pushed the feat(`tls-createSecurePair-deprecation`) branch from 62a736a to da7d3c8 Compare February 2, 2026 13:38
@AugustinMauroy
Copy link
Member

@JakobJingleheimer i had take hand here, it's much more lighter

@AugustinMauroy AugustinMauroy force-pushed the feat(`tls-createSecurePair-deprecation`) branch from 2268a5e to c7b610f Compare February 2, 2026 13:47
@JakobJingleheimer JakobJingleheimer changed the title feat(tls-create-secure-pair-deprecation): handle Node.js DEP0064 migration feat(DEP0064): handle tls.createSecurePair deprecation Mar 8, 2026
Copy link
Member

@JakobJingleheimer JakobJingleheimer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! The code is really readable / easy to follow 🙂

Sorry this took a while for me to get back to this. I was bereaved right after my last review and then lost track.

@brunocroh I think a lot of this is already handled by your fancy utils. Could you take a look?

@brunocroh brunocroh self-requested a review March 21, 2026 23:18
@brunocroh
Copy link
Member

@AugustinMauroy do you know what the problem with the CI is here?

@AugustinMauroy
Copy link
Member

AugustinMauroy commented Mar 22, 2026

@AugustinMauroy do you know what the problem with the CI is here?

I'm going to check but I think something like that should fix it:

git fetch origin main && git restore --source=origin/main -- package-lock.json && npm I

this issue is dude to the fact that ast-grep (used for test on utility package) need to resolve by arch since it's node native add-on

Copy link
Member

@AugustinMauroy AugustinMauroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGMT !

Copy link
Member

@JakobJingleheimer JakobJingleheimer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

W00t! Go team 🙌

@brunocroh brunocroh merged commit 6d6485b into nodejs:main Mar 22, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting author Reviewer has requested something from the author

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: handle tls.createSecurePair() depreciation

4 participants