Brisa 0.1.2
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
- docs: add issue templates by @Anonymous961 in #536
- fix: not log _Fragment (swc of playground) by @aralroca in #542
- fix: skip set attribute when value is
undefined
by @aralroca in #543 - fix: adapt
i18n.t
with HTML (elements
) to work on WC by @aralroca in #544 - fix(i18n): use
interpolation
andformat
inside Web Components by @aralroca in #546 - docs: update CONTRIBUTING.md by @Anonymous961 in #547
- fix: "Upgrade Bun" message prompts the user to install their current version by @amatiasq in #549
- fix: fix composed extensions in
fileSystemRouter
by @aralroca in #552 - update engines && publish commits actions by @enzonotario in #553
- fix(playground): stringify declaration files on monaco editor by @aralroca in #555
- fix(actions): publish commits via pkg-pr-new by @enzonotario in #557
- fix: fix detecting WC in Windows by @aralroca in #548
- chore: upgrade diffing algorithm by @aralroca in #559
- fix: fix WC regex for Windows by @aralroca in #561
- chore: upgrade bun & deps by @aralroca in #562
- chore: homepage content nits by @gariasf in #530
- docs: improve async component generators docs by @aralroca in #563
- fix: add different keys on actions by @aralroca in #564
- feat: add idleTimeout by @aralroca in #566
New Contributors
- @Anonymous961 made their first contribution in #536
Full Changelog: https://github.com/brisa-build/brisa/compare/0.1.1...0.1.2