New on Edge: space config

This was a bigger thing than I anticipated. I hope I implemented this so that it is minimally disruptive, but let me know if things break for you.

I may release this as 0.9.x

Also see the changelog with notes for Edge: CHANGELOG

A head’s up to all plug developers, such as @justyns @Maarrk @joekrill since you can no longer assume all settings will be in a user’s SETTINGS page, you should probably switch to the new system.getSpaceConfig() syscall, which will give you the combined configuration. Not now, but once this is properly released.

Your current code should keep working for some time, but as people switch to using space config, their settings may move elsewhere than just SETTINGS. In addition, for freshly created spaces, new code language for SETTINGS will switch from yaml to space-config, which the current readSetting call that you use does not handle well I think.

Bonus:

Some fun new Library/Core pages like Library/Core/Page/Space Overview

4 Likes

Very cool, that should help organize things better.

Is there (or can there be) an event to listen to for changes to config? In the AI plug, I’m listening to changes to the SETTINGS page specifically to know when to reload the config

Right. At some point I thought about that but then forgot to do it. Will add.

Ok, added a config:loaded event now.

1 Like

Is the original SETTINGS page with a yaml code block still intended to work?

Either way, something I noticed is some settings get ignored until after indexing finished. I have a really large directory ignored by spaceIgnore, but that directory still got indexed.

Maybe a future enhancement would be to grep for files with space-config in them and index those first, then reload the config and continue indexing? Or still load the SETTINGS file first to allow setting some core stuff like the index page, spaceIgnore, and whatever else could affect indexing? I don’t know if it’s worth the effort or not if it’s just a one-time issue though.

Good point. I’d have to think about how to make this better. Right now, from time to time, when an important change is made to an indexer I have a way to force a full space reindex. That was part of this release too. Not too often I hope, but occasionally. A full Reindex will first wipe the existing one and then rebuild it. If you have a large space, or heavy indexing work (like generating embeddings) this can take significant time. All the while your full space config won’t be available.

Perhaps indeed prioritizing SETTINGS is a reasonable hack here… :thinking:

1 Like

Ok, as of Pre-index SETTINGS on full space reindex · silverbulletmd/silverbullet@1bb096f · GitHub this should be better. This performs an index of SETTINGS before anything else.

1 Like