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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: imports support #11

Merged
merged 5 commits into from
Feb 17, 2023
Merged

feat: imports support #11

merged 5 commits into from
Feb 17, 2023

Conversation

antfu
Copy link
Member

@antfu antfu commented Feb 17, 2023

No description provided.

get imports() {
throw new Error("Not implemented");
},
imports: createImportsProxy(root),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it makes sense that we also prefix imports/exports with $ too? (since they are not normal keys)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think that would make sense

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow up: #12

@pi0
Copy link
Member

pi0 commented Feb 17, 2023

Nice work and also refactors! I'm thinking we could support $imports/$exportsas iterator (array) to sub proxies forimportandexport nodes. Since an (esm) module can contain multiple of them. And use names as shortcut accessors to them (mod.$exports` is both an iterator array and can access using named keys). What do you think?

@antfu
Copy link
Member Author

antfu commented Feb 17, 2023

Yeah great ideas. I can do them in up coming PRs

@antfu antfu merged commit fd6f80f into main Feb 17, 2023
@antfu antfu deleted the feat/imports branch February 17, 2023 15:49
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

Successfully merging this pull request may close these issues.

None yet

2 participants