We knew that we wanted to update Beam to improve performance, and update it to use more current implementations of the tools that it's built on. This release, what should be formally seen as a 2.0 does that.
App Directory
The first big change is the use of Next 14 and the app directory. Since migrating our marketing site to take advantage of the newest versions of React and Next, there have been significant benefits, not only to performance, but also to DX. When taking a top-down rewrite into account, I wanted to bring those benefits over to Beam. This new version takes full advantage of it, statically rendering the first page of posts on the index, and dynamically rendering paginated posts after. Initial load times for all pages and posts are almost instant.
tRPC
We're still using tRPC across the app, but we use the new server-side utilities to fetch data, and then use the old useMutation hook to mutate it. We're using the new tRPC apis, released in version 10, which offer better performance, and more clarity when developing. Another DX win.
cmdk & Radix
Radix replaces Headless UI across the app; we were using Radix for a few components already, so in this new implementation, Radix replaces any implementation that was previously using Headless UI! At the same time, cmdk is brought into the search dialog to replace the custom solution that had been used before, giving us an accessible, user-friendly search menu.
SVGO
To manage SVG icons, we're now using a simple implementation of the SVGO command line tool. When you want to add a new icon to the app, add the svg to src/svg and run:
pnpm generate:svg
The newly generated SVG component will be output to src/app/_svg, and is ready to use.
Please feel free to discuss below, and provide any feedback on the changes; they're extensive, but a top-down rewrite is going to be!
A full rewrite of Beam!
Context
We knew that we wanted to update Beam to improve performance, and update it to use more current implementations of the tools that it's built on. This release, what should be formally seen as a
2.0
does that.App Directory
The first big change is the use of Next 14 and the app directory. Since migrating our marketing site to take advantage of the newest versions of React and Next, there have been significant benefits, not only to performance, but also to DX. When taking a top-down rewrite into account, I wanted to bring those benefits over to Beam. This new version takes full advantage of it, statically rendering the first page of posts on the index, and dynamically rendering paginated posts after. Initial load times for all pages and posts are almost instant.
tRPC
We're still using tRPC across the app, but we use the new server-side utilities to fetch data, and then use the old
useMutation
hook to mutate it. We're using the new tRPC apis, released in version 10, which offer better performance, and more clarity when developing. Another DX win.cmdk & Radix
Radix replaces Headless UI across the app; we were using Radix for a few components already, so in this new implementation, Radix replaces any implementation that was previously using Headless UI! At the same time,
cmdk
is brought into the search dialog to replace the custom solution that had been used before, giving us an accessible, user-friendly search menu.SVGO
To manage SVG icons, we're now using a simple implementation of the SVGO command line tool. When you want to add a new icon to the app, add the svg to
src/svg
and run:The newly generated SVG component will be output to
src/app/_svg
, and is ready to use.Please feel free to discuss below, and provide any feedback on the changes; they're extensive, but a top-down rewrite is going to be!