Skip to content

Latest commit

 

History

History
162 lines (112 loc) · 4.69 KB

CHANGELOG.md

File metadata and controls

162 lines (112 loc) · 4.69 KB

0.3.4

  • Fixed reactive setter not working on the server.
  • New isServer setup context property.

0.3.3

  • Fixed make __ob__ unenumerable #149.
  • Fixed computed type
  • Expose getCurrentInstance for advanced usage in Vue plugins.
  • New onServerPrefetch lifecycle hook and new ssrContext setup context property #198.

0.3.2

  • Improve TypeScript type infer for props option #106.
  • Fix return type of createComponent not being compatible with vue-router #130.
  • Expose listeners on SetupContext #132.

0.3.1

  • Fix cleaup callback not running when watcher stops #113.
  • Fix watcher callback not flushing at right timing #120.

0.3.0

  • Improve TypeScript type definitions.
  • Fix context.slots not being avaliable before render #84.

Changed

The render function returned from setup no longer receives any parameters.

Previous

export default {
  setup() {
    return props => h('div', prop.msg);
  },
};

Now

export default {
  setup(props) {
    return () => h('div', prop.msg);
  },
};

0.2.1

  • Declare your expected prop types directly in TypeScript:

    import { createComponent, createElement as h } from '@vue/composition-api';
    
    interface Props {
      msg: string;
    }
    
    const MyComponent =
      createComponent <
      Props >
      {
        props: {
          msg: {}, // required by vue 2 runtime
        },
        setup(props) {
          return () => h('div', props.msg);
        },
      };
  • Declare ref type in TypeScript:

    const dateRef = ref < Date > new Date();
  • Fix createComponent not working with import() #81.

  • Fix inject type declaration #83.

0.2.0

Fixed

  • computed property is called immediately in reactive() #79.

Changed

0.1.0

The package has been renamed to @vue/composition-api to be consistent with RFC.

The @vue/composition-api reflects the Composition API RFC.

2.2.0

  • Improve typescript support.
  • Export createElement.
  • Export SetupContext.
  • Support returning a render function from setup.
  • Allow string keys in provide/inject.

2.1.2

  • Remove auto-unwrapping for Array (#53).

2.1.1

  • Export set() function. Using exported set whenever you need to use Vue.set or vm.$set. The custom set ensures that auto-unwrapping works for the new property.
  • Add a new signature of provide: provide(key, value).
  • Fix multiple provide invoking per component.
  • Fix order of setup invoking.
  • onErrorCaptured not triggered (#25).
  • Fix this losing in nested setup call (#38).
  • Fix some edge cases of unwarpping.
  • Change context.slots's value. It now proxies to $scopeSlots instead of $slots.

2.0.6

Fixed

  • watch callback is called repeatedly with multi-sources

Improved

  • reduce watch() memory overhead

2.0.0

Implement the newest version of RFC

Breaking Changes

this is not available inside setup(). See setup for details.

Features

Complex Prop Types:

import { createComponent, PropType } from 'vue';

createComponent({
  props: {
    options: (null as any) as PropType<{ msg: string }>,
  },
  setup(props) {
    props.options; // { msg: string } | undefined
  },
});

1.x

Implement the init version of RFC