The majority of this ns is focused on graph initilization and
entity lazy loading so split this out to new ns,
logseq.db.common.initial-data. Originally
initialization was tied to sqlite util fns but it has not made
sense for awhile to think of them as sqlite util fns
Graph view is fairly tied to the frontend, has styling concerns in the
ns and doesn't have use cases outside the app. frontend.common is
the parent ns for frontend code to reuse across UI threads.
Didn't move db-view because there are use cases for generating view
entities outside the app and there's no styling related code in it
Split up fns of these checks into entity-util, file-entity-util and
common-entity-util so that we have explicit fns for checking in single
or multi-graph contexts. By doing this, were were able to fix more than
20+ fns that were calling general fns in a single graph context e.g.
checking for :block/type in DB graph only namespaces. Some of these
calls were happening on every :block/title lookup so there may be
some perf enhancements
now that this ns is only used by file graph namespaces.
This is important as it then makes explicit that another 500+ lines
in the graph-parser are file-graph specific. Also added docs to most
graph-parser namespaces to make explicit which are file-graph specific
and not
Turn on kondo :shadowed-var lint and fix failures. If this lint had
been turned on, it would have caught logseq/db-test#38 and saved us time
from debugging which random component was accidentally shadowed by a var
and failing with 'Objects are not valid as a React child'. Also fixed a
few outside components but stopped b/c there are too many to do right
now
Organize them to live under src/main/frontend/worker and add a lint to ensure
that common code with frontend is only under frontend/common/.
Add a linter to ensure that worker doesn't depend on frontend.
Motivated to fix after recent worker breakage fixed by
75463c4df4
by moving batch-tx into outliner dep. Outliner dep is
now fully independent and we are able to write unit tests
for all outliner namespaces unlike before
Added a :discouraged-namespace linter check for future times.
Had to add clj-kondo configs for db and outliner since they
were incorrectly inheriting the frontend config, specifically
the :discouraged-namespace linter. Also removed a 'm/=>' in outliner dep
b/c it would've created a complex clj-kondo setup for malli that
would need to be updated for both top-level clj-kondo and deps/outliner
This is important as a user's ontology (properties + classes) is now describable
with unique identifiers. This will allow for easy sharing and
importing of ontologies between users.
Also <create-class! now exists to create classes consistently. Will
be helpful when we want to provide some validation for classes
- only use it for user properties
- don't use create ident fn to lookup names
- fixed get-area-block-asset-url which didn't work for db graphs without
the frontend
Addressed fixmes for db-based-graph fns that were inlined to prevent
circular dependencies b/n db-property and sqlite-util. Moved multi
graph fns to db-property-util and existing db-property-util to
db-property-build to address this