Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

init.meta.json support #183

Merged
merged 8 commits into from
Jun 6, 2019
Merged

init.meta.json support #183

merged 8 commits into from
Jun 6, 2019

Conversation

Kampfkarren
Copy link
Member

Closes #123.

So far only supports className, want to know if this is what you expected before I work on this more.

@Kampfkarren Kampfkarren marked this pull request as ready for review June 3, 2019 02:22
@Kampfkarren
Copy link
Member Author

Can't figure out why it's failing?

Copy link
Contributor

@LPGhatguy LPGhatguy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good! This feature was simpler than I was expecting it to be I think! :D

server/src/rbx_snapshot.rs Show resolved Hide resolved
server/src/rbx_snapshot.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@LPGhatguy LPGhatguy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mechanically looks pretty good, I have some more comments on organization that should be final!

@@ -348,9 +374,29 @@ fn snapshot_imfs_directory<'source>(
}
}

if let Some(meta_ignore_instances) = meta.ignore_unknown_instances {
snapshot.metadata.ignore_unknown_instances = meta_ignore_instances;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we bump this block to be above where we set children? We're already assigning to the snapshot's metadata and already have a change there.

Ok(Some(snapshot))
}

#[derive(Debug, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
struct InitMetaJson {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need the Json part of this struct name.

Since we don't serialize the struct, we might be able to drop the Serialize derive and all of the skip_serializing_if attributes as well.

})?
} else {
InitMetaJson::default()
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can fold this code down even further!

Instead of assigning the struct out here and defaulting to InitMetaJson, can we check for the existence of this file later, and then pull properties directly from it onto the snapshot?

Then we can localize the changes to this function to exactly one region, and limit the impact in cases that don't use an init.meta.json file.

@Kampfkarren
Copy link
Member Author

@LPGhatguy Done in latest commit

Copy link
Contributor

@LPGhatguy LPGhatguy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we go!

@LPGhatguy LPGhatguy merged commit 0ed6c57 into rojo-rbx:master Jun 6, 2019
Dekkonot pushed a commit to UpliftGames/rojo that referenced this pull request Jan 11, 2024
* A minimum viable product for init.meta.json

* Properties support

* Add ignoreUnknownChildren support

* Apply requested changes

* Use reflection guiding

* Add a script to the test

* Change to ignoreUnknownInstances

* Apply requested changes
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 .meta.json
2 participants