Skip to content

Commit

Permalink
fix: Fix noir_bb browser tests (#11552)
Browse files Browse the repository at this point in the history
Update webpack config to use the non-inlined wasm
  • Loading branch information
Thunkar authored Jan 28, 2025
1 parent 897c840 commit 17aec31
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 5 deletions.
2 changes: 1 addition & 1 deletion barretenberg/acir_tests/browser-test-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "module",
"scripts": {
"build": "rm -rf dest && webpack",
"serve:dest:st": "serve -n -L -p ${PORT:-8080} dest",
"serve:dest:st": "serve -n -L -p ${PORT:-8080} -c ../serve.st.json dest",
"serve:dest:mt": "serve -n -L -p ${PORT:-8080} -c ../serve.mt.json dest"
},
"devDependencies": {
Expand Down
11 changes: 11 additions & 0 deletions barretenberg/acir_tests/browser-test-app/serve.mt.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@
"value": "same-origin"
}
]
},
{
"source" : "**/*.gz",
"headers" : [{
"key" : "Content-Encoding",
"value" : "gzip"
},
{
"key" : "Content-Type",
"value" : "application/wasm"
}]
}
]
}
15 changes: 15 additions & 0 deletions barretenberg/acir_tests/browser-test-app/serve.st.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"headers": [
{
"source" : "**/*.gz",
"headers" : [{
"key" : "Content-Encoding",
"value" : "gzip"
},
{
"key" : "Content-Type",
"value" : "application/wasm"
}]
}
]
}
2 changes: 1 addition & 1 deletion barretenberg/acir_tests/browser-test-app/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
<title>My Test bb.js App</title>
</head>
<body>
<script src="index.js"></script>
<script type="module" src="index.js"></script>
</body>
</html>
22 changes: 22 additions & 0 deletions barretenberg/acir_tests/browser-test-app/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@ export default {
index: "./src/index.ts",
},
module: {
parser: {
javascript: { importMeta: false },
},
rules: [
{
test: /\.gz$/,
type: 'asset/resource',
},
{
test: /\.tsx?$/,
use: [{ loader: "ts-loader" }],
Expand All @@ -23,8 +30,23 @@ export default {
path: resolve(dirname(fileURLToPath(import.meta.url)), "./dest"),
filename: "[name].js",
chunkFilename: "[name].chunk.js", // This naming pattern is used for chunks produced from code-splitting.
library: {
type: 'module',
},
chunkFormat: 'module',
},
experiments: {
outputModule: true,
},
plugins: [
new CopyWebpackPlugin({
patterns: [
{
context: '../../ts/dest/browser',
from: '*.gz',
},
],
}),
new HtmlWebpackPlugin({ inject: false, template: "./src/index.html" }),
new webpack.DefinePlugin({ "process.env.NODE_DEBUG": false }),
],
Expand Down
6 changes: 3 additions & 3 deletions barretenberg/acir_tests/browser-test-app/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ __metadata:
cacheKey: 10c0

"@aztec/bb.js@file:../../ts::locator=browser-test-app%40workspace%3A.":
version: 0.67.1
resolution: "@aztec/bb.js@file:../../ts#../../ts::hash=cd38cd&locator=browser-test-app%40workspace%3A."
version: 0.72.1
resolution: "@aztec/bb.js@file:../../ts#../../ts::hash=902795&locator=browser-test-app%40workspace%3A."
dependencies:
comlink: "npm:^4.4.1"
commander: "npm:^12.1.0"
Expand All @@ -17,7 +17,7 @@ __metadata:
tslib: "npm:^2.4.0"
bin:
bb.js: ./dest/node/main.js
checksum: 10c0/c6c1476f5f5d5cc1ea7022043e00870ee0743fd73a532c171586ab74bac53f3888c648bd4057de5a602e4a556cbb5d91454f57e0875ab002ccc87e7f83f12e43
checksum: 10c0/8cee0c2d82a1737ab2527e196b67e63a997048ebea3af3b5f21f684575c53283430e046553676cee53c424eaec335ba03b4363d3eec704e7cc8e24090eed569a
languageName: node
linkType: hard

Expand Down

1 comment on commit 17aec31

@AztecBot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'C++ Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.05.

Benchmark suite Current: 17aec31 Previous: ac26e1d Ratio
nativeconstruct_proof_ultrahonk_power_of_2/20 4453.446647000021 ms/iter 4062.360423000001 ms/iter 1.10
Goblin::merge(t) 142155428 ns/iter 133734462 ns/iter 1.06

This comment was automatically generated by workflow using github-action-benchmark.

CC: @ludamad @codygunton

Please sign in to comment.