dev: update review.md

This commit is contained in:
rcmerci
2026-01-05 13:24:02 +08:00
parent 41cbba3688
commit ae8710f764
3 changed files with 53 additions and 48 deletions

View File

@@ -31,5 +31,5 @@
## Review Checklist ## Review Checklist
- Linters and unit-tests must pass - Linters and unit-tests must pass
- Check the review notes listed in `prompts/review.md`. - Check the review notes listed in @prompts/review.md

View File

@@ -29,3 +29,5 @@ You're Clojure(script) expert, you're responsible to check those common errors:
- Prohibit converting js/Uint8Array to vector. e.g. `(vec uint8-array)` - Prohibit converting js/Uint8Array to vector. e.g. `(vec uint8-array)`
- This operation is very slow when the Uint8Array is large (e.g. an asset). - This operation is very slow when the Uint8Array is large (e.g. an asset).
- `:block/content` attribute is not used in the DB version; `:block/title` is the attribute that stores the main content of the block.

View File

@@ -24,53 +24,56 @@
]) ])
(def to-ws-op-schema (def to-ws-op-schema
[:multi {:dispatch first :decode/string #(update % 0 keyword)} [:schema {:registry {::block-map
[:update-kv-value [:map
[:cat :keyword [:block-uuid :uuid]
[:map [:db/ident {:optional true} :keyword]
[:db-ident :keyword] [:pos block-pos-schema]
[:value :string]]]] [:av-coll [:sequential av-schema]]
[:rename-db-ident [:card-one-attrs {:optional true} [:sequential :keyword]]]}}
[:cat :keyword [:multi {:dispatch first :decode/string #(update % 0 keyword)}
[:map [:update-kv-value
[:db-ident-or-block-uuid [:or :keyword :uuid]] [:cat :keyword
[:new-db-ident :keyword]]]] [:map
[:move [:db-ident :keyword]
[:cat :keyword [:value :string]]]]
[:map [:rename-db-ident
[:block-uuid :uuid] [:cat :keyword
[:pos block-pos-schema]]]] [:map
[:remove [:db-ident-or-block-uuid [:or :keyword :uuid]]
[:cat :keyword [:new-db-ident :keyword]]]]
[:map [:add ;; new added block
[:block-uuids [:sequential :uuid]]]]] [:cat :keyword ::block-map]]
[:update-page [:move
[:cat :keyword [:cat :keyword
[:map [:map
[:block-uuid :uuid] [:block-uuid :uuid]
[:db/ident {:optional true} :keyword] [:pos block-pos-schema]]]]
[:page-name :string] [:remove
[:block/title :string]]]] [:cat :keyword
[:remove-page [:map
[:cat :keyword [:block-uuids [:sequential :uuid]]]]]
[:map [:update-page
[:block-uuid :uuid]]]] [:cat :keyword
[:update [:map
[:cat :keyword [:block-uuid :uuid]
[:map [:db/ident {:optional true} :keyword]
[:block-uuid :uuid] [:page-name :string]
[:db/ident {:optional true} :keyword] [:block/title :string]]]]
[:pos block-pos-schema] [:remove-page
[:av-coll [:sequential av-schema]] [:cat :keyword
[:card-one-attrs {:optional true} [:sequential :keyword]]]]] [:map
[:update-schema [:block-uuid :uuid]]]]
[:cat :keyword [:update
[:map [:cat :keyword ::block-map]]
[:block-uuid :uuid] [:update-schema
[:db/ident :keyword] [:cat :keyword
[:db/valueType :keyword] [:map
[:db/cardinality {:optional true} :keyword] [:block-uuid :uuid]
[:db/index {:optional true} :boolean]]]]]) [:db/ident :keyword]
[:db/valueType :keyword]
[:db/cardinality {:optional true} :keyword]
[:db/index {:optional true} :boolean]]]]]])
(comment (comment
(def to-ws-ops-validator (m/validator [:sequential to-ws-op-schema]))) (def to-ws-ops-validator (m/validator [:sequential to-ws-op-schema])))