- [Breaking]: Resolver: Read
"exports"from the package root, and apply"browser"redirections after it, by default. Setresolver.unstable_resolveExportsFromPackageRootandresolver.unstable_applyBrowserSpecAfterExportstofalseto opt out (#2174 by @robhogan) - [Breaking]: Default
transformer.asyncRequireModulePathandresolver.emptyModulePathtometro:runtime/..., which aren't file paths. Custom resolvers must delegate unhandledmetro:specifiers tocontext.resolveRequest(#2180 by @robhogan) - [Breaking]: Resolve the module system via
metro:runtime/polyfills/require. A customresolver.resolveRequestmust delegatemetro:specifiers it doesn't handle tocontext.resolveRequest(#2184 by @robhogan) - [Breaking]:
transformer.globalPrefixnow also prefixes__r,__c,__registerSegmentand__accept, and the default run statement. Code that calls these by name must apply the prefix (#2186 by @robhogan) - [Breaking]: Remove the deprecated
redirectModulePathfromResolutionContext. A custom resolver should drop any call to it and delegate tocontext.resolveRequestorresolve, which already apply"browser"redirections and return{type: 'empty'}forfalse(#2181 by @robhogan) - [Breaking]: Remove the deprecated
doesFileExistfromResolutionContext, and theDoesFileExisttype frommetro-resolver(usefileSystemLookup) (#2181 by @robhogan) - [Breaking]:
ResolutionContext.isESMImportis required (#2182 by @robhogan) - [Breaking]: Async bundle and HMR module URLs keep the file extension (
foo.js.bundle), fixing lazy loading of.cjsand.mjsfiles, and of files that share a name with a sibling (#1990 by @dasjideepak) - [Breaking]: Babel transformers can no longer return a
functionMap. Apply thepluginspassed by Metro and return the resulting Babelmetadatato keep function names in stack traces (#2157 by @robhogan) - [Breaking]:
/symbolicateno longer readsreq.rawBody, and fails if a middleware has already read the request body (#2158 by @robhogan) - [Breaking]: Remove the
bundle_transform_progressed_throttledevent fromTerminalReportableEvent.TerminalReportersubclasses should handlebundle_transform_progressed, which their_lognow receives for every progress update (#2170 by @vzaidman) - [Breaking]: Source and JSON files containing the reserved string
_$$_METRO_, including in comments and string literals, now fail to transform (#2155 by @robhogan) - [Breaking]: Remove the deprecated, always-
truehotoption fromgetTransformOptions(#2159 by @robhogan) - [Feature]: Custom serializers receive the reserved string as
options.reservedString(#2155 by @robhogan) - [Fix]: Don't print the terminal status in the middle of bursts of output written outside of it, and don't wait for a pending status update before exiting (#2170 by @vzaidman)
- [Fix]: Fall back to file-based resolution, instead of throwing a
TypeError, when a package's"exports"field is not a string, array or object (#2187 by @kwy404) - [Fix]: Fix relative symlinks on a different Windows drive than the project root (#2161 by @ramya-2196)
- [Performance]: ~5-10% faster resolution (#2181 by @robhogan)
NOTE: Experimental features are not covered by semver and can change at any time.
- [Experimental]: Remove
unstable_incrementalResolutionfromResolutionContext, andmetro-resolver/private/createDefaultContext(#2181 by @robhogan)
Full Changelog: v0.87.3...v0.88.0