Skip to content

refactor: migrate griffith to TS#205

Merged
ambar merged 12 commits intozhihu:masterfrom
ambar:ts-griffith-pkg
Sep 9, 2021
Merged

refactor: migrate griffith to TS#205
ambar merged 12 commits intozhihu:masterfrom
ambar:ts-griffith-pkg

Conversation

@ambar
Copy link
Collaborator

@ambar ambar commented Sep 9, 2021

  • 使用 ts-migrate 迁移 griffith 包
  • 配置 @typescript-eslint,预防类型错误,由于它比较严格目前没有全量通过 —— 仅处理了所有 ts-migrate 后的 @ts-expect-error 错误
  • example 中使用将包 alias 到源码,避免等待,因为有 tsc 类型构建太慢了
  • 修复:MessageContext 中的订阅没有正确销毁, mount/unmout 中命名不一致(ts lint 能轻易发现这种问题):
    componentDidMount() {
    if (this.props.enableCrossWindow) {
    this.crossWindowMessageSubscription = this.subscribeCrossWindowMessage(
    this.dispatchAction
    )
    }
    }
    componentWillUnmount() {
    if (this.crossWindowEventSubscription) {
    this.crossWindowEventSubscription.unsubscribe()
    }
    }
  • 修复:PlayerContainer 到 Player 错误传递了 prop 名称(ts lint 能轻易发现这种问题,TODO: 应该让 prop 命名更一致,如 noVolumnButton):
    hiddenVolumeItem={hiddenVolume}

    hiddenVolume: PropTypes.bool,

@ambar ambar merged commit ca9139e into zhihu:master Sep 9, 2021
@ambar ambar deleted the ts-griffith-pkg branch September 13, 2021 05:42
@ambar ambar mentioned this pull request Sep 17, 2021
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