Skip to content

Conversation

@xk86
Copy link

@xk86 xk86 commented Apr 10, 2025

This changes the requires to use strings, instead of Roblox script paths. In order to accomplish this, some slight changes were made to the internal structure:

source/List/init.luau and source/Dictionary/init.luau have been moved to source/ListInit.luau and source/DictionaryInit.luau, respectively, to allow for relative path names to be preserved. Accordingly, the requires in init.luau for Freeze now refer to ./Freeze/ListInit and ./Freeze/DictionaryInit. This keeps the amount of changes to the actual structure of the project to a minimum, and the names "ListInit" and "DictionaryInit" can be changed.

The imports resolve correctly in Roblox studio:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Freeze = require(ReplicatedStorage.Packages.Freeze)
local Dictionary = Freeze.Dictionary
local List = Freeze.List
...

Some tools (such as selene) may not support string based requires yet, so this may generate warnings or complaints from them.

Outside of Roblox, the libraries require manual specification for right now:

(from .lune, in the project root):

local List = require("../source/ListInit")
local Dictionary = require("../source/DictionaryInit")
...

This change lays the groundwork for future efforts to package Freeze for outside use.

Closes #20

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.

Support String Requires

1 participant