i18next / react-i18next

Internationalization for react done right. Using the i18next i18n ecosystem.
https://react.i18next.com
MIT License
9.23k stars 1.02k forks source link

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

Closed VIKTORVAV99 closed 2 months ago

VIKTORVAV99 commented 2 months ago

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

Checklist

VIKTORVAV99 commented 2 months ago

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

coveralls commented 2 months ago

Coverage Status

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

adrai commented 2 months ago

Better removing them

adrai commented 2 months ago

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

VIKTORVAV99 commented 2 months ago

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 commented 2 months ago

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

adrai commented 2 months ago

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

VIKTORVAV99 commented 2 months ago

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 commented 2 months ago

v15.0.0 has just been relesed

VIKTORVAV99 commented 2 months ago

Very nice!