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

Refactor queries && fix issues related to references #1872

Merged
merged 7 commits into from
May 18, 2021

Conversation

tiensonqin
Copy link
Contributor

@tiensonqin tiensonqin commented May 14, 2021

Problem

  1. can't edit and enter new blocks in the references
  2. references and source blocks are not synced
  3. the existing queries are verbose, it doesn't utilize datascript's recursive queries very well (although we might move to a performant way in the future)
  4. to render the blocks tree, no matter it's a page or refs, a query is triggered when encountering a parent block, this not only hurts the performance but also makes the code ugly.

Goals

  1. make queries simpler and easy to use
  2. simplify the rendering code

Warnings, it might breaks:

  1. aliases
  2. block-refs data attributes

Need more thoughts

  1. Should we remove blocks->vec-tree? Recursive queries already provide the tree structures, we can also use datascript's raw index API to make it faster. see Why are Datascript queries so slow? tonsky/datascript#130 (comment)
  • can't edit or enter new blocks on linked references
  • references and source blocks are not synced
  • simplify the queries
  • collapse children blocks by default, it shouldn't affects the expand/collapsed state for the source blocks
  • unlinked references

@tiensonqin tiensonqin changed the base branch from master to feat/outliner-core May 14, 2021 22:05
@tiensonqin tiensonqin requested review from RCmerci and a user May 17, 2021 08:55
@tiensonqin tiensonqin changed the title [WIP] Refactor queries && fix issues related to references Refactor queries && fix issues related to references May 17, 2021
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tiensonqin tiensonqin merged commit dabb116 into feat/outliner-core May 18, 2021
@tiensonqin tiensonqin deleted the refactor/references branch May 18, 2021 03:57
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.

None yet

1 participant