Components as Data: A Cross Platform GraphQL Component API - Luke Herrington - JSConf US 2019

Channel:
Subscribers:
42,500
Published on ● Video Link: https://www.youtube.com/watch?v=cLpHhgLGCHw



Duration: 34:07
34 views
1


Discussions about "when to use decoupled architecture are plentiful and important, but it often assumes or ignores another tricky decision: "Where" to decouple. This talk will discuss the "Decouple Line" and how moving it around provides some amazing features to your API.

When designing a content API, the assumption is often that decoupling must take the form of an API that matches your data model, where tables in your data store are mapped to resources in your API (think, /author and /posts). This is often helpful and necessary for exposing the raw data that our UIs need, however, in a cross platform scenario where teams are all building similar features, this can lead to a lot of duplicated efforts and discrepancies between the apps. All of these platforms will be writing similar queries, denormalization logic, business logic, and A/B tests, and then finally render the UI with their respective component libraries. This can lead to platform specific bugs, inefficient queries, and design inconsistency across platforms.

Components as Data moves the "decouple line" further toward the frontend to absorb queries, denormalization, business logic, and A/B testing into the backend. In practice, the API serves JSON structured in terms of the tree of UI components that will be used to render the respective data. In doing so, it becomes a quasi frontend in its own right, but it renders JSON instead of HTML or native views. This enables some amazing features:

1. Simpler, presentational frontends

2. Centralized business logic

3. Centralized A/B Testing and Feature Flagging

4. Design consistency via a "Design Schema"

5. Query optimization

Finally, this pattern opens the door for writing a cross platform UI library that implements the "design schema" and can be used as the rendering engine for each platform.




Other Videos By Confreaks


2022-07-06Native Web Apps: React, JS & WebAssembly to rewrite native apps - Florian Rival - JSConf US 2019
2022-07-06CSS Algorithms - Lara Schenck - JSConf US 2019
2022-07-06JavaScript: Off the Grid - Sophia Shoemaker - JSConf US 2019
2022-07-06Creating an AI Musician with JavaScript - Thomas Drach - JSConf US 2019
2022-07-06A Postmortem on the Ingen Incident - Hayley Denbraver - JSConf US 2019
2022-07-06Playing Pokemon Together With Node.js - Samuel Agnew - JSConf US 2019
2022-07-06How we’re embracing functional programming to build a large SPA - Anton Abilov - JSConf US 2019
2022-07-06“WTF does run mean?” & other adventures in teaching others to code - Suzie Grange - JSConf US 2019
2022-07-06Make Web Not War - Dominik Kundel - JSConf US 2019
2022-07-06We Started Using Webpack and It Took A While - Salem Hilal - JSConf US 2019
2022-07-06Components as Data: A Cross Platform GraphQL Component API - Luke Herrington - JSConf US 2019
2022-07-06Building a distributed graph w/ Apollo Federation - Gerwin Brunner & David Krehling - JSConf US 2019
2022-07-06Building Open Source Communities - Tierney Cyren - JSConf US 2019
2022-07-06Empathy is not enough - the power of engaging hard-to-reach users - Ariba Jahan - JSConf US 2019
2022-07-06Just go for it: The story of dance-mat.js - Ramón Huidobro - JSConf US 2019
2022-07-06Creating Beautiful LED Art with JavaScript - Bryan Hughes - JSConf US 2019
2022-07-06¿Donde Esta La BiblioTech? - Patricia Realini - JSConf US 2019
2022-07-06Meet the Packets: How audio travels into your browser - Sara Fecadu - JSConf US 2019
2022-07-06Trans Eye for the Cis Ally: Ensuring an Inclusive Community - Julien Fitzpatrick - JSConf US 2019
2022-07-0611Y IRL (Accessibility in real life) - Theodore Vorillas - JSConf US 2019
2022-07-06Web Norms of the World - Kat Kitay - JSConf US 2019