Dataview Serializer 3.0 - a settings screen you can search, and a bug that could eat a query
Canonical version: Dataview Serializer 3.0 - a settings screen you can search, and a bug that could eat a query.
The Dataview Serializer plugin for Obsidian just reached 3.0.0.
Most of this release is a rebuilt settings screen. It also fixes a bug that could delete a DataviewJS query, so I'll start with that.
A DataviewJS query could delete itself
Dataview Serializer has an update mode called once and eject: run the query, write the result into the note, and remove the query. You use it when you want a snapshot rather than something that keeps refreshing. By design, the query is gone after that first run.
When a dataviewjs query failed, the plugin treated the failure as "the query produced nothing" rather than "the query did not run". In once-and-eject mode, the query is replaced with its output, so an empty output removed the query and whatever it had previously produced. There was no error, no notice, and no undo unless you had a snapshot.
Now a failed query throws. Serialization stops, the plugin tells you, and your note is left exactly as it was.
I introduced this bug three days ago while fixing something adjacent, and an adversarial review caught it before anyone hit it. The test I had written at the time asserted the broken behaviour, so it protected the bug instead of catching it.
A settings screen rebuilt from scratch
The settings pane is no longer drawn by the plugin. It is declared, and Obsidian draws it:
- The settings are searchable. Every name and description is indexed, so typing "folder" in the settings search finds the folder lists without you scrolling past nine toggles.
- The folder lists have real delete buttons. Adding, removing and keyboard navigation come from Obsidian now, instead of a "Remove" button I hand-rolled per row.
- Keyboard navigation, focus handling and screen-reader labelling are Obsidian's, so they behave like the rest of the app's settings.
Everything that was there is still there: the three folder lists, the date placeholders in Folders to force update with their live "currently resolves to" preview, the link-format choice, the device-local disable, and the Git-style status row.
Fast edits no longer overwrite each other
Every setting used to be written by building a new settings object and saving it. If a save was still in flight when you changed something else (adding a folder and immediately flipping a toggle, say), both edits were built from the same starting point, and the second one silently discarded the first.
Settings writes are now queued, and each one starts from the last change that actually reached disk. A failed write no longer leaves the screen showing a value that was never saved, either: the control rolls back to what is really stored.
Two folders added or deleted in quick succession now both stick, which was not reliably true before.
Requires Obsidian 1.13
Dataview Serializer 3.0 requires Obsidian 1.13. That is what makes it a major version.
The declarative settings API arrived in 1.13, and it is all or nothing: either the whole settings screen is declarative, or none of it is. If you are on an older version, Obsidian will not offer you the update, so nothing breaks. Check Settings → About if you are unsure.
Your settings carry over untouched, and every command keeps its existing ID, so any keyboard shortcuts you have bound still work.
Get it
Update from Community plugins in Obsidian.
If you are new to this plugin: it takes your Dataview queries and writes their results into your notes as plain Markdown, so your vault stays readable and portable even where Dataview is not running. This helps when you publish or sync your notes, or if you ever stop using Dataview.
That's it for today! ✨
References
- Release: https://github.com/dsebastien/obsidian-dataview-serializer/releases/tag/3.0.0
- Repository: https://github.com/dsebastien/obsidian-dataview-serializer
- Documentation: https://dsebastien.github.io/obsidian-dataview-serializer/
Related
About Sébastien
Ready to get to the next level?
Found this valuable? Share it with someone who needs it.