Deno’s Fresh Uses Server-Side Rendering for Faster Apps
Deno software engineer Luca Casonato was finishing up the documentation late last week for Tuesday’s official launch of Fresh, a new full-stack web framework for Deno. He took a break to share details on his latest project.
“Fresh is a new style of web framework that’s written for Dino rather than NodeJS,” Casonato, who created Fresh, told The New Stack. “It’s really optimized for edge computing.”
He compared it to Node.js or Vercel, which he said might have serverless functions that run on Amazon Web Services in a single region. Make a request to the server from the U.S. and if the host is in the EU, then the request has to literally transverse the ocean, Casonato said. Instead, Fresh leverages edge computing, where the request is routed to the server nearest the user, he added.
Another JS Framework?
“They’re all not fast enough, or they don’t have a good enough user experience or good enough developer experience,” Casonato said. “With Fresh, we’ve tried to look at all the frameworks, at all the things they do correctly and all the things they don’t do correctly.”
The combination, he contended, is a better framework with fewer downsides than existing frameworks.
Fresh combines a routing framework and a templating engine, to render pages on-demand on the server, according to the documentation. Fresh also provides an interface for rendering some components on the client for maximum interactivity, it states. The framework uses Preact and JSX for rendering and templating on both the server and the client.
Fresh supports TypeScript out of the box and requires zero configuration, according to the documentation. Perhaps one of its more compelling features, however, is the fact it does not have a build step. Build steps can take up to 10 minutes to run, Casonato pointed out.
”With Fresh, that takes no minutes — it’s immediate, there’s no build step,” he said. “So you can take the source code that you’ve written and immediately deploy it to all of your servers without having to transform it in-between, which can really speed up the development.”
The Deno company last week announced it had raised $21 million in an investment round led by Sequoia Capital. It has so far raised $25.9 million in funding over two rounds, according to Crunchbase.