Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
4dbd896
initial POC
baileympearson Jan 28, 2026
b790827
lint
baileympearson Jan 28, 2026
1d1c89e
add adapter unit test
baileympearson Jan 28, 2026
58d8976
unit tests and integration tests
baileympearson Jan 28, 2026
9e0e0ff
cleanup implementation, fix tests
baileympearson Feb 2, 2026
0738ef8
comments
baileympearson Feb 2, 2026
dcdbd79
Merge branch 'main' into NODE-7385
baileympearson Feb 2, 2026
358ede2
working POC bundle + context
baileympearson Feb 2, 2026
c8e5888
working POC bundle + context
baileympearson Feb 2, 2026
f82c084
Merge branch 'main' into NODE-7345-2-poc-single-context
tadjik1 Feb 12, 2026
7f2bd34
got some things working, now figuring out the general types in tests
PavelSafronov Feb 19, 2026
875174b
improve tooling and migrate timeout.test.ts to new format
PavelSafronov Feb 19, 2026
7d9cf78
added better message to restricted require error, including the sourc…
PavelSafronov Feb 20, 2026
b17b665
keep wrapper on the same line as the bundle code, so we have accurate…
PavelSafronov Feb 20, 2026
d23ee71
added readme info about the current approach
PavelSafronov Feb 20, 2026
f45d754
minor changes to get unit and integ tests working
PavelSafronov Feb 20, 2026
bb11d48
added a nodeless build variant
PavelSafronov Feb 20, 2026
06273e7
updated imports of all integ tests and added a bunch of new exports t…
PavelSafronov Feb 23, 2026
5756424
readme updates
PavelSafronov Feb 23, 2026
5c3fcfa
more exports and fixes for integ tests
PavelSafronov Feb 23, 2026
1d0bb60
remove logging from vm context, remove runNodelessTests
PavelSafronov Feb 23, 2026
06ee01a
log more info about require error
PavelSafronov Feb 23, 2026
d6a56b8
add console log when require is blocked
PavelSafronov Feb 23, 2026
7cb3e5d
remove .only
PavelSafronov Feb 23, 2026
641cb28
Merge branch 'main' into NODE-7335-bundle-and-barrel-approach-poc
PavelSafronov Feb 23, 2026
3556355
change how we block require calls, log more info
PavelSafronov Feb 23, 2026
8e0da0a
Merge branch 'NODE-7335-bundle-and-barrel-approach-poc' of https://gi…
PavelSafronov Feb 23, 2026
3ebd9dd
simplified path logic for the require check
PavelSafronov Feb 23, 2026
551c70d
update a few more test imports, skip a v8 test in nodeless testing, a…
PavelSafronov Feb 24, 2026
d2fbe57
add a few more exports
PavelSafronov Feb 24, 2026
7a2fda5
add missing export
PavelSafronov Feb 24, 2026
f454070
fix prose test, add unit test for nodeless
PavelSafronov Feb 24, 2026
7bd8b9a
swapped files to remove all import changes, got most non-integ tests …
PavelSafronov Feb 24, 2026
837f71a
remove incorrect import
PavelSafronov Feb 24, 2026
e187769
remove debug calls
PavelSafronov Feb 24, 2026
670f69e
minor fixes
PavelSafronov Feb 25, 2026
4d537b2
pr feedback: remove duplicates
PavelSafronov Feb 25, 2026
e3703f0
script and eslint updated
PavelSafronov Feb 25, 2026
9183a64
pr feedback:
PavelSafronov Feb 26, 2026
a2804c7
Merge branch 'main' into NODE-7335-bundle-and-barrel-approach-poc
PavelSafronov Feb 26, 2026
7907619
Merge branch 'NODE-7335-bundle-and-barrel-approach-poc' of https://gi…
PavelSafronov Feb 27, 2026
76634cb
pr feedback:
PavelSafronov Feb 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"ignorePatterns": [
"test/tools/runner/bundle/**"
],
"parserOptions": {
"ecmaVersion": 2023
},
Expand Down Expand Up @@ -346,4 +349,4 @@
}
}
]
}
}
97 changes: 97 additions & 0 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3725,6 +3725,60 @@ buildvariants:
- test-tls-support-5.0
- test-tls-support-4.4
- test-tls-support-4.2
- name: rhel80-large-nodeless
display_name: rhel8 Nodeless
run_on: rhel80-large
expansions:
MONGODB_BUNDLED: true
NODE_LTS_VERSION: latest
CLIENT_ENCRYPTION: true
tasks:
- test-latest-server
- test-latest-replica_set
- test-latest-sharded_cluster
- test-rapid-server
- test-rapid-replica_set
- test-rapid-sharded_cluster
- test-8.0-server
- test-8.0-replica_set
- test-8.0-sharded_cluster
- test-7.0-server
- test-7.0-replica_set
- test-7.0-sharded_cluster
- test-6.0-server
- test-6.0-replica_set
- test-6.0-sharded_cluster
- test-5.0-server
- test-5.0-replica_set
- test-5.0-sharded_cluster
- test-4.4-server
- test-4.4-replica_set
- test-4.4-sharded_cluster
- test-4.2-server
- test-4.2-replica_set
- test-4.2-sharded_cluster
- test-latest-server-v1-api
- test-x509-authentication
- test-atlas-connectivity
- test-5.0-load-balanced
- test-6.0-load-balanced
- test-7.0-load-balanced
- test-8.0-load-balanced
- test-rapid-load-balanced
- test-latest-load-balanced
- test-auth-kerberos
- test-auth-ldap
- test-socks5-csfle
- test-socks5-tls
- test-snappy-compression
- test-zstd-compression
- test-tls-support-latest
- test-tls-support-8.0
- test-tls-support-7.0
- test-tls-support-6.0
- test-tls-support-5.0
- test-tls-support-4.4
- test-tls-support-4.2
- name: windows-2022-latest-large-iron
display_name: Windows Node20.19.0
run_on: windows-2022-latest-large
Expand Down Expand Up @@ -3857,6 +3911,49 @@ buildvariants:
- test-tls-support-5.0
- test-tls-support-4.4
- test-tls-support-4.2
- name: windows-2022-latest-large-nodeless
display_name: Windows Nodeless
run_on: windows-2022-latest-large
expansions:
MONGODB_BUNDLED: true
NODE_LTS_VERSION: latest
CLIENT_ENCRYPTION: false
tasks:
- test-latest-server
- test-latest-replica_set
- test-latest-sharded_cluster
- test-rapid-server
- test-rapid-replica_set
- test-rapid-sharded_cluster
- test-8.0-server
- test-8.0-replica_set
- test-8.0-sharded_cluster
- test-7.0-server
- test-7.0-replica_set
- test-7.0-sharded_cluster
- test-6.0-server
- test-6.0-replica_set
- test-6.0-sharded_cluster
- test-5.0-server
- test-5.0-replica_set
- test-5.0-sharded_cluster
- test-4.4-server
- test-4.4-replica_set
- test-4.4-sharded_cluster
- test-4.2-server
- test-4.2-replica_set
- test-4.2-sharded_cluster
- test-latest-server-v1-api
- test-socks5-tls
- test-snappy-compression
- test-zstd-compression
- test-tls-support-latest
- test-tls-support-8.0
- test-tls-support-7.0
- test-tls-support-6.0
- test-tls-support-5.0
- test-tls-support-4.4
- test-tls-support-4.2
- name: rhel8-node20.19.0-test-csfle-mongocryptd
display_name: rhel 8 Node20.19.0 test mongocryptd
run_on: rhel80-large
Expand Down
14 changes: 14 additions & 0 deletions .evergreen/generate_evergreen_tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,20 @@ for (const {
}
BUILD_VARIANTS.push(buildVariantData);
}

// add Node-less variant
const buildVariantData = {
name: `${osName}-nodeless`,
display_name: `${osDisplayName} Nodeless`,
run_on,
expansions: {
MONGODB_BUNDLED: true,
NODE_LTS_VERSION: 'latest'
},
tasks: tasks.map(({ name }) => name)
};
buildVariantData.expansions.CLIENT_ENCRYPTION = clientEncryption;
BUILD_VARIANTS.push(buildVariantData);
}

// Running CSFLE tests with mongocryptd
Expand Down
2 changes: 2 additions & 0 deletions .evergreen/run-azure-kms-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ export MONGODB_URI="mongodb://localhost:27017"
export EXPECTED_AZUREKMS_OUTCOME=${EXPECTED_AZUREKMS_OUTCOME:-omitted}
export TEST_CSFLE=true

npm run build:bundle

npx mocha --config test/mocha_mongodb.js test/integration/client-side-encryption/client_side_encryption.prose.19.on_demand_azure.test.ts
2 changes: 2 additions & 0 deletions .evergreen/run-gcp-kms-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ export MONGODB_URI="mongodb://localhost:27017"
export EXPECTED_GCPKMS_OUTCOME=${EXPECTED_GCPKMS_OUTCOME:-omitted}
export TEST_CSFLE=true

npm run build:bundle

npx mocha --config test/mocha_mongodb.js test/integration/client-side-encryption/client_side_encryption.prose.17.on_demand_gcp.test.ts
2 changes: 2 additions & 0 deletions .evergreen/run-mongosh-scope-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ export SCOPES=$(./node_modules/lerna/cli.js ls --all --json)

cd -

npm run build:bundle

npx mocha --config test/manual/mocharc.json test/manual/mongosh_scopes.test.ts
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,5 @@ uri.txt
crypt_shared.sh

*keytab
driver.bundle.js
test/tools/runner/bundle/
19 changes: 19 additions & 0 deletions etc/build-runtime-barrel.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import fs from 'node:fs/promises';
import path from 'node:path';

// eslint-disable-next-line no-restricted-globals
const useBundled = process.env.MONGODB_BUNDLED === 'true';

const rootDir = path.join(import.meta.dirname, '..');
const outputBarrelFile = path.join(rootDir, 'test/mongodb.ts');
const source = useBundled ? './mongodb_bundled' : './mongodb_all';

const contents =
`// This file is auto-generated. Do not edit.\n` +
`// Run 'npm run build:runtime-barrel' to regenerate.\n` +
`export const runNodelessTests = ${useBundled};\n` +
`export * from '${source}';\n`;
await fs.writeFile(outputBarrelFile, contents);

// eslint-disable-next-line no-console
console.log(`✓ ${outputBarrelFile} now re-exports from ${source}`);
53 changes: 53 additions & 0 deletions etc/bundle-driver.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/usr/bin/env node
import fs from 'node:fs/promises';
import { isBuiltin } from 'node:module';
import path from 'node:path';
import { fileURLToPath } from 'node:url';

import * as esbuild from 'esbuild';

const __dirname = path.dirname(fileURLToPath(import.meta.url));
const rootDir = path.join(__dirname, '..');

const outdir = path.join(rootDir, 'test/tools/runner/bundle/');
await fs.rm(outdir, { recursive: true, force: true });

const outputBundleFile = path.join(outdir, 'driver-bundle.js');
await esbuild.build({
entryPoints: [path.join(rootDir, 'test/mongodb_all.ts')],
bundle: true,
outfile: outputBundleFile,
platform: 'node',
format: 'cjs',
target: 'node20',
external: [
'@aws-sdk/credential-providers',
'@mongodb-js/saslprep',
'@mongodb-js/zstd',
'@napi-rs/snappy*',
'bson',
'gcp-metadata',
'kerberos',
'mongodb-client-encryption',
'mongodb-connection-string-url',
'snappy',
'socks'
],
plugins: [
{
name: 'externalize-node-builtins',
setup(build) {
build.onResolve({ filter: /.*/ }, args => {
if (isBuiltin(args.path)) {
return { path: args.path, external: true };
}
});
}
}
],
sourcemap: 'inline',
logLevel: 'info'
});

// eslint-disable-next-line no-console
console.log(`✓ Driver bundle created at ${outputBundleFile}`);
Loading