Skip to content
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

Add observability hooks for required modules #318

Closed
rdw-software opened this issue Oct 8, 2023 · 1 comment · Fixed by #528
Closed

Add observability hooks for required modules #318

rdw-software opened this issue Oct 8, 2023 · 1 comment · Fixed by #528

Comments

@rdw-software
Copy link
Member

rdw-software commented Oct 8, 2023

The basic idea is that a list of dependencies can be generated by observing the virtual file names passed while running test suites etc.

Quick prototype:

local require = _G.require
	_G.require = function(virtualFileName)
		printf("Required module: %s", virtualFileName)
		return require(virtualFileName)
	end

It might make sense to add an event for this so that it can simply be triggered with the trace command? (requires #55 )

@rdw-software
Copy link
Member Author

rdw-software commented Feb 2, 2024

Will this conflict with LUAZIP searchers?

If vfs.require is used to load files from zip apps, it should also support observability hooks, with no code changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment