Allow .config.luau to require other .config.luaus#212
Conversation
|
To what degree does this solve the machine-writing problem? Is it just an assumed/given that tooling will need to do one of:
?
This feels like it could get messy fast, and could be mildly confusing semantics "why can all other files in this folder use this alias, but this one specific file can only use aliases defined elsewhere?". I can somewhat see the utility though. What happens if Given
alternative. If some requires are allowed in |
Maybe I shouldn't have given Package Managers as much focus as I did, but I believe if this was implemented then they could do either of those things. I think a package manager user would prefer the latter, that keeps more control with them.
The intent was to clarify that it is impossible for a config to do the following: -- Using `@myAlias`, but it's also defining it
local something = require("@myAlias/foo")
-- `@earlier` is defined in a config before us
local otherThing = require("@earlier/bar")
return {
luau = {
aliases = {
something = something.alias,
myAlias = "../../myAlias",
}
}
}At the point of the
After some thinking, I have updated RFC to specify it will have the same behavior in terms of mapping modules to actual files - i.e. I do think supporting use cases like the platform-dependent alias you described can be interesting and useful, but it does raise a lot more questions and it feels like it might be more than I'm willing to take on for this RFC. How would it determine the target platform? Would it be run through a CLI where a platform argument is provided? Would it need to read a file? How does that work with LSPs? Maybe that can instead be a sort of build system, one that generates configuration files - and I think this feature would make that easier to do for |
|
This would increase RBS complexity for basically no real gain. Very few embedders support the full RBS spec anyway atm, and this would just add another thing to worry about when implementing or otherwise discussing RBS semantics. |
Rendered.