Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^17.1.0→^17.1.9Release Notes
i18next/react-i18next (react-i18next)
v17.1.9Compare Source
nsarray are now picked up. The hook used the array itself as theuseMemodependency list, and React only compares the entries both lists have in common when its length changes, so going fromuseTranslation(['nsA'])touseTranslation(['nsA', 'nsB'])kept returning['nsA']: React warned that the dependency array changed size,nsBwas never loaded, and withnsMode: 'fallback'keys only innsBrendered as the key. Removing a namespace kept the old list the same way. The namespaces are now compared by content, so a growing list loads the new namespace (suspending until it is loaded, as switching from'nsA'to'nsB'already does) andtuses it. Lists that keep their length behave as before. Thanks @lprnmns (#1945).v17.1.8Compare Source
formatis no longer dropped.Transreadsformatin an interpolation object as the formatter name ({{ value, format }}), so with{{ format }}as the only key nothing was left:<Trans>Export as {{ format }}</Trans>warnedTRANS_INVALID_OBJand used the default stringExport asinstead ofExport as {{format}}. Whenformatis the object's only key it is now treated as the variable.{{ value, format }}works as before. Without ani18nKey, the key derived from the children changes accordingly, fromExport astoExport as {{format}}. i18next-cli serializesTranschildren with react-i18next, so extracting with this version produces the same key. Thanks @Pharex38 (#1944).v17.1.7Compare Source
"Write &#​169; to get &#​169;"renderedWrite © to get ©instead ofWrite &#​169; to get ©, and&#​60;rendered<instead of&#​60;. This also hit interpolated values withescapeValue: true, where a value containing&#​60;is escaped to&#​60;. Escaped named entities like&lt;already stayed<, as browsers andTransdecode them. Unknown named entities and entities above U+10FFFF still stay as written. Thanks @Pharex38 (#1943).v17.1.6Compare Source
countpassed intOptionsis now used.TransspreadtOptionsand then set its owncountprop, so a count only intOptionswas overwritten withundefined:<Trans i18nKey="items" tOptions={{ count: 5 }} />rendered the keyitemsinstead of5 items, and with childrenTranscould pick the wrong plural form. Likecontext,Transnow falls back totOptions.count, handled the same way as thecountprop. Acountprop, a count in the children orvalues.countstill take precedence, andtOptionsis not modified. Thanks @nk-batman21 (#1942).v17.1.5Compare Source
Transnow falls back to the last key when none of them has a translation, ast()does. It used the array itself asdefaultValue, which i18next handles as an object, so<Trans i18nKey={['notifications.crm_item_created', 'crm_item_created']} components={[<strong />]} />renderedkey 'crm_item_created (en)' returned an object instead of string.instead ofcrm_item_created. An array of selectors falls back to the key of the last selector. The first key that has a translation still wins, andchildren,defaultsandtOptions.defaultValueare used as before. WithsaveMissing, these calls now report the missing key, like a singlei18nKeydoes. Thanks @nk-batman21 (#1941).v17.1.4Compare Source
allowObjectInHTMLChildren, thechildrenof HTML elements now use React's own type (DOMAttributes<T>['children']) instead of theReactI18NextChildren | Iterable<ReactI18NextChildren>union. Both accept the same children, so nothing compiles differently. For default installs the globalHTMLAttributesaugmentation now repeats whatever@types/reactdeclares, so changes in React's types flow through instead of meeting a copy, and type errors on element children no longer list an extraIterable<...>. WithallowObjectInHTMLChildren: truenothing changes. First step of #1928.v17.1.3Compare Source
"Hello 👋 <0>friend</0> &#​127881;"rendered U+F44B and U+F389, private-use glyphs that usually show as a box, instead of 👋 and 🎉: the decoder usedString.fromCharCode, which keeps only the low 16 bits of the code point. This shows up with translations that a TMS or CMS exports HTML-encoded. Entities above U+10FFFF, which are no valid code points, now stay as written instead of becoming U+0000. Entities below U+10000, including surrogate pairs written as two entities, decode as before. Thanks @nk-batman21 (#1940).v17.1.2Compare Source
<Trans i18nKey="welcome">Welcome</Trans>with"Welcome <1>friend</1>"renderedWelcome e, anddefaults="Hi <1>there</1>"with the childHirenderedHi i. The fallback for a single object of components ({{ 1: <strong /> }}) looked the tag up on the string and rendered one of its characters. It now applies only when that child is an object, so{{ 1: <strong /> }}renders as before, and the tag falls back to its inner text, as it already did with several children or with a number or an element as the only child. This also stops a single-entry array child holdingnull({[null]}, e.g. from a.mapthat returnednull) from throwingCannot read properties of null. Thanks @Cayan (#1939).v17.1.1Compare Source
componentsas an object with index keys, the component for key0is now rendered.components={{ 0: <a href={path} /> }}with"You're eligible. <0>Get started here.</0>"rendered the text without the link, a self-closing<0/>rendered nothing, and in<0>a <1>b</1></0>both elements were lost, while keys1and up and the array form worked. The object was passed on as the indexed children, so<0>resolved to the object itself. It is now looked up by key, like a named components map. This also fixes an arraycomponentsnext toreact.transDefaultProps.components, which the merge turns into such an object ({ Bold, 0, 1 }) and so lost its first entry, and a self-closing named tag in a mixed object ({ 0: <a />, Bold: <b /> }with<Bold/>), which rendered as the text<Bold />. Arrays, named maps and index objects starting at1render as before. Thanks @nk-batman21 (#1938).Configuration
📅 Schedule: (in timezone Europe/Berlin)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate CLI.