Open sogaiu opened 5 years ago
As a follow-on experiment, in addition to the changes mentioned above, tried the following at the REPL:
(in-ns 'clojure.core)
(defmethod print-method clojure.lang.Var [o ^Writer w]
(print-tagged-object o (str o) w))
This allowed sending vars and processing them in punk's UI (only tested in the electron app).
With this modification, using results processed from Stuart Halloway's reflector (https://github.com/stuarthalloway/reflector) worked in punk's UI -- e.g. browsing var-related info (not the same as what's provided in REBL for vars "natively").
With just the modifications in the first post (view and reg-event-fx), tried using seancorfield's next.jdbc, in particular what was described at (https://github.com/seancorfield/next-jdbc/blob/master/doc/datafy-nav-and-schema.md#user-content-identifying-foreign-keys):
By default, next.jdbc assumes that a column named
id or _id is a foreign key into a table called with a primary key called id. As an example, if you have a table address which has columns id (the primary key), name, email, etc, and a table contact which has various columns including addressid, then if you retrieve a result set based on contact, call datafy on it and then "drill down" into the columns, when (nav row :contact/addressid v) is called (where v is the value of that column in that row) next.jdbc's implementation of nav will fetch a single row from the address table, identified by id matching v.
It was a bit odd having to click on a number (representing a foreign key) in the Next pane, but it was neat to see it work out :)
Assuming a fresh setup for the standard example, (tap> [(atom {:a 1})]) leads to the following in the Entries pane:
Clicking on the associated line in the Entries pane leads to the following in the Current pane:
Clicking on the associated line in the Current pane leads to the following in the Next pane:
At this point, it doesn't currently appear possible with the current UI to "examine" the latest value any further. Is that correct?
As an experiment, I modified the edn pane to support being clicked (very un-REBL, but yet, very rebel ;) ):
and punk/core.cljc's :nav reg-event-fx to be:
based on a reading of seancorfield's Datafy / Nav blog post:
Ignoring UI/UX issues for the moment, this at least allowed further examination, i.e. clicking on the Next pane lead to the Current pane being filled in as:
(and from there futher exploration was also possible.)
May be this is all moot with punk2?