Skip to content

Fix: make __ob__ unenumerable and enable createComponent() accept tuple props. #147

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

Closed
wants to merge 3 commits into from

Conversation

wjw99830
Copy link
Contributor

Current nonReactive will put a __ob__ property to avoid reactivity in observe function, but in some clone functions, recursive references will throw error or make stack overflow such as JSON.stringify and vue-echarts.

@wjw99830
Copy link
Contributor Author

wjw99830 commented Sep 27, 2019

Example:

<template>
    <vue-echarts :options="nonReactiveOptions"></vue-echarts>
</template>
<script>
export default {
    setup() {
        const nonReactiveOptions = {};
        return { nonReactiveOptions };
    },
};
</script>

@wjw99830 wjw99830 changed the title Fix: make __ob__ unenumerable to avoid recursive references in clone. Fix: make __ob__ unenumerable and enable createComponent accept tuple props. Sep 27, 2019
@wjw99830 wjw99830 changed the title Fix: make __ob__ unenumerable and enable createComponent accept tuple props. Fix: make __ob__ unenumerable and enable createComponent() accept tuple props. Sep 27, 2019
@wjw99830
Copy link
Contributor Author

wjw99830 commented Sep 27, 2019

#146
Current createComponent() couldn't accept options with tuple props:

createComponent({
  props: ['prop1', 'prop2'],
});

Now it would work fine when props: ['prop1', 'prop2'] as const.

@pikax
Copy link
Member

pikax commented Sep 27, 2019

can you add some tests to that?

EDIT: Can you break down this into 2 PRs? since they are unrelated

@wjw99830 wjw99830 closed this Sep 27, 2019
@wjw99830
Copy link
Contributor Author

wjw99830 commented Sep 27, 2019

split this to __ob__ and tuple props

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.

2 participants