Summary:
WIP. The app launches and works for me. I still need to fix the tests
just the DB ones though :D
I changed the `DatabaseProxy` into a `DatabaseConnection` object. It will
request a fully instantiated databse from the backend Browser.
If we're already setup, it'll connect straight to the existing DB.
If we're not setup, then it'll create a new database and run the inital
schema migration on it. The `_createNewDatabase` promise won't resolve
until the migration has run.
Until we add in a more sophisticated migration system and get rid of the
stupid `modelClassMap` that's shoved in `Utils`, I'm passing in a series
of `_setupQueries()` to get everything started.
The `DatabaseConnection` is also the one responsible for queuing up
queries until the DB is fully populated and ready to go.
We actually get a lot of queries before we're setup because a lot of
Stores will make DB requests on `require` in their `constructor` or `init`
methods. (remember all the times we call `_populateStore` in `init`).
Now those queries are aggregated by the `DatabaseConnection` and then
executed sequentially.
Our methods like `persistModel` now resolve only after both the queries
have completed AND their corresponding `triggerLater` has completed as
well.
Test Plan: in progress
Reviewers: bengotow
Reviewed By: bengotow
Differential Revision: https://phab.nylas.com/D1688
Summary:
Allow Database models to create indexes, but don't autocreate bad ones
fix minor bug in error-reporter
Fix index on message list to make thread list lookups use proper index
Developer bar ignores state changes unless it's open
DatabaseView now asks for metadata for a set of items rather than calling a function for every item. Promise.props was cute but we really needed to make a single database query for all message metadata.
New "in" matcher so you can say `thread_id IN (1,2,3)`
Add .scroll-region-content-inner which is larger than the viewport by 1 page size, and uses transform(0,0,0) trick
ScrollRegion exposes `onScrollEnd` so listTabular, et al don't need to re-implement it with more timers. Also removing requestAnimationFrame which was causing us to request scrollTop when it was not ready, and caching the values of...
...clientHeight/scrollHeight while scrolling is in-flight
Updating rendered content 10 rows at a time (RangeChunkSize) was a bad idea. Instead, add every row in a render: pass as it comes in (less work all the time vs more work intermittently). Also remove bad requestAnimationFrame, and prevent calls to...
...updateRangeState from triggering additional calls to updateRangeState by removing `componentDidUpdate => updateRangeState `
Turning off hover (pointer-events:none) is now standard in ScrollRegion
Loading text in the scroll tooltip, instead of random date shown
Handle query parse errors by catching error and throwing a better more explanatory error
Replace "quick action" retina images with background images to make React render easier
Replace hasTagId with a faster implementation which doesn't call functions and doesn't build a temporary array
Print query durations when printing to console instead of only in metadata
Remove headers from support from ListTabular, we'll never use it
Making columns part of state was a good idea but changing the array causes the entire ListTabular to re-render. To avoid this, be smarter about updating columns. This logic could potentially go in `componentDidReceiveProps` too.
Fix specs and add 6 more for new database store functionality
Test Plan: Run 6 new specs. More in the works?
Reviewers: evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D1651
Summary:
Give DatabaseStore trigger payload a 'type' so that you can handle the deletion of objects (clear focus if the object is focused, know to remove it from database view)
Fix specs and add one for new DatabaseView => unpersist handler
Test Plan: Run new test case
Reviewers: evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D1639
Summary:
Fixes: T1334
remove final InboxApp references
move out all underscore-plus methods
Mass find and replace of underscore-plus
sed -i '' -- 's/underscore-plus/underscore/g' **/*.coffee
sed -i '' -- 's/underscore-plus/underscore/g' **/*.cjsx
Test Plan: edgehill --test
Reviewers: bengotow
Reviewed By: bengotow
Differential Revision: https://phab.nylas.com/D1534