Skip to content

Releases

v0.88.1

Choose a tag to compare

@robhogan robhogan released this 26 Nov 15:23
e4ac772
  • [Feature]: metro-cache: HttpStore accepts maxSockets, to change its connection limit, and getParams, to add query parameters (such as a short-lived credential) to every request (#2246 by @GijsWeterings)
  • [Feature]: Transforming file end log entries report the worker's CPU time for the transform as cpu_time_us (#2282 by @vzaidman)
  • [Fix]: Keep function bindings that are reassigned when folding constants in production builds (#2197 by @Mwrnk)
  • [Fix]: Keep side effects such as i++ in the leading operands of a sequence when folding constants in production builds (#2278 by @burrows99)
  • [Fix]: Keep a var declared in a branch that's removed when folding constants in production builds, if code outside the branch uses it, instead of throwing a ReferenceError (#2279 by @burrows99)
  • [Fix]: Don't replace void 0 with undefined when folding constants in production builds, where undefined is shadowed (#2215 by @ZainnQureshii)
  • [Fix]: Memoized inline requires: A module first referenced in a skipped optional chain, logical assignment or default value is no longer undefined at later references (#2280 by @burrows99)
  • [Fix]: experimentalImportSupport: export * from a module with an enumerable __esModule no longer throws in strict mode (#2281 by @burrows99)
  • [Fix]: Define a __proto__ key in JSON modules as an own property, matching JSON.parse (#2199 by @Mwrnk)
  • [Fix]: FileStore writes cache entries atomically, so concurrent reads no longer miss valid entries or see partial writes (#2040 by @frankleng)
  • [Fix]: Respect excludeSource in inline source maps, and pass it to serializer.customSerializer (#2256 by @robhogan)
  • [Fix]: Stop leaking a graph's DeltaCalculator and file change listener when its first build fails (#2283 by @sensei-woo)
  • [Fix]: Resolve a package subpath ending in /., such as pkg/., instead of throwing Unexpectedly escaped traversal (#2213 by @kwy404)
  • [Fix]: Fix resolver.blockList: [] hiding every file (8f49d3681cfd)
  • [Fix]: Fix an out-of-memory crash on a symlink into itself (#2204 by @robhogan)
  • [Fix]: Fix the path of a file added through a symlink to the project root (#2212 by @robhogan)
  • [Fix]: Fix Failed to collapse on a path through a symlink out of the project root, into a directory whose name ends in . (#2237 by @robhogan)
  • [Fix]: require.context on a directory above the project root follows symlinks inside the project root, and lists each level correctly from two or more levels up (#2229 by @robhogan)
  • [Fix]: Use a separate file map cache under Bun, which can't read Node's cache (#2209 by @robhogan)
  • [Fix]: Include dependencies required by Metro's published TypeScript declarations (#2149 by @sorinc03)
  • [Performance]: Dev server memory is ~95% lower per lazy-loaded route (import() or async routes), and lazy bundle requests are ~2x faster (#2239 by @robhogan)
  • [Performance]: Without Watchman, the dev server is ready to bundle ~2.5-3x faster on Linux and Windows, and ~15% faster on macOS (#2104, #2105, #2106, #2107, #2108, #2219, #2220, #2221, #2240 by @robhogan)
  • [Performance]: Without Watchman, CI builds start bundling ~25-35% sooner on Linux and Windows, and ~15% sooner on macOS (#2104, #2219, #2220, #2240 by @robhogan)
  • [Performance]: At least 10x faster composeSourceMaps for large bundles (#2250 by @yhpark)
  • [Types]: Remove undeclared type-only imports between Metro packages. bundle_options moves from metro-core's LogEntry to MetroLogEntry, exported by metro - annotate Logger.on handlers that read it as (entry: MetroLogEntry) => ... (#2257 by @robhogan)

NOTE: Experimental features are not covered by semver and can change at any time.

  • [Experimental]: Share module outputs between graphs with equal transform options, on by default. Set transformer.unstable_shareTransformResults: false to opt out if a transform's output depends on inputs outside its cache key, or if a custom serializer writes to module outputs or dependencies (#2239, #2244 by @robhogan)
  • [Experimental]: Add unstable_hedgeCacheReadsAfterMs, which transforms a module locally when its cache read is slow and takes whichever finishes first, and maxInFlightReads on HttpGetStore, which misses rather than queueing once that many reads are outstanding (#2249 by @GijsWeterings)

Full Changelog: v0.88.0...v0.88.1

v0.88.0

Choose a tag to compare

@robhogan robhogan released this 06 Nov 18:22
d87f4c1
  • [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

v0.87.3

Choose a tag to compare

@robhogan robhogan released this 04 Nov 21:41
64235f6
  • [Fix]: Resolver: Resolve conditional and nested array fallbacks in "exports" and "imports" (#2089 by @maximilliangrand)
  • [Fix]: Apply serializer.processModuleFilter to inline source maps (#2124 by @kwy404)
  • [Fix]: metro-file-map: Keep files under other watch roots when the project root is recrawled (#2123 by @YevheniiKotyrlo)
  • [Fix]: Treat zero-filled FileStore cache files as misses (#2122 by @maximilliangrand)
  • [Fix]: Terminal: Don't erase output printed outside of Terminal (#2130 by @vzaidman)
  • [Fix]: Terminal: Keep Terminal.log() in order with other output (#2162 by @vzaidman)
  • [Performance]: ~4-7% faster cold builds, with ~6-8% less CPU, by skipping input AST cloning in the transform worker (#2033, #2132 by @vzaidman)
  • [Performance]: ~2% less CPU on cold minified builds, with faster source map handling when minifying (#1984 by @robhogan)
  • [Deprecated]: MinifierResult.map - custom minifiers should return decodedMap (#1984 by @robhogan)
  • [Deprecated]: metro-source-map: toBabelSegments, toSegmentTuple and tuplesFromBabelDecodedMap (#1984 by @robhogan)

NOTE: Experimental features are not covered by semver and can change at any time.

  • [Experimental]: Add resolver.unstable_allowVirtualModules, allowing custom resolvers to return virtual modules (#2056, #2036 by @robhogan)
  • [Experimental]: Add metro:inline;base64,<source> specifiers, resolving to a virtual module owned by the importer (#2037 by @robhogan)
  • [Experimental]: Add resolver.unstable_applyBrowserSpecAfterExports to apply "browser" redirections after "exports" (#2134 by @mozzius)
  • [Experimental]: Add resolver.unstable_resolveExportsFromPackageRoot to read "exports" from the package root (#2160 by @robhogan)
  • [Experimental]: Fix transformer.unstable_workerThreads exposing JEST_WORKER_ID to transformers (#2152 by @robhogan)

Full Changelog: v0.87.2...v0.87.3

v0.87.2

Choose a tag to compare

@robhogan robhogan released this 26 Oct 15:35
90ef397
  • [Security]: Fix CVE on micromatch/braces by removing the dependency (#2000 by @robhogan)
  • [Feature]: Add a built-in metro:runtime/* specifier, resolvable from any importer (#2083 by @robhogan)
  • [Feature]: Pass Metro's own @babel/runtime and its version to Babel presets when transformer.enableBabelRuntime is true (#1957 by @robhogan)
  • [Fix]: Resolver: Fix stale resolutions after adding a nearer package.json or retargeting a symlinked directory (#1948 by @robhogan)
  • [Fix]: Resolver: Resolve packages and directories named with an asset extension (eg lodash.zip) as modules (#2055 by @robhogan)
  • [Fix]: Resolver: Fall through to parent conditions when a nested "exports" or "imports" condition has no match (#2074 by @maximilliangrand)
  • [Fix]: Resolver: Don't resolve an exact "exports" or "imports" subpath with a null target through a pattern (#1987 by @kwy404)
  • [Fix]: Resolve Metro's own runtime and @babel/runtime even when they're outside projectRoot and watchFolders (#2065, #2083 by @robhogan)
  • [Fix]: Ambiguous module resolution errors list the conflicting files instead of an empty list, in the terminal and in the app (#2102 by @kwy404)
  • [Fix]: Use [metro-watchFolders]/N/ URLs for assets outside projectRoot, which also moves them in release builds (#1892 by @robhogan)
  • [Fix]: Fix [metro-project] and [metro-watchFolders] bundle serving on Windows (#2015 by @motiz88)
  • [Fix]: Fix an HMR crash on [metro-project] and [metro-watchFolders] URLs (#2017 by @motiz88)
  • [Fix]: Don't resolve [metro-project] and [metro-watchFolders] prefixes in API and CLI entry points (#2030 by @motiz88)
  • [Fix]: Fix backslashes in async bundle paths on Windows (#1938 by @robhogan)
  • [Fix]: Fix stale modules when files change during an in-flight or failed build (#2007 by @YevheniiKotyrlo)
  • [Fix]: Fix files changed during startup being missed until restart (#2054 by @cpruijsen)
  • [Fix]: Fix changes made immediately after startup sometimes being missed on macOS (#2003 by @robhogan)
  • [Fix]: Fix watch mode losing files when a directory replaces a file or symlink, eg unlinking a package (#2009 by @robhogan)
  • [Fix]: FallbackWatcher: Fix a hang on stop, and missed changes after a watch error or on Windows (#1967 by @robhogan)
  • [Fix]: FallbackWatcher: Close watch handles under a deleted directory (#2004 by @YevheniiKotyrlo)
  • [Fix]: metro-file-map: Don't change the active mock when a duplicate is removed (#1756 by @durvesh1992)
  • [Fix]: Create fileMapCacheDirectory if it doesn't exist, rather than failing to persist the file map cache (#2096 by @shubh73)
  • [Fix]: Include Metro's dependency collection modules in the transform cache key (#1749 by @fallintoplace)
  • [Fix]: Inline requires: Don't partially inline requires referenced in type annotations or export {...} specifiers (#2092 by @robhogan)
  • [Fix]: Propagate transformer initialisation errors from Bundler (#1854 by @Boulea7)
  • [Fix]: Release workers and watchers when Metro fails to initialise (#1963 by @robhogan)
  • [Fix]: Ignore attributes like stroke-width when reading SVG dimensions (#1972 by @GabrielDumbrava)
  • [Fix]: Fix generated positions in indexed source maps (#1976 by @kwy404)
  • [Fix]: Fix source maps losing lines after very large unmapped gaps (#1983 by @robhogan)
  • [Fix]: metro-symbolicate: Don't fail on frames with no source position, eg [native code] (#1891 by @robhogan)
  • [Fix]: metro-symbolicate: Parse frames with Windows absolute paths (#1939 by @robhogan)
  • [Performance]: Inline destructured CommonJS requires (const {foo} = require('foo')) under inlineRequires (#2087 by @robhogan)
  • [Performance]: ~3x faster composeSourceMaps, with ~15% less memory (#1978, #1979, #1980, #1983 by @robhogan)
  • [Performance]: ~35% faster first-pass resolution (#1945, #1946, #1948 by @robhogan)
  • [Performance]: ~33% faster non-Watchman crawl on startup (#1677 by @kitten)
  • [Deprecated]: String values of transformer.enableBabelRuntime - use true (#1957 by @robhogan)
  • [Types]: Add TypeScript definitions for metro-runtime (#1996 by @robhogan)
  • [Types]: Declarations use IteratorObject, which needs TypeScript 5.6+ unless skipLibCheck is set (df2e7581bcf4)

NOTE: Experimental features are not covered by semver and can change at any time.

  • [Experimental]: Add server.unstable_middleware and server.unstable_priorityMiddleware, to add middleware after or before Metro's own (#2031 by @vzaidman)
  • [Experimental]: Add server.unstable_onServerCreated, called with Metro's server before it listens (#2031 by @vzaidman)
  • [Experimental]: runServer's unstable_extraMiddleware is deprecated - use unstable_priorityMiddleware (#2031 by @vzaidman)
  • [Experimental]: Fix mismatched asset paths in builds under unstable_serverRoot (#1917 by @robhogan)
  • [Experimental]: metro-file-map: Changes to the plugin and FileSystem APIs (#1944, #1951, #2071 by @robhogan), and crawlerFactory crawlers must report symlink targets as 1 or a pre-resolved path (#1687 by @kitten)

Full Changelog: v0.87.1...v0.87.2

v0.87.1

Choose a tag to compare

@robhogan robhogan released this 13 Sep 10:34
  • [Feature]: Add resolver.schemeResolvers to resolve URI-scheme-prefixed specifiers (eg foo:bar) with custom resolvers (#1804 by @robhogan)
  • [Feature]: Resolve metro:babel-runtime/<path> imports to Metro's own @babel/runtime dependency (8388f71 by @robhogan)
  • [Feature]: metro-babel-transformer: Pass inlinePlatform to Babel presets via caller (6bbe095 by @robhogan)
  • [Fix]: Replace image-size dependency with vendored parsers, fix CVE alerts (#1860 by @robhogan)
  • [Fix]: Include charset=utf-8 in the Content-Type of text assets and source files served by the dev server (#1888 by @robhogan)
  • [Fix]: Preserve Platform.OS write targets during constant inlining (#1890 by @OskarEichler)
  • [Fix]: Inline the last duplicate key from static Platform.select object literals (#1889 by @OskarEichler)
  • [Fix]: FallbackWatcher no longer misses files written to a directory while it is being crawled (#1907 by @robhogan)
  • [Fix]: HttpStore: Handle socket errors during writes, so they're retried rather than crashing the process (fad3b88)
  • [Fix]: Treat CI=false and CI=0 as not-CI when defaulting watch. CI is now detected from process.env.CI only, dropping the ci-info dependency (61e4592 by @robhogan)
  • [Fix]: Fix Fast Refresh hitting undefined modules when using lazy (segmented) bundles in dev (c70d0ae by @robhogan)
  • [Performance]: FallbackWatcher: Drop walker dependency, reduce crawl RSS by ~34% and peak heap by ~41% (#1906 by @robhogan)
  • [Performance]: Don't emit redundant empty dependency map arrays for modules with no dependencies (#1858 by @robhogan)
  • [Types]: Restore publishing of private (underscore-prefixed) fields in TypeScript declarations (#1876 by @robhogan)
  • [Types]: Fix async functions being inferred as returning void (not Promise<void>), eg MetroServer#end (#1909 by @robhogan)
  • [Types]: Tidy up generated types, allow nullable props to be omitted in more places (#1885 by @robhogan)

NOTE: Experimental features are not covered by semver and can change at any time.

  • [Experimental]: metro-file-map: Add crawlerFactory to optionally replace the built-in Watchman / Node crawlers (68022f0 by @vzaidman)
  • [Experimental]: Add serializer.unstable_inlineDependencyMap to inline module IDs at serialisation time (#1786 by @robhogan)
  • [Experimental]: Add serializer.unstable_getAsyncDependencyPath to supply custom paths to framework-defined __loadBundleAsync (#1855 by @robhogan)
  • [Experimental]: Remove transformer.unstable_renameRequire - require is never renamed (42577f7 by @robhogan)
  • [Experimental]: experimentalImportSupport: Fix export * from re-exporting the source module's default export (#1777 by @robhogan)

Full Changelog: v0.87.0...v0.87.1

v0.84.6

Choose a tag to compare

@robhogan robhogan released this 02 Sep 15:51

This release is on the 0.84.x branch

  • [Types]: Fix async functions being inferrerd as returning void (not Promise<void>). (#1887 by @robhogan)
  • [Types]: Tidy up generated types, allow nullable props to be omitted in more places. (#1897 by @robhogan)

Full Changelog: v0.84.5...v0.84.6

v0.84.5

Choose a tag to compare

@robhogan robhogan released this 19 Aug 15:29

This release is on the 0.84.x branch

  • [Fix]: Replace image-size dependency with vendored parsers, fix CVE alerts (#1860 by @robhogan)

Full Changelog: v0.84.4...v0.84.5

v0.83.8

Choose a tag to compare

@robhogan robhogan released this 19 Aug 15:21

This release is on the 0.83.x branch

  • [Fix]: Replace image-size dependency with vendored parsers, fix CVE alerts (#1860 by @robhogan)

Full Changelog: v0.83.7...v0.83.8

v0.87.0

Choose a tag to compare

@robhogan robhogan released this 13 Jul 15:23
  • [Breaking]: Widen Resolution union returned by resolvers to allow type: 'virtualModule', pending implementation. (8336654 by @robhogan)
  • [Feature]: allowOptionalDependencies defaults to true to align with RN and Expo (#1775 by @robhogan)
  • [Fix]: Preserve accumulated and trailing config state when mergeConfig encounters an async config in a config chain (#1754 by @durvesh1992)
  • [Performance] Don't rename require in bundle output, improve cold build time ~5%`(TBD by @robhogan)

NOTE: Experimental features are not covered by semver and can change at any time.

  • [Experimental]: experimentalImportSupport: Support namespace re-exports, such as export * as Name from "module" (#1768 by @robhogan and @krystofwoldrich)
  • [Experimental]: experimentalImportSupport: Fix exports renamed by destructuring, and support exports of rest spreads (#1772 by @robhogan)
  • [Experimental]: experimentalImportSupport: Fix precedence so explicit export default and named exports win over export * from (#1773 by @robhogan)
  • [Experimental]: experimentalImportSupport: Evaluate export from dependencies in the module prelude instead of within or after the module body (#1774 by @robhogan)

Full Changelog: v0.86.0...v0.87.0

v0.86.0

Choose a tag to compare

@robhogan robhogan released this 06 Jul 16:46
  • [Breaking]: Metro now always emits whole-bundle source maps as index maps, and stores each module's map internally as a VlqMap (#1764, #1765 by @robhogan). Custom serialisers/transformers must consume/provide VlqMap mappings, not tuples.
  • [Breaking]: Remove deprecated default exports from public entry points (#1759 by @robhogan)
  • [Breaking]: Remove support for deprecated YAML and .es6 config files (#1752 by @robhogan)
  • [Breaking]: Remove long-deprecated resolver.blacklistRE config in favour of blockList (#1758 by @robhogan)
  • [Fix]: Fix HttpStore write retries incorrectly using the read endpoint's config (#1751 by @durvesh1992)
  • [Performance]: Source maps work makes Metro use 50% less memory and serve source maps 2x faster, for faster RNDT loads (#1741, #1742, #1743, #1760, #1763, #1764, #1765 by @robhogan)

Full Changelog: v0.85.0...v0.86.0