Evaluate Orbit.js

Created on 5 June 2023, about 1 year ago
Updated 2 April 2024, 3 months ago

Problem/Motivation

from @bradjones on Slack: https://drupal.slack.com/archives/C05BP6659U0/p1685984122116309

---

> I would love to make a kinda-impassioned argument that for the transport and lower-level basic implementation that we not start from scratch but take a long look at something like Orbit.js that could be used as a starting point. It has a friendly license and I am already using it extensively to connect to Drupal from a RN client on native and web. I know the maintainer and I think this could be a great way to super-charge the project without duplicating effort on stuff that is already solved well, and then build extra Drupal-y stuff on top. https://orbitjs.com/

---

Now is the time to evaluate options like this. Could it meet our needs? Is it aligned with the goals stated for the project? Other pros/cons?

Proposed resolution

Remaining tasks

πŸ“Œ Task
Status

Closed: outdated

Component

Miscellaneous

Created by

πŸ‡ΊπŸ‡ΈUnited States brianperry

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @brianperry
  • πŸ‡©πŸ‡ͺGermany D34dMan Hamburg

    I do agree that it doesn't make sense to start from scratch.
    At the same time, for a long term success, we should reduce the dependencies as much as possible. Especially when dependencies brings in their own bunch of dependencies which are not under our control.

    I suggest we design a clear user friendly API for our client. We can use orbit.js or something similar under the hood though. This can later evolve into a plugin based architecture that helps you swap the transport layer if needed. But having a normalised API would help develop and maintain other parts that depends on the client, which is the 'main' goal if you ask me.

  • πŸ‡ΊπŸ‡ΈUnited States brianperry

    I don't want to reinvent the wheel if we don't have to. I also agree that we probably need to be extra careful with dependencies, especially for something like the base class in the project.

    Still learning, but Orbit's JSON:API implementation seems to be pretty Orbit specific - as in it isn't really intended to be used out of the context of Orbit. And Orbit also seems to depend on a pre-defined schema.

    Given that, I wonder if where Orbit would be most useful would be a little higher level. This project will still need to have a JSON:API client that can work with a not-yet defined schema. But we could also provide utilities to source JSON Schema data from Drupal (ideally aligning with @bradjones' JSON data/schema work for Core). That would make getting the schema data necessary for Orbit easier. And it could even be formalized as a Drupal Orbit package of some kind.

    That's how I've been thinking of this effort - the more we focus on our extensible base (initially validated by creating a JSON:API client,) the easier it can be for Drupal to work with things like Orbit, and other similar solutions that may not even exist yet. Long-term if that allows one of the other things built on top of this to organically become the community standard rather than this first JSON:API client, that doesn't seem like a bad thing to me.

  • πŸ‡ΊπŸ‡ΈUnited States cosmicdreams Minneapolis/St. Paul

    Not sure I follow here, Orbit sounds like it's specific to Orbit. But we want a general client (not Orbit specific). There might be value in studying their solution, but we may need to hack it to make it more general.

    Am I following the logic her properly?

  • Status changed to Postponed 12 months ago
  • πŸ‡ΊπŸ‡ΈUnited States brianperry
  • πŸ‡ΊπŸ‡ΈUnited States bradjones1 Digital Nomad Life

    Re: #4, Orbit isn't specific to Orbit, and in fact it's maintained by one of the JSON:API spec maintainers so he explicitly designed Orbit to have internal storage that mimicked the JSON:API attributes/relationships model.

    Some of the internal terminology is a little different (since, conversely, Orbit doesn't require JSON:API) but when you create a record for storage in Orbit, it is by definition JSON:API compatible and there is a first-class driver for interacting with a remote system in Orbit core.

    I'll expand on this a bit over at #3365506: [Meta] Vertical Slice POC β†’ , but wanted to directly answer your question here.

  • Status changed to Closed: outdated 3 months ago
  • πŸ‡ΊπŸ‡ΈUnited States brianperry

    Closing as we've completed our 1.0 release and taken an approach that doesn't involve this library.

Production build 0.69.0 2024