Open LPGhatguy opened 2 years ago
I think I need this also. Trying to implement some kind of hot reloading using rojo and roblox-ts. I am using @rbxts/net for events and if I run game (Play Solo) and connect to rojo. Those events will be removed as those files are generated runtime in the filesystem.
@LPGhatguy Perhaps you know any "hack" to cope with such problems?
You can connect to a running DataModel with Rojo. That's the best way to do hot reloading today.
thanks, doing that. Just confirming what steps I am doing:
@rbxts/net
generates networking files into ReplicatedStorage/rbxts_include/node_modules/net/out/_NetManaged/toggleCampaignStartButton
ReplicatedStorage/rbxts_include/node_modules/net/out/_NetManaged
gets removed by sync because it is not actually in rojo DataModel.Do you know if there Is a way to prevent last step?
In rojo config I have:
"ReplicatedStorage": {
"$className": "ReplicatedStorage",
"rbxts_include": {
"$path": "../../include",
"node_modules": {
"$path": "../../node_modules/@rbxts"
}
}
...
}
...
Would ignoreUnknownInstances help?
Right, ignoreUnknownInstances
can help here.
When talking about instances, I recommend using Roblox's naming convention, ie ReplicatedStorage.rbxts_include.node_modules
, to distinguish instances from file paths. @rbxts/net
isn't generating files, it's making instances at runtime. That is definitely a case where the current hot reloading approach with Rojo is not great.
Thanks. Do you know if there is a Roblox-TS and Rojo open-source project that has working hot reloading? I have hot reloading, but It works only one time. I think I need to watch entire ReplicatedStorage and ServerScriptService and do stuff by name instead. But if there already is some working sources, then don't need to debug that needlessly.
Today, some Rojo users connect the Rojo studio plugin from running playtest DataModels. For some projects, this works out of the box, and in conjunction with a hot reloading library, delivers an unrivaled edit-debug loop.
However, if an instance that is fully managed by Rojo is also mutated at runtime, this can cause funny side effects.
We should support a couple features that will make hot reloading in Rojo much better:
$ignoreUnknownInstances
on every instance