Open OlimpiaZurek opened 2 months ago
Triggered auto assignment to @isabelastisser (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
@isabelastisser Whoops! This issue is 2 days overdue. Let's get this updated quick!
Discussion here: https://expensify.slack.com/archives/C05LX9D6E07/p1726226725648319
@OlimpiaZurek, please reopen this issue once the P/S has been updated and approved in Slack. Thanks!
@isabelastisser I updated the P/S in Slack and also the description of the issue, but I can't reopen it.
Problem:
Using the spread operator to merge objects in some performance-critical situations (e.g., frequent function calls) creates unnecessary intermediate objects, negatively impacting memory and performance. The current ESLint rule enforces the spread operator, and developers may follow it without considering better alternatives like
Object.assign()
, which can improve code efficiency.Solution:
Adding Babel’s
plugin-transform-object-rest-spread
to convert spread operators toObject.assign()
at compile time. This approach maintains code consistency, reduces cognitive overhead for developers, and ensures performance optimizations without having to manually refactor each instance.