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

perf(compiler): remove object rest spread (BREAKING CHANGE) #3654

Merged
merged 6 commits into from
Oct 20, 2023

Conversation

nolanlawson
Copy link
Collaborator

@nolanlawson nolanlawson commented Aug 3, 2023

Details

Fixes #3577

Removes object rest spread transformation from the Babel transforms. This is only needed for browsers that don't support spread in object literals, which is well below our current minimum supported browser tier.

(Note that this PR will fail until #3648 is merged, due to Edge 18.)

Does this pull request introduce a breaking change?

  • 🚨 Yes, it does introduce a breaking change.

This is mildly breaking because it is observable. In particular, if you have a counter inside of a getter and are relying on the count to report a particular number, then this change will break you because the Babel transform does not behave exactly like the native behavior. E.g.:

let count = 0;
const {
  foo: {
    bar,
    ...quux
  }
} = {
  get foo() {
    count++;
    return { bar: 42 };
  }
};
console.log(count); // Logs 2 for Babel, 1 for native

This is judged as extremely unlikely to break anyone, but it is technically a breaking change.

Does this pull request introduce an observable change?

  • ⚠️ Yes, it does include an observable change.

See above.

GUS work item

W-13653003

@nolanlawson nolanlawson requested a review from a team as a code owner August 3, 2023 22:34
@nolanlawson nolanlawson added this to the 4.0.0 milestone Aug 3, 2023
@nolanlawson nolanlawson changed the title feat(versioning): remove object rest spread (BREAKING CHANGE) perf(compiler): remove object rest spread (BREAKING CHANGE) Aug 7, 2023
@nolanlawson

This comment was marked as outdated.

1 similar comment
@nolanlawson

This comment was marked as outdated.

@salesforce-nucleus

This comment was marked as outdated.

@nolanlawson nolanlawson changed the base branch from release-v4.0.0 to prerelease-v4.0.0 August 8, 2023 22:31
@nolanlawson

This comment was marked as outdated.

@salesforce-nucleus

This comment was marked as outdated.

@nolanlawson

This comment was marked as outdated.

@salesforce-nucleus

This comment was marked as outdated.

@nolanlawson

This comment was marked as outdated.

@salesforce-nucleus

This comment was marked as outdated.

@nolanlawson nolanlawson closed this Aug 9, 2023
@nolanlawson nolanlawson reopened this Aug 9, 2023
@salesforce-nucleus

This comment was marked as outdated.

@nolanlawson nolanlawson changed the base branch from prerelease-v4.0.0 to milestone-v4.0.0 August 9, 2023 23:12
@nolanlawson

This comment was marked as outdated.

@salesforce-nucleus

This comment was marked as outdated.

@nolanlawson

This comment was marked as outdated.

@salesforce-nucleus

This comment was marked as outdated.

@nolanlawson nolanlawson force-pushed the nolan/object-rest-spread-redux branch from 3230042 to 7ef08bc Compare August 10, 2023 15:48
@nolanlawson

This comment was marked as outdated.

@salesforce-nucleus

This comment was marked as outdated.

@nolanlawson

This comment was marked as outdated.

@nolanlawson

This comment was marked as outdated.

@salesforce-nucleus

This comment was marked as outdated.

@nolanlawson nolanlawson changed the base branch from milestone-v4.0.0 to master August 10, 2023 19:09
Copy link
Contributor

@divmain divmain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Really glad we can address issues like this with API versioning. Kudos!

@nolanlawson nolanlawson merged commit 48f622e into master Oct 20, 2023
8 of 11 checks passed
@nolanlawson nolanlawson deleted the nolan/object-rest-spread-redux branch October 20, 2023 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove Babel object spread transformation
2 participants