Concrete
Rulesbundles

concrete/bundles/island-size

An island chunk is over 1 MB gzip.

An island chunk is over 1 MB gzip.

Graded by the bundles stage of concrete check, in the build venue. A violation reports this id and the file it failed at — see every rule and concrete check.

Reason

An island chunk is downloaded by a visitor, over their connection, when the island comes into view — it is the one part of a template that costs the audience rather than the platform. The client half exists to be small: the server render is what carries the content, and the island adds behaviour to it. The 1 MB gzip ceiling is generous enough that hitting it almost always means a barrel import came along for the ride.

Fix

Import the named things you use instead of a package's whole surface, and split what only some visitors need behind a dynamic import() inside the island. If the weight is a library the section uses at render time, it belongs in the server half, not here.

Before and after

"use client";

import type { IslandEditor } from "@homepages/concrete";
// The whole icon set, to render two of them.
import * as icons from "lucide-react";
import { useState } from "react";

export const editor = { live: true } satisfies IslandEditor;

export default function Gallery({ count }: { count: number }) {
  const [at, setAt] = useState(0);
  return (
    <div>
      <button onClick={() => setAt((at + count - 1) % count)}>{<icons.ChevronLeft />}</button>
      <button onClick={() => setAt((at + 1) % count)}>{<icons.ChevronRight />}</button>
    </div>
  );
}
"use client";

import type { IslandEditor } from "@homepages/concrete";
import { ChevronLeft, ChevronRight } from "lucide-react";
import { useState } from "react";

export const editor = { live: true } satisfies IslandEditor;

export default function Gallery({ count }: { count: number }) {
  const [at, setAt] = useState(0);
  return (
    <div>
      <button onClick={() => setAt((at + count - 1) % count)}>{<ChevronLeft />}</button>
      <button onClick={() => setAt((at + 1) % count)}>{<ChevronRight />}</button>
    </div>
  );
}

On this page