-
-
Notifications
You must be signed in to change notification settings - Fork 399
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
feat: block properties #2189
feat: block properties #2189
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
src/cljc/athens/common_db.cljc
Outdated
|
||
;; TODO: generalize and use athens.self-hosted.migrate to migrate existing datascript dbs | ||
;; For now (the prototyping stage) it is enough that only new servers can use the new schema. | ||
(def schema (merge v1-schema v2-schema)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Important: this PR cannot be merged before we have a migration set up for existing datascript dbs.
@@ -152,62 +174,79 @@ | |||
(:page/sidebar))) | |||
|
|||
|
|||
(defn get-children-uids-recursively |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: this function was moved further down in the namespace.
(d/pull db '[:block/order :block/uid {:block/children ...}]) | ||
(tree-seq :block/children :block/children) | ||
(map :block/uid)))) | ||
(defn sort-block-children |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: this function was moved up within the namespace.
@@ -31,12 +35,15 @@ | |||
(let [db common-db/empty-db] | |||
(is (= [#:op{:type :page/new, :atomic? true, :args {:page/title "Welcome"}} | |||
#:op{:type :block/new, :atomic? true, :args {:block/uid "block-1", :block/position {:page/title "Welcome", :relation :last}}} | |||
#:op{:type :page/new, :atomic? true, :args {:page/title "Welcome"}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the IR algo to not produce duplicate operations.
(bfs/internal-representation->atomic-ops db tree-with-page nil))) | ||
|
||
(is (= [#:op{:type :block/new, :atomic? true, :args {:block/uid "eaa4c9435", :block/position {:page/title "title", :relation :first}}} | ||
(is (= [#:op{:type :page/new, :atomic? true, :args #:page{:title "title"}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IR now creates the location because of the changes in src/cljc/athens/common_events/graph/ops.cljc
. I think this is correct.
New version offers feature parity with clojure 1.11. We use some of the 1.11 features in clojure so we need parity to use them in cljc files.
After updating to cljc 1.11.51 I started seeing some shadow-cljs errors while running java code.
(map :db/id) | ||
(map (partial common-db/get-parent db)) | ||
(mapcat (fn [{:block/keys [properties]}] | ||
(println properties) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: debug code
No description provided.