Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use PouchDB Browser #217

Merged
merged 1 commit into from
Jan 24, 2019
Merged

Use PouchDB Browser #217

merged 1 commit into from
Jan 24, 2019

Conversation

liwde
Copy link
Contributor

@liwde liwde commented Jan 17, 2019

PouchDB is able to run both in NodeJS as well as in a Browser. In a browser, IndexedDB will be used, for NodeJS, however, Leveldown is the backend, which needs a binary. Per default, PouchDB will install support for both scenarios, with the binary failing to install on some versions of node due to prebuilds not being available (i.e. 9, 11).

There are officially supported versions of PouchDB ("presets") that don't come with this dependency. We should use these stripped versions to have less dependencies in our project, allowing a faster and more stable npm install.

See https://pouchdb.com/custom.html for more information.

PouchDB is able to run both in NodeJS as well as in a Browser. In a browser, IndexedDB will be used, for NodeJS, however, Leveldown is the backend, which installs a binary.

There are officially supported versions of PouchDB that don't come with this dependency (that fails to install on some modern versions of node due to prebuilds not being available). We should use these stripped versions to have less dependencies in our project.

See https://pouchdb.com/custom.html for more information.
@codeclimate
Copy link

codeclimate bot commented Jan 17, 2019

Code Climate has analyzed commit ede2134 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (80% is the threshold).

This pull request will bring the total coverage in the repository to 71.4% (0.0% change).

View more on Code Climate.

@liwde liwde requested review from sleidig and codingfabi January 17, 2019 13:21
@liwde liwde self-assigned this Jan 17, 2019
@liwde liwde added the Type: Refactoring / Technical Enh. Technical Enhancement without changes for the user label Jan 17, 2019
@liwde
Copy link
Contributor Author

liwde commented Jan 17, 2019

Be sure to disable useTemporaryDatabase in the config.default.json to not use the MockDB when testing. For me, everything works as expected, except an error message at the Notes section.

The error at the Notes tab is also present in the current master, and comes from issues with the foreign keys in the dev database: Note:1536258354699 references a Child new that is not in the db. I'll open an issue for that, the error message could be a bit more descriptive...

Update: #218

@Lorsbyjm
Copy link
Contributor

I looked at it and its starting and running, but I directly get some errors, see screenshot.

pouchdb-browser

@liwde
Copy link
Contributor Author

liwde commented Jan 23, 2019

@Lorsbyjm, did you perform any actions to get this issue? Is this on a fresh local DB (in an Incognito Tab)?

I could not reproduce this issue on both my computers on both fresh and already-present local databases. Maybe this is related to the database-indices you added recently? These indices would be created by map-reduce-functions and might have issues with unexpected old values in the DB (i.e. text where only numbers are expected). Maybe they were added to your local PouchDB during development/testing, but are maybe not present in this branch?

@Lorsbyjm Lorsbyjm self-requested a review January 24, 2019 18:07
@Lorsbyjm
Copy link
Contributor

Ok guys, should be good. While starting in icognito mode it has the same error like the master.

Copy link
Contributor

@Lorsbyjm Lorsbyjm left a comment

Choose a reason for hiding this comment

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

As mentioned before, all good.

@Lorsbyjm Lorsbyjm merged commit 67aad64 into master Jan 24, 2019
@Lorsbyjm Lorsbyjm deleted the pouchdb-browser branch January 24, 2019 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Refactoring / Technical Enh. Technical Enhancement without changes for the user
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants