Winter '25 ☃️ Status Update #1328
Replies: 3 comments 5 replies
-
Congrats on joining The Guild and thanks for the update! The core improvements sound great, as does a stable release that can drop into place with minimal migration. Of course my hope is that Graffle could eventually replace our entire GraphQL toolchain:
I have one interesting idea to share, sometimes you may have already thought of yourself while you were down in the "rabbit hole". Increasingly I find myself wanting to transform a type wherever it occurs in a response, e.g. always decoding const graffle = Graffle
.create({ schemaMap })
.scalar(`Date`, {
decode: (value) => new globalThis.Date(value),
encode: (value) => value.toISOString(),
})
.type(`Price`, (value) => formatPrice(value)) I haven't fully thought through the potential ramifications, but it seemed worth sharing. |
Beta Was this translation helpful? Give feedback.
-
Hey @jasonkuhrt, I am using GraphQL fragments a lot, both for selection set sharing, and for getting TypeScript types for a selection subset. I found a way to get TypeScript-native fragments using graffle. Maybe this approach can also be useful for other people migrating from graphql codegen. // graphql/fragments/AuthenticatedUser.ts
import type { Select } from '../generated/client/modules/select'
import type * as SelectionSets from '../generated/client/modules/selection-sets'
import { GameServerListEntryFragment } from './GameServerListEntry' // import another fragment
export const AuthenticatedUserFragment = {
id: true,
_id: true,
username: true,
email: true,
crispToken: true,
crispEmailSignature: true,
crispSegments: true,
realRole: true,
verified: true,
registeredAt: true,
gameServers: {
$: { where: { reservation: false, pinned: true }, first: 10 },
edges: {
node: {
...GameServerListEntryFragment,
},
},
},
} satisfies SelectionSets.User
export type AuthenticatedUser = Select.User<typeof AuthenticatedUserFragment> The neat thing is that you can import fragments everywhere you need them and use them in a similar way as you would in GraphQL using the object spread syntax ( |
Beta Was this translation helpful? Give feedback.
-
I will make no claims about velocity but I will feel good for sustaining focus: #1314. Finally merged. I will be working hard to avoid ever going down a rabbit hole that deep again in one PR. 632 files changed! (haha much of that is generated code for website and tests, but its still 100-200 manually edited files) Phew! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Here is my seasonal update on Graffle, this time the Winter '25 edition ☃️. The previous on was on October 3.
Autumn Retrospective
The Good
✅ Albeit there haven't been many, but I've kept on top of user bugs with only a few recent ones being open longer than normal due to a long living PR (more on that later).
✅ I made a lot of progress towards this, getting the bundle size down to 17kb.
✅ Achieved this!
✅ Achieved this!
✅ Did achieve this!
The Bad
❌ Did not achieve this yet
The Ugly
Conclusion
I am happy that I was able to do what I said I would, for the most part. I also started work at The Guild in December 🎉, ending my three months of full-time work on Graffle. Certainly bittersweet from the point of view of the project haha.
Now The Winter Status Update! ☃️
First let's address the 🐘 in the room regarding reduction in velocity:
Work had definitely slowed since starting my new job full time in December. Such is life! It technically would be possible for me to cram 15-20+ hours a week on graffle but at what personal cost? Finding a balance is paramount for my mental health and its simply not possible for me right now to maintain a full time job, raise two children, take care of myself, my partner, and then apparently work another part-time job called Graffle. Graffle is a joy for me to develop but I won't tolerate it becoming a source of anxiety in my life. This is my art project, a labour of love, and that care I believe is also what makes it special and interesting ultimately. If ever I could financially sustain myself with open source, I would shift my position here a bit, but, so long as love is the only driver, then I must make sure this project fits into my life in a way that demonstrates love toward myself too :) - otherwise slow progress will turn into no progress.
The rabbit hole
For the past 1-2 months I've been slowly progressing in a rabbit hole that has seen me rewrite much of the Graffle data core. It has not been totally crazy though, just crazily executed. The insights I've had are about the static data core of Graffle which all its type safe chaining, extensions, transports etc. are powered by. I'm well over half way on that PR now. It must be merged before anything else happens. The result of that work leads towards a central data structure called "context" that has a set of "reducers" that operate over it at value level (runtime) AND type level. For example adding custom scalars, or transports, or extensions, or various configuration states like if an envelop should be returned by request methods. The core of Graffle becomes something even more fundamental than the client, a data structure. The client is simplified to just being a thin wrapper of methods that run these reducers. I'm excited about the changes I am making, and being excited keeps me motivated to work on Graffle :)
Road Map
I want to focus in on a stable release. It is clear to me that I will not be realizing all my ideas before some ideal release and instead need to make a cut off point with what can be stable, and then push the rest into future releases. The good news is that I'm not too far I think from a stable core and the extension system helps me defer not perfectly resolved features. Here's how I see the path ahead:
Release Strategy
In the end, I hope to release
graffle@8
such that it by default is a near drop-in replacement forgraphql-request@7
, just with a simpler more flexible API (e.g. switch envelope on/off, custom scalars, etc.).I intend to keep all the extensions, and the extension system, in a pre-major release state meaning technically unstable. However the
@graffle/document-builder
extension will be quite mature and likely what I work on immediately next to progress to its1.x.x
release.Conclusion
I am not sure how long this will take me, but I can imagine it being 1-2 quarters, given I find a few hours a week to work on it.
If you actually read all this, amazing, thank you! <3 Let me know your thoughts.
Beta Was this translation helpful? Give feedback.
All reactions