Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐞] TS4023 issue when using QwikIntrinsicElement #5140

Closed
gparlakov opened this issue Sep 10, 2023 · 1 comment · Fixed by #5141
Closed

[🐞] TS4023 issue when using QwikIntrinsicElement #5140

gparlakov opened this issue Sep 10, 2023 · 1 comment · Fixed by #5141
Labels
TYPE: bug Something isn't working WAITING FOR: team Waiting for one of the core team members to review and reply

Comments

@gparlakov
Copy link
Contributor

gparlakov commented Sep 10, 2023

Which component is affected?

Qwik Runtime

Describe the bug

When creating a UI library for Qwik and strong typing the properties using QwikIntrinsicElement used like

export type MyLabelProp = QwikIntrinsicElement['label']

that results in a TS4023 issue.

Reproduction

https://github.com/gparlakov/qwik-lib-TS4023-issue-repro

Steps to reproduce

Repro for issue

  • pnpm i (or yarn or npm)
  • npx tsc -p to build the project and emit the d.ts files
  • notice the TS4023 error

(excluding the file label.tsx results in successful build and d.ts files gen)

System Info

System:
    OS: Linux 6.2 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
    CPU: (8) x64 Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
    Memory: 1.20 GB / 7.61 GB
    Container: Yes
    Shell: 5.8.1 - /usr/bin/zsh
  Binaries:
    Node: 18.16.0 - ~/.nvm/versions/node/v18.16.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v18.16.0/bin/yarn
    npm: 9.5.1 - ~/.nvm/versions/node/v18.16.0/bin/npm
    pnpm: 8.7.4 - ~/.nvm/versions/node/v18.16.0/bin/pnpm
  npmPackages:
    @builder.io/qwik: ^1.2.10 => 1.2.10

Additional Information

Suggest exporting all from the jsx-generated.ts file instead of just the few types currently exported.

Previously libraries have done that like ngrx/platform#1118 or guessing what was done to fix #2783

TS issue microsoft/TypeScript#5711

@gparlakov gparlakov added STATUS-1: needs triage New issue which needs to be triaged TYPE: bug Something isn't working labels Sep 10, 2023
@gparlakov
Copy link
Contributor Author

gparlakov added a commit to gparlakov/qwik that referenced this issue Sep 10, 2023
@shairez shairez added WAITING FOR: team Waiting for one of the core team members to review and reply and removed STATUS-1: needs triage New issue which needs to be triaged labels Sep 12, 2023
gparlakov added a commit to gparlakov/qwik that referenced this issue Sep 13, 2023
Update api.md with the exposed DevJSX and QwikIntrinsicElements constituents

re QwikDev#5140
gparlakov added a commit to gparlakov/qwik that referenced this issue Sep 13, 2023
mhevery pushed a commit that referenced this issue Sep 15, 2023
)

* fix(core.d.ts): export HTMLAttributes and DevJSX to fix TS4023 issue when creating qwik UI lib

fix #5140

* docs: update api.md

Update api.md with the exposed DevJSX and QwikIntrinsicElements constituents

re #5140

* docs(core.d.ts): add public annotation to exported types

Add public annotation to exported types

re #5140
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TYPE: bug Something isn't working WAITING FOR: team Waiting for one of the core team members to review and reply
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants