Repository navigation
v7 Roadmap #2709
andrii-bodnar
started this conversation in
General
v7 Roadmap
#2709
Replies: 2 comments 2 replies
|
What about moving babel extractor in a separate package in v7 with direct babel depenedencies, and left cli entirely babel-free. This will give an another benefit - it would be possible to looks for a stats how many people still using a babel implementation. |
1 reply
|
What about renaming Also, take into account that using the |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Lingui 6 was about distribution: ESM-only packages and a modern Node.js baseline. Lingui 7 is about the toolchain.
Over the 6.x cycle we shipped a Rust and SWC based toolchain,
@lingui/native-tools, behind opt-in flags: the native macro transform in@lingui/vite-plugin(macroTransform: true), the native extractor (createSwcExtractor()), and native bundling inlingui extract-experimental. It is up to 2.5x faster than SWC with the Lingui plugin and up to 29x faster than Babel, and it has been dogfooded on real projects since thelingui-swcpreview (#2436).Babel still sits underneath everything by default.
@lingui/clipulls in@babel/core,@babel/parser,@babel/generatorand both Lingui Babel plugins as hard dependencies, even for projects that use only the native paths (#2699). The CLI is also pinned to Babel 7, so Babel 8 projects end up with two Babel majors installed (#2644), and we deferred that move to the next major because it has Node engine and parser implications.V7 flips the defaults: the native transform and the native extractor become the default,
lingui compilestops depending on Babel, and the Babel packages become optional peer dependencies. The Babel extractor and the Babel macro plugin stay fully supported for projects that need them (Flow, Babel-only syntax, custom Babel pipelines, Vue), you just install Babel explicitly. At the same time we move the CLI to Babel 8 and remove the deprecations accumulated over 5.x and 6.x.As with v6, the headline change is big enough on its own. Everything else in this list is either a deprecation removal or a small cleanup that needs a major anyway.
Testing checklist:
@lingui/loader), Metro and Next.js setups@lingui/babel-plugin-lingui-macrowork on Babel 7 and Babel 8Reconsider the minimum Node.js version. v6 set 22.19+. Node.js 22 reaches end of life in April 2027, so depending on the release date v7 may start at 24+.
Blockers:
useLinguitransform emits$__i18n._()which crashes with@lingui/solidswc-plugin#275macro.jsxRuntime: "solid"for the<Trans>transform swc-plugin#276createSwcExtractorignores themacrooption it accepts (lingui/swc-plugin, to be filed)Native toolchain by default
@lingui/vite-plugin:macroTransformdefaults totrue;linguiTransformerBabelPresetstays as the opt-out path and stops printing the notice@lingui/cli:createSwcExtractor()becomes the default extractor, Babel extractor becomes opt-in viaextractors: [createBabelExtractor()]@lingui/cli: rewritecompilecatalog module generation without@babel/generatorand@babel/types, removecompilerBabelOptions@lingui/cli: lazy-load the Babel extractor, move@babel/*and the Lingui Babel plugins to optional peer dependencies Can Babel dependencies be optional when using the native Vite transform and experimental extractor? #2699@lingui/vite-pluginonce@lingui/native-toolsships Solid support vite-plugin: macroTransform generates invalid code for SolidJS #2705@lingui/native-tools: remove the temporaryuseLinguiV5IdGenerationoption, makeuseJsdocI18nCommentthe defaultextract-experimental: promote dependency-tree crawling to alingui extractmode, or keep it as isBabel 8
@lingui/cliand the remaining packages to Babel 8, carrying over the CLI-side changes from feat(cli): move the extractor toolchain to Babel 8 #2644^7 || ^8peer ranges in@lingui/babel-plugin-lingui-macroand@lingui/babel-plugin-extract-messagesRemove deprecations:
babel-plugin-macros(deprecated since v6), drop thebabel-plugin-macrospeer dependency from@lingui/coreand@lingui/reactextractorParserOptionsconfig option, usecreateBabelExtractor({ parserOptions })insteadexperimental.extractorlegacy optionsincludeDeps,excludeExtensions,resolveEsbuildOptions, usebundler: createEsbuildBundler({ ... })pseudoLocalestring form, use the object form{ locale: "pseudo" }i18n.date(),i18n.number()and theformatshelpers in@lingui/core, useIntl.DateTimeFormatandIntl.NumberFormatdirectlyextractorexport from@lingui/extractor-vue, usecreateVueExtractor()To discuss (not blockers)
lingui checkdefaults: which checks run by default and at which severityDocumentation
Post-release
lingui/skillsreferences for the new defaultsAll reactions