Val Town Newsletter 15

Feb 13, 2024 Β· Originally published at Val Town

We shipped Custom Domains, Logs 3.0, faster HTTP responses, and dozens of other improvements. We deprecated our Run API and released a post about our first four runtimes.

Everyone is saying such nice things about us on Twitter. You all are the best!

We're growing our team! We're hiring engineers in NY who are passionate about democratizing programming.

This newsletter comes with a video talk-through, included below with help from Simon Willison.

🌐 Custom domains

Give your HTTP val a custom domain! For example, Steve's dateme.directory is now powered by a val.

A custom domain configured to direct HTTP requests to "amazingVal"

This is feature is available on Val Town Pro. Big thanks to Drago at SaaS Custom Domains πŸ™

𝍌 Logs 3.0

We rebuilt our logs to be faster, larger, streamed, and scalable. Now you can see your val's logs in real-time.

import { delay } from "https://deno.land/std/async/delay.ts";

console.log("Val execution started");
await delay(2000);
console.log(" 10% [=         ] 100%");
await delay(1000);
console.log(" 30% [===       ] 100%");
await delay(1000);
console.log(" 70% [=======   ] 100%");
await delay(1000);
console.log("100% [==========] 100%");
await delay(1000);
console.log("Finished");

The first version of logs were stored in our main Postgres database. The second version was stored in Cloudflare R2, which was more scalable, but trapped our data in blobs. This third version stores your logs in ClickHouse, which makes the system faster, scalable, and paves the way for features to filter and search through your logs. Thanks @nbbaier for the request for real-time logging!

⚑️ HTTP vals are faster and async

We've made HTTP vals faster by sending the HTTP responses as soon as your function returns. This is a 100ms performance improvement for all HTTP vals. Vals with un-awaited promises will see a even bigger improvement on HTTP response times.

A graph highlighting the improvement {/* Source: https://excalidraw.com/#json=ukic9gIBIPzdJXGInKZNl,i0VeZeHpYmR8wEf3nhYkBg */}

This change enables you to perform further computation after your HTTP handler responds, without needing to setup a queue. We continue to compute any unawaited Promises after we send your returned HTTP Response. For example:

import { delay } from "https://deno.land/std/async/delay.ts";

export default async function handler(req: Request) {
  const start = Date.now();
  delay(1000).then(() => console.log(Date.now() - start)); // 1000, logged later
  return Response.json(Date.now() - start); // 0, sent immediately
}

Thanks to Alex and Ross from Playbook for championing this feature request! You can read more about it here in our docs.

πŸ¦ΆπŸ”« Deprecating our Run API

We removed Val Town's biggest footgun – the Run API – without breaking anyone in production. As it turns out: not every function should be an API. For more details, check out the announcement post.

πŸ“ The first four Val Town runtimes

We've built and rebuilt our runtime four times, and learned a lot about balancing safety, speed, and flexibility. Here's the story.

timeline of runtimes

πŸ’‘ Suggest & vote on feature requests

You can now request and vote on features. So far 60 features have been requested, and we've built & closed 3. The top features only have 5 upvotes, so it won't take much community organizing to get your requests to the top of our list.

Screenshot of the new Val Town status page

Improved Feedback button

We ❀️ feedback. Our feedback form now emails our whole team, with you cc'ed.

Popup window displayed after pressing the Feedback button

Or you can make a feature request, report a bug, join our discord, schedule a chat with our founder, or email us directly.

🟩 Val Town status page

Our status page is live. Next stop – more nines.

Screenshot of the new Val Town status page

⌨️ TypeScript-driven autocompletion

Our autocomplete now displays helpful TypeScript docs inline.

Screenshot of the new TypeScript-driven autocompletion in action

⏎ CodeMirror Continue for comments

We made the editor a little cozier by continuing block comments when you hit Enter. This should make writing block comments, like JSDocs, more pleasant. We also released this as an open-source CodeMirror extension – CodeMirror Continue.

πŸ§˜β€β™€οΈ Code folding

We added the ability to fold code blocks. Thanks @nbbaier for the suggestion!

⬆️ Misc updates

πŸ›£οΈ Roadmap

😎 Cool vals