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

Feature/persisted size. Closes #193 #195

Merged
merged 12 commits into from
Jan 18, 2017
Merged

Conversation

vobu
Copy link
Contributor

@vobu vobu commented Jan 6, 2017

Here's a first version.
Main thingies:

  • Persist.persistedSize() - obviously
    -- reused localforage's Promise approach internally
    -- stuck to callback-design of implementation
  • Tests:
    -- generating random collection + DB sizes at runtime, then validating their persisted variants
    -- treat not persisted coll|DB as "0"
    -- evaluate all persisted collections of a DB, no matter whether they're all attached at runtime
    -- validate compressed persisted string being smaller than it's runtime uncompressed version
  • included lie as Promise polyfill - https://github.com/calvinmetcalf/lie (as I wasn't sure whether FDB already comes with one)
    -- package.json (NOT COMMITTED, see below)
    -- Unit Test html's: source.html + minified.html (via link href)
    -- Persist.js (via require)

I have not committed the build-time files such as package.json with version increments and the various fdb*.js in /js/dist - should I at some point? Before merging pull request (eventually)?

Irrelon and others added 12 commits December 23, 2016 23:56
- test for & working implementation of collection.persistedSize()
- test for & working implementation of DB.persistedSize()
- phantomjs issue to resolve
- test for & working implementation of DB.persistedSize()
- JSDoc for all .persistedSize() in Persist.js
…ure/persistedSize

# Conflicts:
#	js/lib/Persist.js
#	js/unitTests/tests/testsPersist.js
- lie as Promise polyfill in source.html + minified.html
- JSDoc: typdef for callback
- refactored Persist.persistedSize to also return sizes of
  individual collections (in addition to total)
- addtl test:
  - test for non-persisted DB|coll returning 0
  - test for compressed persisted String
- small fix in test: drop db also from persistence
- complete commit for valid pull request
@vobu
Copy link
Contributor Author

vobu commented Jan 6, 2017

not such a good idea to leave out package.json et al from the build - have included it, new commit, now mr travis seems fine

@vobu vobu mentioned this pull request Jan 18, 2017
@Irrelon
Copy link
Owner

Irrelon commented Jan 18, 2017

Looks great. Thanks for your hard work to put this together. Sorry it took me a bit of time to review the PR. 👍

@Irrelon Irrelon merged commit c853c65 into Irrelon:master Jan 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants