-
Notifications
You must be signed in to change notification settings - Fork 291
feat: add Agentation #5377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: add Agentation #5377
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
packages/webapp/pages/_app.tsx
Outdated
| </BootDataProvider> | ||
| <ReactQueryDevtools /> | ||
| </HydrationBoundary> | ||
| {process.env.NODE_ENV === 'development' && <Agentation />} |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@capJavert good idea done
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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()withssr: 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
devparameter 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>
packages/webapp/next.config.ts
Outdated
| config.resolve.alias['cross-fetch'] = false; | ||
|
|
||
| // Exclude agentation from production builds | ||
| if (process.env.NODE_ENV === 'production') { |
There was a problem hiding this comment.
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>
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