Hello!
This post is the continuation of a conversation started in OMG’s #plugin-dev channel.
The objective is to better measure interest, and keep the conversation better referenced for Obsidian team and every member of the community interested in the feature.
What is it about ?
In the early days of Bases, one could read « Some planned features include: Bases API for plugins to add more power through custom functions ».
This was, and still is, a wonderful idea! It solves a lot of different uses cases like:
- Share a formula between different Bases files & embeds
- Distribute a formula to different vaults & users
- Grant a way to have complex logic more readable
- Possibly yields better performances
Relevant Feature Requests
Here is a just a few recent Feature Requests submitted on the forum that I believe solvable by this:
- /t//107489: Directly define base formulas in JavaScript
- /t//102027: Collection of formulas to choose from
- /t//104901: Introduce constants in base functions
- /t//106027: Bases Window Functions
Implementation Considerations
Summarizing some chats from the community on implementation.
- Concern about duplicated function/formula names: To address this, functions exposed by a plugin would be available to user by first accessing a unique id/name for the plugin, as we already do for views. So perhaps
azaol_astro.western_emojified(dateProperty).
I’ll update this post from time to time with other piece of information gathered discussing this on the Discord group and this forum post. Comment below if you want to add or improve something written above!