Update rbx_dom dependencies (#795)

In preparation for a new release, rbx_dom needs to be updated.
This commit is contained in:
Micah
2023-10-03 16:32:22 -07:00
committed by GitHub
parent 010e50a25d
commit d38f955144
13 changed files with 3988 additions and 338 deletions

View File

@@ -16,7 +16,7 @@ jobs:
strategy:
matrix:
rust_version: [stable, 1.69.0]
rust_version: [stable, 1.70.0]
steps:
- uses: actions/checkout@v3

24
Cargo.lock generated
View File

@@ -1647,9 +1647,9 @@ dependencies = [
[[package]]
name = "rbx_binary"
version = "0.7.1"
version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4e50573021d04b680018955662eba7dc4aac3de92219231798f6c9b41e38ab01"
checksum = "10942950a57c939e540a2f977ba55e9140007d7e96c532d455502c290fdf710d"
dependencies = [
"log",
"lz4",
@@ -1662,9 +1662,9 @@ dependencies = [
[[package]]
name = "rbx_dom_weak"
version = "2.5.0"
version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "161729449bbb0cfa657ce7bcca6a160d0af06d8b8d9efdc9abe14735dccacdb9"
checksum = "843a2e0e1446623625943f7228d9d4b5cf3883017e3964733600682506864b34"
dependencies = [
"rbx_types",
"serde",
@@ -1672,9 +1672,9 @@ dependencies = [
[[package]]
name = "rbx_reflection"
version = "4.3.0"
version = "4.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08bd48487192046fec8f805f3fa29f3d7d5beb9890b0859b1a92bd8aff580343"
checksum = "41e762dfca3217d2d37da631de2fa0d1616edaa61a0a2633263d5d3305baf8c3"
dependencies = [
"rbx_types",
"serde",
@@ -1683,9 +1683,9 @@ dependencies = [
[[package]]
name = "rbx_reflection_database"
version = "0.2.7+roblox-588"
version = "0.2.8+roblox-296"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1be6cf674182806f11ad4899dd1feafe977591f1ae035ae05a58d4b74e487276"
checksum = "ff48aa41683dc6fe6949b0a82833b3364cf47c87086502b84d3e0419bff33c10"
dependencies = [
"lazy_static",
"rbx_reflection",
@@ -1695,9 +1695,9 @@ dependencies = [
[[package]]
name = "rbx_types"
version = "1.6.0"
version = "1.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "070106e926b8ae54c7bc443e5db4d868d7f0af51c1d7cfd7efe1364c1753d8a3"
checksum = "32a991523e3ad5f43a4d121cb4a1e5bc23f7826bb4a1db5aa51e94f1073150ec"
dependencies = [
"base64 0.13.1",
"bitflags",
@@ -1710,9 +1710,9 @@ dependencies = [
[[package]]
name = "rbx_xml"
version = "0.13.1"
version = "0.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4bc65b70827519fdc4ab47416d1085b912f087fadab9ed415471b6daba635574"
checksum = "fc87343301303ff0510903fb7eb3dbd1c75bdb6ab780fea6091bdc3f58b5829f"
dependencies = [
"base64 0.13.1",
"log",

View File

@@ -1,7 +1,7 @@
[package]
name = "rojo"
version = "7.3.0"
rust-version = "1.68.2"
rust-version = "1.70.0"
authors = ["Lucien Greathouse <me@lpghatguy.com>"]
description = "Enables professional-grade development tools for Roblox developers"
license = "MPL-2.0"
@@ -49,11 +49,11 @@ memofs = { version = "0.2.0", path = "crates/memofs" }
# rbx_reflection_database = { path = "../rbx-dom/rbx_reflection_database" }
# rbx_xml = { path = "../rbx-dom/rbx_xml" }
rbx_binary = "0.7.1"
rbx_dom_weak = "2.5.0"
rbx_reflection = "4.3.0"
rbx_reflection_database = "0.2.7"
rbx_xml = "0.13.1"
rbx_binary = "0.7.2"
rbx_dom_weak = "2.6.0"
rbx_reflection = "4.4.0"
rbx_reflection_database = "0.2.8"
rbx_xml = "0.13.2"
anyhow = "1.0.44"
backtrace = "0.3.61"

View File

@@ -40,7 +40,7 @@ Check out our [contribution guide](CONTRIBUTING.md) for detailed instructions fo
Pull requests are welcome!
Rojo supports Rust 1.58.1 and newer. The minimum supported version of Rust is based on the latest versions of the dependencies that Rojo has.
Rojo supports Rust 1.70.0 and newer. The minimum supported version of Rust is based on the latest versions of the dependencies that Rojo has.
## License
Rojo is available under the terms of the Mozilla Public License, Version 2.0. See [LICENSE.txt](LICENSE.txt) for details.

View File

@@ -20,8 +20,8 @@ local function serializeFloat(value)
return value
end
local ALL_AXES = {"X", "Y", "Z"}
local ALL_FACES = {"Right", "Top", "Back", "Left", "Bottom", "Front"}
local ALL_AXES = { "X", "Y", "Z" }
local ALL_FACES = { "Right", "Top", "Back", "Left", "Bottom", "Front" }
local EncodedValue = {}
@@ -37,7 +37,10 @@ types = {
if ok then
output[key] = result
else
local warning = ("Could not decode attribute value of type %q: %s"):format(typeof(value), tostring(result))
local warning = ("Could not decode attribute value of type %q: %s"):format(
typeof(value),
tostring(result)
)
warn(warning)
end
end
@@ -53,7 +56,10 @@ types = {
if ok then
output[key] = result
else
local warning = ("Could not encode attribute value of type %q: %s"):format(typeof(value), tostring(result))
local warning = ("Could not encode attribute value of type %q: %s"):format(
typeof(value),
tostring(result)
)
warn(warning)
end
end
@@ -111,6 +117,7 @@ types = {
local pos = pod.position
local orient = pod.orientation
--stylua: ignore
return CFrame.new(
pos[1], pos[2], pos[3],
orient[1][1], orient[1][2], orient[1][3],
@@ -120,17 +127,14 @@ types = {
end,
toPod = function(roblox)
local x, y, z,
r00, r01, r02,
r10, r11, r12,
r20, r21, r22 = roblox:GetComponents()
local x, y, z, r00, r01, r02, r10, r11, r12, r20, r21, r22 = roblox:GetComponents()
return {
position = {x, y, z},
position = { x, y, z },
orientation = {
{r00, r01, r02},
{r10, r11, r12},
{r20, r21, r22},
{ r00, r01, r02 },
{ r10, r11, r12 },
{ r20, r21, r22 },
},
}
end,
@@ -140,7 +144,7 @@ types = {
fromPod = unpackDecoder(Color3.new),
toPod = function(roblox)
return {roblox.r, roblox.g, roblox.b}
return { roblox.r, roblox.g, roblox.b }
end,
},
@@ -161,10 +165,7 @@ types = {
local keypoints = {}
for index, keypoint in ipairs(pod.keypoints) do
keypoints[index] = ColorSequenceKeypoint.new(
keypoint.time,
types.Color3.fromPod(keypoint.color)
)
keypoints[index] = ColorSequenceKeypoint.new(keypoint.time, types.Color3.fromPod(keypoint.color))
end
return ColorSequence.new(keypoints)
@@ -279,7 +280,7 @@ types = {
pod[material.Name] = {
math.round(math.clamp(color.R, 0, 1) * 255),
math.round(math.clamp(color.G, 0, 1) * 255),
math.round(math.clamp(color.B, 0, 1) * 255)
math.round(math.clamp(color.B, 0, 1) * 255),
}
end
return pod
@@ -290,7 +291,7 @@ types = {
fromPod = unpackDecoder(NumberRange.new),
toPod = function(roblox)
return {roblox.Min, roblox.Max}
return { roblox.Min, roblox.Max }
end,
},
@@ -299,11 +300,7 @@ types = {
local keypoints = {}
for index, keypoint in ipairs(pod.keypoints) do
keypoints[index] = NumberSequenceKeypoint.new(
keypoint.time,
keypoint.value,
keypoint.envelope
)
keypoints[index] = NumberSequenceKeypoint.new(keypoint.time, keypoint.value, keypoint.envelope)
end
return NumberSequence.new(keypoints)
@@ -358,10 +355,7 @@ types = {
Ray = {
fromPod = function(pod)
return Ray.new(
types.Vector3.fromPod(pod.origin),
types.Vector3.fromPod(pod.direction)
)
return Ray.new(types.Vector3.fromPod(pod.origin), types.Vector3.fromPod(pod.direction))
end,
toPod = function(roblox)
@@ -374,10 +368,7 @@ types = {
Rect = {
fromPod = function(pod)
return Rect.new(
types.Vector2.fromPod(pod[1]),
types.Vector2.fromPod(pod[2])
)
return Rect.new(types.Vector2.fromPod(pod[1]), types.Vector2.fromPod(pod[2]))
end,
toPod = function(roblox)
@@ -389,31 +380,28 @@ types = {
},
Ref = {
fromPod = function(_pod)
fromPod = function(_)
error("Ref cannot be decoded on its own")
end,
toPod = function(_roblox)
toPod = function(_)
error("Ref can not be encoded on its own")
end,
},
Region3 = {
fromPod = function(pod)
fromPod = function(_)
error("Region3 is not implemented")
end,
toPod = function(roblox)
toPod = function(_)
error("Region3 is not implemented")
end,
},
Region3int16 = {
fromPod = function(pod)
return Region3int16.new(
types.Vector3int16.fromPod(pod[1]),
types.Vector3int16.fromPod(pod[2])
)
return Region3int16.new(types.Vector3int16.fromPod(pod[1]), types.Vector3int16.fromPod(pod[2]))
end,
toPod = function(roblox)
@@ -424,12 +412,21 @@ types = {
end,
},
SecurityCapabilities = {
fromPod = function(_pod)
error("SecurityCapabilities is not implemented")
end,
toPod = function(_roblox)
error("SecurityCapabilities is not implemented")
end,
},
SharedString = {
fromPod = function(pod)
fromPod = function(_pod)
error("SharedString is not supported")
end,
toPod = function(roblox)
toPod = function(_roblox)
error("SharedString is not supported")
end,
},
@@ -443,16 +440,13 @@ types = {
fromPod = unpackDecoder(UDim.new),
toPod = function(roblox)
return {roblox.Scale, roblox.Offset}
return { roblox.Scale, roblox.Offset }
end,
},
UDim2 = {
fromPod = function(pod)
return UDim2.new(
types.UDim.fromPod(pod[1]),
types.UDim.fromPod(pod[2])
)
return UDim2.new(types.UDim.fromPod(pod[1]), types.UDim.fromPod(pod[2]))
end,
toPod = function(roblox)
@@ -483,7 +477,7 @@ types = {
fromPod = unpackDecoder(Vector2int16.new),
toPod = function(roblox)
return {roblox.X, roblox.Y}
return { roblox.X, roblox.Y }
end,
},
@@ -503,7 +497,7 @@ types = {
fromPod = unpackDecoder(Vector3int16.new),
toPod = function(roblox)
return {roblox.X, roblox.Y, roblox.Z}
return { roblox.X, roblox.Y, roblox.Z }
end,
},
}

View File

@@ -1,67 +0,0 @@
return function()
local HttpService = game:GetService("HttpService")
local EncodedValue = require(script.Parent.EncodedValue)
local allValues = require(script.Parent.allValues)
local function deepEq(a, b)
if typeof(a) ~= typeof(b) then
return false
end
local ty = typeof(a)
if ty == "table" then
local visited = {}
for key, valueA in a do
visited[key] = true
if not deepEq(valueA, b[key]) then
return false
end
end
for key, valueB in b do
if visited[key] then
continue
end
if not deepEq(valueB, a[key]) then
return false
end
end
return true
else
return a == b
end
end
local extraAssertions = {
CFrame = function(value)
expect(value).to.equal(CFrame.new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12))
end,
}
for testName, testEntry in allValues do
it("round trip " .. testName, function()
local decodeOk, decoded = EncodedValue.decode(testEntry.value)
assert(decodeOk, decoded)
if extraAssertions[testName] ~= nil then
extraAssertions[testName](decoded)
end
local encodeOk, encoded = EncodedValue.encode(decoded, testEntry.ty)
assert(encodeOk, encoded)
if not deepEq(encoded, testEntry.value) then
local expected = HttpService:JSONEncode(testEntry.value)
local actual = HttpService:JSONEncode(encoded)
error(`Round-trip results did not match.\nExpected:\n{expected}\nActual:\n{actual}`)
end
end)
end
end

View File

@@ -1,29 +0,0 @@
return function()
local base64 = require(script.Parent.base64)
it("should encode and decode", function()
local function try(str, expected)
local encoded = base64.encode(str)
expect(encoded).to.equal(expected)
expect(base64.decode(encoded)).to.equal(str)
end
try("Man", "TWFu")
try("Ma", "TWE=")
try("M", "TQ==")
try("ManM", "TWFuTQ==")
try(
[[Man is distinguished, not only by his reason, but by this ]]..
[[singular passion from other animals, which is a lust of the ]]..
[[mind, that by a perseverance of delight in the continued and ]]..
[[indefatigable generation of knowledge, exceeds the short ]]..
[[vehemence of any carnal pleasure.]],
[[TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sI]]..
[[GJ1dCBieSB0aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYW]]..
[[xzLCB3aGljaCBpcyBhIGx1c3Qgb2YgdGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJ]]..
[[zZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGludWVkIGFuZCBpbmRl]]..
[[ZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBleGNlZWRzIHRoZ]]..
[[SBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVhc3VyZS4=]]
)
end)
end

View File

@@ -77,10 +77,10 @@ return {
},
LocalizationTable = {
Contents = {
read = function(instance, key)
read = function(instance, _)
return true, instance:GetContents()
end,
write = function(instance, key, value)
write = function(instance, _, value)
instance:SetContents(value)
return true
end,

File diff suppressed because it is too large Load Diff

View File

@@ -24,7 +24,8 @@ local function findCanonicalPropertyDescriptor(className, propertyName)
return PropertyDescriptor.fromRaw(
currentClass.Properties[aliasData.AliasFor],
currentClassName,
aliasData.AliasFor)
aliasData.AliasFor
)
end
return nil

View File

@@ -1,7 +0,0 @@
return function()
local RbxDom = require(script.Parent)
it("should load", function()
expect(RbxDom).to.be.ok()
end)
end