Next.js hits the turbo button

Issue #280.April 15, 2024.2 Minute read.
Bytes

Today’s issue: Michael Bay’s OSS debut, exposing Devin’s lies, and JavaScript signals in action.

Welcome to #280.


Eyeballs logo

The Main Thing

Lloyd from Dumb and Dumber pouring Turbo Lax laxative into Harry's drink

Take one half teaspoon for fast, effective relief.

Next.js hits the turbo button

Last week was a big one for Next.js – they released v14.2 and hit a major milestone of 1 million monthly active developers. And since I have no clue how they came up with that number, let’s focus on the new stuff in Next.js 14.2.

The biggest takeaway from this release is Next’s continued progress on the Turbopack integration. v14.2 introduces a new Turbopack Release Candidate for speeding up local development, and 99.8% of integration tests are now passing. It also comes with a new Lightning CSS integration ️.

The Next team has used Turbopack internally on vercel(.com) to significantly speed up local server startup times, code update times, and initial route compile times (without caching). Going forward, they’re focused on leveraging Turbopack to improve memory usage and persistent caching.

Beyond the Turbo-tastic perf upgrades, here are a few more v14.2 highlights:

  • Improved caching experience in the App Router with an experimental staleTimes feature, which allows the configuring of the invalidation period of the client router cache.

  • Build and production improvements, like more efficient tree-shaking and refactored bundling logic have reduced memory usage and boosted performance.

  • Better error DX with more helpful error messages, overlay design improvements, and clearer dev and build logs.

Bottom Line: This is probably one of the last minor releases we’ll see from Next.js before React 19 comes out later this year. At that point, other React meta-frameworks will be able to start leveraging RSC more – so it’ll be interesting to see if Next’s lead over the rest of the field begins to shrink at all, or if its dominant run will continue.

        

Postman logo

Our Friends
(With Benefits)

DW from Arthur standing outside a fence looking sad

When that tech conference FOMO hits

Register for POST/CON 24 | Save 20% Off

Postman’s annual user conference will be one of 2024’s biggest developer events, and it features a great mix of high-level talks from tech executives and hands-on training from some of the best developers in the world.

  • Learn: Get first-hand knowledge from Postman experts and global tech leaders.

  • Level up: Attend 8-hour workshops to leave with new skills (and badges!)

  • Be the first to know: See the latest API platform innovations, including advancements in AI.

  • Help shape the future of Postman: Give direct feedback to the Postman leadership team.

  • Network: Meet fellow API users and global tech leaders, including speakers from OpenAI, Heroku, and more.

  • Have fun: Enjoy cocktails, dinner, 360° views of SF, and a live performance from multi-platinum recording artist T-Pain.

Use code PCBYTEBYTEGO20 and save 20% off your ticket.


Tip logo

The Tip

Sponsored by Datadog

Their Front-end Developer Kit gives you a best practices guide for front-end monitoring and testing, a solutions brief on proactively catching bugs, and more.


Have you ever used Array’s fill method? Probably not. Defined, fill “fills all the elements of an array from a start index to an end index with a static value”. It sounds pretty useless, but I’ve found one scenario where it’s helpful.

As you start to make your code more functional, you naturally start to avoid using regular for loops in favor of .map, .reduce, etc. Let’s say our use case was we wanted to execute a function an arbitrary amount of times, say 10. How could we do this and avoid using a for loop? Your first intuition might be to use an Array constructor with .map.

Array(10).map(() => {
  
})

You’ll notice if you run that code it won’t work. When you do Array(10), you’re creating an array of 10 unset or “empty” values. Unfortunately, when you use any of the array methods, they won’t work on an array with empty values.

This is where .fill comes into play. If you do Array(10).fill(), you’ll then get an array with 10 undefined, not empty elements.

Array(10).fill().map(() => {
  
})

Not super useful, but good to know it exists if you need it.


Cool Bits logo

Cool Bits

  1. Asad Memon created MarkdownDown, a site that lets you convert any webpage to a clean markdown file with the images downloaded. It was also the working title for the Black Hawk Down sequel, but Ridley Scott never caught the vision.

  2. OneSchema FileFeeds completely automates mapping, cleaning, and validating messy spreadsheets received via SFTP and email – so you can finally stop wasting precious eng time building and maintaining SFTP integrations 🙏. [sponsored]

  3. If you want to check out more bleeding edge Next.js stuff, Shu Ding created next-view-transitions to give you a basic way to use View Transitions with the Next.js App Router.

  4. Speaking of bleeding edges, this JS Bin lets you play around with native JavaScript Signals for reactivity, which just hit Stage 1 at the last TC39 meeting.

  5. Everyone’s favorite Postgres developer platform, Supabase, is now “generally available”. They just launched on Product Hunt if you want to show them some love.

  6. Convert Office documents to PDFs in the browser using the Apryse PDF SDK and JavaScript. It’s fast and secure, with no need for Office installation or server-side conversions. [sponsored]

  7. Transformers.js was created by Michael Bay Joshua Lochner to let you run machine learning transformers directly in your browser without a server.

  8. Ben Peven wrote on the Sentry blog about How to find the root cause of slow full-stack apps by tracing JavaScript errors across the front and back end. [sponsored]

  9. Luca Casonato wrote about How (and why) Deno built JSR.

  10. Carl went full Coffeezilla to Expose Devin for overstating its claims as “the first AI software engineer.” But as many have pointed out, overstating your capabilities to get a job you don’t qualify for is what software engineers have been doing for decades. So maybe Devin really is the real deal.