Skip to content

init.meta.json support#183

Merged
LPGhatguy merged 8 commits intorojo-rbx:masterfrom
Kampfkarren:initmeta
Jun 6, 2019
Merged

init.meta.json support#183
LPGhatguy merged 8 commits intorojo-rbx:masterfrom
Kampfkarren:initmeta

Conversation

@Kampfkarren
Copy link
Copy Markdown
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
Copy Markdown
Member Author

Can't figure out why it's failing?

Copy link
Copy Markdown
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

Comment thread server/src/rbx_snapshot.rs
Comment thread server/src/rbx_snapshot.rs Outdated
Copy link
Copy Markdown
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!

Comment thread server/src/rbx_snapshot.rs Outdated

if let Some(meta_ignore_instances) = meta.ignore_unknown_instances {
snapshot.metadata.ignore_unknown_instances = meta_ignore_instances;
}
Copy link
Copy Markdown
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.

Comment thread server/src/rbx_snapshot.rs Outdated

#[derive(Debug, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
struct InitMetaJson {
Copy link
Copy Markdown
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.

Comment thread server/src/rbx_snapshot.rs Outdated
})?
} else {
InitMetaJson::default()
};
Copy link
Copy Markdown
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
Copy Markdown
Member Author

@LPGhatguy Done in latest commit

Copy link
Copy Markdown
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