rocicorp / repc

The canonical Replicache client, implemented in Rust.
Other
31 stars 7 forks source link

Add push version #311

Closed arv closed 3 years ago

arv commented 3 years ago

Towards #290

arv commented 3 years ago

Doesn't really do much 🤷

arv commented 3 years ago

TBR

aboodman commented 3 years ago

On Sat, Feb 27, 2021 at 12:43 PM Erik Arvidsson notifications@github.com wrote:

@arv commented on this pull request.

In src/sync/pull.rs https://github.com/rocicorp/repc/pull/311#discussion_r584200357:

@@ -255,6 +257,7 @@ pub struct PullRequest { pub cookie: String,

[serde(rename = "lastMutationID")]

pub last_mutation_id: u64,

  • [serde(rename = "pullVersion")]

The JS API is still all camelCase. This is just for the json.

https://developer.mozilla.org/en-US/docs/Web/Manifest https://developer.chrome.com/docs/extensions/mv3/manifest/

What is the distinction between the JS API and the JSON?

In Next.js, I consume the JSON and use it as JS objects via JSON.parse. There's not really a decode step that I have fine control over...

The links you provided are for web platform APIs, and I don't feel like it's really the same. I'm wondering if there's a strong convention to prefer snake case for web service APIs.

—

You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rocicorp/repc/pull/311#discussion_r584200357, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAATUBGLKZMV7TS2OSIBJCTTBFYQDANCNFSM4YJJIGBQ .

aboodman commented 3 years ago

On Sat, Feb 27, 2021 at 12:58 PM Aaron Boodman aaron@aaronboodman.com wrote:

On Sat, Feb 27, 2021 at 12:43 PM Erik Arvidsson notifications@github.com wrote:

@arv commented on this pull request.

In src/sync/pull.rs https://github.com/rocicorp/repc/pull/311#discussion_r584200357:

@@ -255,6 +257,7 @@ pub struct PullRequest { pub cookie: String,

[serde(rename = "lastMutationID")]

pub last_mutation_id: u64,

  • [serde(rename = "pullVersion")]

The JS API is still all camelCase. This is just for the json.

https://developer.mozilla.org/en-US/docs/Web/Manifest https://developer.chrome.com/docs/extensions/mv3/manifest/

What is the distinction between the JS API and the JSON?

In Next.js, I consume the JSON and use it as JS objects via JSON.parse. There's not really a decode step that I have fine control over...

The links you provided are for web platform APIs, and I don't feel like it's really the same. I'm wondering if there's a strong convention to prefer snake case for web service APIs.

I see what you mean. You're saying the client side API is still camel case. I get that -- it's only the server developer who sees these names.

It looks like there's no strong convention. The google styleguide says camelcase: https://google.github.io/styleguide/jsoncstyleguide.xml?showone=Property_Name_Format#Property_Name_Format, but google maps uses snake :). Facebook and Twitter APIs both use snakecase.

I guess since I'm currently in JS land on the server constructing these responses, so that's where the slight preference that it feels js-y is coming from.

Guess I don't have that strong a preference is you feel strongly about this. I can see the argument your way.

—

You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rocicorp/repc/pull/311#discussion_r584200357, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAATUBGLKZMV7TS2OSIBJCTTBFYQDANCNFSM4YJJIGBQ .

arv commented 3 years ago

As long as it is consistent I do not care too much either. I was just trying to match some kind of industry convention but it seems like there really isn't enough of one.

Using camelCase is nicer in some way because we do not need eslint comments everywhere.

I'm just going to stick with what we have.