v26.4.0
Changed 4
- Cache `toResolveHierarchy` results per `(code, fallbackCode)` pair to reduce per-call overhead from ~886 ns to ~41 ns in render-heavy UIs
- Invalidate the hierarchy cache automatically when `options.fallbackLng` changes through reassignment or in-place array mutation
- Require calling `i18next.services.languageUtils.clearCache()` manually after runtime mutations of resolution-relevant options (`load`, `lowerCaseLng`, `cleanCode`, `nonExplicitSupportedLngs`)
- Update all devDependencies and replace `sinon` with `nise` + `vitest.spyOn` in v1 compatibility tests
From i18next
- perf: cache
toResolveHierarchyresults per(code, fallbackCode)pair. The hierarchy resolver runs on everyt()call and callsIntl.getCanonicalLocalesmultiple times, which showed up prominently when profiling render-heavy UIs (e.g. virtualized data grids); with the cache the per-call cost drops from ~886 ns to ~41 ns. The cache is invalidated automatically whenoptions.fallbackLngchanges (reassignment or in-place array mutation); if you mutate other resolution-relevant options at runtime (load,lowerCaseLng,cleanCode,nonExplicitSupportedLngs), calli18next.services.languageUtils.clearCache()afterwards. Function-valuedfallbackLngand per-call array/objectfallbackLngoptions are never cached, so dynamic fallbacks keep working as before. Thanks @equaterina (#2444). - chore: update all devDependencies (Babel stays on 7.x until
@rollup/plugin-babelsupports 8, eslint on 9.x for neostandard). Removed the unusedcoverallspackage (CI uses the Coveralls GitHub Action) and replacedsinonwithnise+vitest.spyOnin the v1 compatibility tests, which resolves all opennpm auditfindings (0 vulnerabilities) and should close the dependabot alerts on the lockfile.