Discussion
Loading...

Post

  • About
  • Code of conduct
  • Privacy
  • About Bonfire
dansup
@dansup@mastodon.social  ·  activity timestamp yesterday

I'm proud of how far the Loops API has come.

This is the comment resource response, it's not bloated, and contains only contextually useful data.

We also return cursor pagination data in the response so you don't have to parse headers.

And mention indices, so you don't need to parse HTML to handle mention links in your client.

It's not magic, it's just an API designed by a fellow app developer 😉

#loops #loopsDev

Loops comment api resource response
Loops comment api resource response
Loops comment api resource response
  • Copy link
  • Flag this post
  • Block
KielKontrovers Blog
@kielkontrovers@norden.social replied  ·  activity timestamp 21 hours ago

@dansup APIs shouldnt be designed, APIs should be Schema.org. Everything else i dont understand. API should be standards.

  • Copy link
  • Flag this comment
  • Block
Григорий Клюшников
@grishka@friends.grishka.me replied  ·  activity timestamp yesterday

Also, string-based timestamps suuuuuck. But that's more of a taste thing than the inlining of the account objects.

  • Copy link
  • Flag this comment
  • Block
Григорий Клюшников
@grishka@friends.grishka.me replied  ·  activity timestamp yesterday

It can be made even better.

You don't want to include accounts inside the comments or other content objects. You want to return them on the side in an array, like I'm doing in Smithereen, which is mostly copying VKontakte API (minus the tech debt). Imagine you have a thread with multiple comments by the same person. With your (and Mastodon's) approach, you end up with that account object repeated for each of the comments. The compression will alleviate some of that as far as the network traffic is concerned, but the client will still have to waste its resources to parse each one of those instances of that account object.

Sorry, no caption provided by author
Sorry, no caption provided by author
Sorry, no caption provided by author
  • Copy link
  • Flag this comment
  • Block
Log in

A small Bonfire corner on the internet

This is a small personal instance of Bonfire in the Fediverse.

A small Bonfire corner on the internet: About · Code of conduct · Privacy ·
Bonfire social · 1.0.0-rc.3.6 no JS en
Automatic federation enabled
  • Explore
  • About
  • Code of Conduct
Home
Login