-
Notifications
You must be signed in to change notification settings - Fork 0
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
Upgrade to TypeScript #43
Conversation
Pretty format using prettier
Replace node-uuid with uuid Upgrade lodash to exact version. Upgrading to newer version breaks tests for timestamp plugin. Seems like changes have been made to cloneDeep causing this.
Move source code from lib to src. lib will be git ignored in next commit. Replace root index.js with specified main in package.json
Organize methods as public before privates, alphabetically Replace var with const/let Replace this binding with class properties Insert new lines around selections for readability
Organize methods as public before privates, alphabetically Replace var with const/let Insert new lines around selections for readability
Replace var with const/let Insert new lines around selections for readability Since no logic needed to be inside of the class, smaller functions were extracted for cleaner code.
Replace var with const/let Insert new lines around selections for readability Since no logic needed to be inside of the class, smaller functions were extracted for cleaner code. Refactored duplicated code for save/insert to own function.
Extract mergeOptions so that it won't have to be recreated on each refresh.
Replace bluebird Promise with native Promise. Add Babel plugin transform-runtime to support async await.
Add interface for Store and Collection.
Add change to not refresh observer if there are no results, since that would throw in the merger.
We don't use a test directory anymore. Add "Surikat" as author of the library.
# Conflicts: # package-lock.json # package.json
Export more interfaces and classes. Add prepare script to test and build before pack/publish.
Don't prevent init call from Observer.refresh if documents is `undefined`. Needed for the HybridCursor. _ prefix should be removed, and the call in the HybridCursor updated.
Replace `this` with the object meant as `thisArg`. Remove remaining global imports of Lodash with function imports.
To be more readable by extracting boilerplate to test hooks. To not default to empty arrays as results. Would be misleading if they were `undefined`. Nest callbacks properly to avoid flaky tests. Remove unnecessary timeouts.
Can use either the callback form as before or wait for the Promise to resolve. Update test cases to use Promise syntax to add brevity.
Can use either the callback form as before or wait for the Promise to resolve. Update test cases to use Promise syntax to increase brevity.
insert, save & remove will return a Promise if a callback is not provided. remove will now return a "RemoveResult" object. Change in drop API. To reflect the MongoDB API, drop no longer takes any arguments, and will return a boolean indicating that te drop was successful.
Update API for createIndex, ensureIndex & findAndModify, even though they are unsupported in the InMemoryCollection, since the custom stores should implement that API. Add more API documentation to README.
The current API update of the ViewDB interfaces are that the methods (e.g. Cursor.toArray) returns a Promise IF no callback is provided. If a callback is provided, the methods return This was to follow the MongoDB API as a standard, and to prevent cases of e.g. unhandled rejections of promises if only the callback version is used. I did get the suggestion to always return a Promise, regardless of whether a callback is provided or not. I'm however concerned about the beforementioned unhandled rejection case. Any thoughts? 🙂 |
Since `IndexedDBStore` will implement `Store` and `IndexedDBCollection` will implement `Collection` from `viewdb`
# Conflicts: # package-lock.json # package.json
Upgrade to use TypeScript and modern tools.
Remaining Work
Record<string, any>
to silence the warnings.Identified Issues