Skip to content

Migrate to dexie 4.2#8

Merged
dfahlander merged 3 commits intomainfrom
migrate-to-dexie-4.2
Aug 18, 2025
Merged

Migrate to dexie 4.2#8
dfahlander merged 3 commits intomainfrom
migrate-to-dexie-4.2

Conversation

@dfahlander
Copy link
Copy Markdown
Collaborator

@dfahlander dfahlander commented Aug 1, 2025

This PR can act as a documentation for migrating from dexie 4.1-beta experimental Yjs support to the new dexie 4.2.x, where the Y.js support has been extracted from 'dexie' into a new package 'y-dexie'.

Not many code changes needed. See the changes in this PR.

Summary by CodeRabbit

  • New Features

    • Improved collaborative editing by adopting the y-dexie integration.
  • Chores

    • Updated Dexie-related packages to stable 4.2.0 releases.
    • Added the y-dexie dependency.
    • Streamlined database configuration and removed legacy awareness protocol handling.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Aug 1, 2025

Walkthrough

Dependencies updated to Dexie 4.2.0 and related packages; y-dexie was added. Database initialization was changed to register the y-dexie addon (removing direct Y.js/awareness wiring) and the cards.doc schema now uses Y.Doc. A provider import/type in the tiptap component was adjusted to y-dexie types.

Changes

Cohort / File(s) Change Summary
Dependency updates
package.json
Bumped dexie, dexie-cloud-addon, dexie-react-hooks to ^4.2.0; added new dependency y-dexie: ^4.2.0.
DB initialization / Y integration
src/app/db/db.ts
Replaced direct Y.js integration with registering y-dexie addon alongside dexie-cloud; removed Y option and awarenessProtocol config; cards table doc type changed to Y.Doc.
Editor provider import & type
src/app/components/tiptap.tsx
Import for DexieYProvider switched from dexie to y-dexie; EditorProps.provider type changed from `DexieYProvider<Y.Doc>

Sequence Diagram(s)

sequenceDiagram
    participant App
    participant DexieStarter
    participant yDexie
    participant DexieCloud

    App->>DexieStarter: construct / initialize DB
    DexieStarter->>yDexie: register addon
    DexieStarter->>DexieCloud: register addon
    DexieStarter->>DexieStarter: define schema (cards.doc as Y.Doc)
    App->>DexieStarter: use DB (with y-dexie + cloud)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

I hopped into the code today,
Swapped bits of Y for a dexie-way.
New addon nests where Y once stood,
Clouds now sync, the schema’s good.
A happy rabbit hops away 🐇✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between e5305c1 and 0b8caeb.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (1)
  • package.json (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.json
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch migrate-to-dexie-4.2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9b4b706 and e5305c1.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • package.json (2 hunks)
  • src/app/components/tiptap.tsx (1 hunks)
  • src/app/db/db.ts (2 hunks)
🔇 Additional comments (3)
src/app/components/tiptap.tsx (1)

19-19: Confirm the generic parameter for DexieYProvider

The prop type was changed from DexieYProvider<Y.Doc> | null to DexieYProvider | null, which may drop important type information. I couldn’t locate the DexieYProvider definition in your node_modules/y-dexie typings, so please verify whether the new provider type is still generic. If it requires a type argument, restore the <Y.Doc> parameter to maintain type safety.

• File: src/app/components/tiptap.tsx
– Line 19: provider?: DexieYProvider | null

src/app/db/db.ts (2)

52-52: LGTM! The addon integration looks correct.

The migration properly replaces the direct Y.js integration with the y-dexie addon. The addon ordering (yDexie before dexieCloud) appears intentional and correct.


60-60: Good type consistency improvement.

Changing the schema definition from doc:Y to doc:Y.Doc aligns with the actual type used in the ICard interface and improves type specificity.

Comment thread package.json Outdated
@dfahlander dfahlander merged commit 235e3eb into main Aug 18, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant