Skip to content

change returnNull default to false#1885

Merged
adrai merged 4 commits into
masterfrom
returnNull-false
Jun 9, 2023
Merged

change returnNull default to false#1885
adrai merged 4 commits into
masterfrom
returnNull-false

Conversation

@adrai

@adrai adrai commented Dec 13, 2022

Copy link
Copy Markdown
Member

@stale

stale Bot commented Dec 21, 2022

Copy link
Copy Markdown

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the stale label Dec 21, 2022
@stale

stale Bot commented Dec 31, 2022

Copy link
Copy Markdown

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the stale label Dec 31, 2022
@adrai adrai added pr hold and removed stale labels Jan 2, 2023
@adrai

adrai commented Jan 6, 2023

Copy link
Copy Markdown
Member Author

Let's wait to merge this until you "verified" all ts changes.

@coveralls

coveralls commented Jan 6, 2023

Copy link
Copy Markdown

Coverage Status

coverage: 92.14%. remained the same when pulling 8091302 on returnNull-false into 3c5308e on master.

@stale

stale Bot commented Jan 16, 2023

Copy link
Copy Markdown

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the stale label Jan 16, 2023
@adrai adrai removed the stale label Jan 16, 2023
@mr-july

mr-july commented Jan 26, 2023

Copy link
Copy Markdown

@adrai: are you aware of the problem with the codeclima check?

@adrai

adrai commented Jan 26, 2023

Copy link
Copy Markdown
Member Author

@adrai: are you aware of the problem with the codeclima check?

@mr-july was not related to this PR

@stale

stale Bot commented Feb 18, 2023

Copy link
Copy Markdown

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the stale label Feb 18, 2023
@adrai adrai removed the stale label Feb 20, 2023
@stale

stale Bot commented Mar 18, 2023

Copy link
Copy Markdown

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the stale label Mar 18, 2023
@adrai adrai removed the stale label Mar 18, 2023
@stale

stale Bot commented Mar 25, 2023

Copy link
Copy Markdown

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the stale label Mar 25, 2023
@adrai adrai removed the stale label Mar 25, 2023
@stale

stale Bot commented Apr 2, 2023

Copy link
Copy Markdown

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the stale label Apr 2, 2023
@adrai adrai removed the stale label Apr 2, 2023
@stale

stale Bot commented Apr 25, 2023

Copy link
Copy Markdown

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the stale label Apr 25, 2023
@adrai adrai removed the stale label Apr 26, 2023
@stale

stale Bot commented May 4, 2023

Copy link
Copy Markdown

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the stale label May 4, 2023
@adrai adrai removed the stale label May 4, 2023
@stale

stale Bot commented May 19, 2023

Copy link
Copy Markdown

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the stale label May 19, 2023
@adrai adrai removed the stale label May 19, 2023
@adrai

adrai commented Jun 8, 2023

Copy link
Copy Markdown
Member Author

@pedrodurek maybe there is something special to be done for this? https://github.com/i18next/i18next/pull/1885/files#diff-97e65d0ee521805ff4ac2d967b61062da8f5543569da4177ceeff689ce4463a3R129

@adrai adrai mentioned this pull request Jun 8, 2023
7 tasks
@pedrodurek

Copy link
Copy Markdown
Member

Hey @adrai, omitting null from the return type will only work when the resources type is not assigned (when devs opt not to have the keys inferred). Otherwise, it'll iterate over every key and extract the actual literal value. If you move the test to test/typescript/t.test.ts it should work.
If you prefer, we can also change the types for when the resources type is defined to fallback to string if the value is null, up to you!

@adrai

adrai commented Jun 9, 2023

Copy link
Copy Markdown
Member Author

returnNull false having a key value set to null behaves like a non-existing key... so i18next at runtime returns the defaultValue or the key name...

@adrai

adrai commented Jun 9, 2023

Copy link
Copy Markdown
Member Author

I've moved the test, like you suggested... I think it's ok to have an error when using typesafe translations... (behaves like non-existing keys)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider setting the default for returnNull to false in next major version (v23.0.0)

4 participants