Skip to content

Implement objectRestNoSymbols, setSpreadProperties and pureGetters for object rest/spread#12505

Merged
nicolo-ribaudo merged 4 commits into
babel:feat-7.13.0/babel-core-featuresfrom
nicolo-ribaudo:assumption/object-rest-spread
Jan 14, 2021
Merged

Implement objectRestNoSymbols, setSpreadProperties and pureGetters for object rest/spread#12505
nicolo-ribaudo merged 4 commits into
babel:feat-7.13.0/babel-core-featuresfrom
nicolo-ribaudo:assumption/object-rest-spread

Conversation

@nicolo-ribaudo

@nicolo-ribaudo nicolo-ribaudo commented Dec 15, 2020

Copy link
Copy Markdown
Member
Q                       A
Minor: New Feature? Yes
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

Main PR: #12219
RFC: babel/rfcs#5

While implementing objectRestNoSymbols and setSpreadProperties, I noticed that there is a third assumptions in this plugin: that getters are pure. Since we have exactly the pureGetters assumptions, I think it's fine to re-use it.

@nicolo-ribaudo nicolo-ribaudo added PR: New Feature 🚀 A type of pull request used for our changelog categories area: assumptions labels Dec 15, 2020
if (typeof loose !== "boolean") {
throw new Error(".loose must be a boolean, or undefined");
}
const { useBuiltIns = false } = opts;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

In Babel 8 we should change this default to be based on api.targets.

@babel-bot

babel-bot commented Dec 15, 2020

Copy link
Copy Markdown
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/37351/

Comment thread packages/babel-plugin-proposal-object-rest-spread/src/index.js
@codesandbox-ci

codesandbox-ci Bot commented Dec 15, 2020

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 53e6a15:

Sandbox Source
babel-repl-custom-plugin Configuration
babel-plugin-multi-config Configuration

@nicolo-ribaudo nicolo-ribaudo requested a review from hzoo January 12, 2021 15:29
@nicolo-ribaudo nicolo-ribaudo force-pushed the assumption/object-rest-spread branch from d9c06c0 to 526fa68 Compare January 12, 2021 15:29
@nicolo-ribaudo nicolo-ribaudo force-pushed the assumption/object-rest-spread branch from 526fa68 to 53e6a15 Compare January 12, 2021 16:35
@nicolo-ribaudo nicolo-ribaudo force-pushed the feat-7.13.0/babel-core-features branch from 63c7a5a to caa4fda Compare January 12, 2021 16:35
@nicolo-ribaudo nicolo-ribaudo merged commit a6af08c into babel:feat-7.13.0/babel-core-features Jan 14, 2021
@nicolo-ribaudo nicolo-ribaudo deleted the assumption/object-rest-spread branch January 14, 2021 01:58
nicolo-ribaudo added a commit to nicolo-ribaudo/babel that referenced this pull request Feb 4, 2021
nicolo-ribaudo added a commit to nicolo-ribaudo/babel that referenced this pull request Feb 10, 2021
nicolo-ribaudo added a commit to nicolo-ribaudo/babel that referenced this pull request Feb 11, 2021
nicolo-ribaudo added a commit that referenced this pull request Feb 16, 2021
- `mutableTemplateObject` and `ignoreToPrimitiveHint` (#12408)
- `setClassMethods` (#12407)
- `setComputedProperties` (#12490)
- `ignoreFunctionLength` (#12491)
- `noDocumentAll` (#12481)
- `iterableIsArray` and `arrayLikeIsIterable` (#12489)
- `pureGetters` (#12504)
- `skipForOfIteratorClosing` (#12496)
- `objectRestNoSymbols`, `setSpreadProperties` and `pureGetters` (#12505)
- `noNewArrows` (#12613, #12793)
- `setPublicClassFields` and `privateFieldsAsProperties` (#12497)
- `constantReexports` and `enumerableModuleMeta` (#12618)
- `constantSuper`, `superIsCallableConstructor` and `noClassCalls` (#12726)

Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
Co-authored-by: Huáng Jùnliàng <JLHwung@users.noreply.github.com>
nicolo-ribaudo added a commit that referenced this pull request Feb 16, 2021
- `mutableTemplateObject` and `ignoreToPrimitiveHint` (#12408)
- `setClassMethods` (#12407)
- `setComputedProperties` (#12490)
- `ignoreFunctionLength` (#12491)
- `noDocumentAll` (#12481)
- `iterableIsArray` and `arrayLikeIsIterable` (#12489)
- `pureGetters` (#12504)
- `skipForOfIteratorClosing` (#12496)
- `objectRestNoSymbols`, `setSpreadProperties` and `pureGetters` (#12505)
- `noNewArrows` (#12613, #12793)
- `setPublicClassFields` and `privateFieldsAsProperties` (#12497)
- `constantReexports` and `enumerableModuleMeta` (#12618)
- `constantSuper`, `superIsCallableConstructor` and `noClassCalls` (#12726)

Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
Co-authored-by: Huáng Jùnliàng <JLHwung@users.noreply.github.com>
nicolo-ribaudo added a commit that referenced this pull request Feb 21, 2021
- `mutableTemplateObject` and `ignoreToPrimitiveHint` (#12408)
- `setClassMethods` (#12407)
- `setComputedProperties` (#12490)
- `ignoreFunctionLength` (#12491)
- `noDocumentAll` (#12481)
- `iterableIsArray` and `arrayLikeIsIterable` (#12489)
- `pureGetters` (#12504)
- `skipForOfIteratorClosing` (#12496)
- `objectRestNoSymbols`, `setSpreadProperties` and `pureGetters` (#12505)
- `noNewArrows` (#12613, #12793)
- `setPublicClassFields` and `privateFieldsAsProperties` (#12497)
- `constantReexports` and `enumerableModuleMeta` (#12618)
- `constantSuper`, `superIsCallableConstructor` and `noClassCalls` (#12726)

Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
Co-authored-by: Huáng Jùnliàng <JLHwung@users.noreply.github.com>
@github-actions github-actions Bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Apr 15, 2021
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area: assumptions outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: New Feature 🚀 A type of pull request used for our changelog categories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants