Skip to content

feat(build): inline small image assets under 1KB as data URLs#526

Merged
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
AlphaMaleBaDI:feature/data-url-optimization
May 31, 2026
Merged

feat(build): inline small image assets under 1KB as data URLs#526
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
AlphaMaleBaDI:feature/data-url-optimization

Conversation

@AlphaMaleBaDI
Copy link
Copy Markdown
Contributor

Closes #369

Summary

Adds support for inlining static image assets smaller than 1KB as base64 data URLs during the Metro build process.

Changes

  • Added a Metro asset plugin to detect image assets below 1KB
  • Inlined qualifying assets as base64 data URLs
  • Preserved React Native and Expo asset registry behavior
  • Added runtime asset resolution support for inlined assets
  • Added automated tests covering inline and fallback behavior
  • Added a tiny 68-byte PNG test asset for verification

Notes

During repository audit, no existing image assets below the 1KB threshold were found. A small test asset was added to validate the optimization path and future-proof the build pipeline for future small icons and images.

Verification

  • Asset plugin registration verified
  • Runtime asset resolution verified
  • ESLint checks passed
  • Asset inlining test suite added
  • Working tree clean after implementation

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 31, 2026

@AlphaMaleBaDI Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@AlphaMaleBaDI
Copy link
Copy Markdown
Contributor Author

Investigation note:

The failing GitHub Actions checks appear unrelated to the asset inlining implementation.

All workflows fail during the dependency installation phase (npm ci) before linting, testing, bundle analysis, or performance regression validation begin.

The CI logs indicate:

"The npm ci command can only install with an existing package-lock.json or npm-shrinkwrap.json"

This suggests a repository workflow/dependency configuration issue rather than a regression introduced by this change.

The implementation itself was validated locally, including:

  • Metro asset plugin registration
  • Runtime asset resolution
  • ESLint checks
  • Asset inlining test coverage

Happy to make any requested adjustments if maintainers would like additional verification.

@RUKAYAT-CODER RUKAYAT-CODER merged commit d603b74 into rinafcode:main May 31, 2026
0 of 8 checks passed
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.

Implement data URL optimization for small images/icons

2 participants