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

[feature] JSR bundler should handle @deno-types/@ts-types import map remapping #837

Open
nestarz opened this issue Nov 19, 2024 · 0 comments

Comments

@nestarz
Copy link

nestarz commented Nov 19, 2024

Description
When using the JSR bundler with type specifiers like @deno-types or @ts-types, it appears that only the actual imports are remapped according to the import map, but not the type specifiers themselves.

Example
Given this code:

// @ts-types="@types/react"
import React from "react";

And this import map (in deno.json or jsr.jsonc):

{
  "imports": {
    "@types/react": "npm:types-react@^19.0.0-rc",
    "react": "npm:react@^19.0.0-rc"
  }
}

Questions

  1. Does the JSR bundler support remapping these type specifiers according to the import map?
  2. If yes, how can we enable this functionality?
  3. If no, is this a planned feature?

Current Behavior
The bundler only seems to remap the actual imports but not the type specifier directives.

// @ts-types="@types/react"
import React from "npm:react@^19.0.0-rc";

Expected Behavior
Type specifiers should also be remapped according to the import map configuration.

// @ts-types="npm:types-react@^19.0.0-rc"
import React from "npm:react@^19.0.0-rc";
@github-project-automation github-project-automation bot moved this to Needs Triage in JSR Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs Triage
Development

No branches or pull requests

1 participant