Bytes #95 - You Can throw Anything In JavaScript

You Can throw Anything In JavaScript

Issue #95.April 11, 2022.2 Minute read.

This week we've got a launch week hangover, In-N-Out vs. Cheesecake Factory, and an AI that thinks it can take my job.

Welcome to #95.


Jenny Craig Meme

Shed those bits

Astro's launch week

Astro just wrapped up their first "launch week" (get it? cause Rockets? ok), where they announced the release of the the "Astro v1 Beta", "SSR with Astro", "Themes & Integrations" and some other stuff we already forgot about.

In case you missed the last time we talked about Astro, the TLDR is they are on a mission to be the Jenny Craig of JavaScript, and help you shed those unwanted bytes.

What does "Astro v1 Beta" do? Well, like DevRels, we're still not entirely sure. But they are promising no more breaking changes (until v2). Astro also launched Themes & Integrations (AKA starter templates and plugins) and announced financial support for for the maintainers of some of their dependencies.

The biggest announcement, however, was that Astro now has (experimental) support for Server Side Rendering. Previously, Astro only had support for SSG (static site generation), so dynamic data had to be fetched at build time or on the client from one of those “islands of interactivity." With SSR, Astro now lets you build more dynamic websites without sacrificing performance. This new offering also includes API routes (for REST apis, user uploads, serving assets, etc.) -- similar to Next or Remix.

So what makes Astro different? For starters, Astro is BYOF (bring your own framework) so you can use React, Vue, Svelte (or all of them?) for your site. The team also claims that, unlike other frameworks, Astro is "designed to run on the server" - which is good enough evidence for us.

Bottom line: Astro seems like an ideal fit for things like the aspirational rewrite of your personal blog, e-commerce sites, docs, and other websites that don’t need too much client-side JavaScript (which, they'd argue, is most sites). Call 1-800-94-JENNY today, and start losing those unwanted bytes.


Cursed Cookie meme

When you build your own chat app from scratch [sponsored]

Stream is how smart developers build chat apps

Building a chat app from scratch in 2022 is like trying to make Pop-Tarts from scratch -- overly complex and completely unnecessary thanks to glorious technology.

That’s because most developers just use Stream It’s the #1 chat-messaging and activity feed platform in the world -- because it handles all of the mess that comes with building chat apps for you.

bUt WilL iT SCaLe? Don't ask me, ask Match.com – they use Stream to let their 22 million members send each other heartfelt messages like, “You up?” every single ~~day~~ night. So next time you drunkenly message that person who ghosted you 7 months ago, you can thank (or curse) Stream for making it all possible.

CodePen, Imgur, SoundCloud and a bunch of other companies have built apps with Stream too. Chances are, you’ve already used Stream as a user without even realizing it 🤯.

Check out the free trial and I guarantee you'll be shocked by how straightforward (and flexible) the API is.


Step Brothers Meme

Dad, what are you doing? It's launch week!

Redwood's launch week

Redwood didn't want to feel left out, so they just had their own launch week too. Like Astro, this was one of those launch weeks that probably could've been an email (or blog post) -- but hey, we all gotta find reasons to celebrate.

The big news coming out of all the festivities was that after three years of work, RedwoodJS 1.0 was finally released.

So what exactly is RedwoodJS, where did it come from, and what does its future hold? Let's dive in.

  • Redwood's pitch is that it weaves together the "best parts" of React, GraphQL, Prisma, TypeScript, Jest, and Storybook to give you a full-stack framework that's ready to go right out of the box. Abstracting away most of the different tech stack choices like this comes with a lot of upside and a lot of tradeoffs -- kind of like eating at In-N-Out instead of Cheesecake Factory. Both great, but very different.

  • Redwood was created by Tom Preston-Warner, who was also co-founded GitHub and created Jekyll, TOML, and the SemVer specification. Tom also looks a little bit like Tom-from-MySpace, but our research team has confirmed that they are in fact two different people.

  • The future looks promising for Redwood. Last week, Tom also committed $1m to fund the project going forward and another $1m fund for investing in startups built on Redwood (#LaunchWeek 🚀). If you're wondering where these millions are coming from, let me remind you that this man co-founded GitHub.

Bottom Line: Redwood is focused on helping developers who want to build side projects and startups ASAP, rather than obsessing over all the technical details. It's too early to tell how far that philosophy will take Redwood in the ever-changing hierarchy of JavaScript frameworks -- but at least we know they probably won't run out of money anytime soon.


🔬 Spot the Bug -- Sponsored by PostHog

PostHog is an open-source product analytics suite you can self-host. Heatmaps, Recordings, Funnels and more — all in a platform where you can build your own TypeScript plugins!

class Car {
  _milesDriven = 0
  drive(distance) {
    this._milesDriven += distance
  }
  getMilesDriven() {
    return this._milesDriven
  }
}


Cool Bits

  1. Bun is a new JSX/TypeScript transpiler + bundler + dev server + runtime that's supposed to be "100x faster" than existing tools because it's built in Zig (a real programming language, I checked). Bun's millennial pink branding tricked me into thinking I had just signed up for a weekly cinnamon roll subscription from an Instagram ad -- but now I'm just hungry. And I have a new startup idea.

  2. BeJS Conf is happening in Belgium on May 13th, and they've got a ton of cool speakers from the TC39 Committee and core team members of trendy JS frameworks. Plus, Brussels is pretty incredible in the Spring (or so I'm told). [sponsored]

  3. Ben Nadel wrote about how You Can throw() Anything In JavaScript. How much does Ben wanna bet I can throw a football over one of them mountains?

  4. Rome officially announced their new, super fast Formatter for JavaScript and TypeScript last week. It promises to be mostly compatible with Prettier.

  5. Turborepo 1.2 was just released with a new Task Filtering API, an improved internal scheduler and graph, and more. We still don't know what Turborepo does or what those things mean either - so you're in good company.

  6. Yoni Goldberg just updated his very comprehensive JavaScript & Node.js testing best practices, because he's tired of you breaking prod.

  7. pnpm is an NPM alternative that prides itself on being efficient, deterministic, and strict. Just like my third-grade teacher.

  8. DALL·E 2 is a new AI system from OpenAI that can create images and art from a description in natural language. Am I worried that this "machine" is going to come after my livelihood of making niche JavaScript memes? Of course I am. But I'll spend the rest of my days fighting it like I'm Garry Kasparov facing off against Deep Blue. Round 2 of The Battle for Humanity starts now.


🔬 Spot the Bug Solution -- Sponsored by PostHog

Historically - in JavaScript, because we lacked the ability to have private class fields, we'd mark them with an underscore and hope for the best. Now, thanks to recently added Private Class features, we can now mark class fields as private by using the # prefix.

class Car {
  #milesDriven = 0
  drive(distance) {
    this.#milesDriven += distance
  }
  getMilesDriven() {
    return this.#milesDriven
  }
}

const tesla = new Car()
tesla.drive(10)
tesla.getMilesDriven() // 10
tesla.milesDriven // undefined

Join Bytes

Delivered to 105,502 developers every Monday