Migrate Node.js builtin imports to node: scheme (#57611)

Summary:
Pull Request resolved: https://github.com/react/react-native/pull/57611

Directly follows D112733139 (Metro).

**Motivation**

- New Node builtins are *only* available under the prefix (e.g. `node:sqlite`), as this allows Node to introduce them without ecosystem-breaking changes, so this is the direction of travel and the only choice that'll allow consistency.
- Encouraging them and grouping them separately makes it easier to reason about a module's 3rd party dependencies.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D112803684

fbshipit-source-id: 40668d746a7151b3aa4800ff8af997902a18d198
This commit is contained in:
Alex Hunt authored and meta-codesync[bot] committed 2026-07-21 09:01:41 -07:00
1 parent 94d208d96f
commit 89300acb9c
271 files changed
+822 -581

No files matched your search

@@ -11,7 +11,7 @@
'use strict';
const {getWithCurl} = require('../curl-utils');
const http = require('http');
const http = require('node:http');
let server, serverUrl;
@@ -16,9 +16,9 @@ const {
validateAndParseDotSlashFile,
validateDotSlashArtifactData,
} = require('../dotslash-utils');
const fs = require('fs');
const os = require('os');
const path = require('path');
const fs = require('node:fs');
const os = require('node:os');
const path = require('node:path');
jest.useRealTimers();
@@ -26,10 +26,10 @@ jest
process.exit(exitCode);
},
}))
.mock('fs', () => ({
.mock('node:fs', () => ({
existsSync: jest.fn().mockImplementation(_ => true),
}))
.mock('path', () => ({
.mock('node:path', () => ({
dirname: jest
.fn()
.mockImplementation(filePath =>
+3 -3
View File
@@ -11,9 +11,9 @@
'use strict';
const spawnAsync = require('@expo/spawn-async');
const {promises: fs} = require('fs');
const os = require('os');
const path = require('path');
const {promises: fs} = require('node:fs');
const os = require('node:os');
const path = require('node:path');
/*::
type CurlResult = {
+6 -4
View File
@@ -11,12 +11,14 @@
'use strict';
const dotslash = require('fb-dotslash');
const {promises: fs} = require('fs');
const {applyEdits, modify, parse} = require('jsonc-parser');
const os = require('os');
const path = require('path');
const {promises: fs} = require('node:fs');
const os = require('node:os');
const path = require('node:path');
const execFile = require('node:util').promisify(
require('node:child_process').execFile,
);
const signedsource = require('signedsource');
const execFile = require('util').promisify(require('child_process').execFile);
/*::
export type DotSlashHttpProvider = {
+2 -2
View File
@@ -15,8 +15,8 @@ const {
updatePackageJson,
} = require('../../shared/monorepoUtils');
const {getPackageVersionStrByTag} = require('./npm-utils');
const {promises: fs} = require('fs');
const path = require('path');
const {promises: fs} = require('node:fs');
const path = require('node:path');
const MAVEN_VERSIONS_FILE_PATH = path.join(
REACT_NATIVE_PACKAGE_DIR,