Skip to content

Avoid unnecessary legacy transforms and polyfills in modern reader bundles #130

Open

Description

@abhi1693

Problem

Modern browsers receive compatibility code Lighthouse identifies as unnecessary for the measured browser.

Production audit evidence

Measured on 2026-10-07 UTC against https://devfeed.tech using Lighthouse 12.6.1 and Chrome 154.0.8037.97, with fresh anonymous browser profiles. Mobile uses the default simulated mobile network/4× CPU profile (412×823, DPR 1.75); desktop uses the default desktop profile (1350×940, DPR 1). These are lab observations, not field p75 data.

legacy-javascript repeatedly estimated 24,356 bytes (24KiB) waste on homepage runs; the newer legacy insight identified roughly 14KiB in one first-party chunk. Signals include Array.at/flat/flatMap, Object.fromEntries/hasOwn, String.trimStart/trimEnd, and transpiled classes. The two audit estimates are alternate analyses and must not be summed.

Audit IDs: legacy-javascript, legacy-javascript-insight.

Work required

  • Trace flagged output to build targets, framework polyfill behavior, and dependencies. Define the actual supported-browser baseline before adjusting transforms.
  • Use supported build options and dependency choices; do not patch generated bundles or remove polyfills needed by supported browsers.

Acceptance criteria

  • Modern production bundles have fewer measured legacy/polyfill bytes.
  • Tests confirm the defined supported browser matrix, including Chrome and Edge extensions, and cover code paths depending on flagged APIs.
  • Capture comparable before/after reports and add regression coverage for the changed behavior. For shared reader changes, verify browser behavior on web and both built Chrome/Edge extensions.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions