Use monotonic ULIDs as the default node ID generator
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- backend
Research direction
Start at Session.generate_id(), where the current crypto.randomUUID() fallback is described. Evaluate the proposed monotonic ULID implementation or package, preserving the custom generate_id override; done means the default produces sortable, monotonic 26-character IDs while existing applications can retain their generator.
Written by the indexing model from the issue text.
Description
Currently, Session.generate_id() falls back to crypto.randomUUID() when no custom generate_id function is provided.
I think monotonic ULIDs would be a better default.
Why?
Svedit treats node IDs as opaque strings, but all the applications I have built on top of Svedit store nodes as standalone records rather than as a single document JSON. In those systems, documents are simply arrays of node IDs, and nodes such as quotes, tasks, or figures become first-class objects that can be viewed/ searched independently.
Using monotonic ULIDs provides a few nice properties at essentially no cost:
- IDs are lexicographically sortable by creation time.
- Creation order can be recovered without requiring a separate
createdAtfield. - Simpler implementation of views like "All Quotes", "Recently Created Blocks", etc.
- Better database index locality compared to random UUIDs.
- Shorter IDs (26 characters vs. 36 for UUIDs).
Monotonic ULIDs (vs. regular ULIDs) also preserve ordering when multiple IDs are generated within the same millisecond.
Downsides
- Requires a small ULID implementation (either via the
ulidpackage or an embedded implementation).
Migration
- Existing applications could override
generate_idif they want to keep the old uuid
- Dominant language
- TypeScript
- Stars
- 691
- Forks
- 20
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from michael/svedit
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Similar issues
-
bug data-types
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/clickhouse-js#1293 ·
Maintainers usually reply within 1 day
-
area: middleware enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
agent/quality testing
Difficulty 1/5 Under an hour Newbie friendliness 95/100
Maintainers usually reply within 1 day
-
GitHub registry install via `gh` credentials rewrites `\u0000`–`\u001f` escapes in source files to `^@`–`^_`Possibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
juspay/agent-distro#203 ·
Maintainers usually reply within 1 day