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

Support string literal export names #57017

Closed
6 tasks done
justinfagnani opened this issue Jan 11, 2024 · 2 comments Β· Fixed by #58640
Closed
6 tasks done

Support string literal export names #57017

justinfagnani opened this issue Jan 11, 2024 · 2 comments Β· Fixed by #58640
Labels
Duplicate An existing issue was already created Fix Available A PR has been opened for this issue

Comments

@justinfagnani
Copy link

justinfagnani commented Jan 11, 2024

πŸ” Search Terms

export string name literal

βœ… Viability Checklist

⭐ Suggestion

JavaScript allows exporting and importing names that are string literals and not just identifiers. This is for compatibility with future non-JS modules types that might not have the same restrictions on export names, like WASM, CSS, HTML, etc.

See https://tc39.es/ecma262/multipage/ecmascript-language-scripts-and-modules.html#prod-ModuleExportName

πŸ“ƒ Motivating Example

import {'product-card' as productCard} from './product.html` with {type: 'html'};
import {'fast-inverse-square-root' as fastInverseSquareRoot} from 'carmack.wasm';

πŸ’» Use Cases

  1. What do you want to use this for?
    Importing from non-JS modules and defining types for non-JS modules

  2. What shortcomings exist with current approaches?
    You can't do either of the above

  3. What workarounds are you using in the meantime?
    None?

@MartinJohns
Copy link
Contributor

Duplicate of #40594.

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Jan 12, 2024
@typescript-bot
Copy link
Collaborator

This issue has been marked as "Duplicate" and has seen no recent activity. It has been automatically closed for house-keeping purposes.

@typescript-bot typescript-bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 15, 2024
@typescript-bot typescript-bot added the Fix Available A PR has been opened for this issue label May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created Fix Available A PR has been opened for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants