This is a major architectural overhaul compared to 2.0.
Please — as always — make sure you regularly backup your space files to avoid any data loss. Nothing should happen, but better be safe than sorry!
The server has been rewritten in Go (previously Deno). This uses significantly less memory (think: 10x), is significantly smaller in size (think: 10x), and likely faster (although server performance was never really a bottleneck).
Docker base image is now based on Alpine (previously Ubuntu), further reducing memory and disk space usage (think 5x).
Significant sync engine re-architecture: see Architecture and Sync, now lives in the service worker (so can partially happen in the background) and parallelizes sync. Once upgrading a full resync will need to happen. Documents are no longer synced by default (you can enable this via config, see Sync).
More configuration options for what to index for the purpose of reducing local storage size and needless CPU waste. Some useful ones:
config.set("index.search.enable", false) to disable Full Text Search entirely (saves on processing and storage if you don’t use it)
config.set("index.paragraph.all", false) to disable indexing all (untagged) paragraphs. This is also somewhat wasteful if you don’t query these.
Disable ability to rename pages in read-only mode (by Jelenkee)
Command to toggle markdown syntax rendering (by aphymi)
Fix transclusions not being indexed as links (by MrMugame)
Render links inside frontmatter code as clickable anchors (by Andy Constanza)
New SB_LOG_PUSH option asking clients to push their browser JS logs to the server so they’re visible there.
I’d like to thank all contributors and people who are living on the edge builds for having been testing this for the last few weeks. I’m sure there’s still issues, but I’ll try to fix those as they show up.
A special shout out to my sponsors, thanks to whom I managed to spend significantly more time on SB over the last weeks, obviously resulting in big investments in the fundamental.
Btw, if you’re wondering: what happened to 2.1.0-2.1.1? Yeah, I messed up some things, ignore them!
I had removed the page:saved event because nothing (appeared to be) using it and it wasn’t really documented. Since you seem to be using it, I just brought it back (will be in the next release).
As to cron:secondPassed that is still there? I’m using it also in my Git library and it triggers just fine?
As to where the plugs should be defined, this really doesn’t matter, it doesn’t need to be CONFIG. Do note that if you put it in multiple places, the values will override each other.
@Zef Thank you for helping me preserve the page:saved event.
I double-checked, and cron:secondPassed is functioning normally.
Last time, I mistakenly set the interval to 10, assuming the unit was seconds. In fact, it was 10 minutes. After waiting just 1 minute without seeing any result, I wrongly thought that cron:secondPassed had disappeared together with page:saved during the version update — it was simply my misjudgment.
I now realized that this adjustment is not required by the version upgrade itself, but only necessary to comply with the format mentioned in this post:
I have no further issues — 3 matters have all been resolved.
I’m trying to switch to 2.1 (2.1.6-0-g9521c76) from 2.0 and getting this error
Failed to process config Parse error at pos 44885
When I start with fresh data , copy paste current CONFIG file content, then run reload, I see no errors in the console.
Problem exists when refreshing the page.
Is it because my CONFIG file is too big? It has 3028 lines
Ok, generally I would say this is not the best idea. Perhaps it’s better to just use CONFIG for config.* API calls, and move the rest elsewhere (anywhere, really).
Note, as of 2.1.7 it is no longer supported to concatenate strings using the + operator in Space Lua, you have to is the proper .. operator instead. This should never have worked, because it’s not Lua defined behavior, but if you depended on it you may see some errors because of it.
I’m pretty sure mine is because I’d specified an incorrect SB_HOSTNAME environment variable – I had it as :: (which I thought was needed for the JS server to bind to the IPv6 address), but Go didn’t like that. I swapped to fly’s recommended value of fly-local-6pn and things are working just great again!
The weird thing about my fly.io setup is I’m not exposing an IPv4 port; I’m strictly getting to my hosted SB through a fly proxy as an added layer of security.