Skip to content

[Do not merge] Prototype: Async rewriter alternative 1 (Rust, WASM, no AST manipulation) #1931

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 34 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
c1e72b9
WIP
addaleax Apr 2, 2024
e3af42a
fixup: VecDeque
addaleax Apr 3, 2024
ac0a79d
fixup: IIFE wrapping WIP
addaleax Apr 3, 2024
b1db86d
fixup: ...
addaleax Apr 4, 2024
dc08b18
fixup: Kevin’s suggestions
addaleax Apr 4, 2024
7ee0641
fixup: invert condition so the difference shows in CI perf tests
addaleax Apr 10, 2024
2a4996e
fixup: include compiled WASM in compile_ts
addaleax Apr 10, 2024
5d9ad16
fixup: Rust in CI ...
addaleax Apr 10, 2024
0af48ce
fixup: regenerate automatically created files after rebase
addaleax Mar 6, 2025
aaebeae
fixup: handle e.g. `function foo(a=1){}`
addaleax Mar 9, 2025
75a7ba4
WIP
addaleax Mar 10, 2025
4d31176
fixup: snapshot fix
addaleax Mar 11, 2025
fae056a
fixup: literal object keys work
addaleax Mar 11, 2025
dfce63f
fixup: template elements should not receive tags
addaleax Mar 23, 2025
e245d9d
fixup: account for typeof + parentheses
addaleax Mar 23, 2025
64878fb
fixup: set sync rv for arrow functions
addaleax Mar 24, 2025
1ec867e
fixup: handle for-of/in lvalues, labels
addaleax Mar 24, 2025
7d3a10d
fixup: handle bracketed call expressions
addaleax Mar 24, 2025
5e08699
fixup: slash merging
addaleax Mar 24, 2025
f394028
fixup: perf
addaleax Mar 24, 2025
7cad72b
fixup: unnecessary .iter()
addaleax Mar 25, 2025
96441cd
fixup: initialize immediately after class def
addaleax Mar 25, 2025
4a9a651
fixup: extend ; safeguarding
addaleax Mar 25, 2025
0426e16
fixup: more semicolon safeguards
addaleax Mar 25, 2025
1d3e357
fixup: Rust cleanups
addaleax Mar 31, 2025
20f3965
fixup: explicitly install wasm-pack
addaleax May 6, 2025
fb5dada
fixup: add rust executable variant
addaleax May 7, 2025
3dc6cd4
fixup: switch to oxc parser
addaleax May 7, 2025
1273afd
fixup: post-rewrite fixes
addaleax May 7, 2025
baf2755
fixup: `cargo fmt`
addaleax May 7, 2025
74b48d5
fixup: readability
addaleax May 8, 2025
0c167a9
fixup: fmt
addaleax May 8, 2025
288b40e
fixup: add c addon variant
addaleax May 8, 2025
482bc98
fixup: typo discovered during walkthrough :)
addaleax May 9, 2025
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
616 changes: 615 additions & 1 deletion .evergreen.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .evergreen/evergreen.yml.in
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ functions:
source .evergreen/setup-env.sh
npm run evergreen-release bump
npm run compile
tar cvzf compiled-ts.tgz packages/*/{lib,dist,package.json} package.json package-lock.json
tar cvzf compiled-ts.tgz packages/*/{lib,dist,pkg,target,package.json} package.json package-lock.json
- command: s3.put
params:
aws_key: ${aws_key}
Expand Down
3 changes: 3 additions & 0 deletions .evergreen/install-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ if [ "$OS" == "Windows_NT" ]; then

curl -sSfLO https://raw.githubusercontent.com/mongodb-js/compass/42e6142ae08be6fec944b80ff6289e6bcd11badf/.evergreen/node-gyp-bug-workaround.sh && bash node-gyp-bug-workaround.sh
else
echo "Setting up Rust"
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh /dev/stdin -y

if [ `uname` = Darwin ]; then
export NVM_DIR="$BASEDIR/.nvm"
mkdir -p "${NVM_DIR}"
Expand Down
2 changes: 2 additions & 0 deletions .evergreen/setup-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ fi
echo "TERM variable is set to '${TERM:-}'"

if [ "$OS" != "Windows_NT" ]; then
source $HOME/.cargo/env

if [ `uname` = Darwin ]; then
echo "Using clang version:"
(which clang && clang --version)
Expand Down
13 changes: 11 additions & 2 deletions config/webpack.base.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ module.exports = {
test: /\.ts$/,
use: [{ loader: 'ts-loader' }],
exclude: [/node_modules/]
}
},
/*{
test: /\.wasm$/,
type: 'asset/source',
},*/
]
},

Expand Down Expand Up @@ -54,6 +58,7 @@ module.exports = {
},

output: {
chunkFormat: false,
strictModuleErrorHandling: true,
strictModuleExceptionHandling: true,
},
Expand All @@ -66,5 +71,9 @@ module.exports = {
analyzerMode: 'static',
openAnalyzer: false
})
]
],

experiments: {
asyncWebAssembly: true
},
};
151 changes: 151 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
"workspaces": [
"configs/eslint-config-mongosh",
"configs/tsconfig-mongosh",
"packages/async-rewriter3",
"scripts/docker",
"packages/async-rewriter2",
"packages/build",
Expand Down
Loading
Loading