-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clear all consumers when a module changes (#9)
* Add the beginning of consumer cache invalidation * Clear the consumer cache on source change * Update .gitignore * Add test for ensuring no interference Also removes the ConsumerTest folder for generating on the fly * Unfocus * Remove debug prints * Create a module for getCallerPath
- Loading branch information
vocksel
authored
Jun 11, 2022
1 parent
a472460
commit 8a7a226
Showing
5 changed files
with
185 additions
and
17 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# Rojo | ||
/*.rbxl* | ||
/*.rbxm* | ||
sourcemap.json | ||
|
||
# Selene | ||
/roblox.toml | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
rojo build dev.project.json -o studio-tests.rbxl | ||
run-in-roblox --place studio-tests.rbxl --script tests/init.server.lua |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
local root = script.Parent | ||
|
||
local LOADSTRING_PATH_PATTERN = '%[string "(.*)"%]' | ||
|
||
local function getCallerPath() | ||
local level = 1 | ||
|
||
while true do | ||
local path = debug.info(level, "s") | ||
|
||
if path then | ||
-- Skip over any path that is a descendant of this package | ||
if not path:find(root.Name, nil, true) then | ||
-- Sometimes the path is represented as `[string "path.to.module"]` | ||
-- so we match for the instance path and, if found, return it | ||
local pathFromLoadstring = path:match(LOADSTRING_PATH_PATTERN) | ||
|
||
if pathFromLoadstring then | ||
return pathFromLoadstring | ||
else | ||
return path | ||
end | ||
end | ||
else | ||
return nil | ||
end | ||
|
||
level += 1 | ||
end | ||
end | ||
|
||
return getCallerPath |
This file contains 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
This file contains 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