FormidableLabs / ssr-experiments

Experiments for SSR off the main event loop.
0 stars 1 forks source link

Implement "sync" and "jest-worker" implementations with basic "react" scenario. #1

Closed ryan-roemer closed 5 years ago

ryan-roemer commented 5 years ago

Lots of TODOs I'm going to wrap up in separate work and tickets, but as I'm about on parental leave with my 1yo, I'm just getting it all here to kick us off:

Work

Results

Good news

Medium news

Bad news

$ node benchmark/runner/index.js
.ERROR DataCloneError: (a, b) =>
  a.slice(0, 10) === b.slice(0, 10) && a.length === b.length could not be cloned.
    at Worker.postMessage (internal/worker.js:223:23)
    at ExperimentalWorker.send (/Users/rye/scm/fmd/ssr-experiments/node_modules/jest-worker/build/workers/NodeThreadsWorker.js:265:18)
    at WorkerPool.send (/Users/rye/scm/fmd/ssr-experiments/node_modules/jest-worker/build/WorkerPool.js:32:34)
    at Farm._process (/Users/rye/scm/fmd/ssr-experiments/node_modules/jest-worker/build/Farm.js:129:10)
    at Farm._enqueue (/Users/rye/scm/fmd/ssr-experiments/node_modules/jest-worker/build/Farm.js:152:10)
    at Farm._push (/Users/rye/scm/fmd/ssr-experiments/node_modules/jest-worker/build/Farm.js:159:12)
    at /Users/rye/scm/fmd/ssr-experiments/node_modules/jest-worker/build/Farm.js:90:14
    at new Promise (<anonymous>)
    at Farm.doWork (/Users/rye/scm/fmd/ssr-experiments/node_modules/jest-worker/build/Farm.js:56:12)
    at JestWorker._callFunctionWithArgs (/Users/rye/scm/fmd/ssr-experiments/node_modules/jest-worker/build/index.js:162:23)

/cc @kevinmstephens

ryan-roemer commented 5 years ago

Merging. I've got some follow-on work that I'll do in other PRs.

Post-merge review most welcome as well as additional work or PRs in this repo!