github react/metro v0.88.0

one hour ago
  • [Breaking]: Resolver: Read "exports" from the package root, and apply "browser" redirections after it, by default. Set resolver.unstable_resolveExportsFromPackageRoot and resolver.unstable_applyBrowserSpecAfterExports to false to opt out (#2174 by @robhogan)
  • [Breaking]: Default transformer.asyncRequireModulePath and resolver.emptyModulePath to metro:runtime/..., which aren't file paths. Custom resolvers must delegate unhandled metro: specifiers to context.resolveRequest (#2180 by @robhogan)
  • [Breaking]: Resolve the module system via metro:runtime/polyfills/require. A custom resolver.resolveRequest must delegate metro: specifiers it doesn't handle to context.resolveRequest (#2184 by @robhogan)
  • [Breaking]: transformer.globalPrefix now also prefixes __r, __c, __registerSegment and __accept, and the default run statement. Code that calls these by name must apply the prefix (#2186 by @robhogan)
  • [Breaking]: Remove the deprecated redirectModulePath from ResolutionContext. A custom resolver should drop any call to it and delegate to context.resolveRequest or resolve, which already apply "browser" redirections and return {type: 'empty'} for false (#2181 by @robhogan)
  • [Breaking]: Remove the deprecated doesFileExist from ResolutionContext, and the DoesFileExist type from metro-resolver (use fileSystemLookup) (#2181 by @robhogan)
  • [Breaking]: ResolutionContext.isESMImport is required (#2182 by @robhogan)
  • [Breaking]: Async bundle and HMR module URLs keep the file extension (foo.js.bundle), fixing lazy loading of .cjs and .mjs files, and of files that share a name with a sibling (#1990 by @dasjideepak)
  • [Breaking]: Babel transformers can no longer return a functionMap. Apply the plugins passed by Metro and return the resulting Babel metadata to keep function names in stack traces (#2157 by @robhogan)
  • [Breaking]: /symbolicate no longer reads req.rawBody, and fails if a middleware has already read the request body (#2158 by @robhogan)
  • [Breaking]: Remove the bundle_transform_progressed_throttled event from TerminalReportableEvent. TerminalReporter subclasses should handle bundle_transform_progressed, which their _log now 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-true hot option from getTransformOptions (#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_incrementalResolution from ResolutionContext, and metro-resolver/private/createDefaultContext (#2181 by @robhogan)

Full Changelog: v0.87.3...v0.88.0

Don't miss a new metro release

NewReleases is sending notifications on new releases.