Skip to content
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

Track duplicates in MockMap, refactor setThrowOnModuleCollision -> assertValid #1406

Closed
wants to merge 1 commit into from

Conversation

robhogan
Copy link
Contributor

@robhogan robhogan commented Dec 16, 2024

  • Refactors mock duplicate handling from "throw the next time you see an error" to "throw now if there are errors"
  • The new structure is more generic and more plugin-friendly. We'll use plugins for two main purporses:
    • Remove non-Metro concerns from Metro.
    • Extensibility, for using metro-file-map outside Metro for other purposes - eg processing Buck file changes.
  • We'll make the same change for Haste duplicates, so that Haste and Mocks are each (eventually) plugins to metro-file-map.

Changelog: Internal

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 16, 2024
@facebook-github-bot
Copy link
Contributor

@robhogan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

…sertValid (#1406)

Summary:
- Refactors mock duplicate handling from "throw the next time you see an error" to "throw now if there are errors"
 - The new structure is more generic and more plugin-friendly. We'll use plugins for two main purporses:
   - Remove non-Metro concerns from Metro.
   - Extensibility, for using metro-file-map outside Metro for other purposes - eg processing Buck file changes.
 - We'll make the same change for Haste duplicates, so that Haste and Mocks are each (eventually) plugins to metro-file-map.

Changelog: Internal


Test Plan:
- Not observable in Metro since we set `ignorePatterns: ''` - the mock map is always null.
 - New unit tests, existing coverage of mock behaviour.

Reviewed By: huntie

Differential Revision: D67277387

Pulled By: robhogan
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D67277387

@facebook-github-bot
Copy link
Contributor

@robhogan merged this pull request in b63a043.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants