What’s New in Waku v0.27.1

A major improvement in a patch release

Hi,

I just released Waku v0.27.1 this week. It has various fixes and improvements, but I want to emphasize one big improvement. It is a patch release because we do not change any APIs. What is changed is the behavior of static rendering.

Static and Dynamic Parts

There had been a limitation that when you mix a static part and a dynamic part in a page, the static part rerenders in some cases. For example, suppose we have a static layout and dynamic pages.

/static-layout/dynamic-page-1
/static-layout/dynamic-page-2

In terms of HTML, these pages are dynamic anyway, and they always rerender entirely.

However, with RSC, the components look like this:

<StaticLayout>
  <DynamicPage1 />
</StaticLayout>

<StaticLayout>
  <DynamicPage2 />
</StaticLayout>

And we should be able to reuse the static layout if we navigate to dynamic-page-2 from dynamic-page-1.

Previous Limitation

Previously this was already possible when navigating from dynamic-page-1 to dynamic-page-2. StaticLayout did not rerender with soft navigation.

However, there was a limitation at the initial load. When we first opened dynamic-page-1, it always rendered StaticLayout. And if we did a hard navigation, which is the same as the initial load, it also always rendered.

What Changed in v0.27.1

With v0.27.1, we refactored the internals and made sure that StaticLayout only renders once at build time. The technical challenge was finding a way to serialize the static parts of RSC, restore them, and merge them with dynamic parts. The rest was the effort to rework everything with the new architecture, which was not a trivial task.

I am proud of the outcome, and I expect the new behavior matches what developers intuitively expect. Static means static and only evaluated once.

Why Now

I knew this limitation in Waku existed for a while, but the fix was prioritized after we introduced the Slices API. The new behavior is important for static slices, and now static slices are more powerful.

Please give the new version of Waku a try and share your thoughts.

Happy coding.

Reply

or to participate.