Skip to content
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

feat: support i18next v22 type augmentation #1997

Merged
merged 12 commits into from
Nov 6, 2022

Conversation

belgattitude
Copy link
Contributor

@belgattitude belgattitude commented Oct 26, 2022

@belgattitude
Copy link
Contributor Author

Issue

Type checks are lost when reworking the types from 'react-i18next.d.ts' to 'i18next.d.ts'

image

@belgattitude
Copy link
Contributor Author

belgattitude commented Oct 26, 2022

I'll debug tomorrow, but any help appreciated

links to keep an eye on (by @adrai)

Ideally I'd like to provide a specific test for types

@adrai adrai requested a review from pedrodurek October 26, 2022 15:41
@adrai
Copy link
Member

adrai commented Nov 3, 2022

@pedrodurek any chance to help @belgattitude with this?

@pedrodurek
Copy link
Member

Sorry guys, It's been a tough week. I'll have some time tomorrow to look into it.

@pedrodurek
Copy link
Member

pedrodurek commented Nov 5, 2022

Hey @belgattitude, that's happening because next-i18next@12.1.0 is relying on the old react-i18next and 18next versions. https://github.com/i18next/next-i18next/blob/v12.1.0/package.json#L132-L134
cc: @adrai

@adrai
Copy link
Member

adrai commented Nov 5, 2022

Hey @belgattitude, that's happening because next-i18next@12.1.0 is relying on the old react-i18next and 18next versions. https://github.com/i18next/next-i18next/blob/v12.1.0/package.json#L132-L134

cc: @adrai

12.1 is the npm released version, but on master everything is up-to-date @pedrodurek

@pedrodurek
Copy link
Member

pedrodurek commented Nov 5, 2022

Once we create a new version for next-i18next based on master, the types will work. Alternatively, we can add npm override for next-18next

"overrides": {
  "next-i18next": {
    "react-i18next": "12.0.0",
    "i18next": "22.0.3"
  }
}

@adrai
Copy link
Member

adrai commented Nov 5, 2022

Once we create a new version for next-i18next based master, the types will work. Alternatively, we can add npm override for next-18next

"overrides": {
  "next-i18next": {
    "react-i18next": "12.0.0",
    "i18next": "22.0.3"
  }
}

@belgattitude can you check that overrides?

@adrai
Copy link
Member

adrai commented Nov 5, 2022

@belgattitude as soon as you think we're ready for releasing, let me know... probably still waiting for this #1998 ?

@belgattitude
Copy link
Contributor Author

Cool, gonna check tomorrow. Make sense

@pedrodurek
Copy link
Member

Screenshot 2022-11-05 at 10 15 12 AM

@socket-security
Copy link

Socket Security Pull Request Report

Dependency issues detected. If you merge this pull request, you will not be alerted to the instances of these issues again.

😵‍💫 Bin script confusion

This package has multiple bin scripts with the same name. This can cause non-deterministic behavior when installing or could be a sign of a supply chain attack

Consider removing one of the conflicting packages. Packages should only export bin scripts with their name

Package Bin script Location
jest@26.6.3 (added) jest package.json
jest-cli@26.6.3 (added) jest package.json via jest@26.6.3
Pull request report summary
Issue Status
Install scripts ✅ 0 issues
Native code ✅ 0 issues
Bin script confusion ⚠️ 2 issues
Bin script shell injection ✅ 0 issues
Unresolved require ✅ 0 issues
Invalid package.json ✅ 0 issues
HTTP dependency ✅ 0 issues
Git dependency ✅ 0 issues
Non-existent author ✅ 0 issues
Potential typo squat ✅ 0 issues
Known Malware ✅ 0 issues
Telemetry ✅ 0 issues
Protestware/Troll package ✅ 0 issues
Bot Commands

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of package-name@version specifiers. e.g. @SocketSecurity ignore foo@1.0.0 bar@2.4.2

  • @SocketSecurity ignore jest@26.6.3
  • @SocketSecurity ignore jest-cli@26.6.3

Powered by socket.dev

@belgattitude belgattitude changed the title feat: support i18next v22 type augmentation (do not merge) feat: support i18next v22 type augmentation Nov 5, 2022
@belgattitude
Copy link
Contributor Author

Works like a charm 👍

as soon as you think we're ready for releasing, let me know... probably still waiting for this #1998 ?

@adrai regarding #1998, I'd like to have an hour tomorrow to test typescript 4.9-rc before merging.

UPGRADING.md Outdated Show resolved Hide resolved
Copy link
Member

@pedrodurek pedrodurek left a comment

Choose a reason for hiding this comment

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

Looks great to me!

@belgattitude belgattitude marked this pull request as ready for review November 5, 2022 23:00
@adrai adrai merged commit 7464c65 into i18next:master Nov 6, 2022
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.

3 participants