-
-
Notifications
You must be signed in to change notification settings - Fork 764
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support i18next 22, react-i18next 12 and move both to peer-deps #1966
Conversation
Let's wait for the react-i18next update first |
@adrai react-i18next use peerDependencies with a So technically speaking there's nothing on their side. That said I've just forced the ^22.0.0 on this repo to test it out: belgattitude/nextjs-monorepo-example#2802 So far it passes e2e and previews. |
That said I feel it would make sense to add i18next as a peerDependency at some point: "peerDependencies": {
"i18next": "^21.9.1 || ^22.0.0"
} Plus update install instructions, ie: |
There's an ongoing discussion about this: #1951 |
@bryantobing12 @yuuk @martinjlowm @bojackhorseman0309 @rikkit @kachkaev @capellini @matthewwolfe @isaachinman can you please have a look at this PR? |
@adrai I've looked and provided a fix for #1917 (comment). Tested with yarn and pnpm (see ithub.com/bryanltobing/layout-reproduce-i18next/pull/1). With it I'm somehow letting the bundler choose the right package (not totally correct but I can't explain it more). That will circumvent dual package hazards. But at a later point the best is to rework the packaging/exports of both next-i18next and react-i18next. It might come with a major as well. I'll take some time tomorrow to think if it's worthy to make both changes together. |
In reply to
What we could say for sure
Not cause when going into detail, some of them comes from the dual packaging (try to play by removing the cjs or esm export)... But at least we can distinguish problems related to duplicates and exclude this scenario (and noisy debugging). Package managers (and their versions) aren't equal regarding duplicated |
no problem for me, just want to be sure this is generally accepted... |
Yes, true. My feeling: not everything is perfect. Some time ago I had the impression that most of the time, it ended up by a package manager discussion. Now they aligned. I've added a note in the description. |
Happy to see the peer deps change looks like it's going ahead, I'll close my PR #1951 since this branch has the same changes. @belgattitude I'd be happy to test this branch using Yarn 3 PnP if you need, let me know. |
@rikkit thanks for for proposal. Out of my mind, if you use yarn you can take this bryanltobing/layout-reproduce-i18next#1 Run Change the .yarnrc.yml to to pnp linker, nuke the node_modules and run install. |
# Conflicts: # package.json
# Conflicts: # CHANGELOG.md # package.json
@belgattitude fyi: #1991 |
# Conflicts: # examples/simple/package.json # examples/ssg/package.json
fyi: #1982 (comment) |
fyi2: there might still be an issue if using an i18next backend to load the resources in combination with TS: i18next/i18next#1853 (comment) |
@adrai thanks for the links, I won't have time to read them properly today. But on my limited time, I would propose this t(o ease the process).
This PR scope is:
That way we work on step-by-step basis and fix along the way till v13 is in ready state |
Since there was not much feedback regarding the peer deps, I think we should merge it... (but not yet release it) |
updating your branch with master and updating i18next-fs-backend to v2.0.0 in your branch should already be ok |
# Conflicts: # package.json
Great ! v2.0.0 updated. |
Move
react-i18next
andi18next
to peerDependencies and update them to latestWhy ?
What's new
Version
Makes sense to merge along #1974 and possibly
Upgrade
See https://github.com/i18next/next-i18next/pull/1966/files#diff-f411a5009131db5a6c7242b49ca78488f2d274ef9e5e5f4de9262a42108a5386
Notes
Recent versions of packages managers finally aligned on peer-deps and does not install them by default.
In certain situations (auto-install-peers in pnpm or npm v7), some people might forget to add the peer-deps as documented in v13. That might lead to invalid bug reports if the auto-installed version is not within the expectations or created legit duplicates (semver). In those possible cases, ensure both react-i18next and i18next are installed in the consuming app.
PS: I couldn't run
npm run test
without doingnpm run install:examples
first.Checklist
npm run test