Repository: vercel/next.js
File: packages/next/src/server/next-server.ts (TypeScript)

Code before:
    if (process.env.NEXT_MINIMAL) {
      throw new Error(
        'Invariant: renderHTML should not be called in minimal mode'
      )
      // the `else` branch is needed for tree-shaking
    } else {
      // Due to the way we pass data by mutating `renderOpts`, we can't extend the
      // object here but only updating its `nextFontManifest` field.
      // https://github.com/vercel/next.js/blob/df7cbd904c3bd85f399d1ce90680c0ecf92d2752/packages/next/server/render.tsx#L947-L952
      renderOpts.nextFontManifest = this.nextFontManifest

      if (this.enabledDirectories.app && renderOpts.isAppPath) {
        return lazyRenderAppPage(
          req,
          res,
          pathname,
          query,
          // This code path does not service revalidations for unknown param
          // shells. As a result, we don't need to pass in the unknown params.
          null,
          renderOpts as LoadedRenderOpts<AppPageModule>,
          this.getServerComponentsHmrCache(),
          {
            buildId: this.buildId,
            deploymentId: this.deploymentId,
            immutableAssetToken:
              this.nextConfig.experimental.immutableAssetToken ??
              this.deploymentId,
          }
        )
      } else {
        // TODO: re-enable this once we've refactored to use implicit matches
        // throw new Error('Invariant: render should have used routeModule')

        return lazyRenderPagesPage(
          req.originalRequest,
          res.originalResponse,
          pathname,
          query,
          renderOpts as LoadedRenderOpts<PagesModule>,
          {
            buildId: this.buildId,
            deploymentId: this.deploymentId,
            immutableAssetToken:
              this.nextConfig.experimental.immutableAssetToken ??
              this.deploymentId,
            customServer: this.serverOptions.customServer || undefined,
          },
          {
            isFallback: false,
            isDraftMode: renderOpts.isDraftMode,

Review comment (suggestion):
Should this property have a different name. e.g. assetToken. It might not be the immutableAssetToken, but the deplomentId

Code after:
    if (process.env.NEXT_MINIMAL) {
      throw new Error(
        'Invariant: renderHTML should not be called in minimal mode'
      )
      // the `else` branch is needed for tree-shaking
    } else {
      // Due to the way we pass data by mutating `renderOpts`, we can't extend the
      // object here but only updating its `nextFontManifest` field.
      // https://github.com/vercel/next.js/blob/df7cbd904c3bd85f399d1ce90680c0ecf92d2752/packages/next/server/render.tsx#L947-L952
      renderOpts.nextFontManifest = this.nextFontManifest

      if (this.enabledDirectories.app && renderOpts.isAppPath) {
        return lazyRenderAppPage(
          req,
          res,
          pathname,
          query,
          // This code path does not service revalidations for unknown param
          // shells. As a result, we don't need to pass in the unknown params.
          null,
          renderOpts as LoadedRenderOpts<AppPageModule>,
          this.getServerComponentsHmrCache(),
          {
            buildId: this.buildId,
            deploymentId: this.deploymentId,
            clientAssetToken:
              this.nextConfig.experimental.immutableAssetToken ??
              this.deploymentId,
          }
        )
      } else {
        // TODO: re-enable this once we've refactored to use implicit matches
        // throw new Error('Invariant: render should have used routeModule')

        return lazyRenderPagesPage(
          req.originalRequest,
          res.originalResponse,
          pathname,
          query,
          renderOpts as LoadedRenderOpts<PagesModule>,
          {
            buildId: this.buildId,
            deploymentId: this.deploymentId,
            clientAssetToken:
              this.nextConfig.experimental.immutableAssetToken ??
              this.deploymentId,
            customServer: this.serverOptions.customServer || undefined,
          },
          {
            isFallback: false,
            isDraftMode: renderOpts.isDraftMode,