I'm working on Watermark'd. We want to give businesses a verified digital identity that works across the globe starting with businesses registered in South Asia (DUNS number that works for the 21st century).
What we do is quite simple
1. Verify the business is registered in the claimed jurisdiction.
2. Verify if individuals have the authority to act on behalf of that business.
3. Provide sharable credentials.
My hot take is that if you’re using GraphQL without Relay, you’re probably not using it to its full potential.
I’ve used both Relay and Apollo Client on production, and the difference is stark when the app grows!
- you don't have a normalized cache. You may not want one! But if you find yourself annoyed that modifying one entity in one location doesn't automatically cause another view into that same entity to update, it's due to a lack of a normalized cache. And this is a more frequent problem than folks admit. You might go from a detail view to an edit view, modify a few things, then press the back button. You can't reuse cached data without a normalized cache, or without custom logic to keep these items in sync. At scale, it doesn't work.
- Since you don't have a normalized cache, you presumably just refetch instead of updating items in the cache. So you will presumably re-render an entire page in response to changes. Relay will just re-render components whose data has actually changed. In https://quoraengineering.quora.com/Choosing-Quora-s-GraphQL-..., the engineer at Quora points out that as one paginates, one can get hundreds of components on the screen. And each pagination slows the performance of the page, if you're re-rendering the entire page from root.
- Fragments are great. You really want data masking, and not just at the type level. If you stop selecting some data in some component, it may affect the behavior of other components, if they do something like Object.stringify or JSON.keys. But admittedly, type-level data masking + colocation is substantially better than nothing.
- Relay will also generate queries for you. For example, pagination queries, or refetch queries (where you refetch part of a tree with different variables.)
There are lots of great reasons to adopt Relay!
And if you don't like the complexity of Relay, check out isograph (https://isograph.dev), which (hopefully) has better DevEx and a much lower barrier to entry.
And its exchange system is super powerful and flexible. I’ve even seen an offline-first sync engine built as a custom URQL exchange in a react native app. The frontend could be written as if the app always is online but it would handle offline capabilities within the exchange.
Cool demo and a neat write-up! I've been experimenting with similar patterns to differentiate between search queries/question answering and presenting specific outputs to the user.
I disabled my YouTube watch history and installed Unhook. Combined, this essentially hides all recommendations, shorts, etc. I had tried blocking YouTube completely in the past, but it's a genuinely useful tool for learning and work. The new approach still lets me pull information while shielding me from the endless rabbitholes and passive consumption.
As a local, Sri Lanka turning into Bali is one of my biggest anxieties at the moment. I've grown up around the hospitality industry all my life, it's not a good outcome for locals. Tourism should be considered an auxiliary industry not the primary industry.
I agree. Its highly volatile, and has a huge environmental impact.
The ups and downs of tourism during the civil war illustrated it clearly. So did the impact of the Ukraine war (there used to be a lot of Russian tourists).
I was shocked by how cheap hotels had once again become when I last went back to Sri Lanka (2023)
I built a writing/formatting product now used by 60k+ indie authors. One of the requirements was to format PDFs for print publishing with different themes and configurable layouts. Instead of building a custom PDF rendering engine, I decided to use Puppeteer to generate the PDFs.
But there were a bunch of issues we had to deal with:
- To render the gutter (margin in the middle) you had to know which side of the book each page would fall on.
- To generate the headers and footers, you had to know the exact page number for each of the pages.
- You had to know how many pages the table of contents would take up, but you couldn't know the page numbers for each chapter until the book was fully generated.
What I ended up doing was to generate multiple PDFs for each chapter, header, footer, and table of contents separately, then stitching them together very carefully to build the final export. Super hacky, but it ain't stupid if it works!
Out of curiosity, did you consider transpiling to LaTeX? Memoir.cls is fantastic at those sorts of calculations and actually the formatting output from pandoc is usually quite good too.