RW9 (21040b) Alpha Build 🎉

Hey guys,

For you brave souls that have been after a RapidWeaver 9 build, here it is!

RapidWeaver 9 ALPHA
Example Plugin
RWKit

WARNING: This is an ALPHA build and contains many known bugs and broken features. Do not use in production.

New file format

RW9’s document saving code has been completely re-built. It’s faster, safer, and uses Apple’s recommended document saving technologies. It’s now using file wrappers exclusively to persist document data. The main document is stored as a JSON file in the root of the document bundle with pages and resources stored in sub directories.

What about the Sandwich?
Any plugins using the sandwich API to save their content will still function as they did before without any code changes! We’ve worked really hard to make the new document saving code completely transparent to existing plugins. Many of our own built in plugins are still saving this way.

Some of our plugins have started moving to JSON & File Wrappers as their storage system. There’s no public API for this yet but the intention is that this will replace the sandwich format in the future.

Existing documents
There will be migration of old documents to the new format but this will come in a later build. For now, please create new documents.

Safer code

You guys already know we’ve been working hard on RWKit, removing as much old, unused code as possible. The same has been happening in RapidWeaver and I’m pleased to say we’ve reduced the code base from 87,151 lines of Obj-C in RW8 to only 59,268 in lines RW9. That’s a massive 30% reduction in code!

Issue Reporting

RapidWeaver has always been notoriously bad at reporting problems. RapidWeaver 9 aims to solve that problem by introducing the Issues Center. It’ll log events as they occur and report problems along with the call stack and where they occur. This feature is in it’s infancy and will be expanded on in future releases.

Blog Plugin

The Blog plugin is probably the oldest plugin in RapidWeaver and as such was full of the hackiest code I’ve seen. For RapidWeaver 9 we’re going to be building a whole new Blog plugin… watch this space.

File Sharing / Photo Album Plugins

These have been a testing ground for me to muck around with the API. They’re definitely broken and will be fixed up soon.

Example Plugin

I’ve completely re-written the example plugin showing how to interact with the new resource API. There’s also a new API allowing a plugin to request RapidWeaver to be re-launched. This could be particularly useful after installing updates.

The easiest way to try the plugin is to open the project in Xcode, build it, fire up RW and change the addons location to [Example Project Dir]/build

RW API

There are no longer any special/hidden methods in RapidWeaver’s API. Anything our plugins do, you can do too!

I’m sure there’s a tonne of things busted, but with your help we’ll get everything fixed up making RapidWeaver 9 the most powerful and stable release yet!

Cheers!

3 Likes

:clap:

Woo hoo!!! This is great news!! I’ve been trying to get all the RW devs to do this since Andre added sandwiches a decade ago. Seriously, this is the best news I’ve heard in a long time.

As I’ve probably mentioned (a bit too often) I’ve been using file wrappers for partials (nea User Stacks… and now Externals and Templates) for years.

There are a few quirks if used by themselves but with NSDocument’s:

- (BOOL)readFromFileWrapper: ofType: error:
- (NSFileWrapper *)fileWrapperOfType: error:

… you get atomic file handling for free.

One other weird thing… make sure autosavesInPlace is shut off in the NSDocument delegate.

Otherwise that atomic file handling is really crazy – and I’m skeptical it’s really working. I only mention it because there was a time when RW supported the auto-save and versions stuff. In my opinion that’s just bad news with file wrappers (actually with any large files).

Moving Stacks over to the new format will be a piece of cake. I can just chuck my sandwich code overboard (happily) and move everything over the partial archiver.

I’m not currently using JSON – but had planned to already. So I’ll make sure that’s in Stacks 4.2.

I am probably going to build some type of blogging system (someday) myself. i’ve made a start already (like maybe a dozen times LOL ) But fair warning, don’t leak the details to me on that one.

That said, my goal is to build a Jekyll-like system. I doubt it will have much appeal to anyone except the hardcore nerd crowd. Hopefully it will just compliment the built in Blog, new or old. :+1:

more good stuff. i think @joeworkman in particular would really like me to do that after installing big framework updates.