Free range, non-GMO software

Issue #314.August 15, 2024.2 Minute read.
Bytes

Today’s issue: Salt-N-Pepa takes on CSS, a fun-and-flirty parallelizing library, and how optimizing SPA load times with async chunks preloading cured my millennial dread.

Welcome to #314.


Eyeballs logo

The Main Thing

Tony Soprano's daughter asking if he is in the mafia

Dad, are we an open-source company?

Free range, non-GMO software

Last issue, we mentioned that Sentry launched a new type of software license for businesses called Fair Source Software. A few other companies have already joined the movement, so let’s take a closer look at what that actually means.

Quick review: If you’ve spent time learning from all the legal scholars on Hacker News, you’re probably aware that making your source code public on GitHub does not mean your project is “open source.” To do that, the software license must adhere to a specific set of guidelines that allow any developer (or company) to use the code without restrictions.

This usually works out great for everyone, unless another company takes the software your team has been building and uses it to create a competing product – which is apparently what happened to Sentry’s Codecov.

To address this, Sentry added some protections to their software license, which technically meant that the project was no longer open source. But they still wanted to share their code with the community, so rather than going closed source, they created the “Fair Source” licensing category instead.

Fair Source shares similar values to open source – publicly sharing code that developers can learn from and contribute to. The difference is that it allows companies to enforce the additional restrictions Sentry was looking for, like a non-compete clause.

According to the official guidelines an FSS project must:

  1. Have publicly available source code
  2. Have a license that protects that producer’s business model
  3. Transition to an open source license after a period of time

Bottom Line: It’s easy to be cynical about a big company introducing a new flavor of software licensing to protect its business interests. But hopefully, the second-order effect of this will be that more companies feel comfortable publicly sharing their code with the developer community.

        

Sanity logo

Our Friends
(With Benefits)

A dog edited to look like Venasaur the Pokemon

When you try to build your own CMS

Why we love using Sanity as our CMS

Our very small team creates a lot of content: blog posts, newsletters, videos, and highly interactive courses.

Sure, that means we get less sunlight than an average cave worm – but it also means we need a powerful CMS that’s flexible enough for all our needs, but simple enough to let us focus on content.

Luckily, we adopted Sanity’s headless CMS back in 2022, and we’ve never looked back. Here’s why we love it so much:

  • Extreme flexibility lets us easily update our schemas, change the content structure, and customize Sanity’s visual UI for easier collaboration.

  • Treating content as data lets us easily query anything we need via GROQ or GraphQL with great performance – including images and videos.

  • Best-in-class DX lets us connect our front ends, services, and scripts to Sanity APIs and easily build static and dynamic content for our users.

Use the code “bytes” to try the boosted plan for free. Your future self will be grateful you did.


Spot the Bug logo

Spot the Bug

Presented by Stytch

They provide complete auth infrastructure for developers (far beyond basic widgets), plus built-in fraud and risk prevention to help you put an end to bots, fraud, and account abuse.

function flattenArray(arr) {
  let result = [];
  arr.forEach((item) => {
    if (Array.isArray(item)) {
      result.concat(flattenArray(item));
    } else {
      result.push(item);
    }
  });
  return result;
}

console.log(flattenArray([1, [2, [3, [4]]]]));

Cool Bits logo

Cool Bits

  1. Brecht De Ruyt wrote an article called, It’s time to talk about “CSS5”. That was the backup title for Salt-N-Pepa’s #1 hit single from 1991.

  2. Ian Morris wrote about How to redact a PDF and how you can use the Apryse WebViewer SDK to offer secure document redaction to your users. [sponsored]

  3. Parallel DOM is a fun-and-flirty library for parallelizing away heavy DOM operations to make your app faster.

  4. Angular v18.2 just dropped with a bunch of new DX features, including new diagnostics, a new TypeScript isolatedModules option for improving production build times, and more.

  5. Nanda “Not A Number” Syahrasyad wrote about Animating Figma’s SVG exports.

  6. Unlayer Embed gives you a drag-and-drop email editor, page builder, and pop-up builder for your SaaS application. It’s white-label, easy to embed, and will easily save you weeks of eng time. [sponsored]

  7. Swizec shared some pro tips from 8 months of using TanStack/Router in production. Tip #1: In TanStack we trust.

  8. Scott Trinh wrote this in-depth article about One approach to optimizing type checking performance in TypeScript.

  9. Mazzarolo Matteo wrote about Optimizing SPA load times with async chunks preloading

  10. Singulatron is a rapid prototyping environment for AI apps, providing a comprehensive framework and ecosystem that lets you self-host AI models and build on top of them.


Spot the Bug logo

Spot the Bug: Solution

Sponsored by Stytch

Array.prototype.concat() doesn’t mutate the original array, it returns a new array. To fix the issue, we need to assign the return value of result.concat(flattenArray(item)) back to result.

function flattenArray(arr) {
  let result = [];
  arr.forEach((item) => {
    if (Array.isArray(item)) {
      result = result.concat(flattenArray(item));
    } else {
      result.push(item);
    }
  });
  return result;
}

console.log(flattenArray([1, [2, [3, [4]]]]));