# Grant Application: swap.cow.fi performance - bundle optimization

**URL:** <https://forum.cow.fi/t/grant-application-swap-cow-fi-performance-bundle-optimization/3315>\
**Category:** CoW Grants Program\
**Tags:** complete, grant-funded\
**Created:** [December 16, 2025, 2:36pm UTC](https://forum.cow.fi/t/grant-application-swap-cow-fi-performance-bundle-optimization/3315 "2025-12-16T14:36:51Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![crutch12](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.cow.fi/crutch12/32/1605_2.png) [@crutch12](https://forum.cow.fi/u/crutch12)\
**Post date:** [January 27, 2026, 12:34pm UTC](https://forum.cow.fi/t/grant-application-swap-cow-fi-performance-bundle-optimization/3315/17 "2026-01-27T12:34:07Z")

</div>

Hi

Looks like PR was just merged

> <https://github.com/cowprotocol/cowswap/pull/6775>
>
> \# Summary
> 
> Bundle size optimization for swap.cow.fi (see \[grant proposal\](http…s://forum.cow.fi/t/grant-application-swap-cow-fi-performance-bundle-optimization/3315))
> 
> Results:
> \- initial load size (brotli) \*\*2.104kb\*\* -\> \*\*1.254kb\*\*
> \- total bundle size (brotli) 4.52mb -\> 3.91mb
> \- thx to dynamic imports, \`dev\` mode should start faster
> 
> \<details\>
> \<summary\>Initial loading size before/after\</summary\>
>   
> \*\*Before\*\*
> \<img width="1324" height="623" alt="image" src="https://github.com/user-attachments/assets/17011be6-a3fc-495e-8e6b-5260b52d4431" /\>
> 
> \*\*After\*\*
> \<img width="1328" height="616" alt="image" src="https://github.com/user-attachments/assets/60b9a620-d21b-4889-a5ea-47ef7d657646" /\>
> \</details\>
> 
> \### Done
> 
> \- \`@safe-global/api-kit\` - dynamic import + \`@safe-global/\*\*\` new versions (esm support) 
> \- \`@1inch/permit-signed-approvals-utils\` - dynamic import + partial re-export (for better tree-shaking) + new version (esm support) + hardcode used constants
> \- use esm instead of cjs for supported "bad configured" deps (e.g. \`@use-gesture/core\` and \`@safe-global/safe-apps-sdk\`)
> \- dedupe \`bn.js\`
> \- \`lottie-react\` - dynamic import
> \- \`framer-motion\` - dynamic import
> \- \_huge lottie jsons\_ - dynamic import
> \- updated a lot of deps to new versions (esm support)
> \- eslint rules for added dynamic imports
> \- updated contribution docs
> 
> \#### Other
> 
> \- better chunk naming (e.g. \`index-\[hash\].js\` -\> \`metamask-\[hash\].js\`)
> \- added \[rollup-plugin-bundle-stats\](https://www.npmjs.com/package/rollup-plugin-bundle-stats)
> 
> \### Todo
> 
> \- testing
> 
> \### Caveats
> 
> \- \`@safe-global/\*\*\` new versions have slightly different types (e.g. for \`nonce\`), there may be problems I couldn't catch (e.g. on the sdk side)
> 
> \# To Test
> 
> \- run \`rimraf node\_modules\` before \`yarn install\` usage
> \- should work as well as production, but faster
> 
> \# Background
> 
> Optional: Give background information for changes you've made, that might be difficult to explain via comments
> 
> 
> 
> \## Summary by CodeRabbit
> 
> \* \*\*New Features\*\*
> \* Lazy-loaded animations and motion assets; improved code-splitting for faster initial load.
> 
> \* \*\*Bug Fixes\*\*
> \* Fixed Safe transaction nonce handling for more reliable on-chain transaction status.
> 
> \* \*\*Chores / Refactor\*\*
> \* Updated Safe and permit-related packages and build configuration to improve bundling and analysis.
> 
> \* \*\*Documentation\*\*
> \* Contributor guide expanded with bundle optimization and testing guidance.
> 
> \<sub\>✏️ Tip: You can customize this high-level summary in your review settings.\</sub\>

@Sov should I do anything else about this grant application?

---

_[View the full topic](https://forum.cow.fi/t/grant-application-swap-cow-fi-performance-bundle-optimization/3315)._
