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

Generated export seems invalid #168

Closed
zifeo opened this issue Sep 30, 2023 · 4 comments · Fixed by #256
Closed

Generated export seems invalid #168

zifeo opened this issue Sep 30, 2023 · 4 comments · Fixed by #256
Labels
bug Something isn't working target-deno This is about the Deno target

Comments

@zifeo
Copy link

zifeo commented Sep 30, 2023

The following code generate some likely invalid values:

export {
  core,
  runtimes,
  utils,
  core as "metatype:typegraph/core",
  runtimes as "metatype:typegraph/runtimes",
  utils as "metatype:typegraph/utils",
};

Same repro as #102.

@guybedford
Copy link
Collaborator

This is correct - these are exported interface names. In JavaScript it is valid to export arbitrary strings as exports.

@zifeo
Copy link
Author

zifeo commented Oct 5, 2023

@guybedford I suppose this is again a deno compat limitation. What is the exact uses of those?

@guybedford
Copy link
Collaborator

@zifeo it's effectively the distinction between a registry name and a module export, where components can export registry-named pieces of code that can be used to globally define interfaces or implementations. The TypeScript issue to track is microsoft/TypeScript#40594.

We could potentially have an option to customize this and in the Deno case, to disable this feature just like we do in the TypeScript generation right now.

@yoshuawuyts yoshuawuyts added bug Something isn't working target-deno This is about the Deno target labels Oct 19, 2023
@zifeo
Copy link
Author

zifeo commented Nov 20, 2023

@guybedford Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working target-deno This is about the Deno target
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants