The biggest Dart yet

Issue #190.May 25, 2023.2 Minute read.
Bytes

Today’s issue: Hosting all your side projects for free, (mostly) resisting the urge to make ice cream puns, and asking who’s really in charge here.

Welcome to #190.


Eyeballs logo

The Main Thing

Will Ferrell with tranquilizer dart in his neck

Wait, pull what out?

The biggest Dart yet

Dart 3 was just released at Google I/O, and the Dart team is calling it “the biggest release yet.” But to understand why that’s true, we need to quickly brush up on some Dart history.

How we got here: The Dart programming language was originally created at Google as a JavaScript alternative, all the way back in the Party Rock days of 2011.

Like dubstep, that idea didn’t last long. But Dart was still unique because it could compile to multiple targets — ARM64 and X64 for mobile, JavaScript for the web, and self-contained executables for desktop.

This allowed it to eventually power Flutter, the UI toolkit for building cross-platform apps that are natively compiled. And even though Flutter has become super popular, Dart has never enjoyed that same mainstream adoption.

That’s why the Dart team has invested so much into these three major advancements in Dart 3:

  • Null safety and type safety: It’s taken four years, but the Dart team has added 100% null safety to Dart, along with a sound type system. So if a type says a value isn’t null, that means it can never be null. This helps prevent coding errors and allows Dart’s compilers and runtimes to optimize code more efficiently.

  • Major new language features: Dart added new features like records, patterns, and class modifiers to help modernize and improve the DX.

  • WebAssembly compilation: Dart can’t resist a sexy new compilation target, so v3 comes with a preview of Dart to Wasm compilation. They’re focused on Flutter web support for now, but this could eventually be a gamechanger that gets Wasm stans to give Dart a chance.

Bottom Line: It’s awesome to see Dart continue to evolve like this, 12 years after it was first released. It just goes to show that if you want to hit the bullseye, sometimes all you need to do is ask yourself, Who’s in charge, me or the devil? (Language warning 🤐)

        

bright data logo

Our Friends
(With Benefits)

Monica from Friends with a turkey on her head and sunglasses

The original headful browser

Bright Data’s Scraping Browser is the best way to get data

Since when did scraping public web data become harder than training my pet cockatoo to not swear at strangers in public? (He’s a troubled bird.)

Well it just got a lot easier, thanks to Bright Data’s new headful browser that’s specifically designed for scraping at scale.

Here’s how it works:

  • Easily make an API call to fetch any number of browser sessions and interact with them using Puppeteer or Playwright over a CDP protocol.

  • Bright Data unblocks sites for you with its CAPTCHA solvers, fingerprints, and headful browser (much better for scraping than traditional headless browsers).

  • Scale up to as many browsers as you need, and host them all on Bright Data’s award-winning proxy network.

Check it out — and never get blocked from the data your app needs.


Spot the Bug logo

Spot the Bug

Sponsored by Tigris

They’re an open source alternative to MongoDB and DynamoDB, and this tutorial gives a great demo of how to use Tigris to add a real-time, full-text search to a Next.js app.

function makeCamelCase(text) {
  const changeCase = import('https://cdn.skypack.dev/change-case')

  return changeCase.camelCase(text)
}

Cool Bits logo

Cool Bits

  1. Faker.js UI is exactly what it sounds like, a simple UI over Faker.js for easily generating fake-but-realistic data for testing and development – or prod if you made the Forbes 30 under 30 list.

  2. PropelAuth is the easiest way to set up auth that will scale with you every step of the way. No more building custom junk on top of your auth provider ever again 🙏. [sponsored]

  3. VanJS claims to be the world’s smallest reactive UI framework based on pure vanilla JavaScript and the DOM. I’m not sure how many more vanilla ice cream puns I can take at this point in my JavaScript career.

  4. Nicholas Ray wrote about Reducing Wikipedia’s Total Blocking Time by 300ms. And given Wikipedia’s astronomical traffic, Nicholas probably just saved the collective human race about 1,000 years. Well I made some memes today, Nicholas. So I guess we’re both doing our part for humanity.

  5. Una Kravets wrote an article on the Chrome Developers blog about Chrome’s new Popover API.

  6. Zevi Reinitz wrote about How to host your side projects for free in 2023. It reminds me of the #1 thing I learned in college: there’s no better taste in the world than free Domino’s pizza stolen from the entrepreneurship club meetings.

  7. Christoph Purrer wrote about how his team at Meta was able to make Messenger on desktop Faster and Smaller by moving to React Native from Electron.

  8. Strawberry is a zero-dependency, build-free JS framework that gives you reactivity and composability. If you combine this with VanJS, you could make a tasty little soft-serve swirl and oh dammit I just made another ice cream pun.


Spot the Bug logo

Spot the Bug: Solution

Sponsored by Tigris

function makeCamelCase(text) {
  const changeCase = import('https://cdn.skypack.dev/change-case')

  return changeCase.camelCase(text)
}

This import statement is actually a dynamic import. When it’s first called, it will fetch the module’s code from the CDN url and parse it asynchronously, which means import() returns a promise. We either need to use the .then() method or async/await to access the module.

async function makeCamelCase(text) {
  const changeCase = await import('https://cdn.skypack.dev/change-case')

  return changeCase.camelCase(text)
}