replicache icon indicating copy to clipboard operation
replicache copied to clipboard

Should we change the value of TEST_LICENSE_KEY to be "TEST_LICENSE_KEY"?

Open aboodman opened this issue 1 year ago • 5 comments

We have one example of a user confusing this:

https://discord.com/channels/830183651022471199/1016346958320902244

... but also making the value of the key part of the API could facilitate using it in env vars and so on.

aboodman avatar Sep 05 '22 19:09 aboodman

@phritz for opinion.

aboodman avatar Sep 05 '22 19:09 aboodman

SGTM. An even simpler solution might be to just update the docs to say "... pass replicache.TEST_LICENSE_KEY", but whatever you think is less easy to misuse seems fine. if we go the route of changing its value to "TEST_LICENSE_KEY" then:

  • the new code should accept both the old and the new value
  • there should probably be a brief note in the docs about the change in case they try to pass the new value manually to old code
  • we should update the sample apps to use the new way if syntactically it's any different (suspect we just change package const's value so then they wouldn't change)

phritz avatar Sep 05 '22 19:09 phritz

Yeah let's change it. Low priority, but a little bit nicer for the env var use case that tslocke describes if the value seems more purposeful. We should also document the value and consider it part of the API going forward.

aboodman avatar Sep 05 '22 19:09 aboodman

I think in JS code users will continue to prefer using the constant to avoid "magic number" code smell, but in env vars they can use the string and we will commit to maintaining it.

aboodman avatar Sep 05 '22 19:09 aboodman

sgtm

arv avatar Sep 12 '22 07:09 arv