luvit-loader: bug fixes and a refactor#364
Open
Bilal2453 wants to merge 2 commits intoluvit:masterfrom
Open
Conversation
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.luawas this luvi change luvit/luvi@4a6b3c3, it added@to the loaded bundle chunk names, but we are only checking forbundle:, 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.preloadtable first.