MEMBLOG

Progress Update #3

- 2023-09-20

Here are some of the most notable improvements since our last update.

Simpler Argument Receiving

We've simplified how arguments are received in fields/actions/events resolvers so they are now easier to write; no one likes boilerplate. Instead of receiving an object with an args attribute:

const resolver = async ({ args: { arg1, arg2 } }) => {
  // ...
}

args are now received in the first argument:

const resolver = async ({ arg1, arg2 }) => {
  // ...
}

Much easier to read and write. A second argument is also passed which holds additional parameters like self, context, obj, and info:

const resolver = async (args, { self, obj, info }) => {
  // ...
}

I've been waiting a long time to change this but kept putting it off because of the effort required in migrating all existing code into the new style. Thankfully, I remembered about this little thing called jscodeshift and wrote a codemod to make the transition easier.

Okay, yeah, the codemod was written almost entirely by ChatGPT.

Easier Google Auth

We now provide Mebrane's own authentication for Google Sheets, Google Docs and Google Calendar, so you can more easily use those drivers without having to get your own API keys from Google Cloud, which can be cumbersome. Bringing Your Own Key is and will always be supported.

Visiting a driver's endpoint now looks like this:

A screenshot of the Google auth page in the Google Calendar Driver

Subscriptions now show up in the UI

There's a new section in the "Config" panel that shows outgoing subscriptions for the current program (i.e. what events it is subscribed to). You can also right-click and unsubscribe right from the UI.

This implementation was actually drafted many months ago but it had to be manually refreshed which made it confusing. Now that we have WebSocket support (thanks to the Axum port), we can finally use it and its awesome.

Added quick-fix for params

Instead of adding params to the schema and then implementing them, you can now add params directly to a function's signature and use quick-fix to automatically add it to the schema.

Notable Bugfixes

  1. Fixed timer deletion not being picked up
  2. Fixed timers not auto-refreshing in the UI
  3. Internal: migrated endpoints to axum (no more Rocket)


- Juan Campa (juan@membrane.io)

© 2024 Programmability, Inc.