bug: Component types missing when consumed from Stencil

未关闭
#30,661 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
typescript
领域
frontend

调研方向

使用 @ionic/core 8.2.8 和 8.2.9,按照文档中 Stencil 项目的步骤重现该问题,然后在 VS Code 中检查生成的 TSX 类型。完成的标准是 ion-* intrinsic element 类型再次可用,并且事件处理程序不再产生 implicit-any 错误。

由索引模型根据 Issue 内容生成。

描述

ionitron: needs reproduction
Prerequisites
Ionic Framework Version

v8.x

Current Behavior

I have a Stencil project where I consume @ionic/core. Starting with 8.2.9, the types for ion-* elements in the TSX files are no longer available. If I downgrade to 8.2.8, all is good.

When hovering in VS Code:

  • 8.2.8: (property) LocalJSX.IntrinsicElements["ion-item"]: LocalJSX.IonItem & JSXBase.HTMLAttributes<HTMLIonItemElement>
  • 8.2.9: (index) IntrinsicElements[string]: any

And the project won't compile because of Parameter 'ev' implicitly has an 'any' type. on all event handlers.

Expected Behavior

Types should be available.

Steps to Reproduce
  1. npm init stencil
  2. Select ionic-pwa [community]
  3. cd into project, npm install
  4. Inspect elements in VS Code. (IntrinsicElements[string]: any)
  5. npm i @ionic/[email protected]
  6. Inspect elements in VS Code. (LocalJSX.IntrinsicElements["ion-..."]:)
  7. npm i @ionic/[email protected]
  8. Inspect elements in VS Code. (IntrinsicElements[string]: any)
Code Reproduction URL
Ionic Info

npm 10.9.2
node 23.11.0
@ionic/core 8.2.9
@stencil/core 4.36.3

Additional Information

No response

主要语言
TypeScript
星标
52.8k
派生
13.3k
平均合并
3 天 1 小时
30 天内合并 PR
86

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ionic-team/ionic-framework 的其他 Issue

查看 ionic-team/ionic-framework 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。