Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Tencent/omi
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2d636cd25f85dc1dde4b3546bc5790d0f7db2f83
Choose a base ref
...
head repository: Tencent/omi
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4c28c40c15222b3a3e3e16e27d3737305d4d4457
Choose a head ref
  • 4 commits
  • 3 files changed
  • 3 contributors

Commits on Feb 24, 2025

  1. chore(omi): npm publish

    dntzhang committed Feb 24, 2025
    Copy the full SHA
    7c28d8a View commit details

Commits on Mar 12, 2025

  1. Copy the full SHA
    9d67eb5 View commit details
  2. Merge remote-tracking branch 'remote/master'

    duenyang committed Mar 12, 2025
    Copy the full SHA
    1692310 View commit details
  3. Merge pull request #947 from duenyang/master

    fix: 通过 css props 插入的 style 标签层级保持和 shadowroot 一致
    dntzhang authored Mar 12, 2025
    Copy the full SHA
    4c28c40 View commit details
Showing with 6 additions and 12 deletions.
  1. +1 −1 packages/omi/package.json
  2. +4 −10 packages/omi/src/component.ts
  3. +1 −1 packages/omi/src/index.ts
2 changes: 1 addition & 1 deletion packages/omi/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "omi",
"version": "7.7.5",
"version": "7.7.7",
"scripts": {
"start": "vite",
"dev-vite": "vite",
14 changes: 4 additions & 10 deletions packages/omi/src/component.ts
Original file line number Diff line number Diff line change
@@ -178,7 +178,6 @@ export class Component<State = any> extends HTMLElement {
Object.keys(propTypes).forEach(propName => {
// 检查是否是复杂类型
const isComplexType = this.constructor.isComplexType(propName)

if (isComplexType) {
Object.defineProperty(this, propName, {
get: () => this.props[propName],
@@ -366,12 +365,9 @@ export class Component<State = any> extends HTMLElement {
attributes: {},
children: [this.props.css],
}
if ((rendered as VNode[]).push) {
;(rendered as VNode[]).push(styleVNode as ObjectVNode)
} else {
;(rendered as ObjectVNode).children.push(styleVNode as ObjectVNode)
}
return isArray(rendered) ? [...rendered, styleVNode] : [rendered, styleVNode]
}
return rendered
}

connectedCallback(): void {
@@ -385,8 +381,7 @@ export class Component<State = any> extends HTMLElement {
this.beforeRender()
this.fire('beforeRender', this)
// @ts-ignore
const rendered = this.render(this.props, this.store)
this.appendStyleVNode(rendered)
const rendered = this.appendStyleVNode(this.render(this.props, this.store))
this.rendered(rendered)
clearActiveComponent()
this.rootElement = diff(null, rendered as VNode, null, this, false)
@@ -426,8 +421,7 @@ export class Component<State = any> extends HTMLElement {
this.beforeRender()
this.fire('beforeRender', this)
// @ts-ignore
const rendered = this.render(this.props, this.store)
this.appendStyleVNode(rendered)
const rendered = this.appendStyleVNode(this.render(this.props, this.store))
this.rendered(rendered)
clearActiveComponent(null)

2 changes: 1 addition & 1 deletion packages/omi/src/index.ts
Original file line number Diff line number Diff line change
@@ -22,4 +22,4 @@ export type { Signal, SignalObject, Signal as SignalValue } from 'reactive-signa
export { css } from './css-tag'
export { mixin, globalCSS } from './options'
export { registerDirective } from './directive'
export const version = '7.7.5'
export const version = '7.7.7'