Commit Graph

145 Commits

Author SHA1 Message Date
Gabriel Horner
f46f75bf10 fix: remove or rename outdated lint namespaces
Also chore of mv ref ns under util
2025-05-13 11:22:20 -04:00
Gabriel Horner
b985020d1f refactor: mv file graph model fns to their own ns
All these fns are only used by file graphs. Most only act on file only
attributes e.g. :block/file, :block/pre-block? and :block/namespace
2025-05-09 02:51:54 +08:00
Gabriel Horner
d3b7289b20 refactor: split logseq.db.common.sqlite into 2 namespaces
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
2025-04-28 12:55:16 -04:00
Gabriel Horner
691b8866ef refactor: mv another common ns out of db dir
Allows for more improved separate linting
2025-04-28 11:27:49 -04:00
Gabriel Horner
6a635ecb49 refactor: mv common ns out of db ns
Also move common and file fns out of db ns. Cleanup allows
for better separation linting
2025-04-28 10:37:13 -04:00
Gabriel Horner
762b83a3c9 refactor: use less util/node-test? where possible
also add new ns to kondo lint
2025-04-23 10:30:00 -04:00
Gabriel Horner
04a93f6613 chore: mv db or file graph specific ldb fns to
db or file graph namespaces. Follow up to
https://github.com/logseq/logseq/pull/11774#discussion_r2035354875 to
help avoid bugs that are hard to spot b/c of no organization
2025-04-15 22:45:16 -04:00
Gabriel Horner
cd5385a0c3 chore: mv graph view ns to frontend ns
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
2025-04-11 09:30:14 -04:00
Gabriel Horner
6ce701ccc3 fix: remove clj-kondo/ignore
that was moved to incorrect location.  Also fix clj-kondo config
so those ignores aren't needed anymore
2025-04-08 13:36:17 -04:00
rcmerci
b7d65b82e3 refactor(wip): add def-thread-api, and move fns from class DBWorker 2025-03-26 16:47:28 +08:00
Gabriel Horner
06b3bba5fc enhance: add export edn graph as file
Remove command version of export which is a less useful dev tool
than what's possible with cli
2025-03-17 23:28:43 -04:00
Gabriel Horner
04b832f5cb chore: mv file graph specific fns out ldb 2025-02-20 12:37:13 -05:00
Gabriel Horner
e92b107b5b fix: entity-util/{journal?,whiteboard?,page?} calls
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
2025-02-19 16:29:26 -05:00
Gabriel Horner
0964331b8a chore: move 2 more db namespaces to db.common
b/c they are used by both graph types
2025-02-19 16:29:26 -05:00
Gabriel Horner
73cff9db44 chore: mv file-specific vars in db dep
to their own file-based.* namespaces. logseq.db.frontend
can now be linted
2025-02-19 16:29:26 -05:00
Gabriel Horner
18db6b1937 chore: mv db namespaces common to both graphs to logseq.db.common 2025-02-19 16:29:26 -05:00
Gabriel Horner
f597f7c9c0 chore: mv handler.common.file to file-based
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
2025-02-17 14:02:49 -05:00
Gabriel Horner
8710195440 chore: mv handler ns to file-based
since it's only used by file graphs. Also remove unnecessary
db-based-graph? calls in in ns and make aliasing consistent for this ns
2025-02-17 14:02:49 -05:00
Gabriel Horner
b8ad82e650 chore: add kondo aliases for db.sqlite namespaces 2025-01-29 18:03:28 -05:00
rcmerci
9db946c605 enhance: apply defkeywords to built-in classes, add some rtc related keywords 2025-01-09 18:07:13 +08:00
rcmerci
7b9ae93982 enhance: add logseq.common.defkeywords 2025-01-08 21:22:22 +08:00
rcmerci
61054768c1 refactor: replace all rum/use-effect!, add kondo :discouraged-var config 2025-01-08 13:57:28 +08:00
rcmerci
fd0bc933e9 refactor: make react hooks compatible with cljs builtin types 2025-01-07 20:32:00 +08:00
rcmerci
dd17560fd5 refactor: add clojure.string to :consistent-alias in kondo-config 2025-01-03 16:35:11 +08:00
Gabriel Horner
6116b51a46 chore: replace test helper with better supported promesa fn 2024-11-14 12:10:45 -05:00
Gabriel Horner
939dd23f79 chore: use test helpers across db tests
instead of copied and pasted versions
2024-09-27 14:54:03 -04:00
Gabriel Horner
a0d4e43d18 enhance: add /Advanced Query for db graphs
Related to
https://linear.app/logseq/issue/LOG-3246/improve-advanced-query-editor.
Had to upgrade promesa to get p/doseq
2024-09-26 10:55:50 -04:00
Gabriel Horner
afe4280c6a refactor: DRY up spread out definition of db's
namespace/parent feature. Following up to #11517, provide vars
so it's clear how a feature is used and coupled throughout the codebase
2024-09-23 14:53:12 -04:00
Gabriel Horner
5146e0da40 fix: validate property name when changed from menu
Fixes logseq/db-test#69
2024-09-10 17:45:05 -04:00
Gabriel Horner
e5e9c5c687 chore: mv file-based util namespaces to their own directory
Makes maintenance of different graph types easier and increases linting
of what occurs in these namespaces
2024-09-09 14:31:56 -04:00
Gabriel Horner
70383cd813 fix: stop shadowing vars for rest of frontend
Follow up to 5ff364ba1e
2024-09-07 00:13:09 -04:00
Gabriel Horner
47970ee4c6 fix: :node property values should show unique names by tag
Fixes logseq/db-test#44 and also a part of LOG-3191
2024-08-30 12:36:49 -04:00
Gabriel Horner
5ff364ba1e fix: stop shadowing vars for components
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
2024-08-23 15:19:33 -04:00
Gabriel Horner
261118d4dc refactor: finish frontend independence from worker and add lint
Remaining fixes worker all file related. Fixes LOG-3717
2024-08-09 12:16:20 -04:00
Gabriel Horner
20eac03cea refactor: mv common worker/frontend ns to frontend/common
Move common core.async, date and search utils to frontend/common.
Part of LOG-3171
2024-08-09 11:18:32 -04:00
Gabriel Horner
7a40761eca refactor: organize worker namespaces and lint them
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
2024-08-08 23:01:57 -04:00
Gabriel Horner
c660096937 fix: common test failing due to code organization
datascript based utils should be in db dep. common is for dependency free
namespaces
2024-08-08 09:24:02 -04:00
rcmerci
00fb6c52e7 fix(lint): update clj-kondo config to exclude test-graph dirs 2024-07-24 17:53:21 +08:00
Gabriel Horner
3746b8c848 fix: lint and update related ns to have consistent alias 2024-07-22 09:46:49 -04:00
Gabriel Horner
84638989f6 chore: remove some unused db fns and aliases
and some aliases that were barely used
2024-06-25 17:37:52 -04:00
Gabriel Horner
b35f30e203 fix: circular dependency between outliner and frontend
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
2024-06-19 17:21:22 -04:00
Gabriel Horner
9a8c91c0cc chore: mv logseq.db.sqlite.db into sqlite.cli
for more explicit name and purpose. Also updated outdated db readme
and removed unused fns in logseq.db.sqlite.db
2024-06-14 16:53:19 -04:00
Gabriel Horner
8ba5c15f93 fix: remove cli namespace dependency from electron namespaces
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
2024-06-14 15:50:05 -04:00
Gabriel Horner
effde81161 enhance: all user classes have :db/ident
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
2024-05-28 16:52:12 -04:00
Gabriel Horner
d1d50a5b85 chore: mv marker + priority fns to file specific ns
part of LOG-3042
2024-05-06 14:52:28 -04:00
Gabriel Horner
24c48e7a87 fix: multiple fixes related to lookup-by-name
- 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
2024-05-02 15:16:03 -04:00
Gabriel Horner
5c81b61774 fix: file graphs can't load b/c db specific attribute fetched 2024-05-01 09:07:23 -04:00
Gabriel Horner
0aa4bda66c fix: inlined db-based-graph? calls in db-property
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
2024-04-16 14:43:28 -04:00
Gabriel Horner
97367c3d4f fix: add timestamps to built-in property pair
Also cleanup build-initial-properties and remove unused ns
2024-04-11 18:23:52 -04:00
rcmerci
2772592720 enhance(undo): batch process undo/redo-ops 2024-04-09 12:27:33 +08:00