Skip to content

Upgrade Lingui from v5 to v6#377

Closed
blaipr wants to merge 1 commit into
ctrliq:mainfrom
blaipr:feature/lingui-6
Closed

Upgrade Lingui from v5 to v6#377
blaipr wants to merge 1 commit into
ctrliq:mainfrom
blaipr:feature/lingui-6

Conversation

@blaipr

@blaipr blaipr commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

📋 Suggested merge order for all 15 open PRs

Same list on every PR. Hard requirement: #381 before #382/#383/#384. Per-PR rebase/conflict notes are below the list.

  1. Merge PR Fix cross-test mock leak behind the flaky parallel test failures #388 - Fix cross-test mock leak behind the flaky parallel test failures
  2. Merge PR Upgrade twisted, kubernetes, pyyaml, Cython and Django to latest allowed versions #374 - Upgrade twisted, kubernetes, pyyaml, Cython and Django to latest allowed versions
  3. Merge PR Upgrade django-oauth-toolkit 1.7.1 to 3.3.0 #376 - Upgrade django-oauth-toolkit 1.7.1 to 3.3.0
  4. Merge PR Remove EOL msrestazure, msrest and adal dependencies #386 - Remove EOL msrestazure, msrest and adal dependencies
  5. Merge PR Build Activity Stream links for inventory source sync schedules #389 - Build Activity Stream links for inventory source sync schedules
  6. Merge PR Upgrade Lingui from v5 to v6 #377 - Upgrade Lingui from v5 to v6 ⬅️ this PR
  7. Merge PR Upgrade ESLint from 8 to 9 with flat config #378 - Upgrade ESLint from 8 to 9 with flat config
  8. Merge PR Upgrade styled-components from 5 to 6 #380 - Upgrade styled-components from 5 to 6
  9. Merge PR Replace unmaintained dagre with @dagrejs/dagre #387 - Replace unmaintained dagre with @dagrejs/dagre
  10. Merge PR Begin react-router 5 → 6 migration via react-router-dom-v5-compat #381 - Begin react-router 5 → 6 migration via react-router-dom-v5-compat
  11. Merge PR react-router migration batch 1: shared components, contexts and hooks #382 - react-router migration batch 1: shared components, contexts and hooks
  12. Merge PR react-router migration batch 2: screen directories (all except Inventory and Setting) #383 - react-router migration batch 2: screen directories (all except Inventory and Setting)
  13. Merge PR react-router migration batch 3: Inventory and Setting screens #384 - react-router migration batch 3: Inventory and Setting screens
  14. Merge PR Add React Testing Library migration infrastructure and first conversions #385 - Add React Testing Library migration infrastructure and first conversions
  15. Merge PR Surface an error when the webhook credential type lookup returns nothing #390 - Surface an error when the webhook credential type lookup returns nothing

⚠️ Merge-order notes (no hard dependency, but three known conflicts):

  1. Surface an error when the webhook credential type lookup returns nothing #390 rewrites the same locale catalogs. Both PRs re-run lingui extract over every .po/.pot/messages.js file, so whichever merges second will conflict across ~16 catalog files. Don't hand-merge those — resolve by re-running npm run extract-strings && npm run compile-strings on the rebased branch.
  2. Begin react-router 5 → 6 migration via react-router-dom-v5-compat #381/react-router migration batch 1: shared components, contexts and hooks #382 touch two of the same files. Begin react-router 5 → 6 migration via react-router-dom-v5-compat #381 rewrites the import block of testUtils/enzymeHelpers.js that this PR also edits (it deletes the make-plural/loadLocaleData lines), and react-router migration batch 1: shared components, contexts and hooks #382 edits the top of InstanceList.test.js where this PR removes an import. Both are trivial keep-both-changes resolutions.
  3. Lockfile club: Upgrade Lingui from v5 to v6 #377, Upgrade ESLint from 8 to 9 with flat config #378, Upgrade styled-components from 5 to 6 #380, Begin react-router 5 → 6 migration via react-router-dom-v5-compat #381 and Replace unmaintained dagre with @dagrejs/dagre #387 each regenerate package-lock.json; whichever of those merges after another needs a trivial npm install regen.

SUMMARY

Migrates the UI i18n toolchain to Lingui 6 (latest):

  • .linguirclingui.config.js — v6 removed string-based format config; the po format now comes from the @lingui/format-po formatter (new devDependency).
  • i18n.loadLocaleData() removed from i18nLoader.js, testUtils/enzymeHelpers.js and 15 test files — the API was removed in v6 (plural rules come from Intl.PluralRules since v4, so these calls were no-ops). The make-plural dependency is dropped: those calls were its only consumer (its licenses/ui file is removed accordingly).
  • One webpack rule added (resolve.fullySpecified: false for node_modules JS): @lingui v6 packages are ESM-only and import react/jsx-runtime without an extension, which React 17 (no package exports map) cannot satisfy under webpack's strict ESM resolution.
  • Locale catalogs re-extracted and recompiled with the v6 toolchain. The .po/.pot diffs are large because extract re-sorts the whole catalog (normal); the actual content change is small. Existing translations are preserved (e.g. es: 1,896 → 1,898 filled msgstr). A handful of msgids are re-keyed because v6 names placeholders after the source variable instead of positionally ({0}{virtualEnvironment}) — those entries will need re-translation, consistent with the recent "will need to translate later" string updates.

Independent of #374 and #376 — UI-only, no file overlap, mergeable in any order.

ISSUE TYPE

  • New or Enhanced Feature

COMPONENT NAME

  • UI

ASCENDER VERSION

awx: 25.4.1.dev5+gcda0899.d20260610

ADDITIONAL INFORMATION

All UI gates run against exactly this branch state (unmodified main + only this change):

npm --prefix awx/ui run lint     # clean
npm --prefix awx/ui run test     # 544 suites passed (1 skipped), 2855 tests passed (19 skipped)
npm --prefix awx/ui run build    # production build succeeds
py.test awx/main/tests/functional/test_licenses.py   # 1 passed

The full i18n workflow was exercised end to end under v6: extract-strings → compile-strings → lint → test → build.

- Replace .linguirc with lingui.config.js: v6 removed string-based format
  config, so the po format now comes from the @lingui/format-po formatter.
- Remove i18n.loadLocaleData() calls (API removed in v6; plural rules come
  from Intl.PluralRules since v4) from i18nLoader, enzymeHelpers and tests.
- Drop the make-plural dependency — its only consumer was loadLocaleData.
- Add a webpack rule relaxing fully-specified ESM resolution for
  node_modules: @lingui v6 packages are ESM-only and import
  'react/jsx-runtime' without an extension, which react 17 (no exports
  map) cannot satisfy under strict resolution.
- Re-extract and recompile locale catalogs with the v6 toolchain. Existing
  translations are preserved (es: 1896 -> 1898 filled msgstr); a handful of
  msgids are re-keyed because v6 names placeholders after the source
  variable instead of positionally ({0} -> {virtualEnvironment}).
@blaipr

blaipr commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #391, which combines this PR with the other two package-lock-regenerating toolchain upgrades (#377/#378/#387). The three were mutually conflicting on the lockfile (npm inserts their entries at the same alphabetical positions), so combining them is what makes the whole queue mergeable in any order. Content and verification are unchanged — see #391.

@blaipr blaipr closed this Jun 11, 2026
@blaipr blaipr deleted the feature/lingui-6 branch June 11, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant