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

feat(typescript): Update to 5.5.4 #5959

Merged

Conversation

George-Payne
Copy link
Contributor

What is the current behavior?

Since stencil v4.20.0, if you set verbatimModuleSyntax: true in your tsconfig, you get unused errors for h and Fragment in every tsx file:

[ ERROR ]  TypeScript: file/path.tsx:21:1
           'h' is declared but its value is never read.

      L1:  import { h, type FunctionalComponent } from '@stencil/core';

This is caused by a bug in typescript, where jsxFactory and jsxFragmentFactory were not being marked as used: microsoft/TypeScript#59117

This bug has been fixed and released in v5.5.4.

What is the new behavior?

Updating stencil to use typescript v.5.5.4 allows you to use verbatimModuleSyntax.

Documentation

none

Does this introduce a breaking change?

  • Yes
  • No

Testing

  • Create a fresh Stencil project yarn create stencil
  • Add "verbatimModuleSyntax": true to the tsconfig.json
  • Optionally
    • "jsxFragmentFactory": "Fragment" to the tsconfig.json
    • Add fragment usage to my-component.tsx
  • Bulid and observe error:
    image
  • Update stencil in package.json to use changes in this PR.
  • Build and observe success:
    image

Other information

Discord discussion

@tanner-reits tanner-reits added this pull request to the merge queue Aug 29, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 29, 2024
@tanner-reits tanner-reits added this pull request to the merge queue Aug 29, 2024
Merged via the queue into ionic-team:main with commit ce153a0 Aug 29, 2024
88 checks passed
@George-Payne George-Payne deleted the update-typescript-to-5.5.4 branch August 29, 2024 14:14
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