Brisa 0.1.5

by Aral Roca

In this release, we have focused on fixing issues and do some optimizations while we are defining and developing new features for the next releases. The only feature of this release is the extension of the SSR support of Web Components self variable.

The focus in the next releases is to improve our server output system so that the standalone build can have different forms: bundled (will greatly improve req/sec), bundled per route (will help integration with more cloud providers) and binary (will improve execution speed and memory in runtime). This process will help open many doors to new features and improvements in Brisa.

Thanks to all contibutors:

Extend SSR support of WC self

The self property has been extended to work during the Server-Side Rendering (SSR):

Example:

export default function WebComponent({}, { self, cleanup }) {
  const onClickToWC = () => {
    console.log("click");
  };

  // This is ignored during SSR, so you don't need an effect
  // TIP: Remember that thanks to signals Brisa only do the
  // render once
  self.addEventListener("click", onClickToWC);
  cleanup(() => {
    self.removeEventListener("click", onClickToWC);
  });

  return <div>Web Component</div>;
}

Reduce 100B client size and improve performance +1K ops/sec

Fixing some issues, we have realized an improvement during the WC render process and we have done it.

We have reduced the client size by 100 bytes and improved the performance by +1K ops/sec by changing our render process of the web components.

Better fine-graned Reactivity

We have improved the reactivity system to solve disconnected nodes on recursion with fragments. This will help to improve the performance of the reactivity system and avoid unexpected behaviors.

Upgrade diff algorithm to fix various WC bugs

There were behaviors that sometimes the Web Components made a double rendering during navigation with SPA, and other strange behaviors that if the onMount function modified any attribute of the WC (self.setAttribute) then during the diffing it was overwritten. We have found the root of the problem and have solved both problems. So we have Brisa more stable every time. This diffing algorithm is public in another library in case other frameworks want to implement HTML Streaming over the wire.

Fix standalone build constants

Some constants were not being replaced in the standalone build, causing unexpected behaviors. This has been fixed in this release.

Improve control of errors in getServeOptions

In the first implementation, the getServeOptions was something internal to Brisa, where the errors were displayed on the terminal, they were handled there. When we made this public API, we didn't take into account extracting the errors to be able to control them from the outside. Now, the errors are handled from the outside and can be controlled in a simpler way.

And more... See the full changelog below:

What's Changed

New Contributors

Full Changelog: https://github.com/brisa-build/brisa/compare/0.1.4...0.1.5