rocicorp / replicache

Realtime Sync for Any Backend Stack
https://doc.replicache.dev
1.05k stars 37 forks source link

refactor!: Rename ReplicacheOptions.name and Replicache.name to userID. #830

Closed grgbkr closed 2 years ago

grgbkr commented 2 years ago

Problem It is important, but not obvious that ReplicacheOptions.name uniquely identifies the user, authenticates the same user as ReplicacheOptions.auth, and that ReplicacheOptions.auth of a Replicache instance can be used to push the mutations of other Replicache instances with the same name.

Solution Rename ReplicacheOptions.name to ReplicacheOptions.userID, and document its uses. Deprecate Replicache.name in favor of Replicache.userID.

BREAKING CHANGE: Use of ReplicacheOptions.name must be replaced with ReplicacheOptions.userID.

vercel[bot] commented 2 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/rocicorp/replicache/FyLJ6faiZ7xAy2RyqAArFbGN7uF8
✅ Preview: https://replicache-git-grgbkr-sdd-name-to-user-id-rocicorp.vercel.app

aboodman commented 2 years ago

Nit: @arv has in the past pestered me to use my own fork for PR branches. Forwarding the pester (assuming we are still doing that).

aboodman commented 2 years ago

Note: I pushed a new version of this change fixing the conflict.

arv commented 2 years ago

Nit: @arv has in the past pestered me to use my own fork for PR branches. Forwarding the pester (assuming we are still doing that).

That is the common way but I think now that we depend on secrets in GH actions I do not think that works. Given that, putting branches on rocicorp/replicache is unavoidable, but please name them username/description and delete them when done.