-
-
Notifications
You must be signed in to change notification settings - Fork 663
perf(interpolator): use object deconstruction #2181
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
Conversation
We did not use the optional chaining operator etc... because in the past there has been some i18next usage in environments where this was not supported... for example we wanted to still support Node v12 (#1948) and that node version is not able to understand that syntax... |
|
not from my side personally, but I'm sure there are some situations in userland that still uses old node versions... So for now, yes if you remove the optional chaining we can merge that immediately... |
Will do that then and perhaps open an issue about bumping the minimum node version so it can be discussed? |
we can do that for the next major version... but I don't think there are a lot of benefits to make a new major version to just drop older node.js versions... |
Would it be fine if I opened a PR to switch to optional chaining across all of the files then? Then you can merge it whenever you want. |
You can, but that will not be merged so soon... |
That's fine from my side 👍🏻 |
thank you... it's included in v23.11.4 |
…18next#2181) * use object deconstruction and optional chaining * revert optional chaining
The code used in this file can benefit from the use of object deconstruction and optional chaining. Both of these reduce the amount of property lookups the engine needs to do which should help improve performance. Perhaps more important it cuts out unneeded code and allows for better mangling by rollup, cutting down the size of the minified files a bit, without impacting functionality.
Checklist
npm run test
Checklist (for documentation change)