You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
print(`[HotReload] Failed to deserialize bytecode for {self.Source}: {deserialized}`)
144
+
print(`[Graft] Failed to deserialize bytecode for {self.Source}: {deserialized}`)
145
145
end
146
146
147
147
localmodule=self.Module
@@ -157,7 +157,7 @@ local function reload(self: HotReload)
157
157
end
158
158
159
159
localfunctionChangeError=
160
-
`[HotReload] Changing the amount of functions or rearranging them is not yet supported. Not hot reloading. (source: {self.Source})`
160
+
`[Graft] Changing the amount of functions or rearranging them is not yet supported. Not patching. (source: {self.Source})`
161
161
162
162
if#module.protoList~=#deserialized.protoListthen
163
163
print(functionChangeError)
@@ -168,7 +168,7 @@ local function reload(self: HotReload)
168
168
localdProto=deserialized.protoList[index]
169
169
ifproto.nups~=dProto.nupsthen
170
170
print(
171
-
`[HotReload] Changing the amount of upvalues that a function has is not yet supported. Not hot reloading. (line: {dProto.linedefined}, function name: {dProto.debugname}, source: {self.Source})`
171
+
`[Graft] Changing the amount of upvalues that a function has is not yet supported. Not patching. (line: {dProto.linedefined}, function name: {dProto.debugname}, source: {self.Source})`
172
172
)
173
173
return
174
174
end
@@ -184,7 +184,7 @@ local function reload(self: HotReload)
184
184
end
185
185
end
186
186
187
-
print(`[HotReload] Hot reloading {self.Source}`)
187
+
print(`[Graft] Patching {self.Source}`)
188
188
189
189
module.stringList=deserialized.stringList
190
190
module.typesVersion=deserialized.typesVersion
@@ -214,21 +214,21 @@ end
214
214
--[=[
215
215
Asks the [Interface] for the updated source code and then hot reloads the code.
Copy file name to clipboardExpand all lines: src/interface.luau
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -3,10 +3,10 @@
3
3
--[=[
4
4
@class Interface
5
5
6
-
An interface is required in order to create a [HotReload] object.
6
+
An interface is required in order to create a [Graft] object.
7
7
It provides all the required information to it that it needs in order to perform hot reloading (mainly watching for changes and reading / compiling code sources).
8
8
9
-
The main reason why this can't be included in the library by default is because raw luau can't actually read it's own source code or watch for io changes.
9
+
The main reason why this can't be included in the library by default is because pure Luau can't actually read it's own source code or watch for io changes.
10
10
Because of this, there's really no standard to the implementation that runtimes that do support this chooses to have.
11
11
12
12
It's planned in the future to create packages for these runtimes which will implement this interface for you. Which will be listed here.
@@ -22,9 +22,9 @@ export type Interface = {
22
22
@return buffer
23
23
@yields
24
24
25
-
Function that will compile and return the bytecode of the luau module to run.
25
+
Function that will compile and return the bytecode of the Luau module to run.
26
26
27
-
This function may get called multiple times, once while constructing the [HotReload] object, and then whenever [HotReload:Reload] gets called.
27
+
This function may get called multiple times, once while constructing the [Graft] object, and then whenever [Graft:Patch] gets called.
28
28
29
29
The function may throw errors, in which case the error will get caught and hot reloading won't happen until the next reload.
0 commit comments