Repository navigation
Releases
Releases Β· react/metro
v0.88.1
- [Feature]: metro-cache:
HttpStoreacceptsmaxSockets, to change its connection limit, andgetParams, to add query parameters (such as a short-lived credential) to every request (#2246 by @GijsWeterings) - [Feature]:
Transforming fileend log entries report the worker's CPU time for the transform ascpu_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
vardeclared in a branch that's removed when folding constants in production builds, if code outside the branch uses it, instead of throwing aReferenceError(#2279 by @burrows99) - [Fix]: Don't replace
void 0withundefinedwhen folding constants in production builds, whereundefinedis 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
undefinedat later references (#2280 by @burrows99) - [Fix]:
experimentalImportSupport:export * froma module with an enumerable__esModuleno longer throws in strict mode (#2281 by @burrows99) - [Fix]: Define a
__proto__key in JSON modules as an own property, matchingJSON.parse(#2199 by @Mwrnk) - [Fix]:
FileStorewrites cache entries atomically, so concurrent reads no longer miss valid entries or see partial writes (#2040 by @frankleng) - [Fix]: Respect
excludeSourcein inline source maps, and pass it toserializer.customSerializer(#2256 by @robhogan) - [Fix]: Stop leaking a graph's
DeltaCalculatorand file change listener when its first build fails (#2283 by @sensei-woo) - [Fix]: Resolve a package subpath ending in
/., such aspkg/., instead of throwingUnexpectedly 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 collapseon a path through a symlink out of the project root, into a directory whose name ends in.(#2237 by @robhogan) - [Fix]:
require.contexton 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
composeSourceMapsfor large bundles (#2250 by @yhpark) - [Types]: Remove undeclared type-only imports between Metro packages.
bundle_optionsmoves frommetro-core'sLogEntrytoMetroLogEntry, exported bymetro- annotateLogger.onhandlers 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: falseto 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, andmaxInFlightReadsonHttpGetStore, 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
- [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
v0.87.3
- [Fix]: Resolver: Resolve conditional and nested array fallbacks in
"exports"and"imports"(#2089 by @maximilliangrand) - [Fix]: Apply
serializer.processModuleFilterto 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
FileStorecache files as misses (#2122 by @maximilliangrand) - [Fix]:
Terminal: Don't erase output printed outside ofTerminal(#2130 by @vzaidman) - [Fix]:
Terminal: KeepTerminal.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 returndecodedMap(#1984 by @robhogan) - [Deprecated]:
metro-source-map:toBabelSegments,toSegmentTupleandtuplesFromBabelDecodedMap(#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_applyBrowserSpecAfterExportsto apply"browser"redirections after"exports"(#2134 by @mozzius) - [Experimental]: Add
resolver.unstable_resolveExportsFromPackageRootto read"exports"from the package root (#2160 by @robhogan) - [Experimental]: Fix
transformer.unstable_workerThreadsexposingJEST_WORKER_IDto transformers (#2152 by @robhogan)
Full Changelog: v0.87.2...v0.87.3
v0.87.2
- [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/runtimeand its version to Babel presets whentransformer.enableBabelRuntimeistrue(#1957 by @robhogan) - [Fix]: Resolver: Fix stale resolutions after adding a nearer
package.jsonor 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 anulltarget through a pattern (#1987 by @kwy404) - [Fix]: Resolve Metro's own runtime and
@babel/runtimeeven when they're outsideprojectRootandwatchFolders(#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 outsideprojectRoot, 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
fileMapCacheDirectoryif 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-widthwhen 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')) underinlineRequires(#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- usetrue(#1957 by @robhogan) - [Types]: Add TypeScript definitions for
metro-runtime(#1996 by @robhogan) - [Types]: Declarations use
IteratorObject, which needs TypeScript 5.6+ unlessskipLibCheckis set (df2e7581bcf4)
NOTE: Experimental features are not covered by semver and can change at any time.
- [Experimental]: Add
server.unstable_middlewareandserver.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'sunstable_extraMiddlewareis deprecated - useunstable_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 andFileSystemAPIs (#1944, #1951, #2071 by @robhogan), andcrawlerFactorycrawlers must report symlink targets as1or a pre-resolved path (#1687 by @kitten)
Full Changelog: v0.87.1...v0.87.2
v0.87.1
- [Feature]: Add
resolver.schemeResolversto resolve URI-scheme-prefixed specifiers (egfoo:bar) with custom resolvers (#1804 by @robhogan) - [Feature]: Resolve
metro:babel-runtime/<path>imports to Metro's own@babel/runtimedependency (8388f71 by @robhogan) - [Feature]:
metro-babel-transformer: PassinlinePlatformto Babel presets viacaller(6bbe095 by @robhogan) - [Fix]: Replace
image-sizedependency with vendored parsers, fix CVE alerts (#1860 by @robhogan) - [Fix]: Include
charset=utf-8in theContent-Typeof text assets and source files served by the dev server (#1888 by @robhogan) - [Fix]: Preserve
Platform.OSwrite targets during constant inlining (#1890 by @OskarEichler) - [Fix]: Inline the last duplicate key from static
Platform.selectobject literals (#1889 by @OskarEichler) - [Fix]:
FallbackWatcherno 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=falseandCI=0as not-CI when defaultingwatch. CI is now detected fromprocess.env.CIonly, dropping theci-infodependency (61e4592 by @robhogan) - [Fix]: Fix Fast Refresh hitting undefined modules when using lazy (segmented) bundles in dev (c70d0ae by @robhogan)
- [Performance]:
FallbackWatcher: Dropwalkerdependency, 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(notPromise<void>), egMetroServer#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: AddcrawlerFactoryto optionally replace the built-in Watchman / Node crawlers (68022f0 by @vzaidman) - [Experimental]: Add
serializer.unstable_inlineDependencyMapto inline module IDs at serialisation time (#1786 by @robhogan) - [Experimental]: Add
serializer.unstable_getAsyncDependencyPathto supply custompathsto framework-defined__loadBundleAsync(#1855 by @robhogan) - [Experimental]: Remove
transformer.unstable_renameRequire-requireis never renamed (42577f7 by @robhogan) - [Experimental]:
experimentalImportSupport: Fixexport * fromre-exporting the source module's default export (#1777 by @robhogan)
Full Changelog: v0.87.0...v0.87.1
v0.84.6
v0.84.5
v0.83.8
v0.87.0
- [Breaking]: Widen
Resolutionunion returned by resolvers to allowtype: 'virtualModule', pending implementation. (8336654 by @robhogan) - [Feature]:
allowOptionalDependenciesdefaults totrueto align with RN and Expo (#1775 by @robhogan) - [Fix]: Preserve accumulated and trailing config state when
mergeConfigencounters an async config in a config chain (#1754 by @durvesh1992) - [Performance] Don't rename
requirein 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 asexport * 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 explicitexport defaultand named exports win overexport * from(#1773 by @robhogan) - [Experimental]:
experimentalImportSupport: Evaluateexport fromdependencies 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
- [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/provideVlqMapmappings, not tuples. - [Breaking]: Remove deprecated default exports from public entry points (#1759 by @robhogan)
- [Breaking]: Remove support for deprecated YAML and
.es6config files (#1752 by @robhogan) - [Breaking]: Remove long-deprecated
resolver.blacklistREconfig in favour ofblockList(#1758 by @robhogan) - [Fix]: Fix
HttpStorewrite 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