Skip to content

feat!: remove deprecated format as string and formatOptions#2419

Merged
andrii-bodnar merged 10 commits intonextfrom
refactor/remove-depreacted-format-string
Jan 28, 2026
Merged

feat!: remove deprecated format as string and formatOptions#2419
andrii-bodnar merged 10 commits intonextfrom
refactor/remove-depreacted-format-string

Conversation

@timofei-iatsenko
Copy link
Collaborator

@timofei-iatsenko timofei-iatsenko commented Jan 27, 2026

Description

remove deprecated:

export default {
  [...]
  format: 'po',
  formatOptions: {lineNumbers: true}
}

in favour of:

import { formatter } from "@lingui/format-po"

export default {
  [...]
  format: formatter({lineNumbers: true}),
}

This was deprecated in v4, and planned for delete in v5, but it still here.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Examples update

Fixes # (issue)

Checklist

  • I have read the CONTRIBUTING and CODE_OF_CONDUCT docs
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation (if appropriate)

@vercel
Copy link

vercel bot commented Jan 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
js-lingui Ready Ready Preview Jan 28, 2026 11:39am

Request Review

@github-actions
Copy link

github-actions bot commented Jan 27, 2026

size-limit report 📦

Path Size
packages/core/dist/index.mjs 1.77 KB (0%)
packages/detect-locale/dist/index.mjs 618 B (0%)
packages/react/dist/index.mjs 1.21 KB (0%)

# Conflicts:
#	packages/conf/src/__snapshots__/index.test.ts.snap
Comment on lines -202 to -214
const prevFormat = options.convertFrom
if (prevFormat && config.format === prevFormat) {
hasErrors = true
console.error("Trying to migrate message catalog to the same format")
console.error(
`Set ${pico.bold("new")} format in LinguiJS configuration\n` +
` and ${pico.bold("previous")} format using --convert-from option.`,
)
console.log()
console.log(`Example: Convert from lingui format to minimal`)
console.log(pico.yellow(helpRun(`extract --convert-from lingui`)))
process.exit(1)
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a leftover of functionionality which didn't work starting aproximately from lingui@v3

Comment on lines -1089 to -1106
exports[`Catalog POT Flow Should get translations from template if locale file not presented 1`] = `
{
messages: {
2ZeN02: Test String,
mY42CM: Hello World,
},
missing: [
{
id: mY42CM,
source: Hello World,
},
{
id: 2ZeN02,
source: Test String,
},
],
}
`;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these deleted snapshot are duplicates and leftovers from jest - > vitest migration. For some reason vitest haven't detected them as obsolete earlier and started failing only here.

I don't have an answer why that happened, but i re-checked few times that this snapshots are obsolete and correct snaphots are in place.

Vitest uses -> separator between describe title and test case, so in vitest those snapshots called as:

Catalog -> POT Flow -> Should get translations from template if locale file not presented 1

So these snapshots were created by jest.

@andrii-bodnar andrii-bodnar merged commit 85278f4 into next Jan 28, 2026
7 checks passed
@andrii-bodnar andrii-bodnar deleted the refactor/remove-depreacted-format-string branch January 28, 2026 15:50
export const exampleConfig = {
...defaultConfig,
format: multipleValidOptions({}, "po"),
format: multipleValidOptions({}, {}),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this weird code here tricks jest-validate to not complain when the custom formatter passed. More info in this discussion https://discord.com/channels/974702239358783608/974704133661655060/1465991105417052242

@andrii-bodnar andrii-bodnar added this to the v6 milestone Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants