Skip to content

luvit-loader: bug fixes and a refactor#364

Open
Bilal2453 wants to merge 2 commits intoluvit:masterfrom
Bilal2453:refactor-luvit-loader
Open

luvit-loader: bug fixes and a refactor#364
Bilal2453 wants to merge 2 commits intoluvit:masterfrom
Bilal2453:refactor-luvit-loader

Conversation

@Bilal2453
Copy link
Contributor

Fixes #357, Fixes #363

Also reverts back the searcher return order, see #333 (comment), assuming this was an unintended change.

The main issue here that makes luvit-loader unable to find package.lua was this luvi change luvit/luvi@4a6b3c3, it added @ to the loaded bundle chunk names, but we are only checking for bundle:, not @bundle:.

While trying to understand the code I couldn't help myself but refactor this so my simple brain can understand it, the most important change is the dropping of all path reimplementation and instead depending on luvi's. This makes sense, because lit only ever runs on luvi, and as far as lit is concerned it makes no difference. The two implementations should be identical, in fact I believe the path code was copied as is.

Also made the loader/searcher get inserted as the second searcher instead of the first, this allows Lua to check for the package.preload table first.

fix: failing to recognize bundles when prefix is @Bundle:
fix: package.searchers wrong return order
feat: allow preload loader/searcher to run first
refactor: remove path implementation and depend on luvi's
breaking: disallow non-luvi runtimes (lit is always luvi)
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.

module './package' not found on latest luvi? (commit/unstable) module './package' not found on non-LuaJIT variant of luvi

1 participant