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 arbitrary module namespace identifier names #52092

Closed
5 tasks done
qurafi opened this issue Jan 4, 2023 · 2 comments
Closed
5 tasks done

Support arbitrary module namespace identifier names #52092

qurafi opened this issue Jan 4, 2023 · 2 comments

Comments

@qurafi
Copy link

qurafi commented Jan 4, 2023

Suggestion

The new ES2022 standard allows to use string literals in module exports and imports:

import {"\0 any unicode" as foo} from "";
export {foo as "\0 any unicode"};

Ref: tc39/ecma262#2154

This feature is supported in NodeJS since v16(2021) and I have been using this feature but typescript complains about invalid syntax and I don't see this feature in the roadmap?.

🔍 Search Terms

String literals import and export

✅ Viability Checklist

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript/JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
  • This feature would agree with the rest of TypeScript's Design Goals.
@IllusionMH
Copy link
Contributor

Duplicate of #40594

@qurafi
Copy link
Author

qurafi commented Jan 4, 2023

I have been searching hours for similar issue. Anyways, This issue still open from 2 years ago, any update or plan to support it next versions?

@qurafi qurafi closed this as completed Jan 4, 2023
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

No branches or pull requests

2 participants