-
-
Notifications
You must be signed in to change notification settings - Fork 44
feat(DEP0121): net._setSimultaneousAccepts()
#278
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
base: main
Are you sure you want to change the base?
Changes from 2 commits
081d5e8
9084315
0b17324
7bab3c2
14209b5
30594f3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -19,7 +19,7 @@ | |||||
| "automation", | ||||||
| "codemod", | ||||||
| "migrations", | ||||||
| "node.js" | ||||||
| "node.js" | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| ], | ||||||
| "license": "MIT", | ||||||
| "bugs": { | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,77 @@ | ||||||||||||||||||
| # `net._setSimultaneousAccepts()` DEP0121 | ||||||||||||||||||
|
|
||||||||||||||||||
| This recipe provides a guide for removing `net._setSimultaneousAccepts()`. | ||||||||||||||||||
|
|
||||||||||||||||||
| See [DEP0121](https://nodejs.org/api/deprecations.html#DEP0121). | ||||||||||||||||||
|
|
||||||||||||||||||
| ## Examples | ||||||||||||||||||
|
AugustinMauroy marked this conversation as resolved.
|
||||||||||||||||||
|
|
||||||||||||||||||
| ### Remove internal API call | ||||||||||||||||||
|
|
||||||||||||||||||
| ```diff | ||||||||||||||||||
| const net = require("node:net"); | ||||||||||||||||||
|
|
||||||||||||||||||
| -net._setSimultaneousAccepts(false); | ||||||||||||||||||
| const server = net.createServer(); | ||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||
| ``` | ||||||||||||||||||
|
|
||||||||||||||||||
| ### Remove from server initialization | ||||||||||||||||||
|
|
||||||||||||||||||
| ```diff | ||||||||||||||||||
| const net = require("node:net"); | ||||||||||||||||||
|
|
||||||||||||||||||
| function createServer() { | ||||||||||||||||||
| - net._setSimultaneousAccepts(true); | ||||||||||||||||||
| return net.createServer((socket) => { | ||||||||||||||||||
| // handle connection | ||||||||||||||||||
| }); | ||||||||||||||||||
| } | ||||||||||||||||||
| ``` | ||||||||||||||||||
|
|
||||||||||||||||||
| ### Remove from module setup | ||||||||||||||||||
|
|
||||||||||||||||||
| ```diff | ||||||||||||||||||
| const net = require("node:net"); | ||||||||||||||||||
|
|
||||||||||||||||||
| -net._setSimultaneousAccepts(false); | ||||||||||||||||||
| module.exports = { | ||||||||||||||||||
| createServer: () => net.createServer() | ||||||||||||||||||
| }; | ||||||||||||||||||
| ``` | ||||||||||||||||||
|
|
||||||||||||||||||
| ### Remove from application startup | ||||||||||||||||||
|
|
||||||||||||||||||
| ```diff | ||||||||||||||||||
| const net = require("node:net"); | ||||||||||||||||||
|
|
||||||||||||||||||
| function initializeApp() { | ||||||||||||||||||
| - net._setSimultaneousAccepts(true); | ||||||||||||||||||
| const server = net.createServer(); | ||||||||||||||||||
| server.listen(3000); | ||||||||||||||||||
| } | ||||||||||||||||||
| ``` | ||||||||||||||||||
|
|
||||||||||||||||||
| ### ESM import cleanup | ||||||||||||||||||
|
|
||||||||||||||||||
| ```diff | ||||||||||||||||||
| import net from "node:net"; | ||||||||||||||||||
|
|
||||||||||||||||||
| -net._setSimultaneousAccepts(false); | ||||||||||||||||||
| const server = net.createServer(); | ||||||||||||||||||
| ``` | ||||||||||||||||||
|
|
||||||||||||||||||
| ### Remove from configuration | ||||||||||||||||||
|
|
||||||||||||||||||
| ```diff | ||||||||||||||||||
| const net = require("node:net"); | ||||||||||||||||||
|
|
||||||||||||||||||
| const config = { | ||||||||||||||||||
| - simultaneousAccepts: false, | ||||||||||||||||||
| port: 8080 | ||||||||||||||||||
| }; | ||||||||||||||||||
|
|
||||||||||||||||||
| function setupServer(config) { | ||||||||||||||||||
| - net._setSimultaneousAccepts(config.simultaneousAccepts); | ||||||||||||||||||
| return net.createServer().listen(config.port); | ||||||||||||||||||
| } | ||||||||||||||||||
| ``` | ||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,21 @@ | ||||||
| schema_version: "1.0" | ||||||
| name: "@nodejs/net-setSimultaneousAccepts-migration" | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mm, the suggestion is more correct. |
||||||
| version: 1.0.0 | ||||||
| description: "Handle DEDEP0121: Remove net._setSimultaneousAccepts()" | ||||||
|
||||||
| description: "Handle DEDEP0121: Remove net._setSimultaneousAccepts()" | |
| description: "Handle DEP0121: Remove net._setSimultaneousAccepts()" |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,24 @@ | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
| "name": "@nodejs/net-setsimultaneousaccepts-migration", | ||||||||||||||||||||||||||||||
| "version": "1.0.0", | ||||||||||||||||||||||||||||||
| "description": "Handle DEP0121: Remove net._setSimultaneousAccepts().", | ||||||||||||||||||||||||||||||
| "type": "module", | ||||||||||||||||||||||||||||||
| "scripts": { | ||||||||||||||||||||||||||||||
| "test": "npx codemod jssg test -l typescript ./src/workflow.ts ./" | ||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||
| "repository": { | ||||||||||||||||||||||||||||||
| "type": "git", | ||||||||||||||||||||||||||||||
| "url": "git+https://github.com/nodejs/userland-migrations.git", | ||||||||||||||||||||||||||||||
| "directory": "recipes/net-setsimultaneousaccepts-migration", | ||||||||||||||||||||||||||||||
| "bugs": "https://github.com/nodejs/userland-migrations/issues" | ||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||
| "author": "Alejandro Espa", | ||||||||||||||||||||||||||||||
| "license": "MIT", | ||||||||||||||||||||||||||||||
| "homepage": "https://github.com/nodejs/userland-migrations/blob/main/recipes/net-setsimultaneousaccepts-migration/README.md", | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
| "homepage": "https://github.com/nodejs/userland-migrations/blob/main/recipes/net-setsimultaneousaccepts-migration/README.md", | |
| "homepage": "https://github.com/nodejs/userland-migrations/blob/main/recipes/net-setSimultaneousAccepts-migration/README.md", |
Copilot
AI
Apr 22, 2026
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.
repository.directory does not match this recipe’s actual folder path (recipes/net-setSimultaneousAccepts-migration). The current value uses a different casing (net-setsimultaneousaccepts-migration), which will produce broken links in npm/GitHub metadata.
| "directory": "recipes/net-setsimultaneousaccepts-migration", | |
| "bugs": "https://github.com/nodejs/userland-migrations/issues" | |
| }, | |
| "author": "Alejandro Espa", | |
| "license": "MIT", | |
| "homepage": "https://github.com/nodejs/userland-migrations/blob/main/recipes/net-setsimultaneousaccepts-migration/README.md", | |
| "directory": "recipes/net-setSimultaneousAccepts-migration", | |
| "bugs": "https://github.com/nodejs/userland-migrations/issues" | |
| }, | |
| "author": "Alejandro Espa", | |
| "license": "MIT", | |
| "homepage": "https://github.com/nodejs/userland-migrations/blob/main/recipes/net-setSimultaneousAccepts-migration/README.md", |
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.