mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 05:51:39 +00:00
Track what needs to be done in-source
This commit is contained in:
parent
63ea182f94
commit
bf6766919e
8 changed files with 15 additions and 4 deletions
|
|
@ -8,6 +8,7 @@ local HttpError = require(script.Parent.HttpError)
|
|||
local ApiContext = {}
|
||||
ApiContext.__index = ApiContext
|
||||
|
||||
-- TODO: Audit cases of errors and create enum values for each of them.
|
||||
ApiContext.Error = {
|
||||
ServerIdMismatch = "ServerIdMismatch",
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ local function dprint(...)
|
|||
end
|
||||
end
|
||||
|
||||
-- TODO: Factor out into separate library, especially error handling
|
||||
local Http = {}
|
||||
|
||||
function Http.get(url)
|
||||
|
|
|
|||
|
|
@ -45,6 +45,8 @@ local function main()
|
|||
|
||||
local currentSession
|
||||
|
||||
-- TODO: More robust session tracking to handle errors
|
||||
-- TODO: Icon!
|
||||
toolbar:CreateButton("Connect", "Connect to Rojo Session", "")
|
||||
.Click:Connect(function()
|
||||
checkUpgrade()
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ function Session.new()
|
|||
|
||||
setmetatable(self, Session)
|
||||
|
||||
-- TODO: Rewrite all instance tracking logic and implement a real reconciler
|
||||
local created = {}
|
||||
|
||||
created["0"] = game:GetService("ReplicatedFirst")
|
||||
|
||||
local api
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ use std::path::{Path, PathBuf, Component};
|
|||
|
||||
use partition::Partition;
|
||||
|
||||
// TODO: Change backing data structure to use a single allocation with slices
|
||||
// taken out of it for each portion
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
pub struct FileRoute {
|
||||
pub partition: String,
|
||||
|
|
|
|||
|
|
@ -9,9 +9,6 @@ pub enum Message {
|
|||
InstanceChanged {
|
||||
id: Id,
|
||||
},
|
||||
Error {
|
||||
message: String
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ use session::SessionConfig;
|
|||
use vfs_session::{VfsSession, FileItem, FileChange};
|
||||
use message_session::{Message, MessageSession};
|
||||
|
||||
// TODO: Rethink data structure and insertion/update behavior. Maybe break some
|
||||
// pieces off into a new object?
|
||||
fn file_to_instances(
|
||||
file_item: &FileItem,
|
||||
partition: &Partition,
|
||||
|
|
@ -81,6 +83,8 @@ fn file_to_instances(
|
|||
output.get_mut(&child_id).unwrap().parent = Some(primary_id);
|
||||
|
||||
changed_ids.push(child_id);
|
||||
|
||||
// TODO: Should I stop using drain on Vecs of Copyable types?
|
||||
for id in child_changed_ids.drain(..) {
|
||||
changed_ids.push(id);
|
||||
}
|
||||
|
|
@ -99,6 +103,7 @@ pub struct RbxSession {
|
|||
message_session: MessageSession,
|
||||
|
||||
/// The RbxInstance that represents each partition.
|
||||
// TODO: Can this be removed in favor of instances_by_route?
|
||||
partition_instances: HashMap<String, Id>,
|
||||
|
||||
/// The store of all instances in the session.
|
||||
|
|
@ -153,6 +158,7 @@ impl RbxSession {
|
|||
self.message_session.push_messages(&messages);
|
||||
},
|
||||
FileChange::Deleted(route) => {
|
||||
// TODO: Handle deletion of children here and in Moved case.
|
||||
match self.instances_by_route.get(route) {
|
||||
Some(id) => {
|
||||
self.instances.remove(id);
|
||||
|
|
|
|||
|
|
@ -128,6 +128,8 @@ pub fn start(config: WebConfig) {
|
|||
})
|
||||
},
|
||||
|
||||
// TODO: API to read only specific instances
|
||||
|
||||
_ => rouille::Response::empty_404()
|
||||
)
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue