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

Use rbx_reflection to allow type inference on projects #130

Merged
merged 3 commits into from
Feb 27, 2019

Conversation

LPGhatguy
Copy link
Contributor

@LPGhatguy LPGhatguy commented Feb 26, 2019

This is one step towards resolving #31.

This change starts using rbx_reflection's reflection database and type resolution mechanisms to make specifying projects less painful.

This is a dependency that will need continual upgrades in order to support specifying new properties with this short, inferred syntax.

Previously, you would specify a project with properties on services like this:
(diff markers added to draw attention)

{
	"name": "really-red-place",
	"tree": {
		"$className": "DataModel",
		"Lighting": {
			"$className": "Lighting",
			"$properties": {
+				"Ambient": {
+					"Type": "Color3",
+					"Value": [1, 0, 0]
+				},
+				"Technology": {
+					"Type": "Enum",
+					"Value": 1
+				}
			}
		},
		"HttpService": {
			"$className": "HttpService",
			"$properties": {
+				"HttpEnabled": {
+					"Type": "Bool",
+					"Value": true
+				}
			}
		}
	}
}

But after this PR, Rojo can use the reflection database to infer types where they should be obvious:

{
	"name": "really-red-place",
	"tree": {
		"$className": "DataModel",
		"Lighting": {
			"$className": "Lighting",
			"$properties": {
+				"Ambient": [1, 0, 0],
+				"Technology": "Voxel"
			}
		},
		"HttpService": {
			"$className": "HttpService",
			"$properties": {
+				"HttpEnabled": true
			}
		}
	}
}

@LPGhatguy LPGhatguy merged commit 93349ae into master Feb 27, 2019
@LPGhatguy LPGhatguy deleted the use-reflection branch February 27, 2019 06:51
Dekkonot pushed a commit to UpliftGames/rojo that referenced this pull request Jan 11, 2024
* Start dependency on rbx_reflection

* Alive and working, all tests pass

* Update CHANGELOG
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.

1 participant