![]() Resolves #2171 (note display doesn't update height immediately upon change from menu bar) Any `onEdit` type actions have been replaced with `dispatchProps` that directly dispatch the intended actions. It was previously difficult to understand what exactly was executing with the `onAction` props because there wasn't a clear way to walk up the component tree in an editor without resorting to text searching. This was done to simplify the interfaces around the app. So-called "prop drilling" has been replaced by connecting components in the React tree to state. Previously, integrated into the note bucket, the persistence layer would update each note, ghost, and bucket value separately leading to mismatches between a note and the base version it was built from, leading to sync issues. It now operates as a kind of background worker that persists the Redux state into `indexedDB` and stores the entire contents atomically. The persistence layer has now been created as a separate subsystem from before, when it was integrated with the Simperium code. This has dramatically simplified many different subsystems. It also allows us to model the Simperium connection as a reactive system that responds to changes in the app and injects new events from the server in a way that's independent from local operation. This resolves longstanding issues with the note list showing expired data. This allows the app to update so that there's only ever one copy of a note's data and it's always up to date with the text editor. All Simperium interactions take place in this middleware and are no longer woven into the app. The Simperium connection has been moved into a new centralized middleware. Now we will see a single dispatch that multiple reducers listen to instead of dispatching one action type for each reducer. Now we have created new Redux actions for these real actions and app state has been adjusted so that each kind of data has its own reducer and those reducers listen to all the actions which could affect them. Because these presented intermediate states for the app, partial updates, they have been removed. ![]() For example, edit a note and then clear out the search state. In many cases we have been dispatching multiple actions in order to perform one real action. By sharing the note data in the text editor, in the app, and in `node-simperium`, we will guarantee that we won't accidentally apply new edits to old data. `Monaco`'s synchronous plaintext interface allows us to extend the atomic "all updates occur together and instantaneously" paradigm to the text buffer. The new synchronous interface guarantees that updates occur when we expect them to occur and therefore will be updated by the time we continue processing changes and updates from the server. The `indexedDB` interface as asynchronous and led to sync issues under a variety of race conditions with the network data, remote updates, browser tab scheduling, whether the browser was focused or hidden behind other windows, and more. The interface between `node-simperium` and this app has been moved into Redux state and out of `indexedDB`. Moving to `Monaco` allows us to remove a copy of the note data from the app and allows us to maintain a fully-synchronous update cycle, eliminating a race condition between the Simperium copy of the data, the app copy, and the contents in the text buffer. We're also replacing `draft-js` with `Monaco` which is almost as big of a change conceptually as changing the state. This commit changes most of the app and was rolled out in staging to test the changes. In this branch, we're ripping apart the entire app state and Simperium data flow to rebuild it in order to remove a number of those couplings and races. We've been unable to resolve the worst sync bugs in the application and feature development has been artificially limited by the fact that we have to fight a number of data-flow issues tightly coupling different levels of the application's architecture together. Co-authored by and with design work by Description
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |