Am I missing something, or are custom plugins unnecessarily complicated?

Apologies if this comes across as critical. I’ve only recently started using Baserow, and I’ve been very impressed with it so far. It’s a great tool, and I’m very happy it exists.

However, I recently skimmed the documentation and sample plugins with the idea of making a custom plugin to add a formula function to my baserow install, and I’m left feeling like this process is far more complicated than it should be.

Say I want to create a new formula function like this:

tocaps("my string") >> "MY STRING"

I would expect that such a plugin could potentially be as simple as the following two files:

# plugin.ts

export default {
  name: "My Plugin",
  functions: "./functions.ts"
}

# functions.ts

export function tocaps(input: string): string {
  return input.toUpperCase();
}

(I only used TypeScript in my example since that’s the language I’m most comfortable in. I don’t actually care what language plugins are written in.)

However, from my limited understanding of how Baserow custom plugins are expected to be built, such a plugin would require many more directories, files, and configurations to achieve the same basic result.

Am I correct in saying this? I’m really hoping I’m wrong here.

Anyway, my strong preference for a Baserow plugin architecture would that it be as thin and unopinionated as possible. Provide some basic entrypoints for the plugin developer to hook into, and then let the developer decide how complicated or simple they want to make their plugin architecture based on the problem they’re trying to solve. I think taking this approach would both make it far easier for people new to Baserow to learn how to build plugins, and simultaneously make it much easier to build a wide variety of powerful plugins without wrestling with Baserow’s assumptions.

Again, I’m currently very impressed with Baserow, but ran into this today and wanted to share my thoughts in the hopes that I’m wrong about how simple a plugin can be, or that my perspective might have some influence on the future direction the team takes with plugin support.

Hi @narthur,

Thank you for your feedback. I completely understand your perspective and agree that a good plugin architecture should be as minimalistic and unopinionated as possible.

However, our current architecture necessitates the implementation of both the backend in Python (Django) and the frontend in JavaScript (Vue.js/Nuxt.js) for a custom plugin. While we strive to achieve a thinner and less opinionated architecture, we’re not there yet.

For example, our formula language is a language shared between the frontend and the backend. The frontend requires the knowledge of the syntax to ensure that the formula is correct in terms of syntax, while in the backend, the formula is transformed into an SQL query after parsing and sanitization. This is done to achieve the fastest possible processing of all rows of the table(s)

This has the benefit of being very fast when updating large volumes of data running a SQL query, but the downside is that a simple formula requires both the definition in the front end and the actual implementation in the back end.

This explanation is not meant to sound like a justification for the fact that creating a plugin seems more complicated than necessary, but rather an example of a deliberate compromise we’ve made in favor of ensuring performance, even with large volumes of data, at the expense of a system that is very easy to extend but would not be able to guarantee the same performance with large datasets.

1 Like

I appreciate the extra context here. It makes sense that you can’t allow plugin developers to just do whatever they want since you need to compile to SQL for performance reasons. Super useful to understand.

I’m sure you all are way ahead of me on all this, but just thinking, what if the API was more like this?

export function myPlugin(context: PluginContext) {
  context.fluent().api().that().compiles().to().sql();
}

It seems like you might be able to then use a single function provided by the plugin developer to both compile to SQL and also infer the front end typing.

Just a vague idea at the moment. Maybe later I’ll try working it through with a plausible use case to see if it still seems to make sense.

@narthur I chose baserow as the platform for my app in mid 2022 and did a deep dive to understand the plugin architecture, spent countless hours to try to understand it. I even wrote a lengthy tutorial hoping to get other developers interested in baserow plugins: How to create a ChatGPT language translation plugin . And I agree with you it’s complicated. But there’s nothing else like it out there if you need the customizability.

The customizability may be too much if all you want is essentially a formula. If that’s your case, what’s your thought about simply integrating with the rest API and webhooks ?

I would love to have a simple way to essentially add a “python-powered formula”. And here’s the fun fact: someone could actually develop that as a plugin, maybe it’ll come one day. In fact, why don’t you elaborate on what you’d like the interface to be ? Maybe it could be like that of the “AI field” but accept python code as configuration ?

Over the long term, the open and developer friendly nature of baserow pretty much guarantees it will dominate over close sourced alternatives like airtable. It’s the same story, windows vs linux, mssql/sybase/oracle vs postgres. Iphone app store comes to mind also.

3 Likes