Title: API surface regression test to catch unintended exports · Issue #58676 · nodejs/node · GitHub
Open Graph Title: API surface regression test to catch unintended exports · Issue #58676 · nodejs/node
X Title: API surface regression test to catch unintended exports · Issue #58676 · nodejs/node
Description: What is the problem this feature will solve? Sometimes we have internal-only methods/constants/classes unintentionally exposed to userland. After being exposed for a long enough time, they inevitably become used by someone, leaving Node....
Open Graph Description: What is the problem this feature will solve? Sometimes we have internal-only methods/constants/classes unintentionally exposed to userland. After being exposed for a long enough time, they inevitab...
X Description: What is the problem this feature will solve? Sometimes we have internal-only methods/constants/classes unintentionally exposed to userland. After being exposed for a long enough time, they inevitab...
Opengraph URL: https://github.com/nodejs/node/issues/58676
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"API surface regression test to catch unintended exports","articleBody":"### What is the problem this feature will solve?\n\nSometimes we have internal-only methods/constants/classes unintentionally exposed to userland. After being exposed for a long enough time, they inevitably become used by someone, leaving Node.js with a choice: either cause breakage in userland, or keep awkward deprecated/legacy code for years.\n\n### What is the feature you are proposing to solve the problem?\n\n- Fixture with a list of all currently exposed properties (flat array of strings like `fs/promises.readFile`, `dns.lookup.[customPromisifyArgs].1`, etc.)\n- Test that recursively goes through `module.builtinModules`, builds the list, and asserts equality against the fixture\n- Script that would overwrite the fixture with current list using `./out/Release/node ./tools/update-api-surface.mjs`\n\nThis way, the test would fail if something unintended happened, and fixture updates would clearly indicate the additions to public API.\nThis is not 100% robust because it won't include prototypes of some objects created in runtime (for example, `fs.Stats` is accessible while `fs.BigIntStats` is not), but it would catch most of exposures.\n\n### What alternatives have you considered?\n\nTool (e.g. GitHub Actions workflow) that would compare public API surface against base commit and somehow report the changes if any.","author":{"url":"https://github.com/LiviaMedeiros","@type":"Person","name":"LiviaMedeiros"},"datePublished":"2025-06-11T13:17:18.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/58676/node/issues/58676"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:61579e24-309c-ab79-d4b6-3e2c67b425fb |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EA5E:11DE2:59E076:7A5429:6A4D3ECE |
| html-safe-nonce | 9ffd074a33cfb69e56f9406787de2070426b5978971fceea866632c38b99cad6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQTVFOjExREUyOjU5RTA3Njo3QTU0Mjk6NkE0RDNFQ0UiLCJ2aXNpdG9yX2lkIjoiNDMxNTM4MjU0NDM1NjY4NzU2NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e6617adce6dd693dae91646cba3afcec727df6dbdea6e0ef67f884d68f082cf8 |
| hovercard-subject-tag | issue:3136798560 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/58676/issue_layout |
| twitter:image | https://opengraph.githubassets.com/edf98f9819c6a706dcbe543ec9b96e074065e1b06e9a69b8189aad0bc1b13323/nodejs/node/issues/58676 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/edf98f9819c6a706dcbe543ec9b96e074065e1b06e9a69b8189aad0bc1b13323/nodejs/node/issues/58676 |
| og:image:alt | What is the problem this feature will solve? Sometimes we have internal-only methods/constants/classes unintentionally exposed to userland. After being exposed for a long enough time, they inevitab... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | LiviaMedeiros |
| hostname | github.com |
| expected-hostname | github.com |
| None | 92571a8944142227b7e19cd10918b1ddd06e5066c1ad5bc7e4769cf6140a87e6 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 56fc8347865a14e2ec811533d68f929cf4e0ec19 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width