Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

meshdb: Add browser support #335

Merged
merged 5 commits into from
Aug 6, 2019
Merged

Conversation

albrow
Copy link
Contributor

@albrow albrow commented Aug 2, 2019

This PR adds full browser support for the meshdb package (and the db package, which it depends on). Fixes #297.

I've also added a new test which uses QUnit bindings. The test is compiled to WebAssembly and run in a headless browser as part of go test. We might be able to clean up and simplify the process in the future (e.g. by using a tool which automatically builds the required index.html file instead of checking it into git), but it should be good enough for now.

I think our testing strategy should be to run all unit tests in Node.js because it's easier and allows us to use the same test files we already have (any file ending in _test.go). We only need to run high-level integration tests in the browser

This depends on two external PRs. I modified our Gopkg.toml file to pull from our forks while we are waiting for these PRs to be merged.

@albrow
Copy link
Contributor Author

albrow commented Aug 2, 2019

Looks like the browser tests are failing in CI because it can't run qunit-puppeteer. I'll look further into it soon.

@albrow albrow requested a review from fabioberger August 2, 2019 22:44
@albrow albrow added this to the Browser Support milestone Aug 2, 2019
@albrow albrow added the browser label Aug 2, 2019
@albrow albrow force-pushed the feature/meshdb-browser-support branch 2 times, most recently from 5be36cc to 4c545da Compare August 3, 2019 00:01
@albrow
Copy link
Contributor Author

albrow commented Aug 3, 2019

Got CI to work by apt-get installing some additional dependencies.

@@ -0,0 +1,33 @@
<!DOCTYPE html>
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like we're not super consistent in our directory naming between using hyphens and underscores. Do we want to have a mix of both?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah we have been inconsistent here. Part of the problem is that there is an unofficial Go convention of using hyphens, but we also have things like node_modules/ which is using underscores.

How about we use hyphens for directory names whenever possible?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep, I'm down.

package.json Outdated Show resolved Hide resolved
@albrow albrow requested a review from fabioberger August 5, 2019 20:07
@albrow albrow force-pushed the feature/meshdb-browser-support branch from 32312e3 to 0bc35fa Compare August 6, 2019 18:42
@albrow albrow force-pushed the feature/meshdb-browser-support branch from 0bc35fa to e06331f Compare August 6, 2019 18:48
@albrow albrow merged commit 9038fdd into development Aug 6, 2019
@albrow albrow deleted the feature/meshdb-browser-support branch August 6, 2019 18:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add full WebAssembly support to go-leveldb
2 participants