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

use optional chaining, nullish coalescing and nullish coalescing assignment #1774

Merged
merged 3 commits into from
Jul 17, 2024

Conversation

VIKTORVAV99
Copy link
Contributor

Uses optional chaining, nullish coalescing and nullish coalescing assignments to reduce property access, truthy check and streamline code.

Checklist

  • only relevant code is changed (make a diff before you submit the PR)
  • run tests npm run test
  • tests are included
  • commit message and code follows the Developer's Certification of Origin

@VIKTORVAV99
Copy link
Contributor Author

Ah I accidentally committed the build assets as well, is that a problem or should I remove them?

@coveralls
Copy link

coveralls commented Jul 17, 2024

Coverage Status

coverage: 97.193% (-0.01%) from 97.206%
when pulling 7527bc3 on VIKTORVAV99:optional_chaining
into 0338bf1 on i18next:master.

@adrai
Copy link
Member

adrai commented Jul 17, 2024

Better removing them

@adrai adrai merged commit 926baf4 into i18next:master Jul 17, 2024
7 of 8 checks passed
@adrai
Copy link
Member

adrai commented Jul 17, 2024

Should we release a new major version now, or do you like to change something else?

@VIKTORVAV99
Copy link
Contributor Author

Should we release a new major version now, or do you like to change something else?

There is that other PR that changes how the namespaces are loaded at #1770 but the existing code are not really working as sometimes the function that is called though the passed object is undefined. I'll see if I can fix it tomorrow or just leave it for the next major release if I don't solve it or don't have time to solve it tomorrow.

If I can't solve it by then how would you feel about converting the project to TypeScript so it's easier to debug and track down the issues in the future?

@adrai
Copy link
Member

adrai commented Jul 17, 2024

Ok, will wait for tomorrow, and also check for that hasLoadedNamespace functionality...
Regarding TypeScript, please no.

@adrai
Copy link
Member

adrai commented Jul 17, 2024

waiting for your "GO" to create a new major release

@VIKTORVAV99
Copy link
Contributor Author

waiting for your "GO" to create a new major release

Feel free to do so, I have no other breaking changes I want to do. Any potential changes going forward will just be improvements that are non breaking.

@adrai
Copy link
Member

adrai commented Jul 17, 2024

v15.0.0 has just been relesed

@VIKTORVAV99
Copy link
Contributor Author

Very nice!

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