Skip to content

Releases: Tencent/omi

v7.6.6

29 Feb 00:53
Compare
Choose a tag to compare
fix(omi): computed fn should run only once

Using v1.0.2 of reactive-signal

20 Jan 01:53
Compare
Choose a tag to compare

v7.5.6

12 Jan 12:16
Compare
Choose a tag to compare
refactor(omi): props.children have lower priority and coverage mode

Function component is supported! 🎉

12 Jan 03:41
Compare
Choose a tag to compare
function ChildComponent(props) {
  return (
    <span>{props.msg}</span>
  )
}

class ParentComponent extends Component {
  render() {
    return (
      <div>
        <ChildComponent msg="omi" />
      </div>
    )
  }
}

More concise static props definitions for cross framework use🎉

11 Jan 02:32
Compare
Choose a tag to compare
import { tag, Component, h, bind } from 'omi'

@tag('my-counter')
class MyCounter extends Component {
  static props = {
    count: {
      type: Number,
      default: 0,
      changed(newValue, oldValue) {
        this.state.count = newValue
        this.update()
      }
    }
  }

  state = {
    count: null
  }

  install() {
    this.state.count = this.props.count
  }

  @bind
  sub() {
    this.state.count--
    this.update()
    this.fire('change', this.state.count)
  }

  @bind
  add() {
    this.state.count++
    this.update()
    this.fire('change', this.state.count)
  }

  render() {
    return (
      <>
        <button onClick={this.sub}>-</button>
        <span>{this.state.count}</span>
        <button onClick={this.add}>+</button>
      </>
    )
  }
}

Using constructor as tag name

02 Jan 12:38
Compare
Choose a tag to compare
import { Button } from './button' 

class MyApp extends Component {
  render() {
    return (
      <Button>test</Button>
    )
  }
}

v7.3.10

20 Dec 08:38
Compare
Choose a tag to compare
fix(omi): missing form element value

Lazy definition

03 Dec 10:09
Compare
Choose a tag to compare

If we are writing a component library and need to use tree shaking capabilities,

import { WeButton } from 'ui-lib' 

It could lead to definition failure if Button is not used, as it would be tree-shaken away. Therefore, we need to use Button, for example,

WeButton.define('we-button')

v7.3.8

30 Nov 03:52
Compare
Choose a tag to compare
feat(omi): asynchronous execution of directive function

v7.3.6

10 Nov 00:55
Compare
Choose a tag to compare
fix(omi): inserted node of fragment disappears in installed function