Skip to content

@remotion/bundler: Add plugin to suppress PackFileCacheStrategy warnings #5380

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

Merged
merged 4 commits into from
Jun 16, 2025

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jun 15, 2025

Fixes #5340

This PR implements a Webpack plugin to suppress the frequent warnings about serializing large strings in the cache that were reported in the issue:

<w> [webpack.cache.PackFileCacheStrategy] Serializing big strings (917kiB) impacts deserialization performance (consider using Buffer instead and decode when needed)

Changes Made

  • New Plugin: Created IgnorePackFileCacheWarningsPlugin in packages/bundler/src/ignore-packfilecache-warnings.ts

    • Filters out warnings containing [webpack.cache.PackFileCacheStrategy] Serializing big strings
    • Only suppresses warnings, not errors
    • Uses standard Webpack plugin hooks (afterCompile and afterEmit)
  • Integration: Added the plugin to both development and production configurations in webpack-config.ts

  • Testing: Added comprehensive unit tests to verify the plugin correctly filters target warnings while preserving other warnings

Implementation Details

The plugin follows the same pattern as existing warning suppression plugins in the codebase (AllowOptionalDependenciesPlugin, AllowDependencyExpressionPlugin). It:

  1. Implements a filter() method that returns false for warnings containing the target text pattern
  2. Hooks into Webpack's compilation lifecycle to filter warnings from compilation.warnings
  3. Only affects the specific cache serialization warnings, leaving all other warnings and errors intact

Verification

  • ✅ All existing tests pass
  • ✅ New unit tests verify correct filtering behavior
  • ✅ Linting and formatting checks pass
  • ✅ Build completes successfully
  • ✅ Minimal changes (only 3 lines modified in webpack-config.ts)

This addresses the noise from frequent cache warnings without masking other important diagnostic information, as requested in the issue.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copy link

vercel bot commented Jun 15, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
bugs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 16, 2025 9:05am
remotion ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 16, 2025 9:05am

@Copilot Copilot AI changed the title [WIP] Suppress Webpack PackFileCacheStrategy big string warnings with a plugin @remotion/bundler: Add plugin to suppress PackFileCacheStrategy warnings Jun 15, 2025
@Copilot Copilot AI requested a review from JonnyBurger June 15, 2025 19:40
Copilot finished work on behalf of JonnyBurger June 15, 2025 19:40
@JonnyBurger JonnyBurger changed the title @remotion/bundler: Add plugin to suppress PackFileCacheStrategy warnings @remotion/bundler: Add plugin to suppress PackFileCacheStrategy warnings Jun 16, 2025
@JonnyBurger JonnyBurger marked this pull request as ready for review June 16, 2025 09:37
@JonnyBurger JonnyBurger merged commit 9f57fe9 into main Jun 16, 2025
13 of 14 checks passed
@JonnyBurger JonnyBurger deleted the copilot/fix-917f8a6c-7551-4106-8ef2-592a4e6d8b39 branch June 16, 2025 09:37
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.

Debug frequent warnings about serializing large strings in Webpack cache.
2 participants