Update all non-major dependencies #84
No reviewers
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
rust
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
andras/reconcile!84
Loading…
Reference in a new issue
No description provided.
Delete branch "renovate/all"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
1.46.3→1.49.030.3.0→30.5.23.8.1→3.9.100.28.2→0.30.01.94.0→1.99.11.98.0→1.107.11.0.228→1.0.2291.0.228→1.0.2295.4.0→5.6.13.3.1→3.4.12.0.18→2.0.2129.4.6→29.4.159.5.4→9.6.22.8.1→2.9.10.2.114→0.2.1300.3.64→0.3.805.105.4→5.112.2Release Notes
mitsuhiko/insta (insta)
v1.49.0Compare Source
Option<&OsStr>snapshot names, such asPath::file_name(),without explicit string conversion. #929 (@dislogical)
cargo-instabinaries for ARM64 Linux(
aarch64-unknown-linux-gnu). #942 (@aljohri)serialized variant name, including serde renames. #934 (@teddytennant)
compiler warnings when used in expression position. #940 (@Tiwalun)
INSTA_UPDATE=alwaysin snapshot mismatch hints for filesnapshots. #927 (@hiro-nikaitou)
tempfileandrustixdependencies to fix buildswith newer Rust toolchains. #939
cargo insta test --all-targets --test-runner nextestfailing with"Can't mix --doc with other target selecting options". Like
cargo test --all-targets, it no longer runs doctests. #460v1.48.0Compare Source
strip_ansi_escape_codessetting which removes ANSI escape sequences(color codes, cursor movement, etc.) from snapshot content before comparison.
Requires the
filtersfeature. #899 (@pierluigilenoci)metadata fields such as
descriptionandexpression. SetINSTA_YAML_BLOCK_STYLE=1to enable. #851 (@ivov)CI=truenormally makescargo insta testbehave as though--checkwas passed. Explicit snapshot handling options such as
--acceptnow takeprecedence over this environment variable, allowing users to override this
behavior if they want to. #924
cargo insta test --profilebeing forwarded to nextest as the nextestprofile instead of the cargo build profile; it now translates to
--cargo-profilefor the nextest runner. Add--nextest-profileto selectthe nextest profile. #910
cargo insta pending-snapshotsprinting unusable\\?\-prefixed pathson Windows. The
--snapshotfilter now also accepts partial paths: anytrailing path suffix of the snapshot file matches, so a bare
--snapshot my_test.snapworks. #904os error 2when its datafile is missing (e.g. gitignored and not committed). #914
v1.47.2Compare Source
Send + SynconSettings,Redactions, andRedactionbyreverting the
ArctoRcchange from 1.47.0, which was semver-breaking.#873 #874
Send + Syncbounds toComparatortrait for consistency withArc-based storage. #872v1.47.1Compare Source
sort_maps. The change in 1.47.0 sorted allSeqvalues (includingVec), not just non-deterministic collections likeHashSet, which was a breaking change. #876v1.47.0Compare Source
Comparatortrait for customizing how snapshot values are compared. #872 (@dstu)sort_mapsto fix non-deterministicHashSetsnapshots. #876assert_json_snapshot!orassert_yaml_snapshot!as alternatives. #880Send + Syncbounds fromRedaction, allowing non-Sendclosures in dynamic redactions. #874ArcinSettingsunnecessarily. #873 (@dstu)consoleto 0.16 and MSRV to 1.66. #885toml-editto 0.25. #882 (@alexanderkjall)jestjs/jest (jest)
v30.5.2Compare Source
Features
[@jest/transform]Strip TypeScript types with Node when no transformer claims a.ts,.mtsor.ctsfile (#16421)Fixes
[jest-core, jest-haste-map, jest-transform]Keeprequire('../package.json')external when bundling, sojest --versionand the transform and haste-map cache keys report the released version instead of the previous one (#16422)[jest-each]Escape a table row's keys before building the$variableinterpolationRegExp, so a column name such ascount(*)no longer fails the whole table withInvalid regular expression, and a.or|in a column name is matched literally (#16345)[@jest/source-map]Resolve absolute Windows paths in a source map'ssourcesandsourceRootagain, instead of appending them to the transformed file's directory (#16439)v30.5.1Compare Source
Fixes
[jest-config]Don't warn about global-only options in the config that supplies the global config - the root config a project resolves to, or the first entry of--projectswhen no root config is passed (#16411)[jest-config, jest-types]Stop acceptingreporters,coverageReporters,workerIdleMemoryLimit,cwdandrunnerOptionsin a project config - they were silently ignored, and now warn like the other global-only options (#16411)[jest-config, jest-validate]Warn aboutmaxWorkersandcoverageThresholdin a project config instead of dropping them without a word (#16411)[jest-resolve]MatchmoduleNameMapperpatterns against the specifier as written again (reverting #16390) (#16417)[jest-runtime]Resolve packageimportsspecifiers like#depunder ESM again (#16413)Chore & Maintenance
[jest-util]Name thetestEnvironmentOptions.globalsCleanupoption and link the docs from theJEST-01deprecation warning, and document the option's modes (#16404)v30.5.0Compare Source
Features
[@jest/expect-utils, jest-mock]AddmockFn.whenCalledWith(...args)for configuring return values per argument list, with first-class asymmetric-matcher support (#16053)[@jest/expect-utils]ExportAsymmetricMatcherandFunctionParameterstypes (previously private toexpect) (#16053)[jest-circus, jest-core, jest-jasmine2, jest-test-result, jest-types]--collectTestsnow expandstest.each/describe.eachcases and reports per-status counts (skipped/todo via the newwouldRunflag for selected tests) plus a summary line that match a real run, including under--testNamePatternand.only/fdescribefocus on both the circus and jasmine2 runners (#16259)[jest-circus, jest-environment, jest-runtime, jest-types]Add describe-level retries viajest.retryTimes(..., {entireDescribe: true})(#16322)[jest-circus, jest-message-util, jest-reporters, jest-types]AddretryMessagestoAssertionResultand exportformatErrorStack, so the retry log renders nestedcauseandAggregateErrorsections with code frames instead of serialized[cause]:/[errors]:markers (#16316)[jest-circus, jest-types]AddunhandledErrorsDetailedtoCircus.RunResult, so an unhandled rejection reports itscausechain andAggregateErrorentries with code frames instead of a pre-serialized stack (#16316)[jest-haste-map]ReplaceNodeWatcherandFSEventsWatcherwith@parcel/watcherfor the non-watchman watch path (#16188)[jest-resolve]Bumpunrs-resolverto 1.12.1, removejest-pnp-resolverand unnecessary checks (#15721)[jest-resolve]Honor Node's--preserve-symlinks/NODE_PRESERVE_SYMLINKSin the default resolver by passingsymlinks: falsetounrs-resolver(#16260)[jest-runtime]Apply automocking and manual__mocks__files to synchronously evaluable ESM graphs on Node 24.9+ - static imports, dynamicimport()andrequire()of an ESM file now generate an automock from the real module's namespace instead of failing with "Attempting to import a mock without a factory". Graphs that need async evaluation (top-level await) or an async-only resolver or transformer still throw (#16391)[jest-runtime]Routeprocess.getBuiltinModulethrough the sandbox, so it returns the sandboxprocessand the hookednode:moduleinstead of the host's (#16391)[jest-runtime]Throw an actionable error frommodule.register()andmodule.registerHooks()inside a test - the hooks attached to the loader running Jest itself, never saw the sandboxed requires they were meant for, and stayed registered for every later test file in the worker (#16391)[jest-runtime]Surface resolution and import-attribute errors in an ESM graph before executing any of its CJS dependencies on Node 24.9+, matching Node's run-nothing-on-a-broken-graph behavior; the legacy loader on older versions keeps its linking-time execution order (#16391)[jest-runtime]ThrowERR_SOURCE_PHASE_NOT_DEFINEDwith an actionable message forimport sourceandimport.source(), instead of failing at instantiation with V8's bare "Source phase import object is not defined" (#16391)[jest-runtime]Emit the JSON-without-import-attribute deprecation warning once per test file instead of once per worker, so it is no longer silently swallowed for every file after the first (#16391)[jest-runtime]Setimport.meta.maintotruein the test file andfalsein every module it loads, matching Node 24+ (#16367)[jest-runtime]Resolve themodule-syncexport condition, so a package that exposes its ESM entry point forrequire()loads the same file Node would (#16336)[jest-snapshot]Add external snapshot paths to custom reporter failure details (#16374)Fixes
[jest-console, jest-reporters]CustomConsolenow buffers console output soTestResult.consoleis populated for reporters whenverboseis enabled, whileGitHubActionsReporteravoids replaying buffered output in verbose mode (#16155)[expect, jest-message-util, jest-pattern, jest-regex-util, jest-util]Revertnode:protocol imports to restore webpack/browser-bundle compatibility (#16167)[expect]WidentoMatchObjectandobjectContainingparameter type fromRecord<string, unknown>toobjectso class instances are accepted (#16196)[jest-circus]Call a generator test body with the shared test context, sothismatches what a regular test function receives (#16347)[jest-circus]Capture the error listeners of the parent process instead of the in-sandboxprocess, so listeners registered before the test file survive teardown and sandbox listeners no longer leak onto the parent (#16347)[jest-circus]ClearcurrentlyRunningTestafter skipped and todo tests (#16342)[jest-circus]Prevent latedone()callbacks from affecting later test or hook invocations (#16343)[jest-circus, jest-jasmine2]Honor--expandwhen formattingnode:assertfailures, instead of always collapsing the diff (#16347)[jest-circus, jest-jasmine2, jest-message-util]Serialize the inner errors of anAggregateErrorintofailureMessages,retryReasonsandunhandledErrors, so--jsonoutput and reporter annotations include them (#16316)[jest-circus, jest-snapshot]Keep snapshot state and counts correct when a test retries (#16344)[@jest/create-cache-key-function]Include the caller support flags in the generated key, so a transformer that emits ESM or CJS based on them no longer shares one cache entry between the two (#16331)[@jest/create-cache-key-function]Include the stringified project config in the generated key, so editing a transformer's own settings invalidates what it cached (#16331)[@jest/transform]Include the caller support flags in a transform's cache key, so a file transformed both as ESM and as CJS no longer serves one shape's output for the other (#16331)[jest-config]Add missingfindRelatedTests,outputFile, andreplnameentries toValidConfigso they no longer trigger spurious "Unknown option" warnings (#16224)[jest-config]Use--configfor the global config when multiple--projectsare specified (#16273)[jest-core]Serializebigintvalues in--jsonand--outputFileoutput as their literal form (4n), instead of failing the run withTypeError: Do not know how to serialize a BigInt(#16338)[jest-core]Do not report aCustomGCasync resource (used by N-API addons such as napi-rs for per-isolate GC bookkeeping) as an open handle, since it isnapi_unref'd by the addon and can never keep the event loop alive (#16379)[jest-each]Keep a$&,$`,$'or$$inside a%pparam value out of the replacement, so the title shows the value instead of the text around it (#16338)[jest-each]Interpolate abigintinto a%jtitle as its literal form ("4n") at any depth, instead of throwingTypeError: Do not know how to serialize a BigIntwhile collecting the tests (#16338)[jest-environment, jest-runtime]BindsandboxInjectedGlobalsto the right values wheninjectGlobalsisfalse, instead of shifting every one of them by a position (#16377)[jest-environment-node, jest-util]Only warn about a conflictingglobalsCleanupmode when one was explicitly configured, and follow the mode that is actually in effect (#16323)[jest-environment-node, jest-util]Stop resolving lazy globals when setting up an environment, so Node 26's builtin module globals are no longer loaded (and no longer emit their deprecation warnings) for every test file (#16324)[jest-haste-map]Keep watch mode alive when an outside process briefly makes a file unreadable on Windows, instead of tearing the watcher down onEPERM(#16295)[jest-haste-map]Keep indexing when an outside process holds a file open on Windows, instead of failing the whole crawl onEPERM(#16358)[jest-haste-map]Keep a duplicated manual mock resolving when the file it pointed at is deleted in watch mode (#16360)[jest-haste-map]Shut the worker farm down when a duplicate manual mock aborts the build underthrowOnModuleCollision(#16354)[jest-haste-map]Attach the watchman client'serrorlistener before the first command, so a watchman failure falls back to the node crawler instead of crashing on an unhandlederrorevent, and always end the client (#16355)[jest-haste-map]Stop delivering watch events afterWatchmanWatcheris closed, and route its warnings through the configured console (#16355)[jest-haste-map]Restore the nestedduplicatesindex correctly inModuleMap.fromJSON, so a haste collision reported inside a test worker raisesDuplicateHasteCandidatesErrorinstead of aTypeError(#16353)[jest-haste-map]Match watched files on a full extension, somoduleFileExtensions: ['js']no longer acceptsfoo.mjs(#16352)[jest-haste-map]Delimit the fields that make up the haste map cache key, so two different option sets cannot hash to the same cache file (#16352)[jest-message-util]Print the inner errors of anAggregateErrorthrown inside a test (#16316)[jest-message-util]Indent nestedcauseandAggregateErrorsections of a test failure by one level per depth, so the nesting is legible instead of rendering flat (#16316)[jest-message-util]Color stack traces line by line so blank lines stay blank (#16316)[jest-message-util]Detect Jest's own frames without assuming the checkout directory's name, and cover@jest/*packages, so stack traces and code frames point at user code (#16326)[jest-mock]mockResolvedValue/mockRejectedValuenow see all overload return types, so a Promise-returning overload survives even when a later overload returns a non-Promise (e.g.pg.Client['end']) (#16237)[@jest-environment/jsdom-abstract]Make@types/jsdoma peer dependency (#16166)[jest-mock]Remove the leftover own accessor descriptor when restoring aspyOnof an inherited getter or setter, so the instance keeps reflecting the prototype (#16226)[jest-resolve]IncludeextensionsToTreatAsEsmin theshouldLoadAsEsmcache key, so projects with different extension lists don't read each other's answers (#16369)[jest-resolve]MakegetModuleIDAsyncbuild and cachedata:URI module IDs the same way asgetModuleID(#16370)[jest-resolve]Keep thenode:prefix when resolving a core module asynchronously, so a builtin that only exists prefixed (node:sea,node:sqlite,node:test,node:test/reporters) resolves instead of failing as a missing bare package (#16388)[jest-resolve]Look up manual mocks fornode:protocol specifiers under the unprefixed name they are stored as (#16388)[jest-resolve]ApplymoduleNameMapperconsistently to both spellings of core module specifiers (fsvsnode:fs) (#16390)[jest-resolve]Keep virtual and ordinary mock module IDs isolated across test files (#16296)[jest-resolve]Guard missingrequire.resolve.paths(#16052)[jest-resolve, jest-config, jest-runner]Support a user resolver written as an ES module (#16332)[jest-resolve, jest-runtime]Throw the CJS parse error for ESM syntax in a"type": "commonjs"package or a.cjsfile instead of loading it as ESM, matching Node (#16368)[@jest/source-map]Keep source map sources that name a scheme, such aswebpack:///, instead of resolving them into a path that does not exist (#16327)[@jest/source-map]Look up--testLocationInResultspositions at the right column, and keep a mapping to the first column instead of discarding it (#16327)[@jest/source-map]Warn when a source map cannot be parsed, instead of silently leaving its frames untranslated (#16327)[jest-runner, @jest/source-map]Keep a source-mapped stack for an error thrown after the test environment was torn down (#16327)[jest-runtime, @jest/source-map]Keep source maps past teardown and past the next test file'sinstall, so a stack from a file no earlier stack mentioned still points at the original source (#16330)[jest-runtime]Report that no coverage was collected whengetAllV8CoverageInfoCopyis called afterteardown, instead of returning an empty result (#16385)[jest-runtime]Cache a CJS module's parsed exports before walking its re-exports, so two modules that re-export each other no longer overflow the stack when imported from ESM (#16363)[jest-runtime]Keep a re-exported ES module's parse failure from marking the re-exporting CommonJS file as ESM, somodule.exports = require('./dep.mjs')loads instead of failing withmodule is not defined(#16363)[jest-runtime]Scope module mocks instantiated insidejest.isolateModules/isolateModulesAsyncto that block, so a mock first imported there no longer outlives it - matching how CommonJS mocks already behave (#16365)[jest-runtime]Suspend module isolation while generating an automock, so loading the real module to read its shape no longer populates the isolated registry (#16365)[jest-runtime]Check a cached ES module's status beforerequire()returns it, so a module whose evaluation threw rethrows that error and one left linked by a failed sibling is evaluated instead of returning uninitialized bindings (#16364)[jest-runtime]Report the originalERR_REQUIRE_ASYNC_MODULEwhen arequire()of a top-level-await graph is retried, instead of a spurious "concurrentimport()" error (#16364)[jest-runtime]Throw the evaluation error when another caller'simport()of the same module failed while we awaited it, instead of resolving with the errored module (#16364)[jest-runtime]Mark the result ofrequire()ing an ES module that has a default export with__esModule: truethrough a live-binding facade, and serve the same object fromrequire.cache, matching Node (#16367)[jest-runtime]Provide a CommonJS module's exports under the'module.exports'named export when imported from ESM, matching Node 23+ (#16367)[jest-runtime]Give the test file itself a non-nullrequire.main(#16367)[jest-runtime]Populatemodule.childrenwith the modules a file loads, matching Node (#16368)[jest-runtime]Provideimport.meta.resolveandimport.meta.jestindata:URI modules, accept any-case mediatype parameters, and use Node's error codes for invaliddata:URIs (#16368)[jest-runtime]Key ES modules by full URL, so query and fragment suffixes create the same module instances as Node and show up inimport.meta.url(#16375)[jest-runtime]Share modules between overlapping graphs when a CommonJS modulerequire()s an ES module mid-load, instead of evaluating shared dependencies twice (#16375)[jest-runtime]ThrowERR_REQUIRE_CYCLE_MODULElike Node when a CommonJS modulerequire()s an ES module that is still being loaded, instead of evaluating the module a second time (#16366)[jest-runtime]Key builtin modules in the ESM registry by one canonical specifier (#16341)[jest-runtime]import.meta.resolve()for a builtin uses itsnode:specifier (#16341)[jest-runtime]Fall back to native ESM when a.jsfile contains ESM syntax but has no"type":"module"marker (#16152)[jest-runtime]Allowrequire()of ESM-marked files on Node < 24.9 via transform fallback (#16244)[jest-runtime, @jest/transform]Surface actionableERR_REQUIRE_ESMerror for files with untransformed ESM syntax instead of the generic "unexpected token" message (#16244)[jest-runtime]Support older test environments whosemoduleMockerdoes not implementclearMocksOnScope(#16169)[jest-runtime]Applyjest.unstable_mockModulewhen the mocked file itself isrequire()d, not only when it is imported as a dependency (#16389)[jest-runtime]Applyjest.unstable_mockModuleto statically importeddata:URIs on Node 24.9+, matching dynamicimport()(#16389)[jest-runtime]Run an asyncjest.unstable_mockModulefactory once per module instead of twice, and fail the import instead of crashing the worker when the factory rejects (#16389)[jest-runtime]Hide arequire(esm)module that failed to evaluate fromrequire.cache, as Node does, instead of exposing a namespace with uninitialized bindings (#16389)[jest-runtime]Strip the byte-order mark when importing a JSON module, matchingrequire()and Node (#16389)[jest-runtime]ThrowERR_REQUIRE_ASYNC_MODULEwhenrequire(esm)runs under an async-only custom resolver, instead of silently resolving with the default resolver (#16389)[jest-runtime]Parse imported JSON modules with the test realm'sJSON, so their objects passinstanceof Objectinside the test likerequire()d JSON does (#16389)[jest-runtime]Accept everyfile:URL string in the sandboxedmodule.createRequire, including one with alocalhostauthority, as Node does (#16389)[jest-runtime]Point at{virtual: true}whenjest.mockorjest.unstable_mockModuleis given a module that cannot be resolved (#16389)[jest-reporters]Fix coverage report table formatting in CI/GitHub Actions environments whereprocess.stdout.columnsis undefined by falling back to theCOLUMNSenv var or80columns in CI, preserving existing behaviour in other non-TTY environments (#16227)[jest-runtime]Support CJS-in-ESM exports via"module.exports"named exports (#16277)[jest-snapshot]Keep a skipped or failed test's hinted snapshots, instead of reporting them obsolete (#16348)[jest-util]StopglobsToMatcherreusing a cached matcher compiled with different picomatch options, and keep itsdot: truedefault whendotis passed asundefined(#16381)[pretty-format]Move thereact-isaliases into the@jestscope, so they cannot be shadowed by unrelated packages published under the alias names (#16333)Chore & Maintenance
[docs]Document the intentional divergences from Node's module system in the ECMAScript Modules page (#16368)[docs]Note deprecation ofreact-test-rendererin React Native tutorial andpretty-formatREADME (#16294)[docs]Use@testing-library/react-nativein the React Native tutorial instead of the deprecatedreact-test-renderer(#16318)[babel-jest, @jest/transform]Updatebabel-plugin-istanbulto v8 (#16049)[jest-config, @jest/reporters, jest-runtime]Updateglobto v13 (#16397)[jest-haste-map]Refactor massive class into multiple files (#16180)[jest-haste-map]Dropwalkerdependency; replace hand-rolled directory recursion in the JS crawler and watcher startup withfdir(#16187)[jest-haste-map]Reuse cached metadata for files whose haste name is a known duplicate, instead of re-reading and re-parsing them on every startup (#16351)[jest-haste-map]Cache the watchman socket path and replace thewatchman --versionprobe withget-sockname, so warm runs spawn no watchman processes (#16386)[jest-resolve]Store the per-directory package-type lookup in the cache it reads, so it actually memoizes (#16369)[jest-resolve, jest-runtime]Cut repeated work on the resolution hot path: hoist the platform-extension list to construction, memoizeisCoreModuleand the options cache-key serialization, skip mapper preparation when nomoduleNameMapperis configured, run each mapper regex once, and stop re-parsingNODE_OPTIONSon every default-resolver call (#16371)[jest-resolve]Cut warm resolution cost to about a third: reuse oneunrs-resolverfactory per options shape instead of cloning per resolution, compose the factory cache key from per-array cached strings instead of serializing options, and stop constructing anErrorfor misses thatfindNodeModuleswallows; add a__benchmarks__suite for the default resolver (#16373)[jest-runner, @jest/source-map]Replacesource-map-supportwith an implementation in@jest/source-map(#16327)[jest-snapshot]Load babel, semver and synckit lazily, so requiring the package (which every test process does through@jest/expect) no longer loads ~200 modules that only writing inline snapshots needs (#16387)[jest-runtime]Reduce per-require overhead: skip module ID resolution when no mock can apply, answer core modules before probing for a manual mock, share onerequire.cacheproxy across modules, and cache empty files (#16376)[@jest/source-map]DeprecategetCallsitein favour ofSourceMapSupport#getCallsite(#16327)[jest-runtime]Avoid magicalnullvalue in ESM loader (#16160)v30.4.2Compare Source
Fixes
[jest-runtime]Fix named imports from CJS modules whosemodule.exportsis a function with own-property exports (#16150)v30.4.1Compare Source
Features
[jest-config, jest-core, jest-runner, jest-schemas, jest-types]Allow custom runner configuration options via tuple format['runner-path', {options}](#16141)Fixes
[jest-runtime]Align CJS-from-ESM default export with Node:module.exportsis always the ESM default,__esModuleunwrapping is no longer applied (#16143)v30.4.0Compare Source
Features
[babel-jest]Support collecting coverage from.mts,.cts(and other) files (#15994)[jest-circus, jest-cli, jest-config, jest-core, jest-jasmine2, jest-types]Add--collect-testsflag to discover and list tests without executing them (#16006)[jest-config, jest-runner, jest-worker]AddworkerGracefulExitTimeoutconfig option to control how long workers are given to exit before being force-killed (#15984)[jest-config]Add support forjest.config.mtsas a valid configuration file (#16005)[jest-config, jest-core, jest-reporters, jest-runner]verboseandsilentcan now be set per-project; the project-level value overrides the global value for that project's tests (#16133)[@jest/fake-timers]AcceptTemporal.Durationinjest.advanceTimersByTime()andjest.advanceTimersByTimeAsync()(#16128)[@jest/fake-timers]AcceptTemporal.InstantandTemporal.ZonedDateTimeinjest.setSystemTime()anduseFakeTimers({now})(#16128)[@jest/fake-timers]Support fakingTemporal.Now.*(#16131)[jest-mock]AddclearMocksOnScope(scope)onModuleMockerfor clearing every mock function exposed on a scope object (#16088)[jest-resolve]AddcanResolveSync()onResolverso callers can detect when a user-configured resolver only exports anasynchook (#16064)[jest-runtime]Use synchronousevaluate()for ES modules without top-levelawaiton Node versions that support it (v24.9+), and prefer the synchronous transform path when a sync transformer is configured (#16062)[jest-runtime]Supportrequire()of ES modules on Node v24.9+ (#16074)[jest-runtime]Validate TC39 import attributes (with { type: 'json' }) on ESM imports (#16127)[@jest/transform]AddcanTransformSync(filename)onScriptTransformerso callers can pick the sync vs async transform path (#16062)[jest-util]AddisErrorhelper (#16076)[pretty-format]Support React 19 (#16123)Fixes
[expect-utils]FixtoStrictEqualfailing onstructuredCloneresults due to cross-realm constructor mismatch (#15959)[@jest/expect-utils]PreventtoMatchObject/subset matching from throwing when encountering exotic iterables (#15952)[fake-timers]ConvertDateto milliseconds before passing to@sinonjs/fake-timers(#16029)[jest]ExportGlobalConfigandProjectConfigTypeScript types (#16132)[jest-circus]Prevent crash whenasyncErroris undefined for non-Error throws (#16003)[jest-circus, jest-jasmine2]IncludeError.causein JSONfailureMessagesoutput (#15967)[jest-config]Fix preset path resolution on Windows when the preset uses subpathexports(#15961)[jest-config]AllowcollectCoverageandcoverageProviderin project config without a validation warning (#16132)[jest-config]Project config validator now emits "is not supported in an individual project configuration" instead of "probably a typing mistake" for known global-only options (#16132)[jest-environment-node]Fix--localstorage-filewarning on Node 25+ (#16086)[jest-reporters]Apply global coverage threshold to unmatched pattern files in addition to glob/path thresholds (#16137)[jest-reporters, jest-runner, jest-runtime, jest-transform]Fix coverage report not showing correct code coverage when usingprojectsconfig option (#16140)[jest-runtime]Resolveexpectand@jest/expectfrom the internal module registry so test-file imports share the sameJestAssertionErroras the globalexpect(#16130)[jest-runtime]Improve CJS-from-ESM interop:__esModule/Babel default unwrap, broader named-export coverage, and shared CJS singleton across importers (#16050)[jest-runtime]Load.jsfiles with ESM syntax but no"type":"module"marker as native ESM (#16050)[jest-runtime]Extend the.js-with-ESM-syntax fallback torequire()on Node v24.9+ - falls back torequire(esm)when the CJS parser rejects ESM syntax (#16078)[jest-runtime]Fix deadlocks and double-evaluation in concurrent ESM and wasm imports (#16050)[jest-runtime]Fix error whenrequire()is called after the Jest environment has been torn down (#15951)[jest-runtime]Fix missing error whenimport()is called after the Jest environment has been torn down (#16080)[jest-runtime]Fix virtualunstable_mockModuleregistrations not respected in ESM (#16081)[jest-runtime]ApplymoduleNameMapperwhen resolving modules withrequire.resolve()and thepathsoption (#16135)Chore & Maintenance
[@jest/fake-timers]Upgrade@sinonjs/fake-timers(#16139)[jest-runtime]Use synchronouslinkRequests/instantiatefor ESM linking on Node v24.9+ (#16063)prettier/prettier (prettier)
v3.9.10Compare Source
diff
Markdown: Update
micromark-extension-gfm-tableto fix the table parse issue on performance (#20266 by @fisker)See micromark/micromark-extension-gfm-table@
4f43eadfor details.v3.9.9Compare Source
diff
Markdown: Fix text with
$been incorrectly parsed as math syntax (#20140 by @fisker)v3.9.8Compare Source
diff
Markdown: Don't let Liquid objects interrupt paragraphs (#20087 by @seiyab)
v3.9.7Compare Source
diff
Markdown: Prevent indentation drift in list-item code blocks (#19647, #19990 by @Austin1serb, @giaBaoJS)
JavaScript: Fix embedded template literal idempotency (#19725 by @fisker)
Markdown: Preserve Liquid blocks after Markdown tables (#19730 by @wanxiankai, @seiyab)
Markdown: Preserve single tildes in Markdown (#19739 by @lazerg)
Since 3.9.0, single-tilde spans like
H~2~Owere rewritten to double tildes, turning subscript syntax into strike-through. Only double tildes are treated that way now, matching GitHub.Markdown: Fix Markdown blockquote containing
>characters (#19802 by @seiyab)Markdown: Strip blockquote markers from a setext heading's continuation lines (#19878 by @Kjubikstronk)
A setext heading spanning multiple lines inside a blockquote kept the
>marker of its continuation lines as literal text.Markdown: Fix HTML block indentation drift in markdown list items (#19987 by @lazerg)
Angular: Support
@boundaryerror boundaries (#20014 by @Yahiro025)v3.9.6Compare Source
diff
TypeScript: Preserve quotes for methods named
new(#19621 by @kovsu)TypeScript: Support
import defer(#19624, #19675 by @fisker)JavaScript: Added a new official plugin
@prettier/plugin-yuku(#19628, #19629 by @fisker)@prettier/plugin-yukuis powered by Yuku (A high-performance JavaScript/TypeScript compiler toolchain written in Zig).This plugin includes two new parsers:
yuku(JavaScript syntax) andyuku-ts(TypeScript syntax).To use this plugin:
Install the plugin:
Add it to your
.prettierrc:Due to package size limitations, this plugin is not bundled with the main prettier package and must be installed separately.
For more information, check the package homepage.
Big thanks to @arshad-yaseen for his excellent work.
v3.9.5Compare Source
diff
Markdown: Cap ordered list mark at 999,999,999 (#19351 by @tats-u)
CommonMark parsers only support ordered list item numbers up to 999,999,999.
With this change, Prettier now caps the ordered list item number at 999,999,999 to ensure that the output is correctly parsed as an ordered list by CommonMark parsers. Numbers larger than 999,999,999 are not parsed as list item numbers and are left unchanged in the output:
Markdown: Avoid corrupting empty link with title (#19487 by @andersk)
Do not remove
<>from an inline link or image with an empty URL and a title, as this removal would change its interpretation.Less: Remove extra spaces after
[in map lookups (#19503 by @kovsu)CSS: Prevent addition space in
type()with+(#19516 by @bigandy)This fixes the addition space before
+in CSStype()declaration. For exampletype(<number>+)was being converted intotype(<number> +)which is invalid CSS and does not work.Less: Remove spaces between merge markers and colons (#19517 by @kovsu)
Markdown: Preserve wiki links with aliases (#19527 by @kovsu)
TypeScript: Fix comments being dropped on shorthand
typeimport/export specifiers (#19565 by @kirkwaiblinger)Miscellaneous: Preserving comments'
placementproperty (#19567 by @Janther)Prettier@3.9.0 deleted an undocumented property on comments, which was already used by plugins,
comment.placementis now available again after comment attach.Flow: Stop enforcing empty module declaration to break (#19568 by @fisker)
Angular: Support expression for exhaustive typechecking (#19571 by @fisker)
TypeScript: Ignore comments inside mapped type when checking type parameter comments (#19572 by @fisker)
Less: Fix adjacent block comments being corrupted (#19574 by @kovsu)
JavaScript: Handle dangling comments in
SwitchStatement(#19581 by @fisker)TypeScript: Remove space in comment-only object type (#19583 by @fisker)
v3.9.4Compare Source
diff
Angular: Format
@content(name)->@content (name)to align with other block syntax (#19499 by @fisker)v3.9.3Compare Source
diff
Markdown: Fix unexpected removal of characters in liquid syntax (#19489 by @seiyab)
TypeScript: Allow decorators to be used with declare on class fields (#19492 by @evoactivity)
Extensively used within the Ember ecosystem, decorators with
declareon class fields will ignore the babel parser error and allow Prettier to format the code without breaking it.v3.9.2Compare Source
v3.9.1Compare Source
diff
Markdown: Update
micromark-extension-gfm-tableto fix the table parse issue on performance (#20266 by @fisker)See micromark/micromark-extension-gfm-table@
4f43eadfor details.v3.9.0Compare Source
diff
🔗 Release Notes
v3.8.5Compare Source
diff
Flow: Support
readonlyas a variance annotation (#19022 by @marcoww6)Flow now accepts
readonlyas a property variance annotation, equivalent to+(covariant/read-only).v3.8.4Compare Source
diff
Markdown: Fix blank lines between list items and nested sub-lists being removed in Markdown/MDX (#17746 by @byplayer)
Prettier was removing blank lines between list items and their nested sub-lists, converting loose lists into tight lists and changing their semantic meaning.
v3.8.3Compare Source
diff
SCSS: Prevent trailing comma in
if()function (#18471 by @kovsu)v3.8.2Compare Source
diff
Angular: Support Angular v21.2 (#18722, #19034 by @fisker)
Exhaustive typechecking with
@default never;arrow functionandinstanceofexpressions.pyo3/pyo3 (pyo3)
v0.30.1: PyO3 0.30.1Compare Source
PyO3 0.30.1 is a re-release of PyO3 0.30.0 after investments in CI security unfortunately led to a failed crates.io publish. Rather than delete the failed tag, this new tag comes after the CI issues have (hopefully) been corrected.
Thanks to @davidhewitt @Tpt and @viicos for the investigation and fixes.
v0.29.3Compare Source
Packaging
Added
PyModule_GetState_DuringGC,PyModule_GetToken_DuringGC,PyObject_GetTypeData_DuringGC,PyType_GetModuleState_DuringGC,PyType_GetBaseByToken_DuringGC,PyType_GetModule_DuringGC, andPyType_GetModuleByToken_DuringGCfor Python 3.15 and up. #6419Changed
u128/i128conversions on Python 3.15+. #6160setandfrozensetvalues into Rust hash sets. #6225PyBytes::as_bytes()when not usingabi3orabi3t. #6377Removed
PyExc_RecursionErrorInstandPy_UseClassExceptionsFlag(not present in supported Python versions). #6421Fixed
_PyFrameEvalFunction,_PyInterpreterState_GetEvalFrameFuncand_PyInterpreterState_SetEvalFrameFunc, which are not currently treated as CPython private API despite their name. #6195PyUnstable_Eval_RequestCodeExtraIndexFFI binding to link to the private CPython symbol on Python versions before 3.12. #6195PyByteArray_GET_SIZE,PyList_GET_SIZE, andPySet_GET_SIZEto use an atomic load for free-threaded Python. #6230experimental-inspect: deduplicate repeated members of a type union in the generated stubs, and put a space on both sides of the|rather than only before it. #6273experimental-inspect:__next__and__anext__returningOption<T>(orPyResult<Option<T>>) are now introspected as returningT, sinceNonestops the iteration instead of being yielded. #6274clippy::clone_on_copywarnings triggered on nightly Rust by#[pyclass(from_py_object)]on classes which implementCopy. #6309experimental-inspect:__pow__,__rpow__and__get__now introspect their trailing argument as defaulting toNone, matching the CPython slot wrappers which substituteNonewhen it is omitted. #6363experimental-inspect: fix the stubs of a package nested inside another package being written into a directory named after its parent instead of its own name. #6365pyo3-ffi. #6389tuple[]instead oftuple[()]in generated stubs andPyStaticExprdisplay. #6393experimental-inspect: escape stub docstrings to prevent invalid Python syntax. #6394experimental-inspect: fix the generated type annotation forPyBufferonpython <3.12by usingtyping_extensions.Bufferinstead ofcollections.abc.Buffer. #6395Display for PyStaticExpr. #6397raw-dyliblinking is disabled. #6410raw-dyliblinking is disabled. #6410PyVectorcall_Callfailing to link on Python 3.11 and older. #6410pyo3-ffi. #6421#[pyclass]type object during class attribute initialization. #6453v0.29.2Compare Source
Packaging
PYO3_USE_RAW_DYLIB=0opt-out ofraw-dyliblinking for Windows. #6185Fixed
#[pyo3(get)]) whenIntoPyObjectis only implemented on references of the field type. #6276#[classmethod]magic methods receiving the instance instead of its type when invoked through a type slot. #6283pyo3_build_config::add_libpython_rpath_link_argsemitting Unix-style rpath linker arguments on Windows and Cygwin. #6284#[pyclass]instances. #6294#[pyclass]docstrings. #6296#[classattr]values created fromfnitems. #6297v0.29.1Compare Source
Packaging
PYO3_USE_RAW_DYLIB=0opt-out ofraw-dyliblinking for Windows. #6185Fixed
#[pyo3(get)]) whenIntoPyObjectis only implemented on references of the field type. #6276#[classmethod]magic methods receiving the instance instead of its type when invoked through a type slot. #6283pyo3_build_config::add_libpython_rpath_link_argsemitting Unix-style rpath linker arguments on Windows and Cygwin. #6284#[pyclass]instances. #6294#[pyclass]docstrings. #6296#[classattr]values created fromfnitems. #6297v0.29.0Compare Source
Packaging
abi3tandabi3t-py315features. #5807pyo3-macros-backendno longer depends onpyo3-build-config. #5809hashbrownoptional dependency to include version 0.17. #5973pyo3-ffiis nowno_std. #6022Added
PyErr::set_tracebackto set the traceback of an exception object. #5349PyUnicodeDecodeError::new_err_from_utf8to create aPyErrfrom astr::Utf8Error. #5668experimental-inspect: implementINPUT_TYPEandOUTPUT_TYPEon optional third-party crate conversions. #5770experimental-inspect: include doc comments in generated stubs. #5782pyo3_build_config::PythonAbi,pyo3_build_config::PythonAbiKind,pyo3_build_config::PythonAbiBuilder,pyo3_build_config::InterpreterConfig::target_abi, andpyo3_build_config::InterpreterConfigBuilder::target_abi. #5807Borrowed::getas an equivalent toBound::getandPy::get. #5849PyFrame::new,PyTraceBack::new, andPyFrameMethods::line_number. #5857PyUntypedBuffer::objto retrieve the Python object owning the buffer. #5870PyCapsule::new_with_valueandPyCapsule::new_with_value_and_destructor. #5881PyErr::set_contextandPyErr::context. #5887pyo3-introspectionto generate stubs. #5904Python::version_str. #5921TryFrom<&Bound<T>>forPyRef<T>,PyRefMut<T>,PyClassGuard<T>andPyClassGuardMut<T>. #5922From<&Bound<T>>forBound<T>andPy<T>#5922PyDictMethods::set_defaultandPyDictMethods::set_default_refto allow atomically setting default values in a PyDict. #5955PyFrameMethods::outer|code|var|builtins|globals|locals. #5967Fromconversions forPyErrfromstd::time::TryFromFloatSecsError,std::time::SystemTimeError,std::path::StripPrefixError,std::env::JoinPathsError,std::char::ParseCharError, andstd::char::CharTryFromError. #6001pyo3_build_config::InterpreterConfigBuilder. #6034PyCapsule::import_pointer#6066PyClassGuardMapMut. #6073PyListMethods::get_item_unchecked,PyTupleMethods::get_item_unchecked, andPyTupleMethods::get_borrowed_item_uncheckedon abi3. #6075PyClassGuardMapSuper. #6104PyClassGuardandPyClassGuardMuttopyo3::prelude. #6112Debugimpls forPyClassGuardandPyClassGuardMut. #6112PyDateTime,PyDate,PyTime,PyDeltaandPyTzInfoon abi3 with python 3.12+. #6115PyFunctionavailable on abi3. #6117PyUnstable_Object_IsUniquelyReferenced,PyUnstable_Object_IsUniquelyReferencedTemporary,PyUnstable_EnableTryIncref, andPyUnstable_TryIncref. #5828ffi::PyErr_GetHandledExceptionandffi::PyErr_SetHandledException. #5887Py_HASH_SIPHASH13. #5891PyStructSequence_UnnamedFieldconstant on Python 3.9 and up (or 3.11 with abi3 features). #5892PyUnstable_InterpreterFrame_GetCode,PyUnstable_InterpreterFrame_GetLasti,PyUnstable_InterpreterFrame_GetLine, andPyUnstable_ExecutableKinds. #5932PyMarshal_WriteLongToFile,PyMarshal_WriteObjectToFile,PyMarshal_ReadLongFromFile,PyMarshal_ReadShortFromFile,PyMarshal_ReadObjectFromFile, andPyMarshal_ReadLastObjectFromFile. #5934PyObject_GetAIter,PyAIter_Check,PyMapping_HasKeyWithError,PyMapping_HasKeyStringWithError,PyMapping_GetOptionalItem,PyMapping_GetOptionalItemString,PySequence_ITEM,PySequence_Fast_GET_SIZE,PySequence_Fast_GET_ITEM, andPySequence_Fast_ITEMS. #5942compat::PyObject_HasAttrWithError. #5944PyDict_SetDefault,PyDict_SetDefaultRef,PyDict_ContainsString,PyDict_Pop,PyDict_PopString,PyDict_ClearWatcher,PyDict_Watch,PyDict_Unwatch, andPyFrozenDict_New. #5947PyDate_FromDate,PyDateTime_FromDateAndTime,PyDateTime_FromDateAndTimeAndFold,PyTime_FromTime,PyTime_FromTimeAndFold, andPyDelta_FromDSU. #5949PyDict_SetDefaultRefandcompat::PyDict_SetDefaultRef. #5955versions.
cpython/bytearrayobject.h. #5966PyCellObjectand associated functions. #5978PyErr_WarnExplicitObject. #5979PyTracebackObject. #5980PyTuple_FromArrayon 3.15+. #5990and newer. #6014
PyLongimport / export API on Python 3.14+. #6016PyEval_SetProfileAllThreadsandPyEval_SetTraceAllThreads. #6038Py_UNICODE_TODECIMAL. #6041Changed
#[pyfunction]argument extraction error to usePyErr::add_noteinstead of replacingTypeErrorinstances. #5349Py<T>::get_refcntandPyAnyMethods::get_refcntin favor ofpyo3::ffi::Py_REFCNT(obj.as_ptr()). #5797PyEnvironmentError,PyIOError, andPyWindowsErrorto be type aliases ofPyOSError(as is the case in Python since 3.3). #5803pyo3_build_config::InterpreterConfig::from_interpreterto require an additionalstable_abi_versionargument. The old behavior is the same as passingNone. #5807PyList::newto no longer haveExactSizeIteratorbound. #5830experimental-inspect: emit#[classattribute]as plain Python class attributes and not functions annotated with@classattributeand@property. #5839experimental-inspect: useobjectas the input annotation type of magic methods that returnNonImplementedif the input value is not of the correct type. #5841pyo3-build-config/resolve-configfeature. #5862pyo3-ffito use raw-dylib for Windows linking. #5866generate-import-libfeature. #5866PyCapsule::new. #5889PyDate::from_timestampargument is now af64(the Python API expects a float and not an integer) #5896experimental-inspect: ChangePathBuf::extractinput type hint fromstr | os.PathLiketostr | os.PathLike[str]#5897PythonVersionInfo. #5921self. #5930PyAnyMethods::call,PyAnyMethods::call1andPyAnyMethods::call_method1for arguments passed as Rust tuples containing borrowed references to Python objects. #5941#[pyo3(signature = ...)]whenexperimental-inspectfeature is not enabled (they will be ignored). #5999pyo3-ffiwill now rebuild when the Python virtual environment changes in-place. #6008pyo3_build_config::InterpreterConfigfields; getter methods have been added as replacements. #6034_PyCode_GetExtra,_PyCode_SetExtra, and_PyEval_RequestCodeExtraIndexhave been updated toPyUnstable_Code_GetExtra,PyUnstable_Code_SetExtra, andPyUnstable_Eval_RequestCodeExtraIndex. #6038PyCapsule::importto return an error if the pointer is not properly aligned. #6066PyClassGuardMapto be only forPyClassGuard::mapand returnPyClassGuardMapMutfromPyClassGuardMut::map. #6073with_critical_section_mutex2closure to takeOption<EnteredCriticalSection>instead ofEnteredCriticalSectionas the second argument. #6098PyClassGuardMut::as_supernow returnsPyClassGuardMutSuper. #6104experimental-inspect: Generate relative imports instead of absolute ones (useful if the stubs are not describing a root package) #6097Removed
From<str::Utf8Error>,From<string::FromUtf16Error>, andFrom<char::DecodeUtf16Error>forPyErr. #5668Py_TRACE_REFSsupport (unsupported from Python 3.13). #5824experimental-inspect: Remove theTypeInfoenum and theFromPyObject::type_inputandIntoPyObject::type_outputfunctions. They are replaced by thePyStaticExprenum and theFromPyObject::INPUT_TYPEand theIntoPyObject::OUTPUT_TYPEassociated constants. #5893_PyStack_AsDict,_PyObject_CallNoArg,_PyObject_FastCall,_PyObject_FastCallTstate._PyObject_VectorcallTstate,_PyObject_MakeTpCall,_Py_CheckFunctionResult,_PyObject_CallFunction_SizeT,_PyObject_CallMethod_SizeT, and_PySequence_IterSearch. #5942PY_ITERSEARCH_COUNT,PY_ITERSEARCH_INDEX, andPY_ITERSEARCH_CONTAINS. #5942_PySet_NextEntry, and_PyLong_NumBits. #5946_PyFloat_CAST,_PyRun_SimpleFileObject,_PyRun_AnyFileObject,_PyRun_InteractiveLoopObject,_PyUnicode_CheckConsistency,_PyUnicode_COMPACT_DATA,_PyUnicode_NONCOMPACT_DATA,_PyUnicode_Ready, and_Py_HashBytes. #6036_PyEval_EvalFrameDefault. #6038_PyBytes_Resize. #6042_PyErr_BadInternalCall,_Py_GetAllocatedBlocks,_PyObject_GC_Malloc,_PyObject_GC_Calloc, and_PyLong_NumBits. #6053Defaultfor FFI definitionsPyHeapTypeObject,PyObjectArenaAllocator,PyHash_FuncDef, andPyType_Spec. #6093Fixed
add_libpython_rpath_link_argsemitting rpath link args on wasm targets which don't support rpath. #5447From<string::FromUtf8Error>andFrom<ffi::IntoStringError>forPyErrproducingTypeErrordue to broken internals. #5668PyMappingProxy::is_type_ofandPyWeakrefReference::is_type_ofnot accepting subclasses. #5883getattr_optnot treatingAttributeErrorsubclasses as missing attributes on Python < 3.13. #5985#[new]return types that contain named lifetimes. #5998'staticbound onPyCapsuledestructors. #6049PyFrame::builtinscould return a non-dict object. #6052#[pyclass]from a different pyclass'#[new]method. #6062PyClassGuardMapby splitting off the mutable variant. #6073experimental-inspectproc macros (to enable reproducible builds). #6076PyEval_RestoreThreadwhen the interpreter is shutting down on Python 3.13 and older (hang the thread instead of allowingpthread_exitto jump across Rust frames). #6085BoundListIteratorandBoundTupleIterator'snthandnth_backimplementations. #6086BoundListIteratorandBoundTupleIteratornot being exhausted whennthornth_backis called with N larger than the remaining count of items. #6086Syncbound on closure type inPyCFunction::new_closure. #6096PyClassGuardMut::as_superby moving intoPyClassGuardMutSuper. #6104PyTypeObject.tp_versions_usedon Python 3.13 and newer. #5917PyUnicode_Encode,PyUnicode_EncodeASCII,PyUnicode_EncodeCharmap,PyUnicode_EncodeDecimal,PyUnicode_EncodeLatin1,PyUnicode_EncodeRawUnicodeEscape,PyUnicode_EncodeUTF7,PyUnicode_EncodeUTF8,PyUnicode_EncodeUTF16,PyUnicode_EncodeUTF32,PyUnicode_EncodeUnicodeEscape,PyUnicode_TransformDecimalToASCII, andPyUnicode_TranslateCharmap. #6041PyUnicode_ClearFreeListno longer available on 3.9 and up. #6041PyErr_SetInterruptExmissingc_intreturn type. #6043PyBuffer_SizeFromFormaton Python 3.8 (was changed fromc_inttoPy_ssize_ton Python 3.9). #6090PyUnicode_Tailmatchon PyPy (isc_int, unlike CPython). #6090v0.28.3Compare Source
Fixed
#[pyclass(get_all)]on a type namedProbe. #5837_Py_NegativeRefcountwith Python < 3.12. #5847Python::attachortry_attachcould return beforesite.pyhad finished running. #5903PyBytesWriter::write_vectoredwith Python 3.15 prerelease versions. #5907.into_pyobject()implementation for C-like#[pyclass]enums. #5928rust-lang/rust (rust)
v1.99.1Compare Source
===========================
wcslenon UEFI and embedded targetsboolreturn values on x86_64libLLVMon macOSv1.99.0Compare Source
==========================
Language
raw_borrows_via_referenceslint that checks for references that decay immediately into raw borrowsunconditional_paniclint to function calls that panic when the chunks/windows size is zero#[unsafe(naked)]functions to define C-variadic functions (#![feature(c_variadic_naked_functions)]).Sized#[my_macro] mod foo;. This allows outlined modules (mod foo;) anywhere in the body of a custom attribute or derive macro.overflowing_literalslint with repeated negation. For instance, it will now no longer lint on--128_i8, which is already detected by thearithmetic_overflowlint.invalid_runtime_symbol_definitionsandsuspicious_runtime_symbol_definitionslints#[path]attributes on inline modulesunreachable_cfg_select_predicateslint as part ofunusedlint groupasm!on x86UnsafeCellcan be accessed without going throughgetinvalid_reference_castinglint was adjusted accordinglyglobal_asm!docattribute is used on a macro invocationCompiler
-Ctarget-cpuinto a target-modifier for AVR, AMDGCN and NVPTXstatic_position_independent_executableson all gnu targetsPlatform Support
riscv64-unknown-linux-muslto Tier 2 with host toolsRefer to Rust's platform support page
for more information on Rust's tiered platform support.
Libraries
RangeInclusive(a..=branges) is now optimized better in some circumstances. As a side effect of this, the behavior ofRangeInclusivevalues that has already been exhausted (as an iterator) has changed. For example, the return values ofstart()andend()on such ranges may return different values, and using such ranges as slice indexes may have different behavior. These behaviors were not guaranteed to be stable, so these changes are considered to not be breaking changes.transmute_copyto accept?Sizedtypestransmute_copyto use a non-unwinding panicescape_debug_extcore::fmt::NumBufferinalloc(andstd)Stabilized APIs
IntoIteratorforBox<[T; N]>IntoIteratorfor&Box<[T; N]>IntoIteratorfor&mut Box<[T; N]>VecDeque::retain_backcore::ffi::VaListBox::into_non_nullBox::from_non_nullVec::into_partsVec::from_partscore::mem::size_of_val_rawcore::mem::align_of_val_rawcore::alloc::Layout::for_value_rawString::from_utf8_lossy_ownedstring::FromUtf8Error::into_utf8_lossyFusedIterator for StepBy<I>std::fs::set_timesstd::fs::set_times_nofollow<LocalKey<Cell<T>>>::updateCargo
debug. This is a preparation for transitioning thedevprofile away from debugging to give a saner default for faster development iterations. Currently there is no difference betweendevanddebugprofiles. docs #17214default-featuresfield. For example,serde = { workspace = true, default-features = false }now turns off default features even when the workspace definition enables them. On earlier editions,default-features = falseis ignored with a warning. (RFC 3945) #17126See also the full Cargo changelog
Rustdoc
unused_footnote_definitionrustdoc lintCompatibility Notes
std::i32::MAXshould be accessed viai32::MAXinstead.no_mangle_generic_itemsinto hard errorPin::new_uncheckedhas had its safety invariants changed slightlyletpatterns typecheckunsupported()instead offrom_raw_os_error(22)#[repr(simd)]was accidentally allowed on macro invocations on stable RustBox::leak: tell people to avoid unleakingdoc(cfg())into account when filtering doctests'staticsemicolon_in_expressions_from_non_local_macros) even when the macro comes from another crate. Previously, such warnings only appeared for macros from the same crate, to avoid showing warnings that can't be fixed locally; however, this masked problems, as integration tests from the crate providing the macro get compiled as a separate crate, so tests often wouldn't reveal this issue. If you encounter a lint like this, please make sure to report it to the crate providing the macro so they can fix it; don't just silence it in your own crate.semicolon_in_expressions_from_macros: Lint on non-local macros toosemicolon_in_expressions_from_macrosinto a separate lintCIenvironment variable. #17220Internal Changes
These changes do not affect any public interfaces of Rust, but they represent
significant improvements to the performance or internals of rustc and related
tools.
v1.98.1Compare Source
===========================
v1.98.0Compare Source
==========================
Language
&mutwhen unsize-coercing, even in an invariant position. For example, you can now coerce aCell<&'long mut i32>to aCell<&'short mut dyn Send>. Such shortenings were already previously allowed when coercing a&mutto a&, or coercing a&to a&.invalid_runtime_symbol_definitionslint and warn-by-defaultsuspicious_runtime_symbol_definitionslintcoreruntime symbols likememcmp,memset,strlen, ... and is planned to be expanded in the next few releases.c_void_returnslint to checkcore::ffi::c_voidas a return typePlatform Support
powerpc64-unknown-linux-gnuelfv2as Tier 3aarch64-unknown-linux-pauthtestas Tier 3 targetthumbv7a-none-eabito Tier 2thumbv7a-none-eabihfto Tier 2thumbv7r-none-eabito Tier 2thumbv7r-none-eabihfto Tier 2thumbv8r-none-eabihfto Tier 2Refer to Rust's platform support page
for more information on Rust's tiered platform support.
Libraries
Location<'_>lifetime to'staticinPanic[Hook]InfoRangeInclusive::from(legacy::RangeInclusive)ManuallyDrop'sBoxinteraction has been fixedderivemacro is available at{core,std}::derive. This was previously unintentionally stabilized in 1.96, but is now explicitly accepted as a stabilized API.{core,std}::derivewill be 1.96, and not 1.98.Stabilized APIs
str::substr_range[T]::subslice_rangecore::fmt::NumBuffer<{integer}>::format_intoSend/Sync for std::process::CommandArgs{fN}::algebraic_add{fN}::algebraic_sub{fN}::algebraic_mul{fN}::algebraic_div{fN}::algebraic_remNonZero<{integer}>::from_str_radixString::from_utf16leString::from_utf16le_lossyString::from_utf16beString::from_utf16be_lossy[T]::strip_circumfixstr::strip_circumfixAtomic<T>::from_mutAtomic<T>::get_mut_sliceAtomic<T>::from_mut_slicestd::range::legacybool::ok_orbool::ok_or_elseOption::map_or_defaultResult::map_or_defaultBox::as_ptrBox::as_mut_ptrPath::is_emptyPathBuf::into_stringarch::{arm,aarch64}::vdot*: NEON dot product intrinsicsCompatibility Notes
ambiguous_glob_importslint into a hard errorType = TypeandType == Typeare no longer syntactically allowedrepr(transparent)is now more strict about which fields have "trivial" layout and hence can be ignored:repr(C)types, types with private fields, and#[non_exhaustive]types are no longer considered "trivial"transmute()when somereprattributes are involved.derive(PartialOrd)when derivingOrdThis can break crates in practice where a type's PartialOrd and Ord impls were inconsistent with each other.
assert_eqandassert_nePartialEqimplementation, when aderive(PartialEq)implementation for that type also exists.-Zemscripten-wasm-eh=falseflag to switch back to JS exceptions has been removed.File::lockimplementation, it has the wrong semantics (return "unsupported" instead)cfg_select!This may cause more code to be formatted which was previously ignored.
v1.97.1Compare Source
==========================
This backports an LLVM submodule bump to include the LLVM-side fix and a
revert of the rustc change that is one known trigger for the bug. The rustc
side revert should not be strictly necessary but is done out of abundance of caution.
v1.97.0Compare Source
==========================
Language
Result<T, Uninhabited>andControlFlow<Uninhabited, T>to be equivalent toTfor must use lintdead_code_pub_in_binarylint for unused pub items in binary cratesdiv32,lam-bh,lamcas,ld-seq-saandscqtarget featurescfg(target_has_atomic_primitive_alignment)selfin imports in more casesPlatform Support
Refer to Rust's platform support page
for more information on Rust's tiered platform support.
Stabilized APIs
Default for RepeatNCopy for ffi::FromBytesUntilNulErrorSend for std::fs::Fileon UEFI<{integer}>::isolate_highest_one<{integer}>::isolate_lowest_one<{integer}>::highest_one<{integer}>::lowest_one<{integer}>::bit_widthNonZero<{integer}>::isolate_highest_oneNonZero<{integer}>::isolate_lowest_oneNonZero<{integer}>::highest_oneNonZero<{integer}>::lowest_oneNonZero<{integer}>::bit_widthThese previously stable APIs are now stable in const contexts:
char::is_controlCargo
build.warningsconfig. This controls how lint warnings from local packages are treated. Useful for enforcing a warning-free build in CI, replacing-Dwarnings. docsresolver.lockfile-pathconfig. This allows specifying the path to the lockfile to use when resolving dependencies. Useful when working with read-only source directories. docs--target-dirdoesn't look like a Cargo target directory. This prevents accidental deletion of non-target directories.-mshorthand for--manifest-pathcurldependency fromcrates-iocrateRustdoc
--emitflag--remap-path-prefixCompatibility Notes
f32: From<{float}>to constrain{float}pin!, in order to prevent unsoundness. The most likely case where this might impact users is: writingpin!(x)wherexhas type&mut Twill now always correctly produce a value of typePin<&mut &mut T>, instead of sometimes allowing a coercion that produces a value of typePin<&mut T>. This coercion was previously incorrectly allowed since Rust 1.88.0.std::charconstants and functionsf64methods which have been deprecated since 1.0varargs_without_patternlint in depslink_sectionspecifierenums have changed. This is not a breaking change, as it only applies toenums without layout guarantees, but is noted here as we've seen people impacted from having made assumptions about the layout algorithm.#[export_name = "..."]where the name is empty#[link_name = "..."]&#[link(name = "...")]parametersshutdownon a socket to shut down the write side, attempting to write to the socket will now produce aBrokenPipeerror rather thanOther. MapWSAESHUTDOWNtoio::ErrorKind::BrokenPipev1.96.1Compare Source
===========================
v1.96.0Compare Source
==========================
Language
exprmetavariable tocfgManuallyDropas patterns (fixing a regression introduced in 1.94.0)Compiler
riscv64gc-unknown-fuchsiabaseline to RVA22 + vectorLibraries
NonZerointegersStabilized APIs
assert_matches!debug_assert_matches!From<T> for AssertUnwindSafe<T>From<T> for LazyCell<T, F>From<T> for LazyLock<T, F>core::range::RangeToInclusivecore::range::RangeToInclusiveItercore::range::RangeFromcore::range::RangeFromItercore::range::Rangecore::range::RangeIterCargo
target.'cfg(..)'.rustdocflagssupport in configuration.Rustdoc
white-space: pre-wrap;property and stripped any<p>elements from the rendered html, however this caused issues and unintuitive behavior. The new behavior should be more predictable, however some multi-line deprecation notes will now be rendered as as single lines. If this is undesirable, you can use the standard markdown method of forcing a linebreak, which is two spaces followed by a newline ("\n").missing_doc_code_exampleslint on impl itemsCompatibility Notes
#[repr(Int)]enums in some edge cases involving fields of uninhabited zero-sized typesPin<Foo>whereFoodoesn't implementDeref. Some such coercions were previously allowed, but produce a type with no useful public API.--allow-undefinedon wasm targets#![reexport_test_harness_main]attributeuninhabited_staticlint in dependencies and make it deny-by-defaultThis appears to improve the quality of backtraces. This change has no effect on the defaults for the output of rustc/cargo on these targets.
-Csoft-float::{self [as name]}, e.g.,struct S {}; use S::{self as Other};, is now no longer permitted because{self}imports require a module parent.export_name,link_name, andlink_sectionattributes, if multiple of the same attribute is present, the first one now takes precedence.avrtargets, C'sdoubletype is 32-bit by default, so changec_doubletof32onavrtargets to match. This is a breaking change, but necessary to makec_doublematch C's double.BTreeMap::append()was optimized, which may now cause panics for types with incorrectOrdimplsInternal Changes
These changes do not affect any public interfaces of Rust, but they represent
significant improvements to the performance or internals of rustc and related
tools.
aarch64softfloat targets now have to haverustc_abiset to"softfloat"cfg(target_abi)v1.95.0Compare Source
===========================
Language
if letguards on match armsirrefutable_let_patternslint no longer lints on let chainsCompiler
--remap-path-scopefor controlling the scoping of how paths get remapped in the resulting binaryPlatform Support
powerpc64-unknown-linux-muslto Tier 2 with host toolsaarch64-apple-tvosto Tier 2aarch64-apple-tvos-simto Tier 2aarch64-apple-watchosto Tier 2aarch64-apple-watchos-simto Tier 2aarch64-apple-visionosto Tier 2aarch64-apple-visionos-simto Tier 2Refer to Rust's platform support page
for more information on Rust's tiered platform support.
Libraries
thread::scope: document how join interacts with TLS destructorsstr::containson aarch64 targets withneontarget feature enabled by defaultStabilized APIs
MaybeUninit<[T; N]>: From<[MaybeUninit<T>; N]>MaybeUninit<[T; N]>: AsRef<[MaybeUninit<T>; N]>MaybeUninit<[T; N]>: AsRef<[MaybeUninit<T>]>MaybeUninit<[T; N]>: AsMut<[MaybeUninit<T>; N]>MaybeUninit<[T; N]>: AsMut<[MaybeUninit<T>]>[MaybeUninit<T>; N]: From<MaybeUninit<[T; N]>>Cell<[T; N]>: AsRef<[Cell<T>; N]>Cell<[T; N]>: AsRef<[Cell<T>]>Cell<[T]>: AsRef<[Cell<T>]>bool: TryFrom<{integer}>AtomicPtr::updateAtomicPtr::try_updateAtomicBool::updateAtomicBool::try_updateAtomicIn::updateAtomicIn::try_updateAtomicUn::updateAtomicUn::try_updatecfg_select!mod core::rangecore::range::RangeInclusivecore::range::RangeInclusiveItercore::hint::cold_path<*const T>::as_ref_unchecked<*mut T>::as_ref_unchecked<*mut T>::as_mut_uncheckedVec::push_mutVec::insert_mutVecDeque::push_front_mutVecDeque::push_back_mutVecDeque::insert_mutLinkedList::push_front_mutLinkedList::push_back_mutLayout::dangling_ptrLayout::repeatLayout::repeat_packedLayout::extend_packedcore::arch::aarch64::__jcvtThese previously stable APIs are now stable in const contexts:
fmt::from_fnControlFlow::is_breakControlFlow::is_continueRustdoc
Compatibility Notes
$cratewithout renaming, i.e.use $crate::{self};, is now no longer permitted due to stricter error checking forselfimports.In very rare cases, this may cause compilation errors due to bytes from parts of a pointer ending up in the padding bytes of a
constorstatic.ambiguous_glob_imported_traitsis now reported when using an ambiguously glob imported traitEq::assert_receiver_is_total_eqand emit future compatibility warnings on manual impls#[non_exhaustive]enum now reads the discriminant, even if the enum has only one variant. This can cause closures to capture values that they previously wouldn't.mut refandmut ref mutpatterns, part of the unstable Match Ergonomics 2024 RFC, were accidentally allowed on stable within struct pattern field shorthand. These patterns are now correctly feature-gated as unstable in this position.-Z unstable-optionsto use. Previously, they could not be used without the standard library, which has no stable build mechanism. In preparation for thebuild-stdproject adding that support, JSON target specs are being proactively gated to ensure they remain unstable even ifbuild-stdis stabilized. Cargo now includes the-Z json-target-specCLI flag to automatically pass-Z unstable-optionsto the compiler when needed. See #150151, #151534, and rust-lang/cargo#16557.#[feature]attributes on invalid targets are now checkedInternal Changes
These changes do not affect any public interfaces of Rust, but they represent
significant improvements to the performance or internals of rustc and related
tools.
v1.94.1Compare Source
===========================
std::thread::spawnon wasm32-wasip1-threadsstd::os::windows::fs::OpenOptionsExtThe new methods were unstable, but the trait itself is not sealed and so
cannot be extended with non-default methods.
match_same_armsThis resolves CVE-2026-33055 and CVE-2026-33056. Users of crates.io are not affected.
See blog for more details.
sass/dart-sass (sass)
v1.107.1Compare Source
v1.107.0Compare Source
Command-Line Interface
The
--fatal-deprecationflag can now exclude deprecations that wouldotherwise be included by passing a version number. To exclude a deprecation,
add
-before its name. For example,--fatal-deprecation=1.107.0,-importincludes all deprecations that were present in Dart Sass 1.107.0 except for
the
@importdeprecation.The
--fatal-deprecationflag now takes the special valuedart-sass-2,which treats as fatal all deprecations that will become fatal in Dart Sass
2.0.0.
JavaScript API
Options.fatalDeprecationscan now take aDeprecationSelectorDifferenceobject of the form
{include: ..., except: ...}, where theincludefieldlists deprecations to mark fatal (which can be version numbers) and the
exceptfield lists deprecations not to mark fatal. Theexceptfieldtakes precedence over
include.Add a (non-enumerable)
sass.deprecations.dartSass2property which can bepassed to
Options.fatalDeprecationsto mark as fatal exactly thedeprecations that will become fatal in Dart Sass 2.0.0. This can be combined
with other deprecations or used in a
DeprecationSelectorDifferenceto modifyexactly which deprecations it covers.
Passing a version number beyond the current Dart Sass version to
Options.fatalDeprecationsis now deprecated. See the Sasswebsite for details.
Dart API
Add a
Deprecation.dartSass2property which returns exactly the set ofdeprecations that will become fatal in Dart Sass 2.0.0.
Passing a version number beyond the current Dart Sass version to
Deprecation.forVersionis now deprecated.Embedded Protocol
CompileRequest.fatal_deprecation_exceptfield which excludesdeprecations from being considered fatal if they would have been enabled by
CompileRequest.fatal_deprecation.v1.106.1Compare Source
Fix a bug where an attribute selector with an empty value (such as
[class=""]) would crash when serializing.Don't crash when serializing a number with an empty unit. This is only
possible through the JavaScript and Dart APIs or the embedded protocol.
Embedded Dart Sass
PARAMSerrors.v1.106.0Compare Source
Don't normalize CSS escapes in statement contexts that can contain
interpolation. For example,
@f\6Fois now emitted as written rather thannormalized to
@foo.Fix a bug where quotes would be removed from attribute selector values that
contained backslashes.
Fix invalid source spans that could cause crashes when encountering a syntax
error in selectors or media queries that also contain escape sequences.
Fix a bug where the indented syntax parser would crash when parsing a file
where the first statement was indented and appeared after the first line.
Fix a bug that could cause crashes when encountering errors or warnings in
interpolations that contain patterns like
// */.Potentially breaking compatibility fix: CSS escape codes whose values are
0, for Unicode surrogates, or greater than the maximum allowed code point are
now consistently normalized to U+FFFD REPLACEMENT CHARACTER in expression
contexts. Previously, in some cases these were instead normalized to the
normalized form of the original escape sequence, which violates the principle
that all escape sequences for identical values should be normalized the same
way. In other cases, these would simply throw errors.
As a special case,
\0on its own will continue to be normalized to\0tosupport historical CSS hacks.
Potentially breaking bug fix: Throw an error for mixins and functions that
have rest parameters which are the same as normal parameters. Previously, the
positional parameters wouldn't be accessible and calling such a mixin or
function with a named argument would crash the compiler.
Potentially breaking bug fix: Fix various cases where using a CSS escape
code at the beginning of an identifier would change parsing behavior versus
using the character directly.
Potentially breaking bug fix: When a number's unit is ambiguous with a
numeric exponent, the unit is now serialized as an escape code rather than a
literal
eto avoid being interpreted as an exponent by CSS.Potentially breaking bug fix: Don't parse a CSS escape code for U+45 LATIN
CAPITAL LETTER E or U+65 LATIN LOWERCASE LETTER E as an exponent in
@keyframespercentage selectors.Potentially breaking bug fix: Properly normalize underscores written as
CSS escape codes in variable, mixin, and function names.
v1.105.2Compare Source
Node.js Embedded Host
v1.105.1Compare Source
@extends across different media queries.v1.105.0Compare Source
Add support for first-class modules. These can be accessed using the new
meta.load()andmeta.get-module()functions, and may be passed as the$moduleargument to numerous eistingsass:metafunctions.Add the
meta.css()mixin, which includes CSS from a first-class module.JS API
SassModuleclass and a correspondingValue.assertModule()method.Dart API
SassModuleclass and a correspondingValue.assertModule()method.v1.104.1Compare Source
Fix a bug where loud comments before
@userules could be emitted multipletimes under certain circumstances.
Fix a bug in which an invalid selector at the end of an indented syntax
stylesheet would cause the parser to crash instead of emitting a useful error
message.
Command Line Interface
Many-to-many compilations no longer compile any files that appear in the
output directory if the output directory is also within the source directory.
This fixes a bug where
--watchmode could enter an infinite loop recompilingthe same CSS file over and over.
Sass now sets the modification time of output files to the time compilation
started rather than the time it ended. This ensures that, if a source file
is modified during compilation,
--watchand--updatemode will recompilethe outputs to include the new source file contents.
v1.104.0Compare Source
Potentially breaking compatibility fix: Colors now convert the special
values NaN and negative zero, as well as infinity and negative infinity for
polar-hue channels, to 0 as per the CSS spec.
The special value negative zero is now serialized as
-0instead of0forgreater compatibility when using it in CSS calculations.
v1.103.1Compare Source
v1.103.0Compare Source
sets" of missing channels during conversions, per the CSS spec. For example,
color.to-space(lch(50% none none), lab)now returnslab(50% none none)instead of
lab(50% 0 0).v1.102.0Compare Source
draft of CSS Color 4.
v1.101.7Compare Source
v1.101.6Compare Source
v1.101.5Compare Source
v1.101.4Compare Source
Avoid emitting
rgb()orrgba()functions with non-percent decimalchannels. Older browsers only support integer values or (potentially decimal)
percentages for these functions, so in order to preserve
backwards-compatibility while retaining full precision for modern browsers,
legacy colors that contain at least one non-integer channel will now use
percentages for their channels (for example,
rgb(0%, 100%, 50%)rather thanrgb(0, 255, 127.5)).Fix a bug where the values of plain-CSS
if()expressions were emitted usingtheir
meta.inspect()format rather than their CSS serialization format.v1.101.3Compare Source
v1.101.0Compare Source
supports resolving import-only variants of Sass files declared in the
exports,sass, andstylefields ofpackage.json. Previously, thesefiles were ignored even when loaded via
@import, so any code relying onloading module-system-only files this way may break.
v1.100.0Compare Source
Writing two compound selectors adjacent to one another without any whitespace
between them, such as
[class]a, is now deprecated. This was always an errorin CSS and Sass only supported it by mistake.
See the Sass website for
details.
v1.99.0Compare Source
Add support for parent selectors (
&) at the root of the document. These areemitted as-is in the CSS output, where they're interpreted as the scoping
root.
User-defined functions named
calcorclampare no longer forbidden. Ifsuch a function exists without a namespace in the current module, it will be
used instead of the built-in
calc()orclamp()function.User-defined functions whose names begin with
-and end with-expression,-url,-and,-or, or-notare no longer forbidden. These wereoriginally intended to match vendor prefixes, but in practice no vendor
prefixes for these functions ever existed in real browsers.
User-defined functions named
EXPRESSION,URL, andELEMENT, those thatbegin with
-and end with-ELEMENT, as well as the same names with somelowercase letters are now deprecated, These are names conflict with plain CSS
functions that have special syntax.
See the Sass website for details.
In a future release, calls to functions whose names begin with
-and endwith
-expressionand-urlwill no longer have special parsing. For now,these calls are deprecated if their behavior will change in the future.
See the Sass website for details.
Calls to functions whose names begin with
-and end with-progid:...aredeprecated.
See the Sass website for details.
serde-rs/serde (serde)
v1.0.229Compare Source
webpack/minimizer-webpack-plugin (terser-webpack-plugin)
v5.6.1Compare Source
Patch Changes
v5.6.0Compare Source
Minor Changes
support array of minimizers for
minifyandterserOptions(by @alexander-akait in #674)add built-in CSS minimizers from
css-minimizer-webpack-plugin(by @alexander-akait in #674)add built-in HTML minimizers from
html-minimizer-webpack-plugin(by @alexander-akait in #674)add
filtermethod to minimizers, allowing a single plugin instance to handle multiple asset types (by @alexander-akait in #674)terser-webpack-plugin has been renamed to minimizer-webpack-plugin, merging other minimizers from css-minimizer-webpack-plugin and html-minimizer-webpack-plugin. We will continue to publish new releases under the old name, but we recommend switching to the new package - minimizer-webpack-plugin. It is now a single plugin for minification. We also added the ability to specify different minifier types using only one plugin instance, which will improve performance. (by @alexander-akait in #677)
rename
terserOptionstominimizerOptions;terserOptionsis kept as a deprecated alias (by @alexander-akait in #674)All notable changes to this project will be documented in this file. See standard-version for commit guidelines.
v5.5.0Compare Source
Features
frondeus/test-case (test-case)
v3.4.1Compare Source
Fixes
v3.4.0Compare Source
Changes
Instead of having a conflict in example like this:
It now generates prefix name for each test case. In all cases:
Generates
assert_eq!(result, expectation)instead of previousassert_eq!(expectation, result);dtolnay/thiserror (thiserror)
v2.0.21Compare Source
v2.0.20Compare Source
v2.0.19Compare Source
kulshekhar/ts-jest (ts-jest)
v29.4.15Compare Source
Bug Fixes
.cjsconfig files inconfig:migrate(4001b4e), closes #4485v29.4.14Compare Source
Reverts
v29.4.13Compare Source
Features
Performance Improvements
v29.4.12Compare Source
Features
v29.4.11Compare Source
Bug Fixes
v29.4.10Compare Source
Bug Fixes
resolutionModetots.resolveModuleNamefor hybrid module support (b557a85)Programwhen consecutive compiles need different module kinds (a82a2b3), closes #4774moduleResolutioninstead of forcingNode10(1bffffc)mjsfiles fromnode_modulesfor CJS mode (96d025d)v29.4.9Compare Source
Bug Fixes
v29.4.8Compare Source
Bug Fixes
v29.4.7Compare Source
Features
TypeStrong/ts-loader (ts-loader)
v9.6.2Compare Source
Officially ts-loader has supported 3.6.3+ versions of TypeScript. This change means that certain scenarios with older versions of TS will now certainly fail. If anyone is actually using these versions it would be surprising.
v9.6.1Compare Source
v9.6.0Compare Source
v9.5.7Compare Source
Skipping 9.5.5-9.5.6 due to publishing issues
Microsoft/tslib (tslib)
v2.9.1: tslib 2.9.1Compare Source
What's Changed
Full Changelog: https://github.com/microsoft/tslib/compare/v2.8.1...v2.9.1
wasm-bindgen/wasm-bindgen (wasm-bindgen)
v0.2.130Compare Source
Added
A borrowed number,
bool,charor borrowed string crosses by copy, so&f64,&Option<T>,&Nullable<T>,Option<&f64>andOption<&Nullable<T>>are argument types, and anexperimental_generic_monoimport taking&TacceptsT = f64,Option<f64>orNullable<String>, as std'scontains(&T)does.#5436
Added a rejection type parameter to
js_sys::Promise<T, E = JsValue>,mirrored on
JsFuture<T, E>,PromiseState<T, E>andPromiseWithResolvers<T, E>. Awaiting aPromise<T, E>yieldsResult<T, E>, converting the rejection reason as anEthe same uncheckedway the fulfilled value is converted as a
T. Both parameters are covariantunder
Upcast;catch,then_with_rejectand thewithResolversrejectfunction receive an
E;all_tuple/all_settled_tuplecarry a sharedEthrough; and under
js_sys_unstable_apis,Promise::new,Promise::rejectand
Promise::anyare typed on the rejection too,anyasAggregateError. The default keeps existingPromise<T>code unchanged.PromiseWithResolvers<T, E>is invariant in both, since itsresolveandrejectfunctions take them, andJsFuture<T, E>isUnwindSafewheneverTandEare.#5426
Added the
--js-string-builtinsCLI flag, importingstatic_stringconstants as JS String Builtins
string constants from
wasm:js/string-constantsinstead of defining them inthe JS glue. With reference types,
static_stringconstants now occupyfixed
externreftable slots filled in when the module is instantiated, socloning and dropping them is free and never calls into JS.
#5401
Added
Nullable<T>, re-exported asjs_sys::Nullable, for aT | nullvalue at the JS boundary, as
Option<T>is forT | undefined, withOption<Nullable<T>>forT | null | undefined. Both are accepted whereverOption<T>is, for everyTand in every position: JSnullisNullable::Nulland is sent back asnull, whileundefinedinto a plainNullable<T>goes toT's own conversion. A plainOption<T>still readsboth
undefinedandnullasNoneand writesNoneasundefined; theOptionlayer ofOption<Nullable<T>>treats onlyundefinedasNone,since
nullhas to reach theNullablelayer.Option<T>converts fromand into
Nullable<T>, andJsNullable<T>converts from both and intoOption<Nullable<T>>forT: JsGeneric.The API follows
Option's, includingok_or,and_then,filter,as_deref,take,replaceandIntoIterator, and--cfg wasm_bindgen_unstable_try_traitenables?on nightly.NullableIntoWasmAbi/NullableFromWasmAbicarryNullable<T>'snullfor every
T, and are supertraits ofJsStringLikeand the js-sysprimitive-union markers, so
Nullable<impl JsStringLike>andNullable<impl JsNumberOrStringLike>work underexperimental_generic_mono,and
Nullable<T>erases likeOption<T>on a generic import.#5410
#5423
Nullable<T>converts intoJsValuewithFrom,Nullbecomingnullas
NonebecomesundefinedforOption<T>, andOption<T>,Nullable<T>andResult<T, E>arePromisingfor anyT: Promising,so a
Promise<Nullable<JsString>>awaits to aNullable<JsString>.Stringand&strupcast toJsValue, andStringto itself, so aPromise<String>from anexperimental_generic_monoimport isJsGenericand upcasts to
Promise<JsValue>asPromise<bool>does. Together thesemake a
Promise<Nullable<JsString>>orPromise<String>from a monoimport usable wherever a promise is expected.
&strandStringupcast toeach other, so an
Array<&str>inferred from borrowed arguments settles toArray<String>.Option<T>andNullable<T>upcast toJsValuewheneverTdoes, so aPromise<Option<String>>relabels toPromise<JsValue>, andUndefinedandNullupcast toOption<T>andNulltoNullable<T>, so aFunction<fn(A) -> R>stands in for aFunction<fn(A, Option<B>) -> R>.Every Rust and JS carrier wraps into
Option<Target>andNullable<Target>whenever it upcasts to
Target, andNullable<T>upcasts toOption<T>,so an
Array<JsString>relabels toArray<Option<JsString>>orArray<Option<Nullable<JsString>>>, and aFunction<fn(Option<T>) -> R>stands in for a
Function<fn(T) -> R>.#5427
#5437
Added
MaybeIntoWasmAbi/MaybeFromWasmAbi, the ABI ofOption<T>forevery
T, with an associatedMaybeAbithat lets a type without a sparevalue in its own ABI, such as
i32orf64, pick a wider one.Option<T>converts through it, and a blanket impl provides it for every
OptionIntoWasmAbi/OptionFromWasmAbitype, so existing impls and boundsare unaffected.
NullableIntoWasmAbi/NullableFromWasmAbiextend it withnull. As a result,Option<impl JsNumberOrStringLike>and the otherprimitive-union bounds now work in
experimental_generic_monoimportswithout a
where Option<T>: IntoWasmAbiclause.#5423
Under
js_sys_unstable_apis,RegExp::execandJsString::match_returnNullable<T>rather thanOption<T>, as the JS APIs returnnullon nomatch.
#5410
Added the
slice = view | copy | arrayandvec = copy | arrayattributes for imported JS functions, choosing what JS receives for a
sequence argument with numeric elements: a live typed array over wasm
memory, a fresh typed array, or a fresh plain
Array.sliceapplies toborrowed slices (
&[T],Option<&[T]>,Clamped<&[u8]>) andvectoowned ones (
Vec<T>,Box<[T]>,Option<Vec<T>>,Clamped<Vec<u8>>).Each key is accepted per argument, per function and per
extern "C"block,with a more specific level overriding a broader one. Inherited from a
function or block, a key only affects arguments of its own shape; written
on an argument it doesn't fit, it is an error. A generic element type
resolves the mode per instantiation under
experimental_generic_mono,where
Option<&[T]>is now supported too. Neither key is accepted onexported functions.
#5384
Borrowed slices of
String,&str,bool,charand exported enums(
&[T]andOption<&[T]>) can be passed to imported JS functions,arriving as a fresh
Array.#5384
Slices of every
JsStringLikeshape, including&String,&Box<str>,&Cow<str>and&JsString, can be passed to imported JS functions, andJsStringLikealone bounds a&[T]argument of anexperimental_generic_monoimport.#5384
Owned vectors (
Vec<T>,Box<[T]>,Option<Vec<T>>) ofbool,charand string enums can be passed to and from JS, and
Vec<&str>can bepassed to JS.
#5384
String enums implement
TryFromJsValue, accepting only their listed values,so they can be used as dynamic-union variant payloads.
#5376
Added
JsValue::from_utf8_lossyto create a JS string directly from a&[u8], decoding on the JS side with replacement characters for invalidUTF-8 instead of requiring a
String::from_utf8_lossyallocation first.#5370
Documented in the guide that passing an exported Rust type by value moves it
out of the JavaScript object, which throws on any later use.
#5354
Added Rolldown compatibility to the deployment docs in the guide.
#5355
Added
sourceproperty to ToggleEvent.#5353
Added 11 experimental
js-sysmarker traits for every union of two or moreof the TypeScript
bigint,boolean,number, andstringprimitivecategories. Traits such as
JsNumberOrStringLikecan boundexperimental_generic_monoimport parameters while preserving each concreteRust type's native ABI representation. String-containing unions accept every
wasm_bindgen::JsStringLiketype.#5341
Added the experimental
js_sys::PropertyKeymarker trait for thestring | number | symbolkeys accepted by TypeScript'sRecordtype.JsNumberOrStringLikewidens toPropertyKey.#5341
JsStringLikeand thejs-sysstring primitive-union traits now accept&String,&Box<str>and&Cow<str>. These shapes, andOptionof each,also work as plain import argument types.
#5374
Added support for threads on memory64 (
wasm64-unknown-unknownwith+atomics). On memory64,__wbindgen_thread_destroytakes JS numbers.#5378
Added
js-sysbindings for the modern ECMAScript builtins that were stillmissing: the
Iteratorhelpers (Iterator.fromasfrom_iterable,Iterator.concat,map,filter,take,drop,flatMap,reduce,toArray,forEach,some,every,find),Map/WeakMapgetOrInsertandgetOrInsertComputed,Object.groupByandMap.groupBy,Promise.tryandPromise.withResolvers(with aPromiseWithResolvers<T>type), explicitresource management (
DisposableStack,AsyncDisposableStack,SuppressedError,Symbol.dispose,Symbol.asyncDispose),Uint8Arraybase64 and hex conversion (
fromBase64,fromHex,toBase64,toHex,setFromBase64,setFromHex, withBase64Options, itsBase64Alphabetand
Base64LastChunkHandlingenums and aSetFromResulttype),Error.isError,Math.sumPrecise,Math.f16round,RegExp.escapeand thedotAll,hasIndicesandunicodeSetsflaggetters,
String.prototype.isWellFormedandtoWellFormed,Symbol.prototype.description,JSON.rawJSONandJSON.isRawJSON, andthe typed array
toReversed,toSorted,with,findLast,findLastIndex,includesandindexOfmethods. From ECMA-402, theIntl.LocalefirstDayOfWeekandvariantsgetters. From the WebAssemblyJS API,
WebAssembly.JSTag, the compile-options variants ofvalidate,compile,compileStreaming,instantiate,instantiateStreamingandthe
Moduleconstructor (taking aCompileOptionsdictionary, with anInstantiatedSourceresult type),MemorytoResizableBufferandtoFixedLengthBuffer,Global.valueOfand
Exception.stack.#5403
#5421
Changed
Reworked the
js_sys::Temporalbindings andDate::to_temporal_instant,which stay behind
js_sys_unstable_apisand now also need the newtemporalfeature, against the final Stage 4
specification and reshaped them to the web-sys conventions. Inputs are
typed:
*Likedictionaries such asPlainDateLikeforfrom, calendar-free*Fieldsdictionaries forwith, and the bare form of a method takes thetype its argument converts to (
&strtime zones and calendars,&PlainTime,&Duration,&Selfforuntil/since/equals), while every other memberof a specification union gets a
_with_<type>variant, sowith_calendar_with_plain_date,add_with_duration_like,add_with_str,equals_with_zoned_date_time,with_plain_time_with_str,PlainYearMonth::from_with_plain_dateand the typedrelativeTo,calendar,timeZoneandplainTimedictionary setters all exist;comparekeepstaking
&Selfonly. Optional arguments expand to the plain method plus_with_options/_and_options,to_locale_stringtakes no locale, a_with_str/_with_str_sequenceone or anOption<&str>with options, andround,totalandget_time_zone_transitiontake their options dictionary, withround_with_unit,total_with_unitandget_time_zone_transition_with_directionshortcuts. The option dictionariesare
OverflowOptions,DifferenceOptions,RoundToOptions::new(unit),DurationTotalOptions::new(unit),TimeZoneTransitionOptions::new(direction)and friends, the enums drop their
Temporalprefix (Overflow,Unit,LargestUnit,TransitionDirection, …). Bindings for the removedtoPlainYearMonth/toPlainMonthDayonPlainDateTimeandZonedDateTime,ZonedDateTime::with_plain_dateandPlainTime::to_plain_date_timeare gone,offset_nanosecondsreturnsf64,era,era_year,week_of_yearandyear_of_weekreturnOptions,fractionalSecondDigitsis au8,get_time_zone_transitionreturnsNullable<ZonedDateTime>,to_js_string_with_optionsandto_locale_stringare fallible, constructorsexpand their optional trailing fields (
PlainTime::new(),new_with_hour, …,PlainDate::new_with_calendar), andcatchfollows the specification:equals,compare, the typedfromforms (exceptPlainYearMonth's dateconversions, which can leave the range) and the option-less
Instant/PlainTimearithmetic are infallible, whileZonedDateTime::start_of_day,hours_in_dayandPlainDate::to_plain_year_monthare fallible. Fallible bindings returnResult<T, RangeError>, orResult<T, Error>where a property bag, arelativeTo/plainTimeunion orIntloptions can also throw aTypeError.PartialEq/Eqon thedate-time types compare by the spec
equals(), andInstantandPlainTimeare
Ordthroughcompare().#5402
The js-sys
JsFunction*traits' associated types (Ret,ArgN,BindN)no longer carry a
JsGenericbound, so aFunction<fn(..)>signature mayname a converted carrier such as
Nullable<JsString>, andFunction::from_closureaccepts a closure with converted arguments. Genericcode over these traits that calls
call*orbind*now needs the bounditself, as
where F::Ret: JsGeneric, F::Arg1: JsGeneric. The hiddenPromiseTupletrait'sJoinedandSettledlikewise drop it, itsRust-tuple impl packing the promise handles directly rather than upcasting
each, and the
JsGenericbounds that only existed to satisfy aFunction<fn(..)>slotor to tag a type argument are gone:
Promising for Promise<T, E>,Promise::new_typed, thePromiseWithResolversresolve/rejectgetters, the
PropertyDescriptorget/setaccessors,WeakMap::newandthe
entries/from_entriesfamily ofArray,Set,MapandObject.#5427
Option<T>: TryFromJsValuenow readsnullasNone, as theOption<T>ABI does, so
Option::<JsValue>::try_from_js_value(JsValue::NULL)isNonewhere it wasSome(null). ATthat acceptsnullas a distinctvalue space sets the new
TryFromJsValue::NULLABLEconst, asNullable<T>does, and anOptionof it passesnullthrough, soOption<Nullable<T>>reads it asSome(Nullable::Null).Nullable<T>itself converts from a
JsValuewithTryFromJsValue.#5427
With reference types,
static_stringconstants and the reservedundefined,null,trueandfalsevalues are stored at fixed slots ofthe
externreftable, which is now sized to include them, and cloning ordropping them no longer allocates or calls into JS. The per-string JS import
function is no longer emitted.
#5401
Breaking (experimental):
experimental_generic_monoimports no longer addhidden ABI bounds to the generated wrapper. The conversion bounds each
position needs are now declared on the import like any other bound:
T: IntoWasmAbifor an argument,T: RefIntoWasmAbi(a new trait inwasm_bindgen::convert) for a&Targument,T: VectorRefIntoWasmAbifor a&[T]orOption<&[T]>argument,T: FromWasmAbifor a return(
+ 'staticwhenasync),A: FromWasmAbifor a callback argument andR: IntoWasmAbifor a callback return. A missing bound is reported at theposition that needs it.
#5385
The generated
TextDecoderno longer setsfatal: true. Rust&strisalways valid UTF-8, so this only removes a redundant check and lets
JsValue::from_strandJsValue::from_utf8_lossyshare a single decoder.#5370
Replaced the
once_celldependency withcore::cell::LazyCell, which isavailable now that the library MSRV is 1.81.
#5359
Under
js_sys_unstable_apis, the unsuffixedObject::define_property,Object::from_entries,Object::get_own_property_descriptor,Object::has_own,Object::property_is_enumerable,Reflect::define_property,Reflect::delete_property,Reflect::get,Reflect::get_own_property_descriptor,Reflect::has, andReflect::setnow take a generic
K: PropertyKeykey, accepting string, number, or symbolkeys.
Object::get_own_property_descriptorandReflect::get_own_property_descriptornow returnOption<PropertyDescriptor<T>>, andReflect::hasnow takes an&Object<T>target. Callers passing&"key".into()should pass"key"(oranother concrete key type) instead.
#5341
wasm-bindgen-testno longer depends onasync-trait. Its benchmark codenow uses native
async fnin traits.#5365
Escape string inputs in
debugString.#5366
#[wasm_bindgen]now warns when a function sets more than one ofthis,getter,setter,indexing_getter,indexing_setterandindexing_deleter. Only one of them takes effect, and the others used to beignored silently. Conflicting options will be an error in the next major
version.
#4272
#5369
&[T],Vec<T>,Box<[T]>,Option<Vec<T>>andOption<Box<[T]>>arguments with a number element type are now declared in TypeScript and
JSDoc as the typed array or a plain array (e.g.
Uint8Array | number[], orBigInt64Array | bigint[]for 64-bit elements), matching what the generatedJS already accepts. Read-write struct fields of these types are declared as
a getter and setter pair.
&mut [T]arguments still take only a typedarray, since the results are copied back into its buffer, and so do
Clampedarguments, since numbers in a plain array would wrap aroundinstead of being clamped.
#4504
Numeric enums are passed between JS and Rust as an
f64, so a value fromJS that isn't one of the enum's values, such as
'abc',NaN,1.5or2 ** 32, throws "invalid enum value passed" in release builds too,rather than becoming variant 0 or being truncated. Conversions from
JsValuelikewise rejectNaNand fractions. Values abovei32::MAXin a#[repr(u32)]enum are now returned to JS unchangedrather than as negative numbers.
#5384
A
Vec<T>of a numeric enum passed from JS checks each element as asingle enum value, so a wrong element throws the same error a single
argument would, rather than "array contains a value of the wrong type".
#5384
Fixed
Upcast::upcastandupcast_intono longer let a safeUpcastFromimplextend a borrow's lifetime:
ErasableGeneric::Reprnow keeps the reallifetime of a reference, slice,
&str, closure reference orScopedClosureinstead of'static, so theRepr-equality bound rejectssuch an upcast. A generic import likewise no longer accepts an owned
ScopedClosurethat borrows a non-'staticvalue, which handed JS aclosure over freed data; borrowed arguments, and owned ones that only
contain a borrow, still accept any lifetime.
#5178
Concurrent calls to the
webandno-modulesinit function no longerinstantiate the module more than once; later calls share the in-flight
initialization and resolve to the same instance.
#5429
js_sys::Promise::catch_map's handler now receives the rejection reason,typed as the promise's
E, instead of the reason mislabelled as thefulfilled type
T. A handler on aPromise<Foo>written as|v: Foo|musttake
JsValue; it was never aFoo.#5426
Large JS snippets (
module = "...",inline_js) andtypescript_custom_sectionexpressions such asinclude_str!no longer makecompilation slow or print "constant evaluation is taking a long time"
warnings. The macro now lays out the
__wasm_bindgen_unstablecustom sectionas a
#[repr(C)]struct of byte arrays, so const evaluation copies eachchunk at once instead of byte by byte. A crate with a 5 MB snippet went from
64 s to under a second for
cargo check; the section's bytes are unchanged.#5413
Emscripten output now keeps a
privateclass that is only created fromRust, such as one converted into a
JsValueand passed to JS. Everygenerated function that references a class by name now lists it in its
__deps. Previously emcc dropped the class, and calling into it failed withReferenceError: <Class> is not defined.#5415
Imported methods, static methods and constructors without a
js_classnowbind to the
js_nameandjs_namespaceof the type they belong to when thattype is declared in the same
extern "C"block. Previously they used thetype's Rust name, so for example a constructor of
#[wasm_bindgen(js_name = CustomName)] type Type;callednew Type().#5391
Lists passed from JS to Rust no longer leak memory when an element is
rejected, such as a value of the wrong type in a
Vec<String>orVec<T>of exported structs, or an invalid value in aVec<T>of anumeric enum.
#5384
An exported function or closure that rejects an argument from JS, such as
an invalid numeric enum value or an exported struct that is still borrowed,
no longer leaks its other arguments or leaves an exported object it borrowed,
including
self, permanently borrowed. Field setters,free()on aborrowed object, closures called after being dropped and
FnOnceclosurescalled twice also release what JS passed them. The same holds when the
generated JS rejects an argument before calling Rust, such as an object of
the wrong class or a number passed for a
u64, after copying an earlierstring or array into Wasm memory.
#5388
An exported function taking an
Option<JsValue>, or without referencetypes an owned
JsValue, no longer leaks an externref table or JS heapslot when Wasm rejects a later numeric argument, such as a number passed
for a
u64.#5404
The test runner works again with
WASM_BINDGEN_NO_DEBUG=1, so a test suitecan run against the glue a release build gets. The tests are reached through
the
__wasmexport, which only debug glue has had since #4879; the newBindgen::export_wasmoption exports it on its own.#5404
An
asyncexport now converts its arguments when it is called, rather thanwhen its future is first polled. A rejected argument rejects the returned
promise, instead of throwing from the task queue, and an
asyncmethod'sselfstays borrowed from the call on, so freeing the object before thefuture runs throws instead of leaving the method with a freed
self.#5388
Reference types are now detected from the runtime's externref intrinsics when
the
target_featuressection is missing, as withstrip = true. Previouslysuch builds skipped the externref transform, and
#[wasm_bindgen(catch)]imports failed with
externref table required for catch wrappers. A warningnow recommends running
wasm-opton the wasm-bindgen output instead ofstrip = true.#5382
String enums, numeric enums and dynamic unions with the same name in
different modules of one crate are now handled like same-named items in
different crates: two public definitions report that the name is exported
multiple times, and
privatecopies are numbered (Mode,Mode2, ...).Previously
wasm-bindgenfailed withdynamic union variant descriptor not foundorduplicate enums.#5381
privatestring enums and dynamic unions with the same name in differentcrates can now coexist, numbered like structs and numeric enums.
#5381
The TypeScript alias for a string enum that is only referenced through a
dynamic union is now emitted.
#5376
Attributes on imported statics, such as doc comments,
#[allow(...)],#[deprecated]and#[cfg(...)], are now applied to the generated staticinstead of being dropped.
#5377
Imported functions and statics from two different
inline_jssnippets nolonger share one binding when they have the same name and signature. The
snippet contents are now part of the generated shim name, so each import
reads its own snippet's export.
#3878
Imported types with the same Rust name no longer share one
instanceofcheck when their module,
inline_jssnippet,js_nameorjs_namespacediffer. Imported
static_stringstatics with the same name no longer shareone string.
#5352
Imported functions with the same name and signature no longer share one
binding when they differ in how JS is called:
catch,variadic,final,slice_to_array,suspending,experimental_generic_mono, the method kind(
constructor,static_method_of,getter,setter,indexing_*), or ajs_namewith characters that a shim name drops. Twoexperimental_generic_monoimports that differ only in one of these nowboth bind instead of failing the build.
#5352
debugStringhandlesbigintvalues (e.g.123n).#5356
Fixed JSPI task pointers being truncated to 32 bits on
wasm64.#5358
Return pointers above 2 GiB on
wasm32(e.g. thread stacks allocated under+atomics) are no longer treated as negative offsets in the generated JS,which previously threw a
RangeErroron number and string conversions.#5360
With
--debug, passing a value that is not an object with a numericlength, such as anArrayBufferor a string, where Rust takes&[T],Vec<T>,Box<[T]>orOption<Vec<T>>now throws an error naming theexpected and received types, instead of silently passing an empty or zeroed
slice.
&mut [T]arguments must be a typed array with the same element sizeand the same integer or float kind, since the results are copied back into
its buffer.
#1961
Exported function arguments named like an identifier their generated JS
glue binds or references, such as
wasm,retor a class name, no longershadow it, which made calling the function throw. Such arguments get a
numeric suffix in the JS, while the TypeScript definitions keep their name.
#3729
Getters generated by
getter_with_cloneno longer trigger theclippy::clone_on_copylint.#5363
v0.2.129Compare Source
Added
Added the WebGL extension interface
EXT_polygon_offset_clamp.#5336
Added the
texture-compression-unalignedvariant toGpuFeatureName,matching the WebGPU specification.
#5335
Added an Emscripten Target page to the guide covering the
wasm32-unknown-emscriptenbuild flow, including the experimental#[wasm_bindgen(experimental_tokio)]attribute for driving an exportedasync function on a Tokio event-loop runtime there, gated behind
--cfg wasm_bindgen_unstable_tokio.#5334
Added experimental JSPI support on the
wasm32-unknown-emscriptentarget,gated behind
--cfg wasm_bindgen_unstable_jspi:#[wasm_bindgen(jspi)],#[wasm_bindgen(suspending)],jspi_block_on_promiseand the JSPI contextinheritance of
spawn_localwork when linking with-sJSPIand-sJSPI_HOOKS(or-sREENTRANT_JSPI). The fibers belong to Emscripten'sJSPI runtime, which wasm-bindgen integrates with through its lifecycle hook
exports instead of its own shadow stack management.
jspicombines withexperimental_tokiointo a parked runtime: the export is a promisingactivation running its future with
block_onon a Tokio runtime whosewaits are JSPI suspensions, so invocations interleave at every wait.
#5333
Changed
#5257
Fixed
js-sys: theNumberconstants no longer trigger deprecation warnings forthe
core::f64module constants when building the crate from source.#5351
The
wasm_bindgen,wasm_bindgen_futuresandjs_syscrate-path optionson a
#[wasm_bindgen] implblock now apply to its methods; previously theywere ignored there.
#5333
Struct field getters no longer trigger the
unsafe_op_in_unsafe_fnlint(warn by default in edition 2024) when the field name comes from a
macro_rules!body, for example throughpaste!.#4465
The headless test runner now keeps the path of a remote WebDriver URL set
with variables like
CHROMEDRIVER_REMOTE. A driver athttp://host/wd/hub/now getshttp://host/wd/hub/sessioninstead ofhttp://host/session.#2841
The bundler entry module no longer re-exports
#[wasm_bindgen(private)]items from
*_bg.js, which does not export them.#5343
web-sys: WebGL extension interfaces declared withLegacyNoInterfaceObject(
OVR_multiview2,WEBGL_multi_draw,EXT_polygon_offset_clamp) nowgenerate
is_type_of = |_| falselike theirNoInterfaceObjectcounterparts.#5336
The blanket
From<E: Error> for JsErrorimpl is now available without thestdfeature, usingcore::error::Error, so?works inno_stdcrates.#5029
Emscripten output no longer emits the instance reinit machinery, which
Emscripten's JS compiler rejected (unescaped multi-line
__postset, andvar reinit_scheduled = let ...):schedule_reinit()is a no-op there sinceEmscripten owns instantiation. The closure finalization
__postsetis nowemitted as an escaped string literal.
#5332
Updated
walrusto 0.27.2, fixing--keep-debugoutput thatwasm-opt -gcould not process:
.debug_locentries for removed code were unparseable(
debug_loc error), andDW_AT_high_pcwas re-encoded as variable-widthudata(compile unit size was incorrect).#5328
The headless test runner no longer hangs on a WebDriver that never answers, or on
a browser holding the driver's stdio pipes open.
#5338
The CLI's schema version mismatch error now names the input Wasm file and
the path of the running
wasm-bindgenbinary.#4430
#[wasm_bindgen(inspectable)]on a tuple struct no longer generates invalidJavaScript. The generated
toJSONnow reads the0,1, ... fields asthis["0"]instead ofthis.0.#2573
v0.2.128Compare Source
Added
Added
OffscreenCanvasoverloads for the WebGLtexImage2D,texSubImage2D,texImage3DandtexSubImage3Dfunctions, matching theTexImageSourcetypedef in the WebGL specification.
#5312
Added
--split-debug-infoto the CLI. This option extracts the DWARF debuginfo to a separate
*_bg.debug.wasmfile. Use--debug-info-urlto setthe recorded URL for the debug info. #5279
Added
#[wasm_bindgen(experimental_generic_mono)]for imported functions,which binds a generic import once per monomorphisation instead of erasing
its type parameters to
JsValue. It can be applied to an individual importor to a whole
extern "C"block, which every generic function in the blockthen inherits. Each instantiation gets its own descriptor, so arguments and
return values are marshalled at their concrete types (a
u32crosses as anumber, a
Stringas a string) rather than being boxed. Trait bounds,wherepredicates (including higher-ranked ones), associated-typeprojections, lifetime parameters, argument-position
impl Trait, rawcallbacks with owned generic inputs and returns,
async,catch, andslice_to_arrayare all supported; seethe guide
for the supported surface and the shapes that are rejected. The attribute
is experimental and may change as it stabilizes.
#5230
#5272
#5314
Added the experimental, sealed
JsStringLikemarker trait — implemented forString/&str(andjs_sys::JsString/&js_sys::JsStringinjs-sys) —as a bound for
experimental_generic_monoimports that accept any stringshape at its native wire format.
#[wasm_bindgen(experimental_generic_mono)]now supports class-level genericparameters: an imported type that is itself generic (
type Holder<T>),used as a method receiver (
this: &Holder<T>), or as the return type of aconstructor or self-returning static method (
fn new<T>(value: T) -> Holder<T>). See Class-level genericsin the guide.
#5290
A generic imported type used as a method receiver or a constructor's return
type may now carry concrete generic arguments (
this: &Holder<u32>,this: &Holder<u32, T>). The arguments are re-emitted as written, so thegenerated method hangs off
impl Holder<u32>rather than the class's ownparameter defaults.
#5290
Added experimental JSPI (JS Promise Integration) support: using it emits a
compiler warning noting the experimental status.
Supports
#[wasm_bindgen(jspi)]on exports (sync orasync), within whicha
#[wasm_bindgen(suspending)]import call can suspend to the JS eventloop until its
Promisesettles.js_sys::futures::jspi_block_on_promisealso suspends on any
Promiseinside a synchronous function, whilespawn_localis context-aware: tasks spawned from within a JSPI contextsupport synchronous JSPI suspensions throughout their call trees.
Compatible with
catch(rejections asErr),async, andpanic=unwind.#5193
Added a
--ts-typed-array-buffersCLI flag to declare owned typed-arrayreturn values (e.g.
Vec<u8>) asUint8Array<ArrayBuffer>in generatedTypeScript, since they are always copied into a fresh, non-shared
ArrayBuffer. Requires TypeScript 5.7+.#5263
Changed
Export shim symbols are now mangled with a per-crate hash, so identically
named exports from different crates (or two versions of one crate) no
longer fail the link with duplicate-symbol errors; the CLI restores the
canonical names in the final module. Same-named
#[wasm_bindgen(private)]structs/enums now coexist (numbered
Name,Name2, ... internally in thegenerated bindings), while genuinely conflicting public exports are
reported as a wasm-bindgen error instead of a wasm-ld failure. Requires
matching
wasm-bindgenand CLI versions (schema bump).#2247
Setting
js_namespaceon both anextern "C"block and an item inside itis now a hard error. Nested paths must be written in a single attribute,
e.g.
js_namespace = ["a", "b"]. The previous behavior silently droppedthe block-level namespace.
#4324
Changed WebGPU
setImmediatesAPIs to take immutable u8 slice.#5289
Changed Web Bluetooth
writeValue/writeValueWithResponse/writeValueWithoutResponseand WebUSBcontrolTransferOut/transferOut/
isochronousTransferOutAPIs to take immutable u8 slices.#5309
Emscripten glue no longer reads
wasmExports['name']inline inside innerfunctions. It now references the asmjs-mangled identifiers emcc's own
top-level
assignWasmExportsreceiving code binds for every wasm export(e.g.
___wbindgen_malloc,___wbindgen_externrefs), which are thecanonical DCE-graph pairs: wasm-metadce keeps exactly the exports the
included glue uses (previously internal exports and the externref table
could be stripped or left unrenamed by the import/export minifier at
-O2,breaking at runtime). Hoisted classes are now emitted as
=-prefixedstring value snippets so jsifier declares them as
export var Class = class Class {...}instead of anexport classdeclaration, which crashes emcc's acorn-optimizer under
-sMODULARIZE=instance.Fixed
C-style
#[wasm_bindgen]enums inVec<T>/Box<[T]>now generateTypeScript and JSDoc as
EnumName[]instead ofany[].#5321
Fixed
js-sysfailing to compile withno_stdand thefutures-core-03-streamfeature enabled, since the feature unconditionallypulled in
futures-util/std. Thestdfeature offutures-utilis now onlyenabled by the
js-sysstdfeature.#5322
The thread-bootstrap transform is now skipped in Emscripten mode, where the
Emscripten runtime owns pthread startup and TLS. It previously ran on any
module with shared memory and aborted the build (
failed to find __wasm_init_tls), since Emscripten's linker had already consumed thesynthetic symbols it looks for.
#5315
Fixed conflicting deprecation messages on
web-sysdictionary fields thatare themselves deprecated: the deprecated builder-style method no longer
points at an equally-deprecated setter, and the WebAuthn fields removed from
the specification (such as
PublicKeyCredentialRpEntity'sicon) now statewhy they are deprecated.
#5302
#[wasm_bindgen]on a struct now reports an actionable error when the pathto the
wasm_bindgencrate cannot be resolved (e.g. whenwasm-bindgenisonly a transitive dependency through
web-sys), instead of a confusingrecursion limit error.
#5295
Fixed
js_namespaceexports missing from the bundler target's entry modulere-export list, making namespaces unreachable when importing the package.
#5267
The CLI now reports an actionable error when the
__wasm_bindgen_unstablecustom section is missing from a module that still contains wasm-bindgen
shims (e.g. stripped by
llvm-objcopy --strip-all, which removes all customsections since LLVM 23), instead of the confusing
import of `X` doesn't have an adapter listed.#5268
The generated
&Thandle conversions (IntoWasmAbi/OptionIntoWasmAbi) foran imported type with lifetime parameters (
type Holder<'a, T>) no longerreuse
'afor the reference itself. Previously the impl header declared onlya fresh
'aplus the type's type parameters, so a type whose lifetime wasnot literally named
'afailed withE0261against generated code, and onethat was named
'ahad its lifetime forced to unify with the borrow of&self— surfacing asE0521whenever a generic method also had to resolvethrough the same impl.
#5290
An inline lifetime bound on a generic import (
fn f<'a: 'b, 'b, T>(..)) is nolonger dropped from the generated wrapper. Previously the bound was lost while
the generated shim still declared it, so calling the import failed with
"lifetime may not live long enough" reported against generated code.
#5290
A type-parameter default on a
#[wasm_bindgen(experimental_generic_mono)]import is nolonger silently ignored. It has no meaning there (every instantiation gets its
own shim, so there is no single one to default) and rustc's own
invalid_type_param_defaultlint cannot see it, since nothing of the originalsignature survives expansion; it is now rejected with the same
defaults for generic parameters are not allowed herediagnostic rustc gives.Defaults on the type-erasure generic path are unaffected, where they remain
meaningful.
#5290
Fix
js-syswasm64 build withatomicsfeature.#5274
Declare
initSyncin the generated TypeScript definitions for--target no-modules, matching thewasm_bindgen.initSyncfunction thatthe JS output already exposes.
#5284
Removed the last panicking code paths from
externreftable management:RefCell::borrow_mut()embedded panic location data (including the sourcepath string) in
.rodataof optimized builds, which not evenwasm-optcould remove.
#5292
Fix
--no-modules-globalbeing ignored: the custom global name is now usedfor the generated JS binding and TypeScript declarations, and the name is
validated as a JS identifier.
#5286
v0.2.127Compare Source
Added
Navigation API
to
web-sys#5247Added
riscv64gc-unknown-linux-gnurelease artifacts.#5265
Added
JsNullable<T>, modeling WebIDL nullable types (T | null). Bothnullandundefinedare treated as absent, per WebIDL's ECMAScriptconversion rules; the canonical empty value produced from Rust is
null.web-sysnow usesJsNullable<T>instead ofJsOption<T>for nullabletypes nested inside generics (e.g.
Promise<GpuError?>fromGPUDevice.popErrorScope()), fixing spec-definednullresolutions beingtreated as present values under
JsOption<T>'s strict undefined-onlysemantics.
JsNullable<T>participates in the same upcast lattice asJsOption<T>(including contravariant closure argument casts), andadditionally upcasts from
Nulland fromJsOption<T>itself. Importedextern types now also upcast into
JsOption<JsValue>andJsNullable<JsValue>, so catch-all nullable closures can be used where atyped callback is expected.
#5234
Changed
Emscripten output now marks public exports (free functions, classes, enums,
and namespace roots) with the
__export: trueand__force: truesymbolattributes on their
addToLibraryentries, instead of mutatingEXPORTED_FUNCTIONSand pushing toextraLibraryFuncsat library-load time.The
$initBindgeninit closure is kept via__force: true, and privatesymbols (including namespace leaves) carry neither attribute — they remain
reachable through
__deps. Requires an emscripten with__export/__forcesymbol-attribute support.
Updated WebGPU bindings to the August 2026 spec, including the new
GPUCommandEncoder::copy_buffer_to_bufferoverloads andsetImmediates.#5246
Unstable API overload names now elide name tokens shared by every overload
variant:
LockManager::request_with_callbackis nowrequest, andrequest_with_options_and_callbackis nowrequest_with_options.#5246
Fixed
The
nameproperty of the JS error thrown forpanic=unwindis now set froma string literal instead of
PanicError.name, so it survives minification.#5260
Fixed Emscripten builds using pthreads failing to link.
#5254
__wbg_loadin web targets now throws a clear error including the HTTPstatus and URL when given a non-ok fetch
Response, instead of surfacing amisleading MIME-type or Wasm-magic-number error.
#5256
Restored
__stack_pointerwhen an exception unwinds out of a wasm export,preventing repeated
panic = "unwind"calls from leaking shadow-stack framesuntil the shadow stack is exhausted and calls trap. Node reports
memory access out of bounds; poisoned instances can instead reportModule terminated.#5244
slice_to_arrayon a&mutslice (which silently discarded JS's writes) oron a slice with a generic element type is now a compile error, and strings
and arrays received by JS (e.g. a
Vec<String>return value) no longer makea redundant copy of the freshly built value.
#5261
Fixed
asyncimports with non-JS-handle resolved types (e.g.async fn f() -> u32;) silently producing garbage since 0.2.109: thedescriptor named the resolved type instead of the
Promisehandle thatactually crosses the ABI.
#5249
Fixed
catchimports returningi64/u64throwing aTypeError(andpanicking in
__wbindgen_exn_store) when the JS import throws, since thehandleErrorcatch path returnedundefinedwhich cannot be converted toa Wasm
i64.#5238
js_namespaceis now part of an imported function's and imported static'sgenerated shim name. Two imports with identical Rust signatures that differed
only in their
js_namespacehashed to the same__wbg_<name>_<hash>symbol, so they were treated as one binding and one of the two call sites
silently invoked the wrong JS value.
#5250
Macro hygiene fixes -
slice_to_arraynow works in#![no_std]crates.Generated code no longer names
coreorstdunqualified.#5251
Fixed length prefixes in descriptor strings to count
chars rather thanUTF-8 bytes, so non-ASCII names in
js_name/typescript_typeno longerpanic the CLI or mis-bind the generated bindings.
#5248
Fixed threaded Wasm memory layout to reserve wasm-bindgen's internal thread
page after the module's original initial memory instead of at
__heap_base,avoiding overlap with allocators that resolve
__heap_base/__heap_endatlink time and treat that range as preexisting heap space.
#5225
Emscripten output now reaches wasm exports through emscripten's
wasmExportsobject using bracket (string-literal) access (
wasmExports['__wbindgen_start'])instead of a local
wasmalias with dot access.wasmExports['name']is theform emcc's DCE graph roots and its import/export minifier renames in the JS
and the wasm together, so the glue now survives and stays consistent under
-O3/-Os(previously the export names were minified without updating the JScall sites, e.g.
__wbindgen_start is not defined).The emscripten detection marker static is no longer leaked as public API.
#5220
#5222
v0.2.126Compare Source
Changed
enums, plus their finalization registries and string-enum tables) out of the
$initBindgeninit closure into its own top-leveladdToLibrarysymbol andself-registers it into
EXPORTED_FUNCTIONS. emscripten then emits the cleanAPI (
add,Counter, ...) as named ESM exports under-sMODULARIZE=instanceand as
Module.<name>properties (via each symbol's__postset) in factorymode, with no extra sidecar files. Namespaced exports are reached through
their namespace root (e.g.
app), assembled in the root symbol's__postset.User module/inline-js imports are now wired as
addToLibraryshims (they werepreviously dropped, since emcc resolves imports only against
env), and theirESM-imported bindings are
__wbg_-prefixed to avoid colliding with emccruntime names such as
Module/HEAP8.#5210
Fixed
The descriptor interpreter now follows emscripten
invoke_*trampolines.emscripten's exception/longjmp lowering rewrites direct calls into indirect
calls through the function table wrapped in imported
invoke_*(fnptr, ..args)helpers, including the describe helpers a descriptor function must reach. The
interpreter resolves
fnptragainst the reconstructed function table, forwardsthe trailing arguments, and evaluates the surrounding "did it throw?" control
flow (
if/else,loop,br_table), so descriptors are interpretedcorrectly on emscripten builds with unwinding/longjmp enabled.
#5215
Relaxed alignment requirement for 8-byte types.
#5204
Fixed compilation with
(feature = "std", panic = "unwind", target_feature = "atomics")and prevented a
Taskleak when a future unwinds out ofpoll(via a Rustpanic or a foreign JS exception) in both the single-threaded and
multi-threaded executors.
#5214
Headless Chrome/Edge tests now surface the WebDriver's own error message when
session creation fails (e.g. a chromedriver/Chrome version mismatch) instead
of a confusing
http status: 404.#5211
Removed
v0.2.125Compare Source
Added
--force-enable-abort-handlerCLI flag, which emits the hard-abortdetection and
set_on_abortmachinery onpanic=abortbuilds. Withpanic=unwindthis machinery is generated automatically; the flag doesnothing there.
#5191
Changed
__wbindgen_destroy_closureexport private in the Rust API.#5196
v0.2.123Compare Source
Added
Added the
maxAgeattribute to theCookieInitdictionary inweb-sys,matching the current Cookie Store API specification.
#5169
The js-sys futures codegen opt-in can now also be enabled via the
WASM_BINDGEN_USE_JS_SYS=1environment variable, in addition to--cfg=wasm_bindgen_use_js_sys. This works on stable when--targetis in use, where Cargo does not propagate the cfg to host proc-macros.
#5164
Changed
JsOption<T>now treats onlyundefinedas empty, aligning it withTypeScript's strict
T | undefinedsemantics and withOption<T>'s wireshape (
None↔undefined). Previouslyis_empty,as_option,into_option,unwrap,expect,unwrap_or_default, andunwrap_or_elsetreated bothnullandundefinedas absent; JSnullis now a distinct present value. The
impl<T> UpcastFrom<Null> for JsOption<T>is removed (Undefinedstill models absence), and theDebug/Displayabsent placeholder changed from"null"to"undefined". Code relying onnull → Noneshould returnundefinedfrom the JS side, or check explicitly with
val.as_option().filter(|v| !v.is_null()).#5170
Fixed
Removed invalid
js_sys::Array<T>tojs_sys::ArrayTuple<(...)>upcasts.ArrayTupleencodes a fixed tuple arity, while a plain JavaScript array doesnot prove that arity statically.
Fixed incorrect variance in
&mutreference upcasting.&mut Tupcastswere covariant in the pointee, so a
&mut Tcould be widened to a&mutof a supertype and used to write back a value the original type would not
accept, leaving a reference whose static type no longer matches the value
it points to. Mutable references are now invariant in their pointee:
&mut Tonly upcasts to&mut Targetwhen bothTarget: UpcastFrom<T>and
T: UpcastFrom<Target>hold. This rejects the invalid widening but isa breaking change for callers that relied on widening
&mutreferences.#5176
Fixed WASI targets (
wasm32-wasip1/wasm32-wasip2) emitting unresolved__wbindgen_placeholder__imports, which broke component linking. Thecodegen and runtime gates now exclude
target_os = "wasi"(restoring thepre-0.2.115 stub behavior), including the
panic = "unwind"paths inwasm-bindgen-futures.#5175
Fixed a panic ("Unhandled load width 8") in the descriptor interpreter when
processing
-Cinstrument-coverage-instrumented modules, unblockingcargo llvm-cov --target wasm32-unknown-unknownfor crates whose describehelpers get instrumented.
#5179
Fixed
mainsilently never running on wasm64 for bin crates.#5181
v0.2.122Compare Source
Notices
Threading support now requires
-Clink-arg=--export=__heap_baseto be setin
RUSTFLAGSfor nightly toolchains from 2026-05-06 onward, afterrust-lang/rust#156174
removed the implicit
__heap_base/__data_endexports onwasm*targets. Atomics CI, CLI reference tests, and the
nodejs-threads,raytrace-parallel, andwasm-audio-workletexamples have beenupdated to pass
--export=__heap_baseexplicitly. The flag isbackward-compatible with older nightlies.
-Cpanic=unwindon wasm targets now emits modern (exnref) exceptionhandling by default after
rust-lang/rust#156061,
and requires Node.js 22.22.3+ (for
WebAssembly.JSTag). Legacy EH wasmcan still be produced on current nightlies by adding
-Cllvm-args=-wasm-use-legacy-ehtoRUSTFLAGS; Node.js 20 may besupported with legacy exception handling, with a tracking issue in
#5151.
Added
Implemented
TryFromJsValueforVec<T>whereT: TryFromJsValue.A JS value converts when it is a real
Array(perArray.isArray)and every element converts via
T::try_from_js_value. This composesrecursively (
Vec<Vec<String>>,Vec<Option<T>>) and works for anyTwith aTryFromJsValueimpl, including primitives,String,JsValue, andJsCasttypes. Array-likes (objects withlengthandnumeric indices) are intentionally rejected to mirror the static ABI
representation used by
js_value_vector_from_abi.New
extends_js_classandextends_js_namespaceattributes onexported structs to allow defining the parent
js_classname whenit has been customized by
js_nameand the parent's ownjs_namespaceas well in turn. New validation is added at code generation time that
will now catch these cases instead of emitting invalid code. Example:
#5154
Changed
When an exported struct uses
js_namespace, the corresponding valuemust now be repeated on every
implblock. Previously the impl-sidedefaults silently worked resulting in inconsistent emission. Example:
To ease this transition for
js_namespaceusage, diagnosticmessages now include hints for missing namespaces for easier
fixing.
#5154
Fixed
Fixed the descriptor interpreter panicking on
BrandBrIfinstructions emitted by recent nightly compilers when building with
panic=unwind.#5158
Emscripten output now works against vanilla upstream emscripten without
requiring a fork. Dependency tracking,
HEAP_DATA_VIEWsetup,function-decl intrinsic inlining, catch-wrapper gating, and imported
global handling have all been corrected; ESM imports
(
#[wasm_bindgen(module = "...")]and snippets) are emitted to asidecar
library_bindgen.extern-pre.jsconsumers pass to emcc via--extern-pre-js; namespaced exports (js_namespace = [...]on astruct/impl) now attach to
Module.<segments>instead of emittingtop-level
export const(which emcc's library evaluator rejects);the generated
.d.tsfor namespaced exports is now valid TypeScript(mangled identifiers stay module-internal via
declare class/declare enum/declare functionplusexport { BindgenModule };to mark the file as a module; no spurious unqualified
Calc:property on
BindgenModulefor namespaced items; namespace shapesland as plain interface members (
app: { math: { Calc: typeof app__math__Calc } };) instead of the previously-emittedexport let app: { ... };which was invalid TS1131 syntax inside aninterface body).
#5156
Fixed a duplicate phantom class being emitted for an exported struct
renamed via
js_name(Rust ident != JS class name) and/or placed in ajs_namespace, when the struct crosses the boundary as aJsValue(e.g. via
.into()). TheWrapInExportedClass/UnwrapExportedClassimports were keyed by the Rust ident rather than the qualified JS name
that
exported_classesis keyed by (a regression from #5154), so afresh empty class entry was minted and emitted alongside the real one,
with a
free()referencing a nonexistent wasm export. Riding thesame release's #5154 wire-format bump, the now-vestigial
rust_namefield is dropped from the schema and the namespace-qualified name is
no longer cached on
AuxStruct,AuxEnum, orExportedClass(derived on demand from
(name, js_namespace)), collapsing threefallback chains that only papered over the pre-#5154 keying.
#5160
v0.2.121Compare Source
Added
Added the
slice_to_arrayattribute for imported JS functions,which makes a
&[T](orOption<&[T]>) argument arrive on the JSside as a plain
Arrayrather than a typed array — withoutchanging the Rust-side
&[T]signature. Useful when binding JSAPIs that take
T[]rather thanTypedArray<T>. For primitiveelement kinds the wire is the same zero-copy borrow used by plain
&[T], with the JS-side shim wrapping the view inArray.from(...)to materialise the
Array— no extra allocation. ForString,JsValue, and JS-imported element types the Rust side builds afresh
[u32]index buffer that JS reads and frees, with per-element&T -> JsValue(refcount bump for handle-shaped types). NoT: Clonebound is required. The attribute can be set per-fn(
#[wasm_bindgen(slice_to_array)] fn ...) or per-block on anextern "C" { ... }declaration to apply to every imported functionin that block.
&[ExportedRustStruct]remains unsupported (useowned
Vec<T>for that). Has no effect on exported functions;default
&[T](typed-array view / memory borrow) and ownedVec<T>semantics are unchanged for callers that didn't opt in.See the
slice_to_arrayguide page.#5145
Added
js_sys::AggregateErrorbindings (constructor,errorsgetter, andnew_with_message/new_with_optionsoverloads).AggregateErrorrepresentsmultiple unrelated errors wrapped in a single error, e.g. as thrown by
Promise.anywhen all input promises reject, along withjs_sys::ErrorOptions,accepted by built-in error constructors.
ErrorOptions::new(cause)constructs an instance pre-populated with
cause, andget_cause/set_causeprovide typed access to the property. All standard errorconstructors that previously took only a
message(EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError,WebAssembly.CompileError,WebAssembly.LinkError,WebAssembly.RuntimeError) now expose anew_with_options(message, &ErrorOptions)overload, andErrorgainsnew_with_error_options(message, &ErrorOptions)alongside the existinguntyped
new_with_options.AggregateError::new_with_optionsalso takes&ErrorOptions.#5139
Added inheritance for Rust-exported types: an exported struct may
declare
#[wasm_bindgen(extends = Parent)]to inherit from anotherexported
#[wasm_bindgen]struct. The macro injects a hiddenparent: wasm_bindgen::Parent<Parent>field (a refcounted cell aroundthe parent value) and emits
class Child extends Parentin thegenerated JS /
.d.ts. The child gets anAsRef<Parent<Parent>>implfor the direct parent, and threads per-class pointer slots through
the wasm ABI so that
instanceof Parentis true and parent methodsdispatch soundly via the JS prototype chain. From inside child
methods, parent data is reached via
self.parent.borrow()/self.parent.borrow_mut(). See the newextendsguide page.#5120
Added
js_sys::FinalizationRegistrybindings (constructor,register,register_with_token, andunregister). The cleanup callback parameteris typed as
&Function<fn(JsValue) -> Undefined>, so closures created viaClosure::newcan be passed usingFunction::from_closure(for ownedclosures retained by JS) or
Function::closure_ref(for borrowed scopedclosures). Pairs with the existing
js_sys::WeakRefbindings.#5140
Added support for well-known symbols in
js_name,getter, andsettervia the explicit bracket-string form"[Symbol.<name>]". This works for imported and exported methods,fields, getters, and setters. For example,
#[wasm_bindgen(js_name = "[Symbol.iterator]")]on an exported methodgenerates
[Symbol.iterator]() { ... }on the generated JS class, andthe same syntax works for
getter/setterand for imported items.#4230
Added level 2 bindings for
ViewTransitiontoweb-sys.#5138
Add support for dynamic unions: a
#[wasm_bindgen]enum that mixes string-literalvariants with single-field tuple variants is now exported as an untagged TypeScript
union and dispatched dynamically at the JS↔Rust boundary. The new enum-level
#[wasm_bindgen(fallback)]attribute makes the last tuple variant anunconditional catch-all, supporting unions whose trailing variant has no
runtime check (e.g., interface-only imports). String enums and dynamic
unions now emit
export type(was baretype) so the alias is a namedexport, and both honour the
privateflag to suppress the keyword.#4734
#2153
#2088
Fixed
From<Promise<T>> for JsFuture<T>andIntoFuture for Promise<T>nowaccept any
T: FromWasmAbi(rather thanT: JsGeneric), lettingimported
async fns return dynamic-union enums.TryFromJsValuefor C-style enums no longer accepts non-numeric valuesvia JS unary
+coercion. Previously callingdyn_into::<MyEnum>()ona string would silently coerce it via
+"foo"(yieldingNaN, thenNaN as u32 = 0) and could match a discriminant by accident; theconversion now returns
Nonefor any value that is not a JS number.#4734
Fix compilation failure with
no_std+release#5134
Raw identifiers (
r#name) on enums, enum variants, extern types, statics,and
implblocks no longer leak ther#prefix into generated JS / TSoutput and shim names. The Rust-side identifier and the JS-side name are
now tracked separately for enum variants, and all known identifier
fallback paths apply
Ident::unraw()so e.g.pub enum r#Enum { r#A }generatesEnum.Ainstead of producingsyntactically invalid JS.
#4323
Using the
-C panic=unwindoption when building for the bundler targetwould produce invalid JS.
#5142
Changed
js_sys::DataViewnow implements thejs_sys::TypedArraytrait. AFIXMEnotes that the trait should be renamed toArrayBufferViewinthe next major release to better reflect the WebIDL spec name covering
both
DataViewand the typed-array types.#5135
v0.2.120Compare Source
Added
Added support for the
wasm64-unknown-unknowntarget (memory64 / wasm64).usize/isizeand raw pointers are now lowered through anf64JSnumber ABI on wasm64 (matching the existing convention used for
Option<u32>etc. on wasm32), with the CLI inspecting the module's memory type to pick
the right codegen path. Includes a dedicated
wasm64CI job and testsuite covering the new ABI paths.
#5004
Promise ergonomics:
Promise::all_tupleandPromise::all_settled_tuplefor heterogeneous concurrent awaits (arity 1..=8, destructure via
.into_tuple()), and a newwasm_bindgen::IntoJsGenerictrait underpinningtyped-
Arrayinference (with codegen-emitted identity impls and a#[wasm_bindgen(no_into_js_generic)]opt-out for types likeJsClosure).Also re-exports
JsGenericfrom the prelude. Typed collection onjs_sys::Array<T>is exposed as the inherent constructorArray::<T>::from_iter_typed(and companionextend_typed), inferringTfrom the iterator item via
IntoJsGeneric. The stableFromIterator/Extendimpls onArray(=Array<JsValue>) bound byAsRef<JsValue>are preserved, so existing
.collect::<Array>()call sites keep compilingunchanged. Fixes #5042.
#5121,
#5125
Added
wasm_bindgen::instance()to return the currentWebAssembly.Instance. The generated JS glue retains theinstantiated
WebAssembly.Instance.#5118
Added a
--cfg=wasm_bindgen_use_js_sysopt-in that makes async macro codegenuse
js_sys::futuresinstead ofwasm_bindgen_futures, dropping the needfor
wasm-bindgen-futureswhen the crate already depends onjs-sys. A cfgis used rather than a Cargo feature so the choice stays scoped to the crate
that opts in.
#5112
#5127
Changed
web-sysbindings by omitting redundant#[wasm_bindgen]attributes when they match wasm-bindgen defaults, includingstructural method annotations and matching
js_nameentries. The#[wasm_bindgen]attribute parser now also accepts string-literal forms forextends,static_method_of, andvendor_prefix(alongside the existingbare-path/ident syntax), and the generator emits these arguments along with
js_nameas string literals sorustfmtcan format the generated#[wasm_bindgen(...)]attributes uniformly.#5122
Fixed
Fixed namespaced export identifiers in generated JS/TS to use qualified names
consistently, resolving order-dependent codegen issues across platforms. Also
fixed
Vec<T>types in TS signatures to resolve through the identifier map.#5106
Fixed
wasm-bindgen-test-runnertreating ChromeDriver stderr warnings asstartup failures on macOS, causing a restart loop until timeout. The runner
no longer uses stderr output to determine if a driver has failed; instead a
per-attempt timeout detects stuck drivers and retries on a new port.
#5111
v0.2.118Compare Source
Added
Added
Error::stack_trace_limit()andError::set_stack_trace_limit()bindingsto
js-sysfor the non-standard V8Error.stackTraceLimitproperty.#5082
Added support for multiple
#[wasm_bindgen(start)]functions, which arechained together at initialization, as well as a new
#[wasm_bindgen(start, private)]to register a start function withoutexporting it as a public export.
#5081
Reinitialization is no longer automatically applied when using
panic=unwindand
--experimental-reset-state-function, instead it is triggered by anyuse of the
handler::schedule_reinit()function underpanic=unwind,which is supported from within the
on_aborthandler for reinit workflows.Renamed
handler::reinit()tohandler::schedule_reinit()and removedthe
set_on_reinit()handler. The__instance_terminatedaddressis now always a simple boolean (
0= live,1= terminated).#5083
handler::schedule_reinit()now works underpanic=abortbuilds. Previouslyit was a no-op; it now sets the JS-side reinit flag and the next export call
transparently creates a fresh
WebAssembly.Instance.#5099
Changed
#5102
Fixed
ES module
importstatements are now hoisted to the top of generated JSfiles, placed right after the
@ts-self-typesdirective. This ensuresvalid ES module output since
importdeclarations must precede otherstatements.
#5103
Fixed two CLI issues affecting WASM modules built by rustc 1.94+. First,
a panic (
failed to find N in function table) caused by lld emitting elementsegment offsets as
global.get $__table_baseor extended const expressionsinstead of plain
i32.const Nfor large function tables; the fix adds aconst-expression evaluator in
get_function_table_entryand guards againstinteger underflow in multi-segment tables. Second, the descriptor interpreter
now routes all global reads/writes through a single
globalsHashMap seededfrom the module's own globals, and mirrors the module's actual linear memory
rather than a fixed 32KB buffer, so the stack pointer's real value is valid
without any override. This fixes panics like
failed to find 32752 in function tablecaused byGOT.func.internal.*globals being misidentified as thestack pointer.
#5076
#5080
#5093
#5095
v0.2.117Compare Source
Fixed
Fixed a regression introduced in #5026 where stable
web-sysmethods thataccept a union type containing a
[WbgGeneric]interface (e.g.ImageBitmapSource, which includesVideoFrame) incorrectly applied typedgenerics to all union expansions rather than only those whose argument type
is itself
[WbgGeneric]. In practice this causedWindow::create_image_bitmap_with_*and the corresponding
WorkerGlobalScopeoverloads to returnPromise<ImageBitmap>instead ofPromise<JsValue>for the stable(non-
VideoFrame) call sites, breakingJsFuture::from(promise).await?.#5064
#5073
Fixed handling logic for environment variable
WASM_BINDGEN_TEST_ADDRESSinthe test runner, when running tests in headless mode.
#5087
v0.2.116Compare Source
Added
js_sys::Float16Arraybindings,DataViewfloat16 accessors usingf32, and raw[u16]helper APIs for interoperability with binary16representations such as
half::f16.#5033
Changed
Updated to Walrus 0.26.1 for deterministic type section ordering.
#5069
The
#[wasm_bindgen]macro now emits&mut (impl FnMut(...) + MaybeUnwindSafe)/
&(impl Fn(...) + MaybeUnwindSafe)for raw&mut dyn FnMut/&dyn Fnimport arguments instead of a hidden generic parameter and where-clause. The
generated signature is cleaner and the
MaybeUnwindSafebound is visibledirectly in the argument position. The ABI and wire format are unchanged.
When building with
panic=unwind, closures that capture non-UnwindSafevalues (e.g.
&mut T,Cell<T>) must wrap them inAssertUnwindSafebeforecapture; on all other targets
MaybeUnwindSafeis a no-op blanket impl.#5056
v0.2.115Compare Source
Added
console.debug/log/info/warn/erroroutput from user-spawnedWorkerandSharedWorkerinstances is now forwarded to the CLI test runner duringheadless browser tests, just like output from the main thread. Works for
blob URL workers, module workers, URL-based workers (importScripts), nested
workers, and shared workers (including logs emitted before the first port
connection). Non-cloneable arguments are serialized via
String()ratherthan crashing the worker. The
--nocaptureflag is respected.#5037
js_sys::Promise<T>now implementsIntoFuture, enabling direct.awaitonany JS promise without a wrapper type. The
wasm-bindgen-futuresimplementationhas been moved into
js-sysbehind an optionalfuturesfeature, which isactivated automatically when
wasm-bindgen-futuresis a dependency. Allexisting
wasm_bindgen_futures::*import paths continue to work unchanged viare-exports.
js_sys::futuresis also available directly for users who wantpromise.awaitwithout depending onwasm-bindgen-futures.#5049
Added
--target emscriptensupport, generating alibrary_bindgen.jsfilefor consumption by Emscripten at link time. Includes support for futures,
JS closures, and TypeScript output. A new Emscripten-specific test runner is
also included, along with CI integration.
#4443
Added
VideoFrame,VideoColorSpace, and related WebCodecs dictionaries/enums toweb-sys.#5008
Added
wasm_bindgen::handlermodule withset_on_abortandset_on_reinithooks for
panic=unwindbuilds.set_on_abortregisters a callback invokedafter the instance is terminated (hard abort, OOM, stack overflow).
set_on_reinitregisters a callback invoked afterreinit()resets theWebAssembly instance via
--experimental-reset-state-function. Handlers arestored as Wasm indirect-function-table indices so dispatch is safe even when
linear memory is corrupt.
Changed
Replaced per-closure generic destructors with a single
__wbindgen_destroy_closureexport.
#5019
Refactored the headless browser test runner logging pipeline for dramatically improved
performance (>400x faster on Chrome, >10x on Firefox, ~5x on Safari). Switched to
incremental DOM scraping with
textContent.slice(offset), append-only output semantics,unified log capture across all log levels on failure, and browser-specific invisible-div
optimizations (
display:nonefor Chrome/Firefox,visibility:hiddenfor Safari).#4960
TTY-gated status/clear output in the test runner shell to avoid
\rcontrol-characterartifacts in non-interactive (CI) environments.
#4960
Added
bench_console_log_10mbbenchmark alongside the existing 1MB benchmark for theheadless test runner. The main branch cannot complete this benchmark at any volume.
#4960
Updated to Walrus 0.26
#5057
Fixed
Fixed argument order when calling multi-parameter functions in the
wasm-bindgeninterpreter by reversing the args collected from the stack.#5047
Added support for per-operation
[WbgGeneric]in WebIDL, restoring typedgeneric return types (e.g.
Promise<ImageBitmap>) forcreateImageBitmaponWindowandWorkerGlobalScopethat were lost after theVideoFramestabilization.
#5026
Fixed missing
#[cfg(feature = "...")]gates on deprecated dictionary buildermethods and getters for union-typed fields (e.g.
{Open,Save,Directory}FilePickerOptions::start_in()),and fixed per-setter doc requirements to list each setter's own required features.
#5039
Fixed
JsOption::new()to useundefinedinstead ofnull, to be compatible withOption::Noneand JS default parameters.#5023
Fixed unsound
unsafetransmutes inJsOption<T>::wrap,as_option, andinto_optionby replacing
transmute_copywithunchecked_into(). Also tightened theJsGenerictrait bound and
JsOption<T>impl block to requireT: JsGeneric(which impliesJsCast),preventing use with arbitrary non-JS types.
#5030
Fixed headless test runner emitting
\rcarriage-return sequences in non-TTY environments,which polluted captured logs in CI and complicated output-matching tests.
#4960
Fixed headless test runner printing incomplete and out-of-order log output on test failures
by merging all five log levels into a single unified output div.
#4960
Fixed large test outputs (10MB+) causing oversized WebDriver responses that were either
extremely slow or crashed completely, by switching to incremental streaming output collection.
#4960
Fixed a duplciate wasm export in node ESM atomics, when compiled in debug mode
#5028
Fixed a type inference regression (
E0283: type annotations needed) introducedin v0.2.109 where the stable
FromIteratorandExtendimpls onjs_sys::Arraywere changed from
A: AsRef<JsValue>toA: AsRef<T>. Because#[wasm_bindgen]generates multiple
AsRefimpls per type, the compiler could not uniquely resolveT, breaking code likeArray::from_iter([my_wasm_value])without explicitannotations. The stable impls are restored to
A: AsRef<JsValue>(returningArray<JsValue>); the genericA: AsRef<T>forms remain available underjs_sys_unstable_apis.#5052
Fixed
skip_typescriptnot being respected when usingreexport, causingTypeScript definitions to be incorrectly emitted for re-exported items marked
with
#[wasm_bindgen(skip_typescript)].#5051
Removed
webpack/webpack (webpack)
v5.112.2Compare Source
Patch Changes
Reduce repeated scans when concatenating imported modules. (by @xiaoxiaojx in #22865)
Avoid allocating CSS module sets for single-group chunks. (by @xiaoxiaojx in #22866)
Return the value of every module type loaded with
importModule(). (by @alexander-akait in #22869)v5.112.1Compare Source
Patch Changes
Rebuild a lazy barrel in watch when what it defers changes, and keep the imports and re-exports it still runs. (by @aryanraj45 in #22699)
Rebuild under
cacheUnaffecteda module whose re-export target goes or returns. (by @aryanraj45 in #22749)Fix "Self-reference dependency has unused export name" for CommonJS namespace re-exports. (by @alexander-akait in #22791)
Fix
exportType: "style"CSS modules throwing outside the runtime chunk. (by @lazerg in #22833)Fix crash when a CSS module with
exportType: "style"imports an ignored stylesheet. (by @codeXsidd in #22846)Keep empty process environment variables that
.envfiles don't define inDotenvPlugin. (by @alexander-akait in #22794)Rehash an ESM entry chunk when a chunk it imports by file name changes. (by @alexander-akait in #22804)
Handle a NUL inside an HTML CDATA section the way the parsing spec does. (by @dependabot in #22811)
Keep module exports live across chunks, runtimes, HMR and eval, sparing globals. (by @alexander-akait in #22733)
Await asynchronous modules that
ProvidePlugininjects into ES modules. (by @alexander-akait in #22728)Keep a resolve that ends after the compiler closed from throwing. (by @alexander-akait in #22795)
Preserve string names passed to SharedWorker constructors. (by @bjohansebas in #22770)
Preserve string contents when extracting source map comments. (by @bjohansebas in #22768)
Scope strict-mode, async and generator block function declarations to their block. (by @alexander-akait in #22800)
Preserve raw dotenv values when reusing cached environment files. (by @Eshiv-Pandey in #22787)
Preserve assigned or patched built-ins, conversions and pattern targets. (by @aryanraj45 in #22761)
Keep globals a
globalThiswrite replaces, andsliceon a patched array. (by @alexander-akait in #22862)Skip HTML script tags for shared chunks that emit no JavaScript. (by @bjohansebas in #22779)
Keep the digits Firefox lays out a minified CSS percentage with. (by @alexander-akait in #22718)
Reject a second
srcsetdescriptor after a0xdensity descriptor. (by @alexander-akait in #22741)Minify JavaScript faster, folding string methods on constants and
x -= 1. (by @alexander-akait in #22823)Shorten minified JavaScript, and keep it running like its source. (by @alexander-akait in #22717)
Drop more unused functions, arguments, calls, global reads and variable copies when minifying JavaScript. (by @alexander-akait in #22789)
Minify JavaScript smaller where swc does, and fold a function's
lengthright. (by @alexander-akait in #22826)Reduce JavaScript output size where oxc or swc produce smaller output. (by @alexander-akait in #22829)
Update watchpack to 2.6.3 and rebuild on a
node_modulescreated mid-build. (by @alexander-akait in #22743)Support
concatenateModuleswithcacheUnaffected. (by @alexander-akait in #22746)Update schema-utils to 4.8.1. (by @alexander-akait in #22774)
Keep CSS fallbacks, vendor overrides,
oklch()hues and HTML elements. (by @alexander-akait in #22753)Validate
CleanPluginandDotenvPluginoptions with a precompiled check, so valid options no longer compile their schema at startup. (by @alexander-akait in #22758)Speed up startup and CSS minification, sharing the compile cache with workers. (by @xiaoxiaojx in #22706)
Use precise, generic types for modules, parsers, generators, stats and loaders. (by @alexander-akait in #22731)
v5.112.0Compare Source
Minor Changes
Apply
pluginsset on a multi-configuration array to theMultiCompiler. (by @alexander-akait in #22702)Add
optimization.minimize.css.dropOverriddenDeclarations, dropping a declaration a later one overrides where no target is named. (by @alexander-akait in #22175)Export more plugins under their scope, move eleven loose exports under theirs, deprecate the old, and expose
template.DependencyTemplate,module.NullFactoryandutil.makeSerializable. (by @alexander-akait in #22261)Let
util.makeSerializabletake several requests, current one first. (by @alexander-akait in #22340)Emit the source map
scopesfield, so a debugger resolves imported ESM bindings by name. (by @alexander-akait in #21999)Add
library.entryExports: "all"to expose the exports of every entry module. (by @alexander-akait in #22235)Recognize a required
constbinding assigned toexportsas a re-export. (by @hai-x in #22276)Accept glob patterns in more path, module and file filter options. (by @hai-x in #22422)
Bundle a run of inline
<script>tags into one chunk the page can inline. (by @alexander-akait in #22188)Add
module.parser.javascript.topLevelThisfor classic-scriptthissemantics. (by @alexander-akait in #22193)Add
module.parser.html.chunkNameand awebpackChunkNamecomment for tags. (by @alexander-akait in #22200)Add
include/excludeversion and request filters to shared modules. (by @alexander-akait in #22297)Keep module side-effect information in ESM output as PURE annotations. (by @alexander-akait in #21789)
Add
optimization.splitChunks.dedupDepthto discover chunk intersections. (by @alexander-akait in #22240)Add
optimization.minimizeOptions.json, on by default withfutureDefaults. (by @alexander-akait in #22286)Add
SSRManifestPluginand fix server-rendered CSS collection and adoption. (by @alexander-akait in #21913)Add an
ignorehook tooutput.copyand keep unfollowedfromsymlinks. (by @alexander-akait in #22216)Add
optimization.minimize.css.convertApproximateColors. (by @alexander-akait in #22157)Add XML parsing and SVG/XML minification with data URLs and attribute sorting. (by @alexander-akait in #22269)
Extract CSS/HTML license comments like JS and safely shorten CSS gradients. (by @alexander-akait in #22408)
Resolve an async
DefinePlugin.runtimeValueover an asyncbeforeParsehook. (by @alexander-akait in #22210)Add CSS
customMedia/customSelectorsminimize options; resolve chained names. (by @alexander-akait in #22360)Rename the
Harmony*names toESM*and deprecate the old spellings. (by @hai-x in #22283)Reduce
css.syntax/html.syntaxtoparser,printer,SourceProcessorwith one node path. (by @alexander-akait in #22233)Add a JavaScript
SyntaxTreeread like the CSS one, andtoEstreeObject. (by @alexander-akait in #22608)Fix minified code that threw, and add
pure_conversionsandpure_heritage. (by @alexander-akait in #22473)Shorten more CSS values and selectors, fold longhands, order declarations and gather layer blocks. (by @alexander-akait in #22442)
Add
optimization.minimize.css.charset;falsedrops@charsetfor UTF-8 CSS. (by @alexander-akait in #22632)Patch Changes
Join rules a gathered
@layerleaves adjacent, and an at-rule with a later one (by @alexander-akait in #22204)stating the same condition; read what a condition declares.
Read escaped CSS names and functions as spelled, and minify them unescaped. (by @alexander-akait in #22262)
Minify JavaScript, CSS and HTML assets whose names carry a
#fragment. (by @alexander-akait in #22277)Require
minimizer-webpack-plugin5.12, so inline scripts in HTML minify again. (by @alexander-akait in #22296)Minify the attributes of an HTML tag without rewriting the template in it. (by @alexander-akait in #22166)
Order joined at-rule selector lists and gather a repeated large
@layerblock. (by @alexander-akait in #22224)Preserve case-sensitive template identifiers when minifying HTML tag attributes. (by @bjohansebas in #22177)
Match Acorn's strict directives, Unicode identifiers and expression validation. (by @bjohansebas in #22185)
Skip concatenating modules when
optimization.providedExportsis disabled. (by @hai-x in #22410)Join rules a nesting lowering or duplicate drop left for a second pass. (by @aryanraj45 in #22268)
Write U+00A0 in a minified HTML attribute as the character, not
. (by @alexander-akait in #22208)Escape a foreign
<script>or<style>body, which is character data. (by @alexander-akait in #22233)Name the runtime module whose generation fails while hashing. (by @alexander-akait in #22203)
Rebuild a module in watch when its missing unused dependencies swap. (by @alexander-akait in #22693)
Rebuild in watch mode when a file is deleted while a build is running. (by @alexander-akait in #22650)
Take out the declaration a lowered shorthand writes over, which its source spelling made look like a fallback. (by @aryanraj45 in #22270)
Read a foreign
<script>or<style>body as character data, not as raw text. (by @alexander-akait in #22258)Keep an inline
<style>body as written when rebuilding a page webpack emitted. (by @alexander-akait in #22265)Fix minified HTML for
stylespellings, CSS quotes,<noscript>and a BOM. (by @alexander-akait in #22370)Record a build dependency required through a spread on Bun. (by @alexander-akait in #22230)
Write a nested selector opening on a combinator against its parent the way the printer writes one. (by @aryanraj45 in #22271)
Fix missing async stylesheets with a shared runtime. (by @bjohansebas in #22659)
Support deferred imports introduced by hot updates. (by @bjohansebas in #22668)
Fix trailing commas in
require.resolve()andrequire.resolveWeak()calls. (by @bjohansebas in #22658)Keep regular expressions, functions and plugins distinct in resolver caches. (by @bjohansebas in #22667)
Order the list a lowered nested selector lands in on what is written, not on what was. (by @aryanraj45 in #22287)
Hoist a vendor-prefixed nested rule for a target that reads no nesting. (by @aryanraj45 in #22308)
Name a hoisted nested rule in the dark-scheme copy it writes. (by @alexander-akait in #22318)
Minify data: URL payloads in HTML attributes and
new URL, and web manifests. (by @alexander-akait in #22300)fold a fallback's colors over the author's arguments, and print with (by @aryanraj45 in #22314)
recurseBlocks: falserather than throwingRead a regular expression repeating a capture group name in linear time. (by @alexander-akait in #22187)
Make lazy barrels defer import declarations and keep no deferral across compilations. (by @hai-x in #22359)
Invalidate unaffected caches when connection activity or async status changes. (by @bjohansebas in #22431)
Order concatenated re-exports deterministically when their source order ties. (by @alexander-akait in #22697)
Regenerate a module's exports when a require() cycle forms or breaks around it. (by @aryanraj45 in #22644)
Recompute re-exports, code and warnings when a module goes missing or returns. (by @bjohansebas in #22432)
Preserve loader resolution dependencies across cached rebuilds. (by @bjohansebas in #22430)
Read unwatched changes afresh and wait for restarted watch compilers to finish. (by @alexander-akait in #22646)
Parse loader output for
.wasmas JavaScript when async wasm is auto-enabled. (by @alexander-akait in #22556)Remove modules an async chunk inherits from a named parent chunk grown later. (by @hai-x in #22555)
Fix JavaScript minifier crashes, altered behavior, lost comments, unparsable output and null source map sources, including parameter aliases, ESTree trees and preserved names, and stop it writing into the caller's parse options. (by @alexander-akait in #22352)
Preserve the source phase of dynamic WebAssembly import contexts. (by @bjohansebas in #22604)
Await every async entry before resolving an ESM library import. (by @bjohansebas in #22617)
Keep unknown
import.metaproperties per module, alike for aliases and direct use. (by @bjohansebas in #22618)Return WebAssembly modules directly from eager and weak source imports. (by @bjohansebas in #22606)
Handle missing ESM hot update manifests in Node.js without failing HMR checks. (by @bjohansebas in #22613)
Speed up JavaScript parsing: comment lookup, the tokenizer and the grammar. (by @bjohansebas in #22179)
Name a core module external by its key whichever spelling the code uses. (by @alexander-akait in #22565)
Prefix and drop 2009 flexbox names, keeping them where a box lays out by them. (by @alexander-akait in #22320)
Keep
initialwhere Gecko or WebKit reads the property's keyword apart. (by @aryanraj45 in #22176)Fold
calc()as lightningcss does, keeping it where a bare value is refused. (by @aryanraj45 in #22205)Keep a
color-mix()whose hue rests on a gray's conversion residue. (by @alexander-akait in #22198)Keep a shorthand's initial keyword where it parts two keywords of another slot. (by @dependabot in #22518)
Group
lib/andlib/dependencies/sources into directories. (by @alexander-akait in #22118)Treat a browserslist target given at a bare major version (e.g.
safari 10) as<major>.0when a feature's first supported version is a[major, minor]pair, so it is no longer reported as unsupported. (by @Eshiv-Pandey in #22280)Keep the last HMR update with
output.clean; stop rechecking removed files. (by @alexander-akait in #22339)Read and print a CSS backslash as the spec does, and a NUL as U+FFFD. (by @alexander-akait in #22201)
Make minified CSS and HTML stable on a second pass, even for truncated input. (by @alexander-akait in #22290)
Minify a merged
<style>run as one sheet, closing each where its input ended. (by @alexander-akait in #22302)Minify JavaScript with webpack's printer under
futureDefaults,terserotherwise. (by @alexander-akait in #22217)Preserve
wrappedContextRegExpflags when rebuilding context request matchers. (by @Eshiv-Pandey in #22303)Minify CSS
@supports,@importand@custom-mediaconditions, and exponent numbers. (by @alexander-akait in #22347)Fold unitless
hsl()/hwb()channels, and only where the separators are valid. (by @alexander-akait in #22242)Split
@valueimports on thefromkeyword, not a substring in the path. (by @Eshiv-Pandey in #22306)Destructure a dotted
DefinePluginkey whose value is falsy or a runtimeValue. (by @alexander-akait in #22215)Make
Stats.hasErrors()read errors through theprocessErrorshook (viagetErrors()), matchinghasWarnings(), so a plugin that filters errors out of the hook is no longer contradicted byhasErrors(). (by @Eshiv-Pandey in #22281)Allow wrapping an external concatenated module, now asked of the module itself, and re-exporting a JSON or asset
defaultas a namespace object. (by @hai-x in #22226)Match
urlHintsrules written withand,or,notandglobconditions; profile hook map taps, such as resolver and parser hooks, inProfilingPlugin; reportimport.metaoption errors insiderequire.ensurecallbacks, not crash; and replaceany,objectandFunctionwith precise types in the type definitions. (by @alexander-akait in #22681)Reduce CSS and HTML build time and memory allocation. (by @alexander-akait in #22135)
Reuse free names instead of re-parsing modules for the entry IIFE rename. (by @hai-x in #22206)
Release each module's ast once scope-analysed, and encode each export path once. (by @alexander-akait in #22241)
Export a module library entry's default expression as its own binding, and keep (by @hai-x in #22227)
the export helpers where the entry is not inlined.
Give a wrapped concatenated body the same function header as a module factory. (by @hai-x in #22254)
Skip reading every asset when no content hash is named. (by @alexander-akait in #22256)
Cut graph, cached set, lazy barrel and ESM import memory and allocations. (by @alexander-akait in #22289)
Stop a module source from being held as both a string and a buffer. (by @alexander-akait in #22294)
Read the browserslist data and options schema only when a build needs them. (by @alexander-akait in #22324)
Release the eval devtool's cached module sources after wrapping them. (by @alexander-akait in #22358)
Release the rendered module sources after emitting the chunks. (by @alexander-akait in #22365)
Cut the peak memory and time of minifying through webpack's printer. (by @alexander-akait in #22368)
Shrink minified JS: unwrap IIFEs, fold calls, drop dead code, split arrays. (by @alexander-akait in #22393)
Cut JavaScript minifier time and memory; keep token positions in large inputs. (by @bjohansebas in #22329)
Keep the
calc()around asteps()countjump-nonewould reject bare. (by @alexander-akait in #22168)Split the CSS syntax module into a parser file and a printer file. (by @alexander-akait in #22222)
Update enhanced-resolve to 5.26.0. (by @alexander-akait in #22358)
Update watchpack to 2.6.1. (by @alexander-akait in #22670)
Split the HTML syntax module into a parser file and a printer file. (by @alexander-akait in #22223)
Rename classes in
lib/so each says what it does and no two share a name. (by @alexander-akait in #22361)Keep the remote fallback index aligned with registered container externals when an
internalexternal precedes a real one. (by @Eshiv-Pandey in #22362)Stop a minified inlined chunk leaving a doubled
;in its<script>. (by @alexander-akait in #22370)Stop
mergeDistantRulesmangling rules or reorderingall, and merge more. (by @alexander-akait in #22370)Minify by parsing with webpack's own parser rather than terser's. (by @alexander-akait in #22397)
Read JavaScript with webpack's parser alone when minifying, refusing early errors. (by @alexander-akait in #22397)
Parse an
assert(...)call after an import with no semicolon, and a regular expression afteryieldin a generator method. (by @alexander-akait in #22406)Keep the private names a direct
evalreads when mangling. (by @aryanraj45 in #22412)Keep a class dropped for its effects where they read a private name it declares. (by @aryanraj45 in #22421)
Parenthesize the right side of a private
in, ayield,await, privateinor optional chain tagging a template, and aletorasyncstarting a statement or loop head, where the minifier printed code that no longer parsed or read otherwise. (by @aryanraj45 in #22437)Keep a name a parameter list or catch parameter reads from resolving to what the function body or catch block declares, which the minifier renamed or dropped as unused. (by @aryanraj45 in #22439)
Scope and export a CSS Modules
@valuethe same way whether local or imported. (by @alexander-akait in #22443)Keep CSS
border: noneand gradient fallbacks for units a target cannot read. (by @alexander-akait in #22567)Keep minified CSS safe for older browsers; drop dead fallbacks and overrides. (by @alexander-akait in #22696)
Keep CSS rules apart from a neighbor whose selector no browser parses. (by @alexander-akait in #22634)
Keep an
:nth-*()argument with a space after its sign as written. (by @alexander-akait in #22700)Keep minified CSS readable by browsers the compat data does not cover. (by @alexander-akait in #22701)
Keep a module its chunk still needs after
compilation.rebuildModule(). (by @alexander-akait in #22705)Keep a CSS rule nested under a selector opening on a combinator when lowering. (by @alexander-akait in #22707)
Use module paths for webpack's built-in minimizers so parallel minification can load them directly in workers instead of serializing their function sources. (by @xiaoxiaojx in #22309)
Keep stats from an earlier build readable after a later build no longer has one of their modules. (by @alexander-akait in #22695)
v5.111.1Compare Source
Patch Changes
Throw on a write to an imported binding without losing concatenation. (by @alexander-akait in #22141)
Keep the
</html>a page was written with, whatever opened the element. (by @aryanraj45 in #22103)Look an attribute up by what its value decodes to, not how it was spelled. (by @aryanraj45 in #22107)
Minify HTML by what a value says rather than how it was spelled. (by @alexander-akait in #22154)
Follow HTML template form and frameset rules during tree construction. (by @dependabot in #22129)
Keep the whitespace
calc()needs around+and-in a custom property. (by @alexander-akait in #22150)Keep an attribute's delimiter and spell its value back where quoting is frozen. (by @alexander-akait in #22119)
Rewrite an attribute value the source spelled with character references. (by @aryanraj45 in #22110)
Unquote an HTML attribute value carrying a vertical tab. (by @alexander-akait in #22162)
Keep a shadow's spread and canonicalize a merged selector list. (by @alexander-akait in #22101)
Leave out an implied tag and merge adjacent runs on the first pass. (by @aryanraj45 in #22121)
Minify in one pass what a second pass of the CSS minifier used to find. (by @alexander-akait in #22106)
Cover the CSS lookup tables no stylesheet in the corpus reaches. (by @aryanraj45 in #22126)
Keep
initialwhere an engine reads the property's initial keyword apart. (by @aryanraj45 in #22128)Join the CSS rules a cut leaves adjacent, and keep a value an escape ate. (by @alexander-akait in #22108)
Drop the dead CSS a cut leaves, and join more of the blocks that print alike. (by @alexander-akait in #22111)
Run the printer equivalence suite against Firefox as well as Chrome. (by @aryanraj45 in #22151)
Finish in one CSS pass the joins, drops and collapses left to a second. (by @alexander-akait in #22117)
Move the context module sources into
lib/context/. (by @alexander-akait in #22115)Declare loader context types in JSDoc instead of hand-written
.d.tsfiles. (by @alexander-akait in #22116)Emit a failing module's stack relative, and name what a tap failed with. (by @alexander-akait in #22122)
Finish in one CSS pass the drops, layer gathers and joins left to a second. (by @alexander-akait in #22120)
Speed up CSS parsing by stepping over dropped selector preludes in bytes. (by @alexander-akait in #22142)
Record hoisted, module and block declarations while parsing, not by re-walking. (by @alexander-akait in #22147)
Fold more enumerated attribute values and drop those naming no keyword. (by @alexander-akait in #22148)
Halve the CSS minifier's browser-version tables by narrowing their element type. (by @alexander-akait in #22140)
Make each
optimization.minimize.cssswitch govern its own rewrite alone. (by @alexander-akait in #22140)Join the rules a top-level
@layergather leaves meeting at the seam. (by @alexander-akait in #22140)Gather a CSS layer past a rule that writes only a different one. (by @alexander-akait in #22154)
Order HTML attributes by what reaches the output, and read values decoded. (by @alexander-akait in #22146)
Drop a fallback declaration every
browserslisttarget reads past. (by @alexander-akait in #22158)Fix module library exports lost under cache or missing behind a re-export. (by @hai-x in #22114)
v5.111.0Compare Source
Minor Changes
Enable
output.moduleby default withfutureDefaultson ESM-capable targets. (by @alexander-akait in #22088)Remove
experiments.outputModule, setoutput.moduleto emit ESM instead. (by @alexander-akait in #22011)Add
output.copyto copy files and directories into the output directory. (by @alexander-akait in #21938)Accept a file URL in any spelling Node reads where an absolute path is taken. (by @alexander-akait in #22012)
Minify inline CSS and JSON via
renderEmbeddedSource, exporting webpack's own. (by @alexander-akait in #21993)Export
cssMinifyandhtmlMinifyoncss.syntaxandhtml.syntax. (by @alexander-akait in #21953)Make
processResultasync and let a tap rename the asset it rewrote. (by @alexander-akait in #21854)Lower a CSS spelling a target cannot read and write a color fallback before one. (by @alexander-akait in #21926)
Allow optional filesystem cache build dependencies. (by @xiaoxiaojx in #21849)
Add
output.environment.topLevelAwaitand await every async ESM entry. (by @alexander-akait in #21915)Add
unusedSymbolsandpseudoClasses, and evaluate a CSS color function. (by @alexander-akait in #21927)Drop an implied shorthand slot, fold a math function, tighten color conversion. (by @alexander-akait in #21929)
Add
module.parser.javascript.specNamespaceObjectfor spec namespace objects. (by @alexander-akait in #22049)Drop what is already said or only a gone engine reads, add
lowerUnsupported. (by @alexander-akait in #21931)Add
normalizeUrlAttributes,mergeScripts, boolean and token switches. (by @alexander-akait in #21960)Minify an event handler attribute, and name the production each script body is. (by @alexander-akait in #21968)
Add source-map, asset, module, bailout, federation hints; group config checks. (by @alexander-akait in #21961)
Lower CSS nesting,
:dir()and custom at-rules; gate case folding and escapes. (by @alexander-akait in #21950)Add
optimization.minimize.css.mergeDistantRulesto join rules across a gap. (by @alexander-akait in #21969)Patch Changes
Minify an embedded body through the embedded path, dropping three html options. (by @alexander-akait in #21936)
Take a minified
styleattribute's answer whatever quoting it needs. (by @alexander-akait in #21936)Name chunk imports in the chunk loader, not at each import site. (by @alexander-akait in #22076)
Repair hashed names; under HMR bake hashed url maps and reload moved css names. (by @alexander-akait in #21916)
Enable
output.moduleformoduleandmodern-modulelibrary types. (by @alexander-akait in #22071)Name an anonymous
export default classbefore its static initializers run. (by @alexander-akait in #21910)Throw on a non-optional read past an undefined
DefinePluginmember. (by @alexander-akait in #22017)Reject a fulfilled async cycle member with the cycle's evaluation error. (by @alexander-akait in #21921)
Escape external requests in generated ESM imports and star reexports. (by @bjohansebas in #22078)
Fix stack overflows in ESM library star reexport cycles with externals. (by @bjohansebas in #22080)
Preserve live bindings when reexporting external ESM exports. (by @bjohansebas in #22082)
Use configured external requests in ESM star reexports; reject property paths. (by @bjohansebas in #22079)
Preserve import attributes on ESM library star reexports of externals. (by @bjohansebas in #22081)
Fail the build when a runtime module's code generation throws while hashing. (by @alexander-akait in #22034)
Settle a css chunk load without a DOM where its stylesheet cannot be read. (by @alexander-akait in #21970)
Await a deferred import's async dependency that is evaluating-async. (by @alexander-akait in #21934)
Keep a color the CSS minifier would round where its channels are read back. (by @alexander-akait in #21923)
Refresh a cached module's
resolveOptionsfrom the factory, not the pack. (by @hai-x in #21945)Read a
<script type>decoded, so a reference-spelled type is minified. (by @alexander-akait in #21933)Read the extension out of a path-scoped rule's alternation, class or braces. (by @alexander-akait in #21946)
Keep an HTML attribute name or list token holding a foreign template delimiter. (by @alexander-akait in #22018)
Answer a name a module does not export from the spec namespace. (by @alexander-akait in #22092)
Give a deferred namespace the spec's exotic shape when the exports are known. (by @alexander-akait in #21939)
Give a JSON, text or CommonJS namespace the spec's exotic shape and identity. (by @alexander-akait in #22087)
Report a missing asset instead of a code generation deadlock. (by @alexander-akait in #21992)
Keep a concatenated CommonJS reference a separate statement, guarding it once. (by @alexander-akait in #21962)
Keep CSS module exports for a direct loader
importModule()call. (by @alexander-akait in #22047)Fix
import.metaandrequire.main, and scope-hoistimport.meta.main. (by @alexander-akait in #21973)Honor
resolve.fileSystemand say wheremodule.exprContextCriticalmoved. (by @alexander-akait in #22091)Release stale compilation data from nested children and idle watch builds. (by @alexander-akait in #22096)
Resolve a
@valueonce and then localize it, wherever it names an identifier. (by @alexander-akait in #22036)Release the printed-text store's text when the CSS printer drops it. (by @alexander-akait in #21958)
Skip a foreign dependency whose
isLazyis a flag when walking a lazy barrel. (by @alexander-akait in #21998)Move diagnostics to
buildInfo.diagnostics, persisting parse-time bailouts. (by @hai-x in #22055)Invalidate consumer codegen when an inlined export value changes. (by @xiaoxiaojx in #22020)
Rebuild DelegatedModule when DLL manifest metadata changes. (by @xiaoxiaojx in #22028)
Keep a CSS layer's blocks in order where one of them streams. (by @alexander-akait in #22044)
Refuse inlining const exports across sync cycles with binding reads. (by @xiaoxiaojx in #22085)
Escape a text run ending in
</, which the tag after it made a comment of. (by @aryanraj45 in #22086)Skip JS render sentinel scans on chunks without HTML. (by @xiaoxiaojx in #21974)
Minify an attribute by what its value says, not by how the source spelled it. (by @aryanraj45 in #22095)
Cut allocation and scanning in the CSS and HTML printers, output unchanged. (by @alexander-akait in #21997)
Emit less chunk-loading runtime. (by @alexander-akait in #22094)
Recognize the reflected attributes of
frame,frameset,marqueeanddir. (by @alexander-akait in #22003)Drop the
neo-asyncdependency in favor of a faster built-in async helper. (by @alexander-akait in #21959)Speed up cache serialization by cutting per-object lookups and call frames. (by @alexander-akait in #21994)
Update dependencies and match the
ReadFileSynctype to Node.js typings. (by @dependabot in #21919)Match acorn on
**arrows, LS/PS cooking, string export names,programreuse. (by @alexander-akait in #21666)Parse a regexp literal the running engine cannot build, and keep locations. (by @alexander-akait in #22009)
Parse without acorn, serialize parse-error locations, trim walker allocations. (by @alexander-akait in #21667)
Drop the
acorndependency in favor of webpack's own JavaScript parser. (by @alexander-akait in #22042)Name HTML chunks after their tags' urls, drop the JS copy, type
text/html. (by @alexander-akait in #22008)v5.110.3Compare Source
Patch Changes
Fix
import()options, circular reexport severity and namespace writes. (by @alexander-akait in #21867)Skip ESM interop when require() targets a module outside the concatenation. (by @hai-x in #21884)
Fix concatenated
require()in arequire.ensurecallback or a computed request. (by @hai-x in #21907)Keep
optimization.minimizea boolean; its options move tominimizeOptions. (by @alexander-akait in #21886)Fix mangled exports read through require() and a leaked internal reference. (by @alexander-akait in #21905)
Fix
newon a default import of a wrapped CommonJS module. (by @alexander-akait in #21876)Throw when a deferred namespace of an async module is forced while it evaluates. (by @alexander-akait in #21871)
Do not report a missing export for a name a side-effect-free barrel defers. (by @alexander-akait in #21874)
Fix queue, URL scheme, dotenv, HTTP module and persistent cache edge cases. (by @alexander-akait in #21901)
Evaluate a deferred import's async dependencies where the import sits. (by @alexander-akait in #21902)
Omit ambiguous
export *names from the module namespace. (by @alexander-akait in #21878)v5.110.2Compare Source
Patch Changes
Fix analyzable ESM baking around cycles, mixed-served wasm and style url maps. (by @alexander-akait in #21851)
Minify more HTML and CSS shorthands, and cut two costs off printing. (by @alexander-akait in #21842)
Report a named import that is never read when it names a missing export. (by @alexander-akait in #21856)
Fix ESM circular reexports, cyclic const TDZ, and defer evaluation order. (by @alexander-akait in #21852)
Stop
output.htmlemitting an unused JS chunk for each generated page. (by @alexander-akait in #21859)Stop emitting the CSS chunk loading runtime when every CSS chunk is initial. (by @alexander-akait in #21862)
Strip a BOM a loader put on a string, and shift a source map that counted it. (by @alexander-akait in #21857)
v5.110.1Compare Source
Patch Changes
Fix a capture-group-less
snapshot.managedPathsRegExp; speed up cache writes. (by @alexander-akait in #21843)Throw
SyntaxError, orWebAssembly.CompileError, from an unparsable module. (by @alexander-akait in #21847)Accept the
optimization.minimize: trueshorthand set by a plugin inapply(). (by @AgentEnder in #21845)v5.110.0Compare Source
Minor Changes
Wrap concatenated modules in lazy
__webpack_require__.cwaccessors and inlinerequire(), keeping a wrapped body's names and side effects intact. (by @hai-x in #21519)Add performance hints reporting what a build costs: duplicate packages and modules, circular dependencies, broad contexts, large modules and chunks, hotspots,
eval, missing PURE annotations, polyfills, redundant dynamic imports, OS-dependent rules, cache effectiveness, how chunks load, what splitting refused, why an optimization was skipped, and rules, defines, externals, aliases and barrel reexports nothing uses. An oversized asset names its largest modules, and an entrypoint carrying the runtime recommendsoptimization.runtimeChunk. Enable every check not set individually withperformance.all, report hints in stats only withperformance.hints: "stats", and get them in a stable order that leaves the build hashes unchanged. (by @alexander-akait in #21841)Add the
descriptionRelativePathmodule rule condition. (by @alexander-akait in #21705)Add OS-independent
globmatching to module rules. (by @alexander-akait in #21771)Report inner-graph, AMD and bare
modulebailouts inoptimizationBailout. (by @alexander-akait in #21740)Allow marking externals as side-effect-free with a
sideEffectsflag. (by @alexander-akait in #21712)Give externals the original request of a context module element. (by @alexander-akait in #21780)
Add the
externalsPresets.nodeModulespreset with anallowlistoption to externalize installed packages, replacing thewebpack-node-externalsplugin. (by @alexander-akait in #21569)Add
output.library.umdAmdContainerfor an AMD-style loader branch in UMD. (by @hai-x in #21770)Resolve
@custom-mediavalues that aretrue/falseor name another custom media. (by @alexander-akait in #21624)Add the
__webpack_css_server_styles__module variable to read the CSS collected while rendering without a DOM, and keep that CSS in the order the styles were applied. (by @alexander-akait in #21576)Patch the HTML
<head>in place on hot update instead of forcing a full reload, including when a<script>that never executed is removed. (by @alexander-akait in #21624)Scope counter names in CSS modules; fix the
counter()counter-style andanimationtimeline keywords. (by @alexander-akait in #21600)Derive
import defer/import sourcefrom the target and fix the source phase. (by @alexander-akait in #21810)Emit analyzable ESM urls for chunks, assets, styles, workers and wasm. (by @alexander-akait in #21788)
Tree shake CommonJS:
module.exportsobject literals, exports destructured from arequire()binding, unused method requires, and unused side-effect-freerequire()calls and reexports. (by @alexander-akait in #21841)Resolve relative entry
baseUrivalues and bake one side of a hash cycle. (by @alexander-akait in #21750)Minify CSS further, only where the document is unchanged: shorthands and box longhands,
font-weight,<position>andfont-stretchkeywords, colors (polar, Lab andhsl()converted to hex), numbers, times, zero units,calc()and every math function the spec names folded over constants, selector lists, An+B, keyframe selectors, media-feature ranges,unicode-range,transitionlayers,display, transforms, gradients, font families, identical repeated declarations, and rules an identical later one makes dead. Abilities are read off the target browsers,vendorPrefixesadds and drops vendor prefixes for them, andrewriteCustomPropertiesshortens custom property values. Minification never changes whether a declaration parses, and beautifying keeps every rule. (by @alexander-akait in #21841)Safely minify CSS (with source maps) and HTML assets when
optimization.minimizeis enabled, unless a minimizer is already configured for them, making only transformations an engine cannot tell apart. Every rewrite is named as an option, so it can be switched off. (by @alexander-akait in #21841)Minify HTML further where the parsed document is unchanged: drop redundant quotes, whitespace nothing renders, escapes text does not need, implied tags, optional end tags nothing prints behind, empty attributes and nested empty elements; fold enumerated values and casing; normalize each attribute against the element it is on; and rewrite
style, token lists,srcset,sizes, URL, integer and boolean attributes, viewportcontent, inline<style>and a JSON<script>body through their own grammars. Adds theoptimization.minimize.htmloptionscollapseWhitespace,mergeStyles,minifyConditionalComments,minifySrcdoc,preserveComments,removeEmptyAttributes,removeEmptyElements,removeImpliedTags,removeRedundantAttributes,sortAttributesandsortTokenLists, and keeps an end tag the parent, the next element or the adoption agency would otherwise restructure the tree over. (by @alexander-akait in #21841)Suggest the closest name or a casing fix anywhere in a failed request. (by @alexander-akait in #21727)
Add aggregated
shutdownhook toMultiCompiler. (by @bjohansebas in #21578)Report which compilers changed on the MultiCompiler
donehook. (by @bjohansebas in #21580)Add
[containedpath]/[containedfile]placeholders, used for[path]/[file]of asset and html modules withexperiments.futureDefaults. (by @alexander-akait in #21592)Support an object for an entry's
htmlthat overridesoutput.htmlper option. (by @alexander-akait in #21574)Configure or exclude each asset type's minifier via
optimization.minimize. (by @alexander-akait in #21663)Support printing CSS and HTML beautified as well as minified. (by @alexander-akait in #21660)
Add
renderEmbeddedSource, and minify what it offers out of the box. (by @alexander-akait in #21830)Report bindings named
eval,argumentsor reserved words in ES module output. (by @alexander-akait in #21567)Emit no development source map for module libraries, or any with futureDefaults. (by @alexander-akait in #21839)
Speed up builds and cut memory: faster CSS, HTML and JavaScript parsing and minification, a built-in scope analyzer replacing
eslint-scope, faster dependency hot paths, module diagnostics, CommonJS export scanning and concatenated module renaming, runtime modules, parsers, generators and dependencies loaded only when used, one file watcher pool shared between MultiCompiler children, and lower parser, graph and startup memory. (by @alexander-akait in #21841)Improve tree-shaking for a namespace reexported as default, and fix
import d from "./mod"; d.memberreadingundefinedin that case. (by @alexander-akait in #21841)Warn on cross-kind CSS module export conflicts and let the class win. (by @alexander-akait in #21538)
Add
output.resourceHints.dedupeto skip prefetch links for already preloaded/prefetched chunks. (by @alexander-akait in #21386)Patch Changes
Let a memory-cache etag mismatch fall through to the file cache instead of reporting a miss. (by @alexander-akait in #21624)
Determine provided exports in dependency order, so a build's module hashes no longer depend on what the persistent cache held. (by @alexander-akait in #21630)
Emit no dead module and no failing require for an
asset-urlexternal. (by @alexander-akait in #21713)Fix names, hidden devtools and cache reuse for CSS maps inlined into JS. (by @alexander-akait in #21558)
Follow the HTML spec more closely when parsing and printing: frameset content, quirks paragraphs and selects,
<![CDATA[outside foreign content as a bogus comment,<?target data?>as a processing instruction,</>dropped, comment data and DOCTYPE identifiers read from the tokenizer states, attributes merged from a repeated<html>/<body>tag, legacy JavaScript script types, voidkeygenand font format detection — and hand back the tree a parsed document was built from when printing it. (by @alexander-akait in #21841)Clear a
Watching'sblockedflag when its build starts, so it reports only a child actually waiting for its MultiCompiler parent. (by @bjohansebas in #21639)Fix AMD
define()output using the wrong module and exports argument names. (by @hai-x in #21814)Fix
ReferenceErrorfromimport.meta.mainusing the wrong module argument. (by @hai-x in #21620)Leave a
@namespaceURI alone instead of resolving and rewriting it as an asset. (by @alexander-akait in #21658)Resolve escaped CSS names, and scope a grid area cell name as one name. (by @alexander-akait in #21665)
Track exports usage of side-effect-free modules an active import() evaluates. (by @hai-x in #21623)
Resolve absolute symlink targets and treat an unreadable context as missing. (by @alexander-akait in #21647)
Fix corrupted icon URLs in a
.webmanifestwith a BOM or non-ASCII text. (by @alexander-akait in #21655)Respect
strictThisContextOnImportsforrequire()member calls. (by @hai-x in #21601)Fix
import.meta,[object Object]asset urls and crashes in build-time executed modules. (by @alexander-akait in #21841)Inherit sideEffects past a type-only nested package.json for files under node_modules. (by @xiaoxiaojx in #21686)
Do not fail directory creation when the file system reports it already exists. (by @alexander-akait in #21698)
Fix top-level
usingandawait usingdeclarations in modules. (by @alexander-akait in #21557)Fix
DefinePluginoptional chains reading an undefined object member. (by @lazerg in #21823)Fix MultiCompiler: compute the common
outputPathby whole path segments, run again after a dependency validation failure, and recover watch mode from a fatal child error without leaking watchings. (by @alexander-akait in #21841)Keep a nested bundle's runtime tables separate when bundling webpack output. (by @alexander-akait in #21568)
Keep the runtime out of strict mode when
output.globalObjectreadsthis. (by @alexander-akait in #21715)Run an even-priority
__webpack_require__.Ohandler without waiting. (by @alexander-akait in #21803)Treat top-level
thisin a classic worker entry as its global scope. (by @alexander-akait in #21720)Rehash runtime modules whose code changes under a content-named filename. (by @alexander-akait in #21828)
Fix namespace object reexports and string export names in module library output and emit a CommonJS entry's default as
export default. (by @alexander-akait in #21589)Keep tree-shaken JSON arrays as arrays when a prototype property is read. (by @hai-x in #21599)
Generate every CSS and HTML lookup table into
lib/{css,html}/data.jsfrommdn-data,color-nameand the spec IDL — including the value-type facts read out of the CSS value-definition grammars — leaving bothsyntax.jsfiles algorithm only. (by @alexander-akait in #21841)Support UNC paths in module and context replacement plugins. (by @avivkeller in #21645)
Emit less runtime code: shorter syntax where
output.environmentallows, no IIFE for aRuntimeModulewithout locals, no unread__webpack_esm_id__andexports.idchunk exports, and an ESM entry chunk installing its own modules from its local bindings instead of importing itself. (by @alexander-akait in #21841)Release the compilation and file system caches retained after
compiler.close(). (by @alexander-akait in #21603)v5.109.2Compare Source
Patch Changes
Resolve aliases pointing at a package directory whose name ends with
.jsagain. (by @alexander-akait in #21542)Name CSS sources in source maps by their resource path, without the
cssprefix. (by @bjohansebas in #21536)Delete no longer referenced files from the filesystem cache directory after storing the cache, age them by recorded time so restored caches are cleaned too, and collect every fully expired pack in one store instead of one per build. (by @bjohansebas in #21528)
Report
"universal"as the loader context target for the universal target. (by @alexander-akait in #21540)Skip
require().propin dead branches gated by inlined imported constants. (by @hai-x in #21517)Annotate configuration options and public hooks in the generated types with the
@sinceJSDoc tag. (by @bjohansebas in #21473)v5.109.1Compare Source
Patch Changes
Fix stray semicolon emitted before an imported call following a parenthesized sequence element. (by @alexander-akait in #21533)
Make
require(esm)module.exportsre-export analysis independent of module processing order. (by @alexander-akait in #21521)Ignore ERR_SERVER_NOT_RUNNING on lazy-compilation backend dispose so
compiler.close()succeeds on Bun. (by @alexander-akait in #21521)Name the failing key when DefinePlugin fails to evaluate a
typeofvalue. (by @alexander-akait in #21503)Improve Deno compatibility: guard
setNoDelayand force-close connections on lazy-compilation backend dispose, and return a realArrayBufferfrom the Node async/sync wasm loader soWebAssembly.instantiateaccepts it. (by @alexander-akait in #21524)Speed up the HTML parser and cut its peak memory: module-scope helpers/state and tokenizer callbacks, plus exact AST column pre-sizing. (by @alexander-akait in #21492)
Track CommonJS build dependencies by parsing sources when
require.cachechildren are unavailable (e.g. Bun). (by @alexander-akait in #21531)Cook common string-literal escapes on the JS parser fast path and own the tokenizer's cold-path readers. (by @alexander-akait in #21500)
Build the CSS
parseA*AST on the SoA store instead of node classes, cutting parse memory and time. (by @alexander-akait in #21498)Speed up and cut memory of the experimental CSS and HTML parsers: drop two derivable AST node columns, and scan long string, url, comment, and plaintext token bodies natively. (by @alexander-akait in #21504)
Speed up non-modules CSS parsing: skip redundant token re-reads, drop selector-prelude tokens without materializing nodes, allocate rule preludes lazily, and fast-path empty list seals. (by @alexander-akait in #21511)
Speed up stats generation and cut its peak memory: reuse cached sort comparators instead of thrashing the comparator caches on every sort, and drop redundant module-graph lookups and allocations in the extractors. (by @alexander-akait in #21506)
Speed up CSS parsing: byte-range function-name checks, indexed sibling lookahead. (by @bjohansebas in #21520)
Reduce allocations and redundant work across the code-generation, module-concatenation, exports/usage-analysis, hashing, and chunk-splitting hot paths. (by @alexander-akait in #21516)
Enable the Node.js compile cache in the webpack CLI entry point. (by @bjohansebas in #21523)
Encode the persistent cache with V8's value serializer. (by @avivkeller in #21514)
Speed up SplitChunksPlugin: reject non-subset chunk sets with 64-bit signatures, cache unnamed entry keys, and drop per-module closures. (by @avivkeller in #21529)
Initialize
NormalModule._astin the constructor so each instance keeps a single hidden-class shape. (by @alexander-akait in #21515)Reduce allocations in the binary serialization hot paths. (by @alexander-akait in #21526)
Deduplicate and simplify several lib modules and speed up AggressiveMergingPlugin. (by @alexander-akait in #21525)
Rename nested
const/let __webpack_require__and__webpack_exports__declarations in bundled webpack output. (by @hai-x in #21508)v5.109.0Compare Source
Minor Changes
Default
experiments.typescriptto"auto", enabling built-in TypeScript support on Node.js >= 22.6 when no TypeScript loader is registered. (by @alexander-akait in #21398)Default
experiments.css,experiments.htmlandexperiments.asyncWebAssemblyto"auto", enabling built-in support unless a loader is registered for those files; modules with inline or hook-injected loaders (e.g. html-webpack-plugin templates) keep being parsed as JavaScript. (by @alexander-akait in #21365)Add
output.resourceHintsto emit resource hints (preload/prefetch/modulepreload/preconnect), on by default for ESM output, plusmodule.parser.<type>.urlHints,css.fontPreloadandjavascript.dynamicImportCssPreload. (by @alexander-akait in #21408)Add built-in build progress via
infrastructureLogging.progress, plusestimatedTime,phaseTimings, progress barwidthandprogressBar: "auto"onProgressPlugin. (by @alexander-akait in #21352)Concatenate CommonJS modules with statically analyzable exports; opt out via
optimization.concatenateModules: { commonjs: false }. (by @alexander-akait in #21417)Wrap "weird" CommonJS modules into module concatenation instead of bailing out. (by @alexander-akait in #21436)
Add
output.html.inline(true | "script" | "style") and thewebpackInlinemagic comment to inline chunk content into HTML. (by @alexander-akait in #21260)Add
output.html.injectto control where chunk tags are injected. (by @alexander-akait in #21383)Add
output.html.title,output.html.metaandoutput.html.baseoptions for head generation. (by @alexander-akait in #21394)Support per-icon link attributes (
sizes,media,color,type,crossorigin) and arrays inoutput.html.favicon. (by @alexander-akait in #21487)Add
output.html.manifestto generate and link a web app manifest with hashed icons. (by @alexander-akait in #21487)Add
output.html.cspto inject a Content-Security-Policy meta with inline-content hashes and an optional nonce. (by @alexander-akait in #21487)Add the
output.htmlinjectTagscompilation hook to inject tags (script/link/meta/…) withinjectToplacement. (by @alexander-akait in #21487)Add the
output.htmltransformTagscompilation hook to mutate, remove, or move (between<head>and<body>) a page's existing<script>/<link>/<style>/<meta>tags. (by @alexander-akait in #21487)Extend the HTML pipeline with
htmllink sources (bundled as their own emitted page) andrel="preload"/"prefetch"links bundled as chunks. (by @alexander-akait in #21346)Recognize more asset-bearing HTML sources: the
twitter:player:streammeta, legacy SVG references, and Web App Manifesticons/screenshots/shortcutsURLs. (by @alexander-akait in #21355)Add
module.parser.html.asto parse HTML as a document or an element fragment. (by @alexander-akait in #21441)Allow disabling a built-in HTML parser source via
type: falseinsources. (by @alexander-akait in #21441)Export
webpack.html.HtmlModulesPluginwithtransformHtml/htmlEmittedcompilation hooks. (by @alexander-akait in #21487)Resolve
@custom-media(including media-type values) and@custom-selectorin native CSS. (by @alexander-akait in #21442)Scope
view-transition-name/-group/-classnames and::view-transition-*()pseudo references in CSS modules undercustomIdents. (by @alexander-akait in #21486)Add
import.meta.globsupport, with acaseSensitiveoption and consistent hidden/node_modulesmatching. (by @alexander-akait in #21385)Resolve
import.meta.resolve("./asset")to the emitted asset URL via theimportMeta.resolveparser option. (by @alexander-akait in #21415)Add
import.meta.envdefaults:MODE,DEV,PROD,SSRandBASE_URL. (by @alexander-akait in #21440)Add fine-grained
import.metaparser options. (by @alexander-akait in #21327)Deprecate the
importMetaContextparser option in favor ofimportMeta.webpackContext. (by @alexander-akait in #21360)Emit analyzable
new URL(…, import.meta.url), worker/worklet URL andimport()references with literal specifiers for ESM module output. (by @alexander-akait in #21194)Compile async modules to generators for targets without async/await. (by @alexander-akait in #21410)
Evaluate and validate the second argument of dynamic
import(specifier, options). (by @alexander-akait in #21446)Add
module.parser.javascript.workletto bundle WorkletaddModule()entries. (by @alexander-akait in #21384)Add
?raw,?url,?inlineand?no-inlineasset query suffixes underexperiments.futureDefaults. (by @alexander-akait in #21379)Add an
interop("default" | "esModule") hint for object externals to control default-export interop. (by @alexander-akait in #21371)Add an
amd-asyncexternals type that loads AMD externals without an AMD library wrapper. (by @alexander-akait in #21340)Support
cache.compression: "zstd"for the filesystem cache. (by @alexander-akait in #21438)Warn on strict-mode-only syntax and semantic hazards in ES module output, configurable via the
strictModeViolationsparser option. (by @alexander-akait in #21387)Support parsers without location APIs: locations derive from node offsets and AST nodes no longer carry
loc. (by @alexander-akait in #21451)Attach the original DOM event to
ChunkLoadErrorandScriptExternalLoadErroraserror.event. (by @alexander-akait in #21388)Add
output.wasmStreamingFallbackfor wasm fallback on a wrong MIME type. (by @alexander-akait in #21299)Show why a module was marked as not cacheable in stats output. (by @alexander-akait in #21403)
Expose the active
MultiWatchingonMultiCompiler.watching. (by @alexander-akait in #21469)Resolve git merge conflicts when parsing the build-http lockfile. (by @alexander-akait in #21397)
Patch Changes
Fix broken HMR with
output.moduleand non-importchunk loading by emitting a plain-JSON hot-update manifest. (by @alexander-akait in #21460)Fix unused CSS module exports leaking into the JS wrapper. (by @alexander-akait in #21301)
Fix deferred import evaluation: re-throw cached errors, guard forcing a still-evaluating module, keep re-exported deferred namespaces identical, and evaluate initial-chunk deferred context imports lazily. (by @alexander-akait in #21446)
Keep ESM live bindings for a module library's entry exports, including when the runtime is emitted as a separate chunk. (by @alexander-akait in #21349)
Fix SplitChunks merging undersized modules into the wrong result group. (by @alexander-akait in #21356)
Fix named id assignment reusing an already-used numbered suffix, which could produce duplicate module/chunk ids. (by @alexander-akait in #21406)
Fix inlined non-binary asset modules with
encoding: falseemitting "undefined" instead of their content. (by @alexander-akait in #21406)Decode non-base64 data URIs as UTF-8 so multi-byte characters are preserved. (by @alexander-akait in #21366)
Keep required JSON data intact when a prototype method (e.g.
arr.includes()) is called on it. (by @alexander-akait in #21433)Recognize modern RegExp flags (
d,s,u,v) when statically evaluatingnew RegExp(...). (by @alexander-akait in #21366)Merge object-form and dotted DefinePlugin definitions so
import.meta.env/process.envare consistent across direct, whole-object and destructured access. (by @alexander-akait in #21419)Emit an error when an object external has no entry for the used externals type. (by @alexander-akait in #21340)
Fix a persistent cache restore crash when a content section starts exactly on a content-buffer boundary. (by @alexander-akait in #21406)
Restore missing
internalSerializablesentries (webpack/lib/Module and cold filesystem cache). (by @alexander-akait in #21391)Fix watch rebuild crash when context symlink targets lack
timestampHash. (by @alexander-akait in #21381)Fix lazy compilation backend leaking idle module entries and hanging on exit. (by @alexander-akait in #21468)
Stop logging benign ECONNRESET client errors from the lazy compilation server. (by @alexander-akait in #21406)
Accept compilations from another webpack copy in
getCompilationHooksagain. (by @alexander-akait in #21407)Fix
output.htmlinjection edge cases: escaping, head detection, duplicate meta tags, resource-hint/entry-tag retention withinject: false, and stylesheet placement. (by @alexander-akait in #21416)Ignore a
<base>inside an inert<template>when resolving HTML URLs. (by @alexander-akait in #21441)Bust an HTML page's
[contenthash]when its inlined chunk content changes. (by @alexander-akait in #21441)Fix a dangling stylesheet
<link>for a JS-only chunk in an HTML entry. (by @alexander-akait in #21441)Fix a malformed HTML magic comment leaking a pending
webpackInlinedirective onto the next element. (by @alexander-akait in #21406)Fix off-by-one dropping the last character of an unterminated
url(...)at end-of-input. (by @alexander-akait in #21406)Consume the trailing whitespace of a CSS hex escape when unescaping identifiers. (by @alexander-akait in #21366)
Fix
[fullhash]inoutput.webassemblyModuleFilenameby dropping a stray brace and requesting thegetFullHashruntime module. (by @alexander-akait in #21406)Fix duplicated errors/warnings in stats output when detail-less entries exceed
errorsSpace/warningsSpace. (by @alexander-akait in #21406)Improve module parse errors with a babel-style code frame and the module type. (by @alexander-akait in #21485)
Fix
formatSizerendering sizes of 1 TiB or larger as "undefined". (by @alexander-akait in #21366)Skip the anonymous default export
.namefix-up whennameis non-configurable, instead of throwing on pre-ES2015 engines. (by @alexander-akait in #21370)Escape
?and#in context module regexp identifiers so source map names are not truncated. (by @alexander-akait in #21422)Resolve directory requests to their index module in scoped
DllReferencePlugin. (by @alexander-akait in #21437)Skip the
hasSymbolcheck in the async module runtime whenenvironment.symbolis set. (by @alexander-akait in #21423)Use a shared
__webpack_require__.cjshelper for wrapped CommonJS modules. (by @alexander-akait in #21464)Derive ASI positions from source text instead of acorn's
onInsertedSemicolon, so custom parsers need not collect semicolons. (by @alexander-akait in #21453)Avoid a second full parse for
autosource type by downgrading module to script in place on a top-level return. (by @alexander-akait in #21455)Fix exponential-time side-effects analysis on cyclic module graphs by memoizing cycle-free results via Tarjan lowlink. (by @alexander-akait in #21373)
Speed up JavaScript parsing and AST walking and reduce parser memory usage. (by @alexander-akait in #21373)
Speed up CSS and HTML parsing and code generation and reduce parser memory usage. (by @alexander-akait in #21332)
Speed up snapshot creation and reduce its memory usage. (by @alexander-akait in #21401)
Reduce allocations in JS codegen, concatenation, queues and parser setup. (by @alexander-akait in #21341)
Speed up stats generation on large builds by reusing the item context across array items. (by @alexander-akait in #21425)
Memoize loader resolution per compilation to avoid re-resolving the same loader for every matching module. (by @alexander-akait in #21435)
Reuse and harden webpack's shared resource parser in the loader runner. (by @alexander-akait in #21392)
Update webpack-sources to 3.5.1 and enhanced-resolve to 5.24.2 to cut peak memory. (by @alexander-akait in #21344)
Inline the loader-runner package into core. (by @alexander-akait in #21249)
Fix context hash crash on unsupported directory entries like FIFOs and sockets. (by @hai-x in #21484)
Verify internalSerializables in lint:special and regenerate it in fix:special. (by @alexander-akait in #21476)
v5.108.4Compare Source
Patch Changes
Speed up non-CSS-Modules parsing by not building unused selector AST nodes. (by @alexander-akait in #21324)
Speed up non-CSS-Modules CSS parsing by dropping value tokens nothing reads. (by @alexander-akait in #21324)
Resolve HTML asset URLs against the document
<base href>. (by @alexander-akait in #21329)Add HTML integration tests: generateError output, ignored src, null-char parse. (by @aryanraj45 in #21328)
Reduce CPU and memory overhead of HTML and CSS parsing and code generation. (by @alexander-akait in #21332)
Reduce HTML parser memory and CPU by skipping unused AST nodes. (by @alexander-akait in #21323)
Reduce HTML parser memory by storing the AST in struct-of-arrays form. (by @alexander-akait in #21331)
Key the provided-exports cache on a lazy barrel's still-lazy re-export targets. (by @hai-x in #21326)
Default
output.globalObjecttoglobalThisfor universal targets. (by @alexander-akait in #21314)Pass through
new URL(...)directory references instead of resolving them. (by @alexander-akait in #21312)v5.108.3Compare Source
Patch Changes
Speed up CSS parsing and reduce CSS AST node memory. (by @alexander-akait in #21285)
Fix HMR codegen crash for harmony accept with unresolved imports. (by @xiaoxiaojx in #21302)
Match harmony accept dependencies by module reference so HMR codegen handles imports without a module or chunk id. (by @alexander-akait in #21303)
v5.108.2Compare Source
Patch Changes
Fix lazy barrel deferral of ungrouped side-effect imports. (by @hai-x in #21291)
Respect the
node:prefix for node.js core modules used as externals. (by @alexander-akait in #21286)v5.108.1Compare Source
Patch Changes
Fix invalid property access for escaped namespace imports with multi-character mangled export names. (by @xiaoxiaojx in #21280)
Add frames to ProfilingPlugin TracingStartedInBrowser event so the trace loads in Chrome DevTools. (by @alexander-akait in #21269)
v5.108.0Compare Source
Minor Changes
Treat top-level await and
import.metaas ES module markers, matching Node.js syntax detection so no explicit module type is needed. (by @alexander-akait in #21218)Add a
buntarget that emits ESM and externalizesbun:*and node.js built-in modules. (by @alexander-akait in #21248)Support CommonJS reexports via
Object.definePropertyvalue and getter descriptors. (by @alexander-akait in #21129)Support JSON Schema
constwhen generating CLI flags from a schema. (by @alexander-akait in #21087)Support JSON Schema
if/then/elsewhen generating CLI flags from a schema. (by @alexander-akait in #21087)Skip import specifiers,
require()andimport()calls in dead conditional branches gated by inlined imported constants (isDEV ? A : B), evaluated viagetCondition. (by @hai-x in #21136)CSS
localIdentName[hash]now resolves to the local ident hash (matching css-loader); use[modulehash]for the module hash. (by @alexander-akait in #21259)Add CSS parser
asoption and resolveurl()inside HTMLstyleattributes. (by @alexander-akait in #21157)Add dedicated module classes for all built-in module types. (by @alexander-akait in #21164)
Support
.html/.cssfor the default./srcentry under the html/css experiments. (by @alexander-akait in #21039)Add
defineConfighelper for typed configuration files. (by @alexander-akait in #21169)Add a
denotarget (with versions, e.g.deno,deno2,deno1.40) that emits ESM, resolves node.js built-ins via the requirednode:specifier, and keeps Deno's own import protocols (npm:,jsr:,node:,http(s)://) external. (by @alexander-akait in #21247)Use
module-importfor electron externals when the target supports ESM. (by @alexander-akait in #21184)Add
output.environment.logicalAssignmentto emit||=in runtime code when the target supports logical assignment operators. (by @bjohansebas in #21219)Resolve and rewrite asset URLs inside
<iframe srcdoc>in HTML modules. (by @bjohansebas in #21226)Add HMR support for HTML modules with body/title DOM patching on update. (by @alexander-akait in #21011)
Add
css-urlhtml source type extractingurl()references from CSS-valued attributes. (by @alexander-akait in #21250)Add
module.parser.html.sourcesoption to disable or customize URL-attribute extraction for HTML modules, withscript/script-module/stylesheet/stylesheet-inlinetypes for custom attributes (by @alexander-akait in #21022)Add
module.parser.html.templateoption to transform HTML module source before parsing. (by @alexander-akait in #21055)Extract more source URLs in HTML modules (SVG, legacy and obsolete attributes). (by @alexander-akait in #21241)
Inline
export default <const>when the default-exported value is a primitive constant. (by @hai-x in #21189)Support
optimization.inlineExportsfor better tree-shaking. (by @hai-x in #20973)Re-encode inline hash digests (
[contenthash]/[chunkhash]/[fullhash]/[modulehash]) from the full content hash, so they carry full entropy and work underoptimization.realContentHashand in dynamically-loaded chunk filenames; also preserve leading zero bytes in base-N digests. (by @alexander-akait in #21267)Allow tree-shaking unused calls to
/*#__NO_SIDE_EFFECTS__*/-annotated (pure) exports across module boundaries. (by @hai-x in #20907)Defer building unused re-export targets of side-effect-free barrel modules. (by @hai-x in #21165)
Keep export mangling enabled for modules whose namespace object is used as a whole value, by materializing a decoupled namespace object that keeps the original export names. (by @alexander-akait in #21234)
Add
output.environment.letoption (paired with target'sletcapability) and emitlet/constinstead ofvarin generated runtime code wherever it is safe. Bindings that may be wrapped in runtime-conditionifblocks (harmony imports, ConcatenatedModule external imports) continue to usevarto preserve function scoping. (by @alexander-akait in #21010)Add
output.htmlto emit an HTML file per entrypoint, injecting its JS/CSS chunks (includingdependOnshared chunks). (by @alexander-akait in #21215)Add
module.parser.javascript.pureFunctionsto mark top-level names as side-effect-free for tree shaking. (by @hai-x in #21063)Add
universaltocompiler.platform, true for universal targets ("universal"or["web", "node"]). (by @bjohansebas in #21252)Add
output.strictModuleResolutionto gate the runtimeMODULE_NOT_FOUNDguard. (by @hai-x in #21067)Support an inline digest in hash path placeholders, e.g.
[contenthash:base64:8]. (by @alexander-akait in #21259)Support
[uniqueName]and its[uniquename]alias in template paths. (by @alexander-akait in #21155)Support CSS in Node for universal targets, collecting styles for SSR. (by @alexander-akait in #21208)
Improve commonjs, node-commonjs and global externals for universal targets. (by @alexander-akait in #21187)
Add a
universaltarget preset (browser + web worker + Node.js + Electron + NW.js) that always outputs ECMAScript modules. (by @alexander-akait in #21214)Support
new Worker(new URL(...))in universal (node + web) targets by resolving the Worker constructor fromworker_threadswhen no globalWorkerexists. (by @alexander-akait in #21195)Add
output.workerChunkFilenameandentry.workerfor worker chunk filenames. (by @alexander-akait in #21128)Patch Changes
Skip re-parsing the inlined entry module when no renaming is needed. (by @alexander-akait in #21167)
Extend the avoidEntryIife no-parse fast path to multi-entry chunks. (by @alexander-akait in #21173)
Reuse the binary deserialize dispatch table to speed up cache restore. (by @alexander-akait in #21175)
Type
buildInfoandbuildMetaper module type with shared common properties. (by @alexander-akait in #21172)Avoid copying module runtime requirements when ownership is not transferred. (by @alexander-akait in #21140)
Keep all CommonJS exports when an exported function accesses them via
this. (by @alexander-akait in #21179)Align CLI color-support detection across Node, Deno and Bun. (by @alexander-akait in #21257)
Include the schema origin path in conflicting-schema CLI argument errors. (by @alexander-akait in #21087)
Reject
__proto__,constructorandprototypepath segments incli.processArgumentsto prevent prototype pollution. (by @alexander-akait in #21057)Speed up
Compilation.deleteAssetandCompilation.renameAssetvia a lazy reverse index from asset file name to containing chunks. (by @alexander-akait in #21035)Fix merging of inner modules' top-level declarations in concatenated modules. (by @alexander-akait in #21170)
Reduce allocations in export hashing and concatenation name lookups. (by @alexander-akait in #21167)
Avoid toLowerCase allocations in CSS keyword comparisons. (by @alexander-akait in #21109)
Speed up CSS identifier escaping with a char-class lookup table. (by @alexander-akait in #21109)
Resolve
[fullhash]inurl()public paths for inlined CSS export types (style/text/css-style-sheet) at runtime. (by @alexander-akait in #21054)Avoid quadratic line scan when building CSS module exports source maps. (by @alexander-akait in #21109)
Compute CSS comment source locations lazily. (by @alexander-akait in #21109)
Support inline hash digest and length in CSS module
localIdentNameplaceholders. (by @alexander-akait in #21259)Resolve full CSS escapes (including hex) in CSS-Modules names, so e.g.
\75 rl()matchesurl(). (by @alexander-akait in #21196)Reduce CSS parser CPU (hoisted per-call regexes, byte-compared
@containerpure-mode keywords) and stop retaining parsed comments on the reused parser instance between modules. (by @alexander-akait in #21202)Reduce CSS build time and memory usage. Per-export CSS dependencies are consolidated into one dependency per module, and hot-path allocations and lookups in CSS code generation and the module-graph cache are trimmed. (by @alexander-akait in #21114)
Cache CSS public-path placeholder offsets per module source to avoid re-materializing and re-scanning the source on every render. (by @alexander-akait in #21054)
Fix CSS tokenizer infinite loops and dropped tokens on malformed input. (by @alexander-akait in #21102)
Speed up CSS identifier unescaping with bulk run flushing. (by @alexander-akait in #21109)
Skip already-visited symlink targets when resolving context hashes so cyclic symlink graphs no longer overflow the queue. (by @alexander-akait in #21088)
Resolve
DefinePluginaccess to an undefined object member asundefined. (by @alexander-akait in #21040)Avoid materializing dependency source locations when sorting, keeping them lazy to reduce build time and memory. (by @alexander-akait in #21228)
Speed up serialization deserialize by replacing a Buffer.isBuffer call with a typeof check. (by @hai-x in #21203)
Emit assets with absolute target paths as-is to avoid invalid Windows paths. (by @alexander-akait in #21223)
Add
output.environment.spread,output.environment.hasOwn, andoutput.environment.symbol, and use method shorthand, spread,Object.hasOwn, and an unguardedSymbolin generated runtime code where the environment supports it. (by @alexander-akait in #21188)Drop the unused loadScript runtime from ESM hot-update bundles. (by @alexander-akait in #21208)
Extend value binding optimization to export default expressions. (by @xiaoxiaojx in #21117)
Reduce ExportInfo memory and cache size for inline-exports metadata. (by @alexander-akait in #21171)
Resolve nested exports info paths iteratively to cut per-level array allocations. (by @alexander-akait in #21137)
Fix stale incremental cache for css, html and asset/source/inline modules. (by @alexander-akait in #21108)
CommonJS tree-shaking no longer drops exports accessed before a deferred require binding. (by @xiaoxiaojx in #21123)
Make CSS-referenced asset available in lazy JS chunk during incremental rebuilds. (by @alexander-akait in #21100)
Correct string/template import specifier parsing for filesystem cache build dependencies and fix module-sharing hostname validation. (by @alexander-akait in #21232)
perf: guard isDeferred() behind experiments.deferImport in ConcatenatedModule (by @shashank-u03 in #21096)
Speed up deterministicGrouping and cached comparators on large builds. (by @alexander-akait in #21197)
Reduce allocations on harmony/commonjs dependency hot paths. (by @alexander-akait in #21180)
Force-load a module's new owning chunk during HMR when its only loaded chunk is removed from a runtime, so it keeps receiving updates. (by @alexander-akait in #21131)
Fix HTML parser adoption agency to handle a
nobrshielded by a marker. (by @alexander-akait in #21274)Expand HTML parser tag/attribute coverage and decode character references. (by @alexander-akait in #21159)
Speed up and reduce allocations in the experimental HTML parser's tokenizer, tree builder, and entity decoder. (by @alexander-akait in #21152)
Speed up the experimental HTML parser and reduce its memory usage. (by @alexander-akait in #21130)
Avoid redundant HTML module work: reuse the dependency-template render across the JS and HTML code-generation passes, and memoize sentinel resolution/content hashing per source. (by @alexander-akait in #21054)
Release inner-graph state after use and speed up inlined-export checks. (by @alexander-akait in #21167)
Reduce JavascriptParser allocations on the walk hot path to speed up parsing and lower memory usage. (by @alexander-akait in #21139)
Reduce CPU and memory overhead of the lazy barrel optimization. (by @alexander-akait in #21213)
Keep the error message in module build errors on engines whose
Error.stackomits it. (by @alexander-akait in #21239)Speed up module concatenation by caching repeated per-module computations. (by @alexander-akait in #21115)
Move the
hotflag fromModuletoNormalModule, where it's actually read and written. (by @alexander-akait in #21028)Move the
weakflag fromDependencytoModuleDependency, where it's actually set. (by @alexander-akait in #21111)Avoid the entry IIFE for multiple inlined entry modules by renaming collisions. (by @alexander-akait in #21151)
Reject
new import.defer(...)/new import.source(...)with member access as a SyntaxError. (by @alexander-akait in #21211)Avoid
ProvidePlugininjection for local CommonJS require bindings that use the same variable name. (by @fireairforce in #21041)Resolve the global
new Worker(new URL(...))toworker_threadson thenodetarget. (by @alexander-akait in #21217)Use optional chaining in generated runtime code where the environment supports it. (by @alexander-akait in #21186)
Allow output.path to be the filesystem root by treating EISDIR like EEXIST in mkdirp. (by @alexander-akait in #21223)
Reduce memory by not retaining the source location object on every dependency. (by @alexander-akait in #21183)
Keep the full exports object when a
require()binding is re-exported. (by @alexander-akait in #21144)Replace glob-to-regexp dependency with watchpack's globToRegExp utility. (by @hai-x in #21176)
Shrink the persistent cache: add a NULL_AND_I16 binary tier and inline tiny strings instead of larger far back-references. (by @hai-x in #21210)
Type serializer read/write contexts with positional tuples and fix a ProvideSharedDependency version/request swap. (by @alexander-akait in #21201)
Speed up buildChunkGraph by deriving block modules from the first runtime. (by @alexander-akait in #21166)
Cache re-export target resolution in SideEffectsFlagPlugin for faster builds. (by @alexander-akait in #21085)
Skip pure single-star passthrough modules for
export *re-exports. (by @alexander-akait in #21085)Skip dependency error/warning reporting for unchanged modules on rebuilds. (by @alexander-akait in #21154)
Use value descriptors instead of getters for const export bindings. (by @xiaoxiaojx in #21021)
Apply CSS hot updates on the Node side of a universal target. (by @alexander-akait in #21217)
Guard CSS
styleexport-type injection so it no-ops when there is nodocument. (by @alexander-akait in #21193)Avoid building warning stats objects when counting warnings without a filter. (by @alexander-akait in #21198)
Recognize forward-slash Windows absolute paths (e.g. C:/dir) consistently. (by @alexander-akait in #21223)
v5.107.2Compare Source
Patch Changes
Reduce per-file overhead in
ContextModuleFactory.resolveDependenciesby batchingalternativeRequestshook calls. Previously the hook was invoked once per file in the context (with a single-item array), paying per-call overhead (closure allocation,resolverFactory.get, intermediate arrays inRequireContextPlugin) for every file. The hook is now invoked once per directory with all matched files in one batch —RequireContextPlugin's tap already iterates the items array, so the output is unchanged. Steady-state rebuild on a 4000-filerequire.contextdrops a further ~15 ms (after the watch-mode purge fix in the same release). (by @alexander-akait in #21020)Include each external info's
runtimeConditioninConcatenatedModule#updateHashso changes to a concatenated external's runtime condition invalidate persistent caches instead of slipping through with the module id alone. (by @alexander-akait in #21023)Fix HTML
[contenthash]for referenced asset and inline-style URL changes. (by @alexander-akait in #21018)Resolve chunk-hash placeholders in chunk URLs embedded into extracted HTML. (by @alexander-akait in #21018)
Remove unnecessary
__webpack_require__runtime helpers in ESM library output with multi-module chunks. (by @xiaoxiaojx in #21032)Rewrite
NormalModule#getSideEffectsConnectionStatewalk as an allocation-light iterative loop instead of a generator trampoline, restoring rebuild performance lost in #20993 while keeping deep import chains stack-safe. (by @alexander-akait in #21014)Fix runtime
ReferenceErroron the first activation of a lazy-compiled module whenoutput.library.typeproduces a closure-wrapped bundle (umd,umd2,amd,amd-require,system). (by @alexander-akait in #21013)External modules of these types reference closure-bound identifiers like
__WEBPACK_EXTERNAL_MODULE_react__, supplied by the library wrapper that is generated once per chunk. WhenlazyCompilationactivates an entry or import for the first time, any external dependency the lazily-built module pulls in arrives in a hot-update chunk that lives outside the original wrapper closure, so its factory body cannot resolve the closure identifier and only a manual page refresh recovers.The inactive
LazyCompilationProxyModulenow declares statically-enumerable externals (string and object forms ofexternals) as its own dependencies, so the initial entry chunk's library wrapper already exposes their closure identifiers. When activation later pulls in those externals through the lazily-compiled module, they resolve to the already-installed factories instead of throwing. Function and RegExp externals are not pre-populated because their effective request set isn't knowable up front.Fill in missing
entryOptionswhen an async block joins an existing entrypoint. (by @alexander-akait in #21026)Release per-child
codeGenerationResultsinMultiCompilerand atCompiler.closeto reduce memory retention. (by @alexander-akait in #21015)Reduce peak memory of
SourceMapDevToolPluginon large builds (closes #20961). (by @alexander-akait in #20963)Fix slow
require.context()/ dynamicimport()rebuilds in watch mode (#13636). When a file inside a watched context directory changed,NodeWatchFileSystemwould callinputFileSystem.purge(contextDir). The enhanced-resolvepurgeimplementation matches cache keys withkey.startsWith(contextDir), so the stat cache of every file under the directory was discarded on every rebuild —ContextModuleFactory.resolveDependenciesthen re-stat-ed the whole tree on each rebuild. Single-file rebuilds on a 4000-file context now reuse the warm stat cache, dropping median rebuild from ~1260 ms to ~650 ms in a local reproduction (≈49%). For directory items that are explicitly watched contexts,purgeis now called with{ exact: true }(added inenhanced-resolve@5.22.0) so only the directory's own entry is invalidated; file-level changes in the same aggregated event continue to purge file stats and the parentreaddiras before. (by @alexander-akait in #21020)v5.107.1Compare Source
Patch Changes
Align the experimental HTML tokenizer with the WHATWG spec: fix offset-range bugs in the script-data, content-mode end-tag, attribute-value, and EOF states; surface tokenizer parse errors to consumers via a new
parseErrorcallback ("warning"when the tokenizer recovers and the emitted token is still well-formed,"error"when the offset range is incomplete — e.g.eof-in-tag); and add the full WHATWG named character references table sodecodeHtmlEntitieshandles all named entities (including legacy bare forms like&and multi-code-point entities like≂̸) with proper longest-prefix backtracking. (by @alexander-akait in #21000)Tree-shake CommonJS modules imported through a
const NAME = require(LITERAL)binding when only static members ofNAMEare read. Previously webpack treated every export of such modules as referenced (because the barerequire()dependency reportsEXPORTS_OBJECT_REFERENCED), so unusedexports.x = ...assignments remained in the bundle even withusedExportsenabled. The parser now forwardsNAME.x/NAME.x()/NAME["x"]accesses to the underlyingCommonJsRequireDependencyas referenced exports, falling back to the full exports object the momentNAMEis read in any other context (passed by value, destructured later, accessed with a dynamic key, …). This brings the binding form to parity with the existing destructuring form (const { x } = require(...)). (by @alexander-akait in #21003)Fix
RangeError: Maximum call stack size exceededthrown fromHarmonyImportSideEffectDependency.getModuleEvaluationSideEffectsStateon long linear chains of side-effect-free imports.NormalModule.getSideEffectsConnectionStatepreviously descended throughHarmonyImportSideEffectDependency.getModuleEvaluationSideEffectsStaterecursively, adding two stack frames per module, which overflowed V8's stack at a few thousand modules deep. The traversal is now iterative. (by @alexander-akait in #20993)Fix
NormalModuleFactoryparser/generator types: (by @alexander-akait in #20999)module.generator.htmlnow usesHtmlGeneratorOptionsinstead ofEmptyGeneratorOptions(theextractoption was hidden from thecreateGenerator/generatorhook types).webassembly/async,webassembly/sync) generator hooks now useEmptyGeneratorOptionsinstead ofEmptyParserOptions.NormalModuleFactory#getParser/createParser/getGenerator/createGeneratorare now generic over the module-type string, returning the specific parser/generator class for known types (e.g.JavascriptParserfor"javascript/auto",CssGeneratorfor"css", etc.) instead of always returning the baseParser/Generator.NormalModuleCreateDatais now generic over the module type soparser,parserOptions,generator, andgeneratorOptionsare narrowed to the specific class / options for the giventype.Link import bindings used inside
define(...)callbacks in ES modules. Previously,HarmonyDetectionParserPluginskipped walking the arguments ofdefinecalls in harmony modules, so references to imported bindings inside an inline AMDdefinefactory (e.g.define(function () { console.log(foo); })) were not rewritten to their imported references and could causeReferenceErrorat runtime. Inner graph usage analysis is also fixed for the related patternconst fn = function () { foo; }; define(fn);. (by @alexander-akait in #20990)HTML-entry pipeline (
experiments.html+experiments.css): emit<link rel="stylesheet">tags for CSS chunks reachable from a<script src>entry. Previously when the bundled JS imported CSS, the resulting.cssfile was emitted to disk but never referenced from the extracted HTML (no<link>tag), and whensplitChunksextracted CSS into sibling chunks the HTML cloned the originating<script>for each one — producing<script src="style.js">pointing at non-existent JS filenames instead of<link rel="stylesheet" href="style.css">. CSS chunks are now sorted by the entrypoint's module post-order index so the<link>tags also appear in source import order, fixing the cascade ordering issue documented inhtml-webpack-plugin#1838andwebpack/mini-css-extract-plugin#959for HTML-entry builds.nonce/crossorigin/referrerpolicyare copied from the originating tag onto the emitted<link>. (by @alexander-akait in #21002)Allow
devtoolandSourceMapDevToolPlugin(or multipleSourceMapDevToolPlugininstances) to coexist on the same asset. Previously the second instance would silently skip any asset whoseinfo.related.sourceMaphad already been set by an earlier instance, and even when it ran the asset had been rewrapped as aRawSourceso no source map could be recovered — producing an empty.mapfile. The plugin now keeps a per-compilation stash of pristine source maps, namespaces its persistent cache entries by the options that affect output, and appends additionalrelated.sourceMapentries instead of overwriting them. The classic workaround of pairingdevtool: 'hidden-source-map'with anew webpack.SourceMapDevToolPlugin({ filename: '[file].secondary.map', noSources: true })now produces both maps in a single build. (by @alexander-akait in #21001)Narrow
TemplatePathFncallback types by context.pathData.chunkis now non-optional for chunk filename callbacks (output.filename,chunkFilename,cssFilename,cssChunkFilename,htmlFilename,htmlChunkFilename,optimization.splitChunks.cacheGroups[*].filename), andpathData.moduleis non-optional for module filename callbacks (output.assetModuleFilename, per-modulegenerator.filename/generator.outputPath,module.parser.css.localIdentName). (by @alexander-akait in #20987)Tighten the
CreateDatatypedef inNormalModuleFactory.CreateDatanow represents the fully-populated value passed to thecreateModule,module, andcreateModuleClasshooks (NormalModuleCreateData & { settings: ModuleSettings }), whileResolveData.createDatais typed asPartial<CreateData>to reflect the empty initial state. Plugins tapping those hooks no longer need to cast individual fields away from optional. (by @alexander-akait in #20992)Stop
webpackPrefetch/webpackPreloadmagic comments from leaking acrossimport()call sites that share awebpackChunkName. When two imports targeted the same named chunk and only one of them setwebpackPrefetch: true, the prefetch directive was applied from every parent chunk that referenced the named chunk. Prefetch and preload orders are now resolved perimport()call site instead of from the shared chunk group's accumulated options. (by @alexander-akait in #20994)Fix
[fullhash:N]and[hash:N](with length suffix) inoutput.publicPathnot being interpolated at runtime. The detection regex inRuntimePluginonly matched[fullhash]/[hash]without a length suffix, so thePublicPathRuntimeModulewas not flagged as a full-hash module and__webpack_require__.pwas emitted with the placeholderXXXXleft in place (e.g.out/XXXX/) instead of the real hash truncated to the requested length. (by @alexander-akait in #21004)Re-export
ModuleNotFoundErrorfromwebpack/lib/ModuleNotFoundErrorfor backward compatibility with old plugins that import it from that path. This re-export will be removed in webpack 6. (by @alexander-akait in #20988)v5.107.0Compare Source
Minor Changes
Add
module.generator.javascript.anonymousDefaultExportNameoption to control whether webpack sets.nameto"default"for anonymous default export functions and classes per ES spec. Defaults totruefor applications andfalsefor libraries (whenoutput.libraryis set) to avoid unnecessary bundle size overhead. Also extract anonymous default export.namefix-up into a shared runtime helper (__webpack_require__.dn), replacing repeated inlineObject.defineProperty/Object.getOwnPropertyDescriptorcalls with a single short call per module to reduce output size. (by @xiaoxiaojx in #20894)Support module concatenation (scope hoisting) for CSS modules with
text,css-style-sheet,style, andlinkexport types (by @xiaoxiaojx in #20851)The
generator.exportsConventionfunction form for CSS modules now acceptsstring[]in addition tostring. (by @alexander-akait in #20914)Add
linkInserthook toCssLoadingRuntimeModule.getCompilationHooks(compilation)so plugin developers can control where stylesheet<link>elements are inserted into the document. (by @alexander-akait in #20947)Add
CssModulesPlugin.getCompilationHooks(compilation).orderModuleshook. (by @alexander-akait in #20978)Add a
pureparser option forcss/moduleandcss/autotypes matchingpostcss-modules-local-by-default's pure mode: every selector must contain at least one local class or id, otherwise webpack emits a build error. (by @alexander-akait in #20946)Support CSS Modules
@valueidentifiers as@importURLs and insideurl()functions, e.g.@value path: "./other.css"; @import path;and@value bg: "./image.png"; .a { background: url(bg); }(by @alexander-akait in #20925)Add experimental TypeScript support via
experiments.typescript: true(auto-enabled byexperiments.futureDefaults). Uses Node.js's built-inmodule.stripTypeScriptTypes(Node.js >= 22.6 with the stablemode: "strip"API, including Node.js 26) to transform.ts,.cts,.mts,data:text/typescript, anddata:application/typescriptmodules — no type checking, only erasable TypeScript (types, generics,import type, casts)..tsx/JSX and non-erasable syntax (enum,namespace, parameter-property constructors, decorator metadata) are NOT supported; use a TSX-capable loader (e.g.ts-loader,swc-loader) for those. (by @alexander-akait in #20964)Added an
experiments.htmlflag that reserves thehtmlmodule type for the first-class HTML entry-point support. (by @aryanraj45 in #20902)Preserve
defer/sourceimport phase keywords on external dependencies in ESM output, the same way import attributes are preserved. (by @alexander-akait in #20934)Support the
#__NO_SIDE_EFFECTS__annotation to mark functions as pure for better tree-shaking. (by @hai-x in #20775)Add
module.generator.html.extractfor HTML modules and the matchingoutput.htmlFilename/output.htmlChunkFilenamefilename templates (defaults derived fromoutput.filename/output.chunkFilenamewith.jsswapped for.html, mirroring the CSS pipeline). When extraction is on, the parsed and URL-rewritten HTML is emitted as a standalone.htmloutput file alongside the module's JavaScript export. (by @alexander-akait in #20979)Add
"module-sync"to defaultconditionNamesfor resolver defaults to align with Node.js, which exposes themodule-synccommunity condition for synchronously-loadable ESM. (by @alexander-akait in #20933)Patch Changes
Fix CSS modules
composessocomposes: foo from "./self.module.css"from insideself.module.cssno longer creates a duplicate module instance. Fix CSS modulescomposesparsing solocal()andglobal()function wrappers are tracked per class name. Fix CSS modulescomposes: ... from "<file>"so the composed files load in an order consistent with every rule's local composes order, instead of source first-appearance order. (by @alexander-akait in #20929)Avoid emitting the
__webpack_require__runtime in CSS bundles when all imported CSS modules were concatenated into the same scope. (by @alexander-akait in #20936)Recompute the CSS chunk's
[contenthash]and the rendered CSS bytes when an asset referenced byurl()/src()/string in CSS changes its hashed filename. (by @alexander-akait in #20938)Embed an inline
sourceMappingURLdata URI inside the CSS when theparser.exportTypeoption aretext,style, orcss-style-sheet. Also merge@imported CSS at build time fortextandcss-style-sheetexportTypes so the bundle ships a single accurate inline source map covering every contributing file. Map each generated CSS-module class export line in the JS bundle back to its selector position in the original CSS file (e.g.btn: "..."→.btn { ... }). (by @alexander-akait in #20886)Fix CSS modules deduplication so a
.module.<ext>file imported both directly (JS) and via icss (composes from/:import) becomes a single module instance. (by @alexander-akait in #20929)Preserve
@charsetat-rule when CSS modules useexportType: "text". (by @alexander-akait in #20912)Resolve
[hash]/[fullhash]placeholders inoutput.publicPathwhen generatingurl()references forexperiments.css. (by @alexander-akait in #20879)Fix HMR for concatenated CSS modules with
styleexportType by using stable per-module identifiers for injected style elements and tracking inner module IDs of concatenated modules in HMR records (by @xiaoxiaojx in #20911)Fix CSS Modules
@valueresolution when the same local name is imported from multiple modules. (by @alexander-akait in #20940)Fix
typeof ns.default/ns.default instanceof Xon a staticimport defer * as ns from "./mod"fordefault-onlyanddefault-with-namedexternal modules underoptimization.concatenateModules. The concatenated-module rewrite was collapsingns.defaultto the deferred-namespace proxy itself instead of routing through the optimized.agetter (which lazily evaluates the module and returns its default value), sotypeof ns.defaultobserved"object"(the proxy) rather than the type of the default. ThedynamicexportsType already used.acorrectly; default-only and default-with-named now match. (by @alexander-akait in #20910)Make
import defer * as nsmore spec-compliant:ns.x = valueno longer triggers module evaluation (per the TC39 import-defer[[Set]]algorithm), and the deferred namespace is now a distinct object from the eager namespace, with the same Deferred Module Namespace Exotic Object shared across defer-import call sites for the same module. (by @alexander-akait in #20913)Fixed spec deviations in the deferred namespace object returned by
__webpack_require__.z(import defer * as ns/import.defer(...)). (by @alexander-akait in #20910)Drop the
__webpack_require__,__webpack_require__.d, and__webpack_require__.oruntime helpers fromlibrary: { type: "module" }bundles when the on-demand exports source they were emitted for ends up dropped (e.g. a single concatenated entry without an IIFE). (by @alexander-akait in #20901)Resolve the static specifier of a dynamic
import()whose argument is a side-effect-freeSequenceExpression, e.g.import((1, 0, "./mod.js"))is now treated the same asimport("./mod.js")instead of being rejected as unresolvable. (by @alexander-akait in #20917)Stable shared module ids and runtime-chunk emission order. (by @imccausl in #20860)
Fix snapshot validity check for context dependencies in watch mode by treating watchpack's existence-only entries (
{}) as cache misses. (by @alexander-akait in #20916)Support no-expression template literals in computed member access (e.g.
import.meta[`url`]). (by @alexander-akait in #20889)Improve tree-shaking in
isPure: handle more expression types (ArrayExpression,ObjectExpression,NewExpression,ChainExpression,UnaryExpression(safe operators),MetaProperty,TaggedTemplateExpression,BinaryExpression(strict equality)), prevent/*#__PURE__*/comments from leaking acrossObjectExpressionproperties, and detect PURE comments insideTemplateLiteralinterpolations. (by @alexander-akait in #20723)Reject
new import.defer(...)andnew import.source(...)as a parse-timeSyntaxError, matching the spec —ImportCallis aCallExpressionand is not a valid operand ofnew. Parenthesized forms (new (import.defer(...))) remain valid and continue to throwTypeErrorat runtime as before. (by @alexander-akait in #20917)Escape
#characters that appear inside a path-shaped request's directory portion before passing the request to the resolver, so projects located in directories like/home/user/proj#1(and tools like webpack-dev-server that build entry requests with query strings) resolve correctly. The escape only kicks in when the request contains both a#in the path portion and a?query string — paths without a query keep their existing semantics. (by @alexander-akait in #20980)Silence unhandled rejection from the prefetch trigger when chunk loading fails. The
ensureChunkHandlers.prefetchruntime createdPromise.all(promises).then(...)whose result is discarded by__webpack_require__.e. If chunk loading rejected (e.g.chunkLoadTimeout), that dangling chain produced an unhandled rejection. Prefetch is best-effort, so a no-op rejection handler is now attached. (by @alexander-akait in #20898)Align
require()of an ES module with Node.js'srequire(esm)"module.exports"named-export convention. When CommonJSrequire()resolves to an ES module that exports a binding with the literal string name"module.exports"(e.g.export { value as "module.exports" }),require()now returns the value of that export instead of the module's namespace object — matching Node.js v22.12+/v23+ behavior and easing migration of dual ESM/CJS libraries that rely onmodule.exports = …. The unwrap applies to plainrequire(),require().foo, calls (require()(…)), destructuring, and to CJS wrappers likemodule.exports = require(esm)/exports.x = require(esm). (by @alexander-akait in #20981)Remove outdated
@types/eslint-scopepackage from dependencies. (by @alexander-akait in #20869)Fix
export *resolution when a star-reexported module re-exports a name back to the importer cyclically. Previously, in a graph whereadoesexport * from "./b"; export * from "./c";andbdoesexport { foo } from "./a";whilecprovides the actualfoobinding, webpack hoistedfoofrombintoa's namespace without per-name cycle detection — emitting a getter chain (a.foo→b.foo→a.foo) that threw "Maximum call stack size exceeded" at runtime. The TC39ResolveExportalgorithm requires the cyclic branch to return null and the star loop to fall through to the non-cyclic source. (by @alexander-akait in #20959)Preserve
usingdeclaration initializers when the inner graph optimization is enabled. (by @hai-x in #20906)Fixed typescript types. (by @alexander-akait in #20880)
Bump
webpack-sourcesto^3.4.1and feed asset bytes into hashes via the newSource.prototype.buffers()API. For largeConcatSource/ReplaceSourceoutputs this avoids the intermediateBuffer.concatthatsource.buffer()performs, removing a peak-memory spike equal to the source's total size on each hashed asset (AssetGenerator.getFullContentHash,CssIcssExportDependencycontent hashing, andRealContentHashPlugin). A small benchmark on a 64 MiBConcatSourceshows ~64 MiB lower peak external memory and ~45% faster hashing. (by @alexander-akait in #20897)v5.106.2Compare Source
Patch Changes
CSS @import now inherits the parent module's exportType, so a file configured as "text" correctly creates a style tag when @imported by a "style" parent. (by @xiaoxiaojx in #20838)
Make asset modules available in JS context when referenced from both CSS and a lazily compiled JS chunk. (by @xiaoxiaojx in #20801)
Include missing generator options in hash to ensure persistent cache invalidation when configuration changes (CssGenerator
exportsOnly, JsonGeneratorJSONParse, WebAssemblyGeneratormangleImports). (by @xiaoxiaojx in #20821)Fix
||default value handling in ProgressPlugin and ManifestPlugin that incorrectly overrode user-provided falsy values (e.g.modules: false,entries: false,entrypoints: false). (by @xiaoxiaojx in #20823)Migrate from
mime-typestomime-db. (by @alexander-akait in #20812)Handle
@charsetat-rules in CSS modules. (by @alexander-akait in #20831)Marked all experimental options in types. (by @alexander-akait in #20814)
v5.106.1Compare Source
Patch Changes
Fix two ES5-environment regressions in the anonymous default export
.namefix-up: the generated code referenced an undeclared__WEBPACK_DEFAULT_EXPORT__binding causingReferenceError, and usedReflect.definePropertywhich is not available in pre-ES2015 runtimes. The fix-up now references the real assignment target and usesObject.defineProperty/Object.getOwnPropertyDescriptor. (by @xiaoxiaojx in #20796)Prevent
!importantfrom being renamed as a local identifier in CSS modules. (by @xiaoxiaojx in #20798)Use compiler context instead of module context for CSS modules local ident hashing to avoid hash collisions when files with the same name exist in different directories. (by @xiaoxiaojx in #20799)
v5.106.0Compare Source
Minor Changes
Add
exportType: "style"for CSS modules to inject styles into DOM via HTMLStyleElement, similar to style-loader functionality. (by @xiaoxiaojx in #20579)Add
contextoption support for VirtualUrlPlugin (by @xiaoxiaojx in #20449)Generate different
CssModuleinstances for differentexportTypevalues. (by @xiaoxiaojx in #20590)Added the
localIdentHashFunctionoption to configure the hash function to be used for hashing. (by @alexander-akait in #20694)Additionally, the
localIdentNameoption can now be a function.Added support for destructuring assignment
requirein cjs, allowing for tree shaking. (by @ahabhgk in #20548)Added the
validateoption to enable/disable validation in webpack/plugins/loaders, also implemented API to make it inside plugins. (by @xiaoxiaojx in #20275)Added
sourcesupport for async WASM modules. (by @magic-akari in #20364)Patch Changes
Add a static getSourceBasicTypes method to the Module class to prevent errors across multiple versions. (by @xiaoxiaojx in #20614)
Included fragment groups in the conflicting order warning for CSS. (by @aryanraj45 in #20660)
Avoid rendering unused top-level
__webpack_exports__declaration when output ECMA module library. (by @hai-x in #20669)Fixed resolving in CSS modules. (by @alexander-akait in #20771)
Allow external modules place in async chunks when output ECMA module. (by @hai-x in #20662)
Implement
deprecateflag in schema for better TypeScript support to show which options are already deprecated by the configuration (by @bjohansebas in #20432)Set
.nameto"default"for anonymous default export functions and classes per ES spec (by @xiaoxiaojx in #20773)Hash entry chunks after runtime chunks to prevent stale content hash references in watch mode (by @xiaoxiaojx in #20724)
Fix multiple bugs and optimizations in CSS modules: correct third code point position in walkCssTokens number detection, fix multiline CSS comment regex, fix swapped :import/:export error message, fix comma callback incorrectly popping balanced stack, fix cache comparison missing array length check, fix match.index mutation side effect, move publicPathAutoRegex to module scope, precompute merged callbacks in consumeUntil, simplify redundant ternary in CssGenerator, fix typo GRID_TEMPLATE_ARES, remove duplicate grid-column-start, and merge duplicate getCompilationHooks calls. (by @xiaoxiaojx in #20648)
Correct url() path resolution and preserve source maps for non-link CSS export types (style, text, css-style-sheet) (by @xiaoxiaojx in #20717)
Emit error when proxy server returns non-200 status code in HttpUriPlugin instead of silently failing. (by @xiaoxiaojx in #20646)
import.metaas standalone expression now returns a complete object with known properties (url,webpack,main,env) instead of an empty object({}), and hoists it as a module-level variable to ensureimport.meta === import.metaidentity. Inpreserve-unknownmode (ESM output), the hoisted object merges runtimeimport.metaproperties viaObject.assign. (by @xiaoxiaojx in #20658)Fix incorrect condition in FileSystemInfo that always evaluated to false, preventing trailing slash removal from directory paths during build dependency resolution. (by @xiaoxiaojx in #20649)
fix: VirtualUrlPlugin absolute path virtual module IDs getting concatenated with compiler context (by @xiaoxiaojx in #20656)
When a virtual module ID is an absolute path (e.g.
virtual:C:/project/user.js), the auto-derived context was incorrectly joined withcompiler.context, producing a concatenated path likeC:\cwd\C:\project. Now absolute-path contexts are used directly.All deprecated methods and options now have
@deprecatedflag in types. (by @alexander-akait in #20707)Fix
CompatibilityPluginto correctly rename__webpack_require__when it appears as an arrow function parameter (e.g.(__webpack_module, __webpack_exports, __webpack_require__) => { ... }). (by @hai-x in #20661)Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR has been generated by Mend Renovate CLI.
⚠️ Artifact update problem
Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.
♻ Renovate will retry this branch, including artifacts, only when one of the following happens:
The artifact failure details are included below:
File name: Cargo.lock
79046c025ad5cd8ff7f6d5cd8ff7f677876d868177876d8681877e8bc996Update all dependenciesto Update all non-major dependencies877e8bc99615eab16e6715eab16e6779b929e13879b929e13878a2d401fe78a2d401fe20704f652620704f6526ad5751095aad5751095a1435a2223eView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.