2.0 KiB
You're Clojure(script) expert, you're responsible to check those common errors:
-
empty?should be used instead ofemptywhen a boolean value is expected in an expression. -
If a function does not use
d/transact!, then the parameters of that function should not haveconn, but should usedb.connis mutable, anddbis immutable. -
If the arguments of
cljs-time.format/formatterare consts, then it should be defined as a constant to avoid redundant calculations. -
Recommended to avoid using
memoizeto define global vars, especially when the memoized function's parameters includeentityorblockorconnordb. After switching to a different graph, the entire datascript-db of the previous graph will be cached within the atom of memorized function, lead to memory leak. -
Avoid using
dorunto execute side effects;doseqis recommended. -
util/web-platform?is a not a function. -
It is recommended to use
lambdaisland.glogifor printing logs.- Require
[lambdaisland.glogi :as log]if needed. - Replace
js/console.errorwithlog/error. - Replace
js/console.warnwithlog/warn. - Replace
js/console.logwithlog/info. - NOTE:
log/<level>function takes key-value pairs as arguments
- Require
-
After adding a new property in
logseq.db.frontend.property/built-in-properties, you need to add a corresponding migration infrontend.worker.db.migrate/schema-version->updates.- e.g.
["65.9" {:properties [:logseq.property.embedding/hnsw-label-updated-at]}]
- e.g.
-
If common keywords are added or modified, make corresponding changes in their definitions.
- common keywords are defined by
logseq.common.defkeywords/defkeywords
- common keywords are defined by
-
A function that returns a promise, and its function name starts with "<".
-
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).
-
:block/contentattribute is not used in the DB version;:block/titleis the attribute that stores the main content of the block.