milomg / js-reactivity-benchmark

98 stars 17 forks source link

Unable to execute the benchmark with NPM #6

Open fabiospampinato opened 1 year ago

fabiospampinato commented 1 year ago

I can't seem to be able to execute the benchmark, neither the test nor the bench scripts work for me, after a clean clone after an npm install.

~/Code/fabiospampinato/js-reactivity-benchmark ❯ npm run test               

> js-reactivity-benchmark@1.0.0 test
> vitest

 DEV  v0.29.7 /Users/fabio/Code/fabiospampinato/js-reactivity-benchmark

 ❯ src/frameworks.test.ts (40)
   ✓ @angular/signals | simple dependency executes
   × @angular/signals | static graph
   × @angular/signals | static graph, read 2/3 of leaves
   × @angular/signals | dynamic graph
   ✓ Compostate | simple dependency executes
   ✓ Compostate | static graph
   ✓ Compostate | static graph, read 2/3 of leaves
   ✓ Compostate | dynamic graph
   ✓ $mol_wire_atom | simple dependency executes
   ✓ $mol_wire_atom | static graph
   ✓ $mol_wire_atom | static graph, read 2/3 of leaves
   ✓ $mol_wire_atom | dynamic graph
   ✓ Preact Signals | simple dependency executes
   ✓ Preact Signals | static graph
   ✓ Preact Signals | static graph, read 2/3 of leaves
   ✓ Preact Signals | dynamic graph
   ✓ @reactively | simple dependency executes
   ✓ @reactively | static graph
   ✓ @reactively | static graph, read 2/3 of leaves
   ✓ @reactively | dynamic graph
   ✓ s-js | simple dependency executes
   ✓ s-js | static graph
   ✓ s-js | static graph, read 2/3 of leaves
   ✓ s-js | dynamic graph
   ✓ SolidJS | simple dependency executes
   ✓ SolidJS | static graph
   ✓ SolidJS | static graph, read 2/3 of leaves
   ✓ SolidJS | dynamic graph
   ✓ uSignal | simple dependency executes
   ✓ uSignal | static graph
   ✓ uSignal | static graph, read 2/3 of leaves
   ✓ uSignal | dynamic graph
   ✓ Vue | simple dependency executes
   ✓ Vue | static graph
   ✓ Vue | static graph, read 2/3 of leaves
   ✓ Vue | dynamic graph
   ✓ x-reactivity | simple dependency executes
   ✓ x-reactivity | static graph
   ✓ x-reactivity | static graph, read 2/3 of leaves
   ✓ x-reactivity | dynamic graph

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Tests 3 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

 FAIL  src/frameworks.test.ts > @angular/signals | static graph
TypeError: runWatchQueue is not a function
 ❯ Object.withBatch src/frameworks/angularSignals.ts:22:5
     20|   withBatch: (fn) => {
     21|     fn();
     22|     runWatchQueue();
       |     ^
     23|   },
     24|   withBuild: (fn) => fn(),
 ❯ Module.runGraph src/util/dependencyGraph.ts:64:15
 ❯ src/frameworks.test.ts:38:17

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/3]⎯

 FAIL  src/frameworks.test.ts > @angular/signals | static graph, read 2/3 of leaves
TypeError: runWatchQueue is not a function
 ❯ Object.withBatch src/frameworks/angularSignals.ts:22:5
     20|   withBatch: (fn) => {
     21|     fn();
     22|     runWatchQueue();
       |     ^
     23|   },
     24|   withBuild: (fn) => fn(),
 ❯ Module.runGraph src/util/dependencyGraph.ts:64:15
 ❯ src/frameworks.test.ts:48:17

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/3]⎯

 FAIL  src/frameworks.test.ts > @angular/signals | dynamic graph
TypeError: runWatchQueue is not a function
 ❯ Object.withBatch src/frameworks/angularSignals.ts:22:5
     20|   withBatch: (fn) => {
     21|     fn();
     22|     runWatchQueue();
       |     ^
     23|   },
     24|   withBuild: (fn) => fn(),
 ❯ Module.runGraph src/util/dependencyGraph.ts:64:15
 ❯ src/frameworks.test.ts:62:17

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/3]⎯

 Test Files  1 failed (1)
      Tests  3 failed | 37 passed (40)
   Start at  21:36:43
   Duration  333ms (transform 88ms, setup 0ms, collect 147ms, tests 16ms)

 FAIL  Tests failed. Watching for file changes...
       press h to show help, press q to quit
~/Code/fabiospampinato/js-reactivity-benchmark ❯ npm run bench

> js-reactivity-benchmark@1.0.0 bench
> esbuild src/index.ts --external:v8-natives --bundle --format=cjs --platform=node | node --allow-natives-syntax

✘ [ERROR] No matching export in "node_modules/@angular/core/fesm2015/core.mjs" for import "runWatchQueue"

    src/frameworks/angularSignals.ts:2:35:
      2 │ import { signal, computed, effect, runWatchQueue } from "@angular/core";
        ╵                                    ~~~~~~~~~~~~~

1 error
~/Code/fabiospampinato/js-reactivity-benchmark ❯ 

Am I doing something wrong?

milomg commented 1 year ago

Can you check that you installed using pnpm i which will automatically patch angular to export runWatchQueue

fabiospampinato commented 1 year ago

I don't have pnpm installed, is pnpm meant to be a requirement for this benchmark?