Brisa 0.1.2

by Aral Roca

This release fixes 12 bugs. It also includes some improvements and new features, thanks to all contibutors:

Add idleTimeout for Bun & Node.js runtimes

In this version, we have added the idleTimeout property to the brisa.config.ts file. This property allows you to set the maximum amount of time a connection is allowed to be idle before the server closes it. A connection is idling if there is no data sent or received.

brisa.config.ts:

import type { Configuration } from "brisa";

export default {
  idleTimeout: 10,
} satisfies Configuration;

Learn more about the idleTimeout property.

Stream SQLite queries

Async generators can now be used in conjunction with SQLite queries to stream HTML content. This is useful when you want to render a large amount of data without blocking the main thread and the user can start seeing the content as it is being fetched.

import { Database } from "bun:sqlite";

const db = new Database("db.sqlite");

export default function MovieList() {
  return (
    <ul>
      <MovieItems />
    </ul>
  );
}

// Streaming HTML from SQLite query
async function* MovieItems() {
  for (const movie of db.query("SELECT title, year FROM movies")) {
    yield (
      <li>
        {movie.title} ({movie.year})
      </li>
    );
  }
}

i18n fixes and improvements

In this version, it is possible to use formatters through format inside Web Components. This property captures the interpolations to format them as you like, for example:

{
  "hello": "Hola, {{name}}",
  "helloWithFormat": "Hola, {{name, uppercase}}"
}

To consume it:

t("hello", { name: "Brisa" }); // Hola, Brisa
t("helloWithFormat", { name: "Brisa" }); // Hola, BRISA

In this case, the helloWithFormat key will be formatted to uppercase. To define all the formatters, you can check the i18n documentation.

Complex extensions in fileSystemRouter

In this version, we have added support to composed extensions in fileSystemRouter, e.g.: .d.ts.

Fix bug SPA Navigation with server actions

In this version, we have fixed a bug that occurred when the same element was in different routes but in each route had a different server action.

Fix some bugs in Windows

There are still some bugs in Windows that will be fixed for the next release, but for the time being this version fixes some bugs such as the detection of Web Components.

Skip undefined attributes

Previously it could happen that an element had an "undefined", e.g.: <div class="undefined">, now it has been fixed so that the attribute is not added if the value is undefined.

Add issue templates on GitHub

In this version, we have added issue templates to help you create better issues.

Thanks to @Anonymous961 for their contribution 🎉

Fix errors in Brisa Playground

In this version, we have fixed some wrong errors in the Brisa Playground console.

Improve CONTRIBUTING.md

In this version, we have improved the CONTRIBUTING.md file to help you contribute to the project.

Thanks to @Anonymous961 for their contribution 🎉

What's Changed

New Contributors

Full Changelog: https://github.com/brisa-build/brisa/compare/0.1.1...0.1.2