DevLog 6: Previews, Better Progressive Enhancements, Fixes
Published on:
Markdown Previews
The posts can now be previewed without saving. This is not a live preview, so you need to click a button on the editor to see it rendered from the server.
It works with and without JavaScript, but the better experience is when JS is enabled, as it replaces the editor with preview without reloading the page.
When JS is disabled in the browser, you get to open the preview in a new tab. Just note that refreshing the tab wonβt update the preview.
Progressive enhancement
While the review itself is progressive enhancement, I added a few more things.
The menu no longer uses bootstraps way of navigation with div-soup and JavaScript.
The navbar now uses the details tag to make it intractable.
Form validation now does not overly rely on JavaScript either, instead it uses HTML5 style input patterns to validate it.
Fixes
The IndieAuth implementation had issues with the server implementation, the login used to fail. I have now added better tests to validate the implementation so it wonβt break again. I also switched to the W3C version of IndieAuth instead of the live draft.
Breaking changes
While fixing the IndieAuth, I decided to use sqlx_cli instead of diesel for migration scripts. The reason is obvious, I use sqlx for querying the DB, so diesel_cli just added an unnecessary dependency.
This means that the migration script would need to be re-run again. But surprisingly, I didnβt see any errors on running or reverting the migrations. It would be different if someone else is using the project and did something weird, so I am mentioning this as a breaking change. Take a backup of your DB before pulling the latest changes.
I have also updated the docker file to no longer store the DB locally, instead it will be stored inside the docker volume. This is so that we can run multiple instances without them conflicting each-other.
I will implement a backup feature sometime down the line so that you can do backups from the Admin or User UI.
Non-breaking changes
The other changes are just minor code refactor and bug fixes, nothing important.
Interactions
No interactions yet.