Ryan Liptak
Ryan Liptak
To attempt to demonstrate [the issue I brought up with relative requires](https://github.com/luvit/luvit/pull/932#issuecomment-251220350), here's a simple (and somewhat likely) example: File structure: ``` init.lua deps/ +- one/ +- package.lua +- init.lua...
Yeah, I think that'd make the most sense--add a separate module specifically for relative requires. Another alternative would be to add a function that resolves a relative path to an...
@creationix the current loader has basic support for Linux absolute paths (but not Windows): https://github.com/luvit/luvit/pull/932/files#diff-b511e047bb8a8ec669ceeedd21cc8a73R176 @SoniEx2 not sure how that's relevant.
I like that. It seems Luvit has been moving towards plain Lua conventions for a while, so this just seems like another leap towards that. What about deps/libs special handling?
That seems like it might be a bit odd, as that would mean you'd need to write different code to require a Lit-style dependency as opposed to a Lua-style one,...
> You're right that require alone can't do lit style path resolving exactly because of the problem with the cache you found. I don't think I've said there's a problem...
> A resolve library can implement this logic and pass on lua style module names to require. Absolutely, I just don't think it should be the _only_ way to require...
I think he's basically suggesting what luvit's `require` module does now (store it's own cache of loaded modules, separate from `package.loaded`). I'm not sure it's possible to re-implement that scheme...
I think this might be a difference in `url.parse` rather than `url.format` (the url gets run through `url.parse` at the start of `url.format`).
Strange, I don't see where that would be happening in the node implementation: https://github.com/nodejs/node/blob/e767ed0558a17b87e543b79d1f842821fbdb8e6b/lib/url.js#L575-L660