mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 22:11:38 +00:00
feat: add .gitignore for logs and refactor ServeSession to include path_roots in init_tree return
- Introduced a new .gitignore file to exclude log files from version control. - Modified the `init_tree` function in `ServeSession` to return `path_roots`, enhancing the function's utility. - Cleaned up commented-out code in `sourcemap.rs`, `patch_apply.rs`, and `tree.rs` for better readability and maintainability.
This commit is contained in:
parent
6325935557
commit
4ddc4a3e31
5 changed files with 36 additions and 74 deletions
|
|
@ -42,8 +42,6 @@ pub fn apply_patch_set(tree: &mut RojoTree, patch_set: PatchSet) -> AppliedPatch
|
|||
|
||||
{
|
||||
profiling::scope!("updates");
|
||||
// Updates need to be applied after additions, which reduces the complexity
|
||||
// of updates significantly.
|
||||
for update_patch in patch_set.updated_instances {
|
||||
apply_update_child(&mut context, tree, update_patch);
|
||||
}
|
||||
|
|
@ -109,8 +107,6 @@ struct PatchApplyContext {
|
|||
#[profiling::function]
|
||||
fn finalize_patch_application(context: PatchApplyContext, tree: &mut RojoTree) -> AppliedPatchSet {
|
||||
for id in context.has_refs_to_rewrite {
|
||||
// This should always succeed since instances marked as added in our
|
||||
// patch should be added without fail.
|
||||
let mut instance = tree
|
||||
.get_instance_mut(id)
|
||||
.expect("Invalid instance ID in deferred property map");
|
||||
|
|
@ -181,7 +177,6 @@ fn finalize_patch_application(context: PatchApplyContext, tree: &mut RojoTree) -
|
|||
_ => continue,
|
||||
};
|
||||
|
||||
// Remove all Rojo ref-related attributes
|
||||
let keys_to_remove: Vec<String> = attributes
|
||||
.iter()
|
||||
.filter_map(|(name, _)| {
|
||||
|
|
|
|||
|
|
@ -125,28 +125,25 @@ impl RojoTree {
|
|||
//
|
||||
// We need to insert the NeedsPivotMigration property with a value of false on
|
||||
// every instance that inherits from Model for pivots to build correctly.
|
||||
let hack_needs_pivot_migration = match snapshot.class_name.as_ref() {
|
||||
// This is not a future proof way to do this but the last time a
|
||||
// descendant of Model was added was in 2020 so it's probably fine.
|
||||
let needs_pivot = match snapshot.class_name.as_ref() {
|
||||
"Model" | "Actor" | "Tool" | "HopperBin" | "Flag" | "WorldModel" | "Workspace"
|
||||
| "Status"
|
||||
if !snapshot
|
||||
.properties
|
||||
.contains_key(&ustr("NeedsPivotMigration")) =>
|
||||
{
|
||||
vec![("NeedsPivotMigration", Variant::Bool(false))]
|
||||
}
|
||||
_ => Vec::new(),
|
||||
| "Status" => !snapshot
|
||||
.properties
|
||||
.contains_key(&ustr("NeedsPivotMigration")),
|
||||
_ => false,
|
||||
};
|
||||
|
||||
let is_script = is_script_class(snapshot.class_name.as_ref());
|
||||
|
||||
let builder = InstanceBuilder::empty()
|
||||
let mut builder = InstanceBuilder::empty()
|
||||
.with_class(snapshot.class_name)
|
||||
.with_name(snapshot.name.into_owned())
|
||||
.with_properties(hack_needs_pivot_migration)
|
||||
.with_properties(snapshot.properties);
|
||||
|
||||
if needs_pivot {
|
||||
builder = builder.with_property("NeedsPivotMigration", Variant::Bool(false));
|
||||
}
|
||||
|
||||
let referent = self.inner.insert(parent_ref, builder);
|
||||
self.insert_metadata(referent, snapshot.metadata);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue