Paul Krill
Editor at Large

Fresh web framework for Deno speeds page loading

news
Aug 17, 20232 mins
Development Libraries and FrameworksJavaScriptWeb Development

Ahead-of-time compilation results in assets being served 45x to 60x faster than just-in-time rendering, the Fresh development team says.

abstract network

With Fresh 1.4, the latest version of the full-stack web framework leveraging the Deno javaScript/TypeScript runtime, the Fresh authors are heralding faster page loads and shared layouts.

Introduced August 16, Fresh 1.4 is focused on developer experience and ease of use in shared layouts, route-specific islands, and other capabilities. For faster page loading, pre-compiling resulted in assets being served 45 to 60 times faster than just-in-time rendering for a cold start of a serverless function, the Fresh team said. The savings depend on the size of the “islands,” or interactive components, being delivered.

For layouts, Fresh 1.4 adds support for _layout files, which can be described as a route local app wrapper. These can be put in any route folder, with Fresh detecting all layouts that match and stack them atop each other.

Falling under the umbrella of Deno technologies, Fresh is a combination of a routing framework and templating engine that renders pages on demand. Projects can be deployed manually to any platform with deno. An edge runtime such as Deno Deploy provides the best experience.

Developers can start a Fresh project by running deno run -A -r https://fresh.deno.dev or update an existing project by running deno run -A -r https://fresh.deno.dev/update in their project folder. In other improvements in Fresh 1.4:

  • To simplify custom HTML, head, and body tags, developers can set the <html>, <head>, and <body> tag directly on the server.
  • Async layouts are supported, along with _layout components.
  • define* helper functions make function definitions quicker to type.
  • Route groups are featured to help with organizing code.

Future plans for Fresh include overhauling the plugin system to make it more powerful and easier to understand. Support for view transitions also is eyed, along with SPA-like client navigation.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author