athensresearch / athens

Athens is no longer maintainted. Athens was an open-source, collaborative knowledge graph, backed by YC W21
https://athensresearch.github.io/athens
Other
6.32k stars 397 forks source link

Datascript DevTools #139

Closed tangjeff0 closed 4 years ago

tangjeff0 commented 4 years ago

We currently have re-frame-10x setup, but it doesn't work with re-posh, which is one reason we are relying less on re-frame and re-posh (#95).

Similar tools in this space are fulcro-inspect (demo), redux-devtools, and Elm debugger (demo).

We do not need every dev tool feature like performance statistics.

What we do want is:

I'm not exactly sure the best implementation strategy. Options I can think of off the top of my head:

jelmerderonde commented 4 years ago

Some initial thoughts on implementing this:

Questions

Discovered

I will proceed with some small experiments to check if my assumptions are correct and how sci and posh function together.

tangjeff0 commented 4 years ago

@jelmerderonde

jelmerderonde commented 4 years ago

Alright, more updates!

Discussion

There might be a simple (and possibly naive) way to deal with the last two points: don't use posh for querying, just supply the datascript functions in the sci bindings. Instead, we just re-evaluate the query every time a datascript transaction occurs. This is less sophisticated, because re-evaluating will occur even if the will query return the same results.

Discovered

jelmerderonde commented 4 years ago

There might be a simple (and possibly naive) way to deal with the last two points: don't use posh for querying, just supply the datascript functions in the sci bindings. Instead, we just re-evaluate the query every time a datascript transaction occurs. This is less sophisticated, because re-evaluating will occur even if the will query return the same results.

@tangjeff0 what do you think about this solution?

tangjeff0 commented 4 years ago

@jelmerderonde in general I have a bias towards quick, naive first passes.

In this case, definitely go for it. Posh doesn’t offer full datascript features anyways. I mentioned lack of pull in query. But it also doesn’t bridge the entity API.

tangjeff0 commented 4 years ago

Something else I am trying to figure out — it seems I’m not getting reactive updates for posh pull.

jelmerderonde commented 4 years ago

Just a small update, didn't have much time last week to work on this unfortunately. I reworked the data browser, it is now much more extensible and uses datafy and nav.

Still to do:

Latest version (not fully usable yet) can be found at: https://jelmerderonde.github.io/athens/cards.html#!/athens.devcards.devtool. Load some real data, but you first have to click "Transactions" and then "Query" to get it to work.

jelmerderonde commented 4 years ago

Just added a draft PR #164 to show progress so far. Some things still to be done, but the major functionality seems to be there.

jelmerderonde commented 4 years ago

Another update! Just set PR #164 as "ready-to-merge". It still needs some work, but I think it is at a stage where it would benefit from some help from others as well.

The devtool-panel is implemented in the actual app and you can summon it with ctrl-g.

Still todo:

tangjeff0 commented 4 years ago

@jelmerderonde I think this issue is amazing. We have time travel with ctrl-z and ctrl-shift-z. You are free to continue working on this, but I'm really happy with it right now. I think further improvements would make this its own library/open-source package 😄