Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixup! Consistently perform bootstrap and encode Brotli config for im…
…proved caching/reduced complexity Re-add fast-path for ESM when we detect it before phase3. And simplify code.
- Loading branch information
1 parent
f4bc94a
commit 44ab40b
Showing
4 changed files
with
87 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,18 @@ | ||
import { completeBootstrap, BootstrapStateForChild } from '../bin'; | ||
import { argPrefix, compress, decompress } from './argv-payload'; | ||
import { | ||
completeBootstrap, | ||
BootstrapStateForChild, | ||
BootstrapStateInitialProcess, | ||
BootstrapStateForForkedProcesses, | ||
} from '../bin'; | ||
import { argPrefix, decompress } from './argv-payload'; | ||
|
||
const base64ConfigArg = process.argv[2]; | ||
if (!base64ConfigArg.startsWith(argPrefix)) throw new Error('unexpected argv'); | ||
const base64Payload = base64ConfigArg.slice(argPrefix.length); | ||
const state = decompress(base64Payload) as BootstrapStateForChild; | ||
const state = decompress(base64Payload) as | ||
| BootstrapStateForForkedProcesses | ||
| BootstrapStateInitialProcess; | ||
|
||
state.parseArgvResult.restArgs = process.argv.slice(3); | ||
state.restArgs = process.argv.slice(3); | ||
|
||
completeBootstrap(state); | ||
completeBootstrap(state as BootstrapStateForChild); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters