Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.56k stars 2.9k forks source link

Add babel plugin-transform-object-rest-spread #49168

Open OlimpiaZurek opened 2 months ago

OlimpiaZurek commented 2 months ago

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 to Object.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.

melvin-bot[bot] commented 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.

melvin-bot[bot] commented 2 months ago

@isabelastisser Whoops! This issue is 2 days overdue. Let's get this updated quick!

isabelastisser commented 2 months ago

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!

OlimpiaZurek commented 1 month ago

@isabelastisser I updated the P/S in Slack and also the description of the issue, but I can't reopen it.