Skip to content

Commit

Permalink
chore: add vue + vue-router to benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Mar 9, 2024
1 parent ee10a4f commit 0e72dc2
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 2 deletions.
13 changes: 13 additions & 0 deletions packages/bench/index.js
Expand Up @@ -28,6 +28,10 @@ const suites = [
title: 'threejs10x',
inputs: [path.join(repoRoot, './temp/three10x/entry.js')],
},
{
title: 'vue',
inputs: [path.join(dirname, 'vue-entry.js')],
},
{
title: 'react_and_react_dom',
inputs: ['react', 'react-dom'],
Expand All @@ -40,6 +44,15 @@ const suites = [
async function runRolldown(item) {
const build = await rolldown.rolldown({
input: item.inputs,
resolve: {
// TODO
// For now these are needed to align better w/ esbuild & Vite behavior
// because internally we are still using the default behavior of oxc
// resovler. We should ship a more sensible resolver default that aligns
// with Vite's.
conditionNames: ['import'],
mainFields: ['module', 'browser', 'main'],
},
})
await build.write({
dir: path.join(dirname, `./dist/rolldown/${item.title}`),
Expand Down
4 changes: 3 additions & 1 deletion packages/bench/package.json
Expand Up @@ -12,6 +12,8 @@
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"tinybench": "^2.5.1"
"tinybench": "^2.5.1",
"vue": "^3.4.21",
"vue-router": "^4.3.0"
}
}
10 changes: 10 additions & 0 deletions packages/bench/vue-entry.js
@@ -0,0 +1,10 @@
import { createApp } from 'vue'
import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
history: createWebHistory(),
})
const app = createApp({})

app.use(router)
app.mount('#app')
2 changes: 1 addition & 1 deletion packages/node/package.json
Expand Up @@ -37,4 +37,4 @@
"unbuild": "^2.0.0",
"vitest": "^0.34.6"
}
}
}
20 changes: 20 additions & 0 deletions yarn.lock
Expand Up @@ -2858,6 +2858,13 @@ __metadata:
languageName: node
linkType: hard

"@vue/devtools-api@npm:^6.5.1":
version: 6.6.1
resolution: "@vue/devtools-api@npm:6.6.1"
checksum: 10/040f7307904e23fd02a3f65b024ac7fe71b9e1f5f66244a5ba30d9f3d1b58a79dd5a3b46e8ed4c6a51a153688a356f776bb3260f801df39a7a3cf972c9c79505
languageName: node
linkType: hard

"@vue/devtools-api@npm:^7.0.14":
version: 7.0.15
resolution: "@vue/devtools-api@npm:7.0.15"
Expand Down Expand Up @@ -3672,6 +3679,8 @@ __metadata:
react: "npm:^18.2.0"
react-dom: "npm:^18.2.0"
tinybench: "npm:^2.5.1"
vue: "npm:^3.4.21"
vue-router: "npm:^4.3.0"
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -12882,6 +12891,17 @@ __metadata:
languageName: node
linkType: hard

"vue-router@npm:^4.3.0":
version: 4.3.0
resolution: "vue-router@npm:4.3.0"
dependencies:
"@vue/devtools-api": "npm:^6.5.1"
peerDependencies:
vue: ^3.2.0
checksum: 10/511689a38f2824223eec9a6c50745af81de01c027fa54107221ec09918aebd72817c0c2dd462f4e8829ed06f74dc1816f304e2aaf5b03bb7436a222dd0f5b4cb
languageName: node
linkType: hard

"vue@npm:^3.3.8, vue@npm:^3.4.19":
version: 3.4.19
resolution: "vue@npm:3.4.19"
Expand Down

0 comments on commit 0e72dc2

Please sign in to comment.