github aralroca/next-translate 3.0.0

5 hours ago

πŸš€ Next-translate 3.0.0 Release Notes

First of all, I want to personally apologize for the long period this project has been without proper maintenance. I’ve been heavily involved in other projects during this time, but I’ve decided it’s time to give Next-translate the priority it deserves once again. From now on, you can expect a much more constant rhythm of updates, bug fixes, and feature improvements. Thank you for your incredible patience and for the community support that kept this project alive!

πŸ” Highlights

🏎️ Turbopack & Next.js 16 Support (Finally!)

Next-translate and next-translate-plugin now fully support Turbopack (Next.js 16+). We've resolved several compatibility issues related to re-export detection and internal logic to ensure a seamless experience with the new Rust-based bundler.

πŸ“ App Router & Next.js 15+ Compatibility

Significant improvements have been made to the App Router (app directory) integration:

  • Awaitable Params: Added support for Next.js 15+ where params and searchParams are asynchronous on the server side.
  • Stability: Improved stability of the t function and clearer patterns for server-side translation.

✨ New Features

  • createTranslation helper: A new specialized helper to simplify translations within the App Router context.
  • Enhanced Trans Component: Added support for nested arrays and improved pluralization logic.
  • formatElements Utility: Now explicitly exported for custom formatting logic.
  • Improved Typings:
    • Updated to TypeScript 5.3.3.
    • Full type safety for getT and better definitions for config.interpolation.format.
  • Better TS Support: Improved loading of TypeScript configuration files relative to the project's current working directory.
  • Metadata Support: Added official examples and fixes for using useTranslation inside Next.js generateMetadata.

πŸ› οΈ Bug Fixes

  • Turbopack Integration: Fixed re-export detection logic that was causing issues in some Turbopack configurations.
  • Package Exports: Formalized the exports field in package.json for reliable ESM/CJS compatibility.
  • useContext Errors: Fixed recurring errors in certain Next.js edge cases and HMR scenarios.
  • Middleware Proxy Migration: Migrated to a more robust proxy-based approach for middleware.

⚠️ Breaking Changes

  • Removed Pages-to-App Router Migration Support: support for the automatic migration logic between pages and app router has been removed to keep the plugin lean and focused on the new architecture.
  • Formalized Subpath Exports: You must now use formal entry points instead of deep internal paths.
  • Next.js Minimum Version: Optimized for Next.js 13.5+. Support for asynchronous params requires Next.js 15+.
  • TS Configurations: TypeScript files are now loaded relative to the CWD, which might change behavior in monorepos with non-standard structures.

What's Changed

New Contributors

Full Changelog: 2.6.2...3.0.0
Full Changelog Next-translate-plugin: aralroca/next-translate-plugin@2.6.2...3.0.0

Don't miss a new next-translate release

NewReleases is sending notifications on new releases.