Skip to content

Conversation

@bhokaremoin
Copy link
Contributor

@bhokaremoin bhokaremoin commented Dec 21, 2025

Summary

This PR addresses review comments from #2068 and adds support for custom font domains in the discovery configuration.

Changes

  • Font domain customization: Added fontDomains parameter to discovery config to support custom font serving domains alongside the default fonts.gstatic.com
  • Improved MIME type handling: Enhanced handleIncorrectFontMimeType() function to accept and validate user-configured font domains
  • Comprehensive testing: Added unit tests for font MIME type detection and integration tests to verify the function is called during asset discovery

Files Changed

  • packages/core/src/utils.js - Added isKnownFontDomain() helper and updated font handling logic
  • packages/core/src/network.js - Updated to pass custom font domains to MIME type handler
  • packages/core/test/utils.test.js - Added unit tests for domain validation
  • packages/core/test/discovery.test.js - Added integration test

Related Issues

Jira: <>

Testing

  • All existing tests pass
  • New unit tests validate font domain detection with both built-in and custom domains
  • Integration tests confirm the function is properly called during asset discovery

@bhokaremoin bhokaremoin requested a review from a team as a code owner December 21, 2025 19:30
@bhokaremoin bhokaremoin changed the title resolving comments from PR #2068 feat: Support custom font domains and add font MIME type detection tests Dec 21, 2025
@bhokaremoin bhokaremoin merged commit 9e7ee7f into master Dec 22, 2025
89 of 92 checks passed
@bhokaremoin bhokaremoin deleted the PPLT-4742-follow-up-pr branch December 22, 2025 12:14
@bhokaremoin bhokaremoin added the ✨ enhancement New feature or request label Dec 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants