If you have free time, I'd pop open Chrome Dev Tools, run a performance monitor on both and try to diff out what each of those products do that cause the additional input lag (if there's no code obfuscation).
1,498 karma · joined February 19, 2017
https://github.com/BrianHung cv.brianhung.me
If you have free time, I'd pop open Chrome Dev Tools, run a performance monitor on both and try to diff out what each of those products do that cause the additional input lag (if there's no code obfuscation).
To be fair, both Slate and ProseMirror call themselves frameworks for building rich text editors as opposed to drag-and-drop editors themselves.
The best way to build an editor yourself then would be to look at other existing editors using the same framework, and try to understand the architecture and usage.
Is it somehow that Slate is more suitable handling asynchronous data (e.g. server generated uuids for each block, recursively fetching content for each block and its children)?
Also these resources:
The method used by diffsitter is to compute the path with minimal editing distance: https://github.com/afnanenayet/diffsitter/blob/main/src/ast.....
In the case where the edits are known (because you're re-creating the AST per keystroke), you can save parsing time by passing in the old tree and a set of edits: https://tree-sitter.github.io/tree-sitter/using-parsers#edit....
Intuitively, I feel like there should be a way to reduce diffing time as well to avoid O(mn) run and space time that comes from the dynamic programming solution to compute the minimal edit.
For starters, you can take inspiration from apps like bear notes, ia writer, ulysses, typora, or even apple notes (which has collaborative editing nowadays).
The crucial part here is how big is the gap between a proposee’s worst and best match: if the gap is null for all proposees, there isn’t any strategic incentive for one to lie about their preferences. However, that obviously is a very hard requirement.
There's some prior work on this: e.g. https://github.com/lfades/static-tweet and https://github.com/vercel/og-image.
For the majority of use cases, do you think contenteditable + view layer which precisely updates the HTML is still viable? More specifically, what do you think about open-source libraries like ProseMirror (https://prosemirror.net/) or Slate.js (https://github.com/ianstormtaylor/slate) which do that (ProseMirror uses its own view library on vanilla javascript, Slate uses React)?
I understand if you have really long documents or spreadsheets (I imagine latter is more frequent), you could maybe solve performance rendering problems with virtualization, which canvas gives more flexibility to?
So that could mean two things:
- SQLite is being used in-memory, but things are still being flushed to IndexedDB for persistence? shouldn't help with faster page navigation here
- SQLite is not being used, so it can't explain the performance increase
I think the answer is more in the second link (changelog):
> - *Your workspace is now more reliable after Apr 16, 2021's scheduled maintenance — we upgraded from a single database instance to a sharded deployment, which means Notion is now capable of serving 3x as much traffic as before*
On an other hand, Notion doesn't seem built to serve read-only webpages like a static blog or Medium.com: the expectation is that you'll use the editor, so assumption is javascript is enabled and the editor itself can be used to render a read-only view from JSON or however they're keeping document state.
Opening dev tools on the website, it looks like they're just using Webpack (like React CRA?); not sure if they're changing the javascript bundle per page like with Next.js. It would make sense to not have server-side rendering if you're building both browser and desktop apps, since that would mean avoiding a separate framework only for the browser.
Another clue is that people who try to use Notion as a CMS for their blogs had to build out a React library to emulate the feel of Notion itself: https://github.com/splitbee/react-notion https://github.com/NotionX/react-notion-x.
Also link to that source code mentioned: https://source.chromium.org/chromium/chromium/src/+/master:c...
Here's my intuition on that:
- it doesn't answer how much of the wealth was created (endogenous) or taken (zero sum): tech companies can simultaneously induce new demand and preferences while replacing older companies
- it doesn't answer whether the average worker or society as a whole is better or worse with a lower or higher compensation ratio, because by averaging you lose nuance; for example, are more or less people employed by tech companies now then by the companies that were replaced? are the worker salaries themselves higher or lower compared previous worker salaries?
For me, higher compensation ratios in _tech_ companies is good for people in tech: tech requires less labor for inch of market cap, while that labor is compensated higher. Whether or not that's an overall good for society though, idk.