Skip to content

Conversation

@rebelchris
Copy link
Contributor

@rebelchris rebelchris commented Jan 26, 2026

Changes

Adds Agentation tooling

Events

Did you introduce any new tracking events?

Experiment

Did you introduce any new experiments?

Manual Testing

Caution

Please make sure existing components are not breaking/affected by this PR

Preview domain

https://feat-agentation.preview.app.daily.dev

@rebelchris rebelchris requested a review from a team as a code owner January 26, 2026 11:58
@vercel
Copy link

vercel bot commented Jan 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
daily-webapp Ready Ready Preview Jan 28, 2026 0:47am
1 Skipped Deployment
Project Deployment Review Updated (UTC)
storybook Ignored Ignored Jan 28, 2026 0:47am

Request Review

</BootDataProvider>
<ReactQueryDevtools />
</HydrationBoundary>
{process.env.NODE_ENV === 'development' && <Agentation />}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we probably want to lazy load with suspense so it does not get bundled at all in prod, maybe even null it in webpack bundler

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@claude this seems like a good idea (null bundler)

Copy link
Contributor

@claude claude bot Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude finished @rebelchris's task in 2m 1s —— View job


Implementation complete

  • Read _app.tsx to understand current Agentation implementation
  • Read Next.js/webpack configuration
  • Implement webpack null loader for production builds
  • Run linting
  • Commit and push changes

I've implemented the webpack null bundler for Agentation as suggested. The changes prevent the agentation package from being bundled in production builds.

What changed

Modified packages/webapp/next.config.ts to add a webpack alias that resolves agentation to false when NODE_ENV === 'production'. This means:

  • In development: Agentation loads normally and is available for use
  • In production: The package is excluded from the bundle entirely, reducing bundle size

The implementation follows the same pattern already used in the config for cross-fetch, ensuring consistency with the existing codebase.
| Branch

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@capJavert good idea done

Copy link
Contributor

@capJavert capJavert Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@claude you did not lazy load it, import still exists top level

Copy link
Contributor

@claude claude bot Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude finished @capJavert's task in 2m 53s —— View job


Implementation complete

  • Read _app.tsx to understand current implementation
  • Read next.config.ts to review webpack configuration
  • Convert top-level import to lazy/dynamic import
  • Review build mode check (NODE_ENV vs next config)
  • Run linting
  • Commit and push changes

What changed

packages/webapp/pages/_app.tsx:

  • Removed top-level import { Agentation } from 'agentation' (line 3)
  • Added conditional dynamic import using Next.js dynamic() with ssr: false
  • The component now only loads when process.env.NODE_ENV === 'development'
  • Updated JSX to conditionally render based on component availability

packages/webapp/next.config.ts:

  • Added dev parameter to webpack function signature
  • Changed condition from process.env.NODE_ENV === 'production' to !dev
  • Uses Next.js native build mode flag instead of environment variable

Result

The agentation package is now properly lazy loaded and will be completely excluded from production builds. The top-level import has been removed, so webpack will not bundle it in production at all.
| Branch

Add webpack alias to null agentation package in production builds,
preventing it from being bundled when NODE_ENV=production. This ensures
the development tool doesn't bloat the production bundle.

Co-authored-by: Chris Bongers <rebelchris@users.noreply.github.com>
config.resolve.alias['cross-fetch'] = false;

// Exclude agentation from production builds
if (process.env.NODE_ENV === 'production') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should check build mode from next config, not NODE_ENV, not 100%

- Remove top-level import of agentation package
- Use Next.js dynamic() to lazy load only in development
- Update webpack config to use Next.js dev flag instead of NODE_ENV
- Prevents agentation from being bundled in production builds

Co-authored-by: Ante Barić <capJavert@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants