Repository navigation
Conversation
|
@vzaidman I'll merge the stack below this but leave this one for you - you may want to import it as I suspect there are internal callers that'll need migrating. |
Metro review: Looks goodRisk: low · Commit: This PR removes No findings. Verified
Not run: Internal Meta callers can't be checked from OSS. Benchmarks weren't run because the PR only removes dead code. Automated review by Claude. Advisory only: it never approves or blocks, and a maintainer makes the call. |
#2219 added `getSerializableState()`, which returns the file system's own data, and moved the cache write onto it. This removes `getSerializableSnapshot()`, the deep copy it replaced, which nothing in Metro calls now. Anyone calling `getSerializableSnapshot()` should migrate to `getSerializableState()`. Because it isn't a copy, it can drift as the file system changes unless it's consumed synchronously. `getSerializableState()` is on `MutableFileSystem` rather than `FileSystem`, but the file system that `FileMap.build()` returns is a `TreeFS`, which implements it. A caller that holds on to the result across an `await`, or while the file map is watching, can copy it with `structuredClone()`, which copies at least as deeply as `getSerializableSnapshot()` did. Though `metro-file-map`'s API is private, I had a search around GitHub to make sure this won't break anyone - nothing outside Metro calls it, including RN and Expo. Changelog: Internal Test plan: Needs a Meta import to check for internal callers.
#2219 added
getSerializableState(), which returns the file system's own data, and moved the cache write onto it. This removesgetSerializableSnapshot(), the deep copy it replaced, which nothing in Metro calls now.Anyone calling
getSerializableSnapshot()should migrate togetSerializableState(). Because it isn't a copy, it can drift as the file system changes unless it's consumed synchronously.getSerializableState()is onMutableFileSystemrather thanFileSystem, but the file system thatFileMap.build()returns is aTreeFS, which implements it. A caller that holds on to the result across anawait, or while the file map is watching, can copy it withstructuredClone(), which copies at least as deeply asgetSerializableSnapshot()did.Though
metro-file-map's API is private, I had a search around GitHub to make sure this won't break anyone - nothing outside Metro calls it, including RN and Expo.Changelog: Internal
Test plan:
Needs a Meta import to check for internal callers.