Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Merge requests
  • !12534

Using import type for types imports [typescript-fetch]

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/orange-buffalo/import-types into master Jun 04, 2022
  • Overview 1
  • Commits 1
  • Pipelines 0
  • Changes 68

Created by: orange-buffalo

When generating code with typescript-fetch, it creates imports of both types and values via import statement. This causes issues with modern toolset (e.g. Vite or esbuild) due to separate processing of individual modules and type erasure - as a result, import statement refers to no longer existing export.

Typescript 3.8 introduces import type statement for importing types. typescript-fetch already generates Typescript 4.0 which has this support. Hence this PR suggests usage of import type statement for importing types during typescript-fetch generation.

See also #11179 (closed).

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/orange-buffalo/import-types