Skip to content

Releases: Tencent/omi

Support CSSStyleSheet injection

23 Jun 03:25
Compare
Choose a tag to compare
v6.19.5

feat(omi): support CSSStyleSheet injection

Using adoptedStyleSheets to static css

23 Jun 03:15
Compare
Choose a tag to compare
v6.19.4

chore: tab to 2 space

Remove dead code

18 May 14:02
Compare
Choose a tag to compare
v6.19.3

publish(omi): remove dead code & fix omi.d.ts

Update omi.d.ts

05 May 13:45
Compare
Choose a tag to compare

Fix onclick, onblur lint errors.

Fix light dom diff error when component exec update method

02 May 05:17
Compare
Choose a tag to compare
v6.19.1

publish(omi): v6.19.1, fix diff error when using ligth dom

Fix prevProps losing

02 May 02:03
Compare
Choose a tag to compare
v6.19.0

publish(omi): v6.19.0, fix prevProps losing

Light DOM Supported in Functional Style Define

30 Apr 22:41
Compare
Choose a tag to compare
define('my-ele', _ => {
  return <span>Hello Light Dom</span>
}, {
  isLightDom: true
})

Light DOM Supported

30 Apr 04:56
Compare
Choose a tag to compare
import { define, WeElement } from 'omi'

define('my-component', class extends WeElement {
  static propTypes = {
    first: String,
    last: String
  }

  static isLightDom = true

  render(props) {
   return <div>
     Hello, World! I'm {props.first}, {props.last}
    </div>
  }
})

Support options.ignoreAttrs

25 Apr 09:44
Compare
Choose a tag to compare

When using OMI to render the whole application, you don't need to get prop through getAttribute, you can set options.ignoreAttrs to true to improve performance.

forceUpdate and UpdateProps

18 Apr 03:06
Compare
Choose a tag to compare

Before v6.17.3

Ignore attributes in html mode and update:

this.update(true)

For example, click on the mask of the pop-up layer to close the pop-up, pass it to the parent component in the react, let the parent component update, while Omi advocates self-update, so that the diff area is smaller.

onMaskClick = ()=> {
  //change props
  this.props.show = false
  //prevent parent component from updating diff without results
  this.prevProps.show = false
  //update self and ignore attributes in html mode
  this.update(true)
  //trigger events, which can be used to change external state variables to maintain consistency, but external components need not be updated
  this.fire('close')
}

Now

Ignore attributes in html mode and update:

this.forceUpdate()

For example, click on the mask of the pop-up layer to close the pop-up, pass it to the parent component in the react, let the parent component update, while Omi advocates self-update, so that the diff area is smaller.

onMaskClick = ()=> {
  this.updateProps({
    show: false
  })
  
  this.fire('close')
}