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
Recursively export constants from modules #10049
Conversation
This might be a reason why regular `let` might be problematic in modules. In the case of `const`, we can grab the value directly from the parsed results, but with `let`, we might need to evaluate the module.
Just discovered that when you import constants with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks like a very good PR to me, very good job 👌
and i love your examples 🙏 ❤️
i just have a question about one test 😏
also, maybe we should wait for after the release at this point? |
I'd personally include it in the release, since the original export const implementation had some rough edges that are easy to encounter. We could ship with a more polished experience. |
85fa2c5
to
db7d162
Compare
thanks for answering my thread @kubouch 🙏 |
Thanks! LGTM! I've tried and played with it, and it works pretty good! |
let's land this before we freeze for the release for real 🥳 |
Description
#9773 introduced constants to modules and allowed to export them, but only within one level. This PR:
Should unblock #9678
Example:
Limitation 1:
Considering the above
spam
module, attempting to geteggs bacon
fromspam
module doesn't work directly:Workaround (for example):
I'm thinking I'll just leave it in, as you can easily work around this. It is also a limitation of the import pattern in general, not just constants.
Limitation 2:
overlay use
successfully imports the constants, butoverlay hide
does not hide them, even though it seems to hide normal variables successfully. This needs more investigation.User-Facing Changes
Allows recursive constant exports from submodules.
Tests + Formatting
After Submitting