tyler

星期三 08 晚上 八月 6o 2025

Bytes: The Next.js of LLMs

Bytes: The Next.js of LLMs

Cool Bits logo

Cool Bits

  1. Jared White wrote about how CSS and Tailwind are finally friends at last. Just like how I’m finally friends with my old high school nemesis who has apparently been quietly working at Figma for the last 7 years. It’s so nice to reconnect with old classmates without any sort of pretext or personal agenda.

  2. Take Postman’s State of the API Survey. Thousands of developers have already shared how the world of APIs has changed. Join them and you’ll be entered to win an iPad Pro with all the accessories. [sponsored]

  3. Colton Voege wrote about how AI is not actually making engineers 10x more productive. Only a potent blend of gas station kratom and disapproval from a father figure can do that.

  4. Waku (a minimal React framework focused on RSC) now has Vite RSC support.

  5. Una Kravets wrote about creating a scroll-spy with 2 lines of CSS. But if you want a scroll-manchurian-candidate, you’re still gonna need to use Tailwind.

  6. React Universe Conf just published their full agenda, featuring Nicola Corti and Riccardo Cipolleschi from Meta co-hosting the keynote, plus new speakers from Amazon and HelloFresh. Matt Pocock will also be leading a Vercel AI SDK v5 workshop 🔥. Check it out. [sponsored]

  7. Catherine Jue wrote about the power of fast software.

  8. Speaking of which, Ryan Skinner wrote about how he built a full-stack React framework that’s 4x faster than Next.js with 4x more throughput. Tim Neutkens, you have 24 hours to respond.

  9. CodeRabbit’s free VS Code extension gives you line-by-line AI code reviews right in your IDE. It’s like having a senior developer who understands the context of your whole codebase give you feedback on every line of code and provide one-click fix suggestions. [sponsored]

  10. TkDodo wrote about React Query selectors, supercharged.

  11. Jean Boussier wrote about what’s wrong with the JSON gem API. We all know that Ruby is objectively inferior, but this post does have some interesting insights on API design.

  12. Cloudflare called out Perplexity for using stealth, undeclared crawlers to evade website no-crawl directives – which gave me flashbacks to being called out by the manager of my local 7-11 for wearing multiple disguises into the store on July 11th to get eight free slurpees. And I would’ve gotten away with it too, if it weren’t for those meddling kids.


Pop Quiz logo

Pop Quiz: Answer

function filterRecommendations(purchasedProducts, potentialRecommendations) {
  return potentialRecommendations.filter(
    (product) => !purchasedProducts.includes(product)
  );
}

We can improve this code by using a Set to store the purchasedProducts list. Because Set allows us to check for the existence of a value in constant time, we can avoid the linear time lookup that Array.includes requires. In theory, this should make the function significantly faster for large lists of products (but you should always benchmark your code to be sure).

function filterRecommendations(
  purchasedProducts,
  potentialRecommendations
) {
  const purchasedProductsSet = new Set(purchasedProducts);
  return potentialRecommendations.filter(
    (productId) => !purchasedProductsSet.has(productId)
  );
}

console.time("Recommendations");
const purchasedProducts = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
const potentialRecommendations = [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
const result = filterRecommendations(
  purchasedProducts,
  potentialRecommendations
);
console.log(result); // [11, 12, 13, 14, 15]
console.timeEnd("Recommendations"); // 0.212890625 ms

Bytes

Want us to say nice things

about your company?

Sponsor Bytes

or share it

Built with ❤️ by ui.dev

50 W Broadway Ste 333 PMB 51647 Salt Lake City, Utah 84101

发布者