8000 refactor(cache): improve cache and integrate reagent by becomingbabyman · Pull Request #107 · homebaseio/homebase-react · GitHub
[go: up one dir, main page]

Skip to content

refactor(cache): improve cache and integrate reagent #107

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

Merged
merged 20 commits into from
Jun 26, 2021

Conversation

becomingbabyman
Copy link
Member
@becomingbabyman becomingbabyman commented Jun 7, 2021

PR Description

The current homebase cache is not very composable and it's kind of hard to reason about.

The goal of this PR is to rewrite the cache to make it more readily support different view frameworks like (React or Reagent) and different DBs like (Datascript or Datahike).

  • Cache
    • homebase.cache
      • Entity + Attribute cache
      • Query cache
      • Ensure that view updates are also transactional and consistent
        • Pass the same DB snapshot to all the change-handlers of a given transaction
        • Batch all UI updates to occur simultaneously
  • Views
    • homebase.react
      • useEntity
      • useQuery
      • remove old cache code
    • homebase.reagent
      • (homebase.reagent/connect! db-conn)
      • (homebase.reagent/entity db-conn lookup)
      • reactive homebase.reagent/Entity type
      • (homebase.reagent/q query db-conn & args)
      • Release on Clojars
  • DBs
    • Datascript
    • Datahike (probably save this for another PR)
  • Tests
    • Reagent UI tests for all the different reactivity patterns (entity, ref, reverse ref, q, q + pull)
    • Reagent UI tests to make sure the minimal re-render is happening and the dom is not being thrashed
    • Datahike + (Reagent / React) tests

PR Checklist

Testing

  • added relevant test coverage
  • no tests needed

Docs

Typescript

  • added or edited relevant Typescript type declarations
  • no type declaration updates needed

Merging

For maintainers.

To merge, select "Squash and Merge". Then:

  1. Make sure the top commit message follows Angular Git Commit Guidelines,
  2. Delete all other commit messages in the description, but keep any lines designating co-authors so contributors will retain credit for their contributions.

@becomingbabyman becomingbabyman added the enhancement New feature or request label Jun 7, 2021
@becomingbabyman becomingbabyman self-assigned this Jun 7, 2021
@vercel
Copy link
vercel bot commented Jun 7, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

homebase-example-counter – ./examples/counter

🔍 Inspect: https://vercel.com/homebaseio/homebase-example-counter/An1bN9p8nRoiYdCKmkZHyLZo2iNV
✅ Preview: https://homebase-example-counter-git-cache-refactor-homebaseio.vercel.app

homebase-example-todo – ./examples/todo

🔍 Inspect: https://vercel.com/homebaseio/homebase-example-todo/28tD14xC9A8CxYgE8vvv2MgysLV9
✅ Preview: https://homebase-example-todo-git-cache-refactor-homebaseio.vercel.app

homebase-example-ts-firebase-todo – ./examples/typescript-firebase-todo

🔍 Inspect: https://vercel.com/homebaseio/homebase-example-ts-firebase-todo/HysWZZWiU5TJdNMbUjniNmi8XLdT
✅ Preview: https://homebase-example-ts-firebase-todo-git-cache-refactor-homebaseio.vercel.app

homebase-example-roam – ./examples/roam

🔍 Inspect: https://vercel.com/homebaseio/homebase-example-roam/24NJAuWip8ACFeho6s7UmutoV32i
✅ Preview: https://homebase-example-roam-git-cache-refactor-homebaseio.vercel.app

rubinovitz
rubinovitz previously approved these changes Jun 25, 2021
Copy link
Contributor
@rubinovitz rubinovitz left a comment

Choose a reason for hiding this comment

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

LGTM.
I'm most qualified to comment on the docs and they look great. Excited to get this out there!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0