Skip to content
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

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

Open
OlimpiaZurek opened this issue Sep 13, 2024 · 4 comments
Open

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

OlimpiaZurek opened this issue Sep 13, 2024 · 4 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Reviewing Has a PR in review Weekly KSv2

Comments

@OlimpiaZurek
Copy link
Contributor

OlimpiaZurek commented Sep 13, 2024

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.

@OlimpiaZurek OlimpiaZurek added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 labels Sep 13, 2024
Copy link

melvin-bot bot commented Sep 13, 2024

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 melvin-bot bot added the Overdue label Sep 16, 2024
Copy link

melvin-bot bot commented Sep 16, 2024

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

@isabelastisser
Copy link
Contributor

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!

@melvin-bot melvin-bot bot removed the Overdue label Sep 16, 2024
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Sep 20, 2024
@OlimpiaZurek
Copy link
Contributor Author

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

@OlimpiaZurek OlimpiaZurek changed the title Disabling the ESLint Rule prefer-object-spread Add babel plugin-transform-object-rest-spread Sep 24, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

3 participants