github bknd-io/bknd v0.18.0

7 hours ago

Introducing modes: UI-only, code-only, hybrid (#249, #252, #253)

Warning

This is an intentionally breaking change if you were using initialConfig. Change this property name to config and it continues to work as previously (UI-only mode is the default).

The most requested feature has been configuring bknd only with code, and while the main goal of the project is to have a visually configurable backend, having the option to configure bknd with code makes perfect sense for 2 reasons:

  1. you may be using bknd in a bigger context, and/or need higher precision which is only achievable if you can fully control bknd with code
  2. you want to visually configure bknd while in development, and want the production instance to be read-only and as performant as possible

Because of this, bknd can now be executed in 3 modes:

  • UI-only: This is the default mode, it allows visual configuration and saves the configuration to the database. Expects you to deploy your backend separately from your frontend.
  • Code-only: This mode allows you to configure your backend programmatically, and define your data structure with a Drizzle-like API. Visual configuration controls are disabled.
  • Hybrid: This mode allows you to configure your backend visually while in development, and uses the produced configuration in a code-only mode for maximum performance.

Read more about how to configure your preferred mode in the modes section of the docs.

Admin Customizations (#264, #265)

If you're rendering the Admin within your React Framework of choice, you can now customize certain aspects of it:

  • add additional action items to the dropdowns to the user menu (top right), when the contents of an entity and when creating or updating an entity
  • rendering a header or a footer when listing, creating or updating an entity
  • rendering a custom component for an entities field (e.g. a custom rich text component)
  • adding a custom route

See an example in the Admin UI docs.

Media handling improvements (#276)

Several improvements to how bknd handles media has been added, including improving various mime type handling, increasing the listing limits (in case your uploading many files to an entity) as well as extended previews: You can now see the contents of a PDF file in modal using your browsers built-in PDF reader, read the contents of text fields and play audio files. Additionally, attached files to an entity are now correctly cleaned up if the entity is deleted.

0.18_media_previews_o.mp4

SQLite Connection Options (e.g. WAL mode, #266)

When using the SQLite construct functions, you can now add a handler when the connection has been created. This allows to e.g. set the journal mode to WAL:

import { nodeSqlite, type NodeBkndConfig } from "bknd/adapter/node";
export default {
  connection: nodeSqlite({
    url: "file:data.db",
    onCreateConnection: (db) => {
      db.exec("PRAGMA journal_mode = WAL;");
    },
  }),
} satisfies NodeBkndConfig;

Other Changes

  • cli: externalize all direct dependencies to prevent being bundled by @dswbx in #247
  • update docs: add bknd.config.ts example and clarify cloudflare setup by @dswbx in #260
  • refactor: remove unique field validation from EntityIndex by @dswbx in #261
  • fix: typegen: adjust field formatting and type name handling by @dswbx in #262
  • fix: implement chunked request handling for cloudflare vite dev-fs plugin by @dswbx in #263
  • fix: set s3 client service to s3 to produce correct headers required by minio by @dswbx in #275

Full Changelog: v0.17.2...v0.18.0

Don't miss a new bknd release

NewReleases is sending notifications on new releases.