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,10 +11,10 @@
const {
prepareDebuggerShellFromDotSlashFile,
} = require('../src/node/private/LaunchUtils');
const fs = require('fs').promises;
const http = require('http');
const os = require('os');
const path = require('path');
const fs = require('node:fs').promises;
const http = require('node:http');
const os = require('node:os');
const path = require('node:path');
// The implementation of prepareDebuggerShellFromDotSlashFile relies on
// details of DotSlash that are not guaranteed to be stable (support for
@@ -11,8 +11,8 @@
import {configureAppMenu} from './AppMenu.js';
import SettingsStore from './SettingsStore.js';
const path = require('path');
const util = require('util');
const path = require('node:path');
const util = require('node:util');
// $FlowFixMe[unclear-type] We have no Flow types for the Electron API.
const {BrowserWindow, app, shell, ipcMain} = require('electron') as any;
@@ -11,8 +11,8 @@
// $FlowFixMe[unclear-type] We have no Flow types for the Electron API.
const {app} = require('electron') as any;
const fs = require('fs');
const path = require('path');
const fs = require('node:fs');
const path = require('node:path');
type Options = Readonly<{
name?: string,
@@ -12,7 +12,7 @@ import buildInfo from './BuildInfo';
// $FlowFixMe[untyped-import] Flow doesn't infer JSON types
const pkg = require('../../package.json');
const util = require('util');
const util = require('node:util');
// $FlowFixMe[unclear-type] We have no Flow types for the Electron API.
const {app} = require('electron') as any;
@@ -12,7 +12,7 @@ import {prepareDebuggerShellFromDotSlashFile} from './private/LaunchUtils';
const {spawn} = require('cross-spawn');
const debug = require('debug')('Metro:DebuggerShell');
const path = require('path');
const path = require('node:path');
// The 'prebuilt' flavor will use the prebuilt shell binary (and the JavaScript embedded in it).
// The 'dev' flavor will use a stock Electron binary and run the shell code from the `electron/` directory.