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

support object rest #1542

Closed
wants to merge 4 commits into from
Closed

support object rest #1542

wants to merge 4 commits into from

Conversation

Rich-Harris
Copy link
Member

This supersedes #1541; I can't figure out how to commit to a pull request.

It doesn't solve the thorny issue we just found in Gitter:

<pre>{JSON.stringify(props)}</pre>

<script>
    export default {
        data: () => ({
            unwanted: 1,
            wanted: 2
        }),

        helpers: {
            JSON
        },

        computed: {
            props: ({ unwanted, ...props }) => props
        }
    };
</script>

After changing the value of 'wanted' a couple of times...

+ expected - actual

-<pre>{"wanted":6,"props":{"wanted":4,"props":{"wanted":2}}}</pre>
+<pre>{"wanted":6}</pre>

@Conduitry
Copy link
Member

Test failures look to just be caused by Node 6 not supporting object rest.

Committing to a pull request is something I had to keep re-learning how to do and eventually just made some notes for myself. To wit:

git checkout -b <what you want to call the branch locally>
git pull <https url to fork> <your branch name>
<commit, etc>
git push -u <https url> <branch name>

A little inconvenient, as you need to enter your username and password and can't just use your ssh key, but it does feel tidier than making a new PR.

@Rich-Harris
Copy link
Member Author

Wait, I messed this up. When we have ({ unwanted, ...props }), we're not saying that props is a dependency, we're saying that everything except unwanted is a dependency. (unwanted is also a dependency, since it's there in the object pattern, even though it's only there because we don't want it... rest properties are fun.) That's not expressed in this PR.

@Rich-Harris
Copy link
Member Author

closing in favour of #1628

@Rich-Harris Rich-Harris closed this Aug 4, 2018
@Conduitry Conduitry deleted the TehShrike-1540-rest-support branch November 25, 2018 02:27
@Conduitry Conduitry restored the TehShrike-1540-rest-support branch November 25, 2018 02:28
@Conduitry Conduitry deleted the TehShrike-1540-rest-support branch April 21, 2019 16:06
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.

3 participants