This repository was archived by the owner on Sep 30, 2023. It is now read-only.
Refactor: Move core functionality to index.js #17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR starts us off towards browser support by migrating core functionality from cli.js to index.js. It's a WIP still but I think it's good enough to take out of draft. See the "What's left" section below for a start of what should be done before approval.
What it does:
benchmarksfolder in the repo that just callesnew Date()start,runOneandgetElapsedtoindex.jsstartbut then applies that signature at the call site incli.jsso that nothing should functionally changecli.jsinif (require.main == module)so that simplyrequiringit doesn't run the benchmarks automaticallystartfunctiontest/cli.test.jsthat run thestartfunctionThis gives us near 100% test coverage 🎉 and also paves the way for building with
webpacket al and doing some browser benchmarkingThese PRs should be merged first!
rimraffor now and handle output in a separate PR../benchmarksto./test/benchmarksor something to get it out of the root repocli.jsandindex.jsto a/srcfolder--expose-gcWhat's left:
Actually capture and check the outputs of the new tests to ensure they're actually doing what they're supposed to be doing instead of just callingawait startand being happy that there were no errorsPut output back but perhaps considerconsole.logor something so there's nothing node.js-specific inindex.js(should all be captured incli.jsand perhaps an upcomingbrowser.js)(Above moved to new issues)
Fixes #15