@quenty/valueobject 9.0.0 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +52 -0
- package/package.json +9 -8
- package/src/Shared/ValueObject.lua +10 -14
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,58 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [10.0.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/valueobject@9.0.0...@quenty/valueobject@10.0.0) (2024-02-13)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* New loader (breaking changes), fixing loader issues ([#439](https://github.com/Quenty/NevermoreEngine/issues/439)) ([3534345](https://github.com/Quenty/NevermoreEngine/commit/353434522918812953bd9f13fece73e27a4d034d))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### BREAKING CHANGES
|
|
15
|
+
|
|
16
|
+
* Standard loader
|
|
17
|
+
|
|
18
|
+
Adds new loader version which replicates full structure instead of some partial structure. This allows us to have hot-reloading (in the future), as well as generally do less computation, handle dependencies more carefully, and other changes.
|
|
19
|
+
|
|
20
|
+
This means you'll need to change you how require client-side modules, as we export a simple `loader` module instead of all modules available.
|
|
21
|
+
|
|
22
|
+
Signed-off-by: James Onnen <jonnen0@gmail.com>
|
|
23
|
+
|
|
24
|
+
* fix: Fix missing dependency in ResetService
|
|
25
|
+
|
|
26
|
+
* feat: Add RxPhysicsUtils.observePartMass
|
|
27
|
+
|
|
28
|
+
* fix: Fix package discovery for games
|
|
29
|
+
|
|
30
|
+
* feat: Add UIAlignmentUtils.verticalToHorizontalAlignment(verticalAlignment) and UIAlignmentUtils.horizontalToVerticalAlignment(horizontalAlignment)
|
|
31
|
+
|
|
32
|
+
* feat: AdorneeData:InitAttributes() does not require data as a secondparameter
|
|
33
|
+
|
|
34
|
+
* ci: Upgrade to new rojo 7.4.0
|
|
35
|
+
|
|
36
|
+
* fix: Update loader to handle hoarcekat properly
|
|
37
|
+
|
|
38
|
+
* docs: Fix spacing in Maid
|
|
39
|
+
|
|
40
|
+
* fix: Add new ragdoll constants
|
|
41
|
+
|
|
42
|
+
* fix: Compress influxDB sends
|
|
43
|
+
|
|
44
|
+
* style: Errors use string.format
|
|
45
|
+
|
|
46
|
+
* fix: Handle motor animations
|
|
47
|
+
|
|
48
|
+
* ci: Upgrade rojo version
|
|
49
|
+
|
|
50
|
+
* feat!: Maid no longer is includd in ValueObject.Changed event
|
|
51
|
+
|
|
52
|
+
* docs: Fix docs
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
6
58
|
# [9.0.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/valueobject@8.4.0...@quenty/valueobject@9.0.0) (2024-01-10)
|
|
7
59
|
|
|
8
60
|
**Note:** Version bump only for package @quenty/valueobject
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/valueobject",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0",
|
|
4
4
|
"description": "To work like value objects in Roblox and track a single item with .Changed events",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -26,15 +26,16 @@
|
|
|
26
26
|
"Quenty"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@quenty/brio": "^
|
|
30
|
-
"@quenty/
|
|
31
|
-
"@quenty/
|
|
32
|
-
"@quenty/
|
|
33
|
-
"@quenty/
|
|
34
|
-
"@quenty/
|
|
29
|
+
"@quenty/brio": "^11.0.0",
|
|
30
|
+
"@quenty/ducktype": "^3.0.0",
|
|
31
|
+
"@quenty/loader": "^8.0.0",
|
|
32
|
+
"@quenty/maid": "^3.0.0",
|
|
33
|
+
"@quenty/rx": "^10.0.0",
|
|
34
|
+
"@quenty/signal": "^5.0.0",
|
|
35
|
+
"@quenty/valuebaseutils": "^10.0.0"
|
|
35
36
|
},
|
|
36
37
|
"publishConfig": {
|
|
37
38
|
"access": "public"
|
|
38
39
|
},
|
|
39
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "5736b108e4d23cd4c9e761bbe4cc9fed6fb32dfa"
|
|
40
41
|
}
|
|
@@ -12,6 +12,7 @@ local Observable = require("Observable")
|
|
|
12
12
|
local ValueBaseUtils = require("ValueBaseUtils")
|
|
13
13
|
local RxValueBaseUtils = require("RxValueBaseUtils")
|
|
14
14
|
local Brio = require("Brio")
|
|
15
|
+
local DuckTypeUtils = require("DuckTypeUtils")
|
|
15
16
|
|
|
16
17
|
local EMPTY_FUNCTION = function() end
|
|
17
18
|
|
|
@@ -40,8 +41,7 @@ function ValueObject.new(baseValue, checkType)
|
|
|
40
41
|
@prop Changed Signal<T> -- fires with oldValue, newValue, ...
|
|
41
42
|
@within ValueObject
|
|
42
43
|
]=]
|
|
43
|
-
self.Changed = GoodSignal.new() -- :Fire(newValue, oldValue,
|
|
44
|
-
self._maid:GiveTask(self.Changed)
|
|
44
|
+
self.Changed = self._maid:Add(GoodSignal.new()) -- :Fire(newValue, oldValue, ...)
|
|
45
45
|
|
|
46
46
|
return setmetatable(self, ValueObject)
|
|
47
47
|
end
|
|
@@ -75,7 +75,7 @@ end
|
|
|
75
75
|
@return boolean
|
|
76
76
|
]=]
|
|
77
77
|
function ValueObject.isValueObject(value)
|
|
78
|
-
return
|
|
78
|
+
return DuckTypeUtils.isImplementation(ValueObject, value)
|
|
79
79
|
end
|
|
80
80
|
|
|
81
81
|
function ValueObject:_toMountableObservable(value)
|
|
@@ -150,7 +150,7 @@ function ValueObject:Observe()
|
|
|
150
150
|
|
|
151
151
|
local maid = Maid.new()
|
|
152
152
|
|
|
153
|
-
maid:GiveTask(self.Changed:Connect(function(newValue, _,
|
|
153
|
+
maid:GiveTask(self.Changed:Connect(function(newValue, _, ...)
|
|
154
154
|
sub:Fire(newValue, ...)
|
|
155
155
|
end))
|
|
156
156
|
|
|
@@ -194,7 +194,7 @@ function ValueObject:ObserveBrio(condition)
|
|
|
194
194
|
end
|
|
195
195
|
end
|
|
196
196
|
|
|
197
|
-
maid:GiveTask(self.Changed:Connect(function(newValue, _,
|
|
197
|
+
maid:GiveTask(self.Changed:Connect(function(newValue, _, ...)
|
|
198
198
|
handleNewValue(newValue, ...)
|
|
199
199
|
end))
|
|
200
200
|
|
|
@@ -216,7 +216,7 @@ end
|
|
|
216
216
|
```lua
|
|
217
217
|
self.IsVisible:SetValue(isVisible, true)
|
|
218
218
|
|
|
219
|
-
print(self.IsVisible.Changed:Connect(function(isVisible, _,
|
|
219
|
+
print(self.IsVisible.Changed:Connect(function(isVisible, _, doNotAnimate)
|
|
220
220
|
print(doNotAnimate)
|
|
221
221
|
end))
|
|
222
222
|
```
|
|
@@ -241,11 +241,7 @@ function ValueObject:SetValue(value, ...)
|
|
|
241
241
|
|
|
242
242
|
rawset(self, "_value", value)
|
|
243
243
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
self.Changed:Fire(value, previous, maid, ...)
|
|
247
|
-
|
|
248
|
-
self._maid._valueMaid = maid
|
|
244
|
+
self.Changed:Fire(value, previous, ...)
|
|
249
245
|
end
|
|
250
246
|
end
|
|
251
247
|
|
|
@@ -269,7 +265,7 @@ function ValueObject:__index(index)
|
|
|
269
265
|
elseif index == "_value" then
|
|
270
266
|
return nil -- Edge case
|
|
271
267
|
else
|
|
272
|
-
error(("%q is not a member of ValueObject"
|
|
268
|
+
error(string.format("%q is not a member of ValueObject", tostring(index)))
|
|
273
269
|
end
|
|
274
270
|
end
|
|
275
271
|
|
|
@@ -278,9 +274,9 @@ function ValueObject:__newindex(index, value)
|
|
|
278
274
|
-- Avoid deoptimization
|
|
279
275
|
ValueObject.SetValue(self, value)
|
|
280
276
|
elseif index == "LastEventContext" or ValueObject[index] then
|
|
281
|
-
error(("%q cannot be set in ValueObject"
|
|
277
|
+
error(string.format("%q cannot be set in ValueObject", tostring(index)))
|
|
282
278
|
else
|
|
283
|
-
error(("%q is not a member of ValueObject"
|
|
279
|
+
error(string.format("%q is not a member of ValueObject", tostring(index)))
|
|
284
280
|
end
|
|
285
281
|
end
|
|
286
282
|
|