Less code, faster builds, same telemetry: Turbopack support for the Next.js SDK
Blog post from Sentry
Next.js's transition from Webpack to Turbopack as its default bundler prompted a significant overhaul of the Sentry SDK, leading to a more streamlined and efficient approach to telemetry without relying on bundlers. Previously, the SDK used a complex system involving Webpack loaders and multiple templates to wrap code for telemetry purposes, which was cumbersome and prone to breakage. With Turbopack and Next.js's built-in OpenTelemetry instrumentation, the SDK now listens to emitted spans instead of wrapping code, reducing the codebase by a factor of ten and eliminating the need for bundler-specific solutions. This change ensures faster builds and maintains consistent telemetry data, while also aligning with a broader industry trend toward adopting OpenTelemetry as a standard interface, where frameworks handle the technical details and third-party tools manage data flow. This evolution reflects a strategic shift that simplifies the SDK's architecture and enhances its efficiency and compatibility with future Next.js updates.