Avatar for the gadget-inc user
gadget-inc
mobx-quick-tree
BlogDocsChangelog

Add support for acceptsUndefined: false to safe references

#109Merged
Comparing
accepts-undefined
(
5488410
) with
accepts-undefined
(
330abed
)
CodSpeed Performance Gauge
+75%
Improvements
1
Regressions
0
Untouched
10
New
0
Dropped
0
Ignored
4

Benchmarks

Improved

instantiating a large union
bench/create-union.benchmark.ts::instantiating a large union
CodSpeed Performance Gauge
+75%
101.6 µs
58 µs

Passed

instantiating a small root
bench/instantiation.benchmark.ts::instantiating a small root
CodSpeed Performance Gauge
+7%
23.3 µs
21.8 µs
instantiating a large root
bench/instantiation.benchmark.ts::instantiating a large root
CodSpeed Performance Gauge
+4%
2.6 ms
2.5 ms
instantiating one reference
bench/create-references.benchmark.ts::instantiating one reference
CodSpeed Performance Gauge
+4%
41.5 µs
39.9 µs
mobx-quick-tree ClassModel
bench/cross-framework.benchmark.ts::mobx-quick-tree ClassModel
CodSpeed Performance Gauge
+4%
43 µs
41.5 µs
accessing memoized null property of a class model
bench/property-access.benchmark.ts::accessing memoized null property of a class model
CodSpeed Performance Gauge
+4%
9.9 µs
9.6 µs
instantiating a diverse root
bench/instantiation.benchmark.ts::instantiating a diverse root
CodSpeed Performance Gauge
+3%
56.5 µs
55.1 µs
instantiating deep references
bench/create-references.benchmark.ts::instantiating deep references
CodSpeed Performance Gauge
+2%
92.7 µs
90.6 µs
accessing unmemoized getter properties of a class model
bench/property-access.benchmark.ts::accessing unmemoized getter properties of a class model
CodSpeed Performance Gauge
0%
14.9 µs
14.9 µs
accessing memoized getter properties of a class model
bench/property-access.benchmark.ts::accessing memoized getter properties of a class model
CodSpeed Performance Gauge
-1%
11.2 µs
11.3 µs
accessing unmemoized null property of a class model
bench/property-access.benchmark.ts::accessing unmemoized null property of a class model
CodSpeed Performance Gauge
-2%
10.8 µs
11 µs

Ignored

mobx-quick-tree types.modelIgnored
bench/cross-framework.benchmark.ts::mobx-quick-tree types.model
CodSpeed Performance Gauge
+1%
155.1 µs
154.2 µs
mobx-state-treeIgnored
bench/cross-framework.benchmark.ts::mobx-state-tree
CodSpeed Performance Gauge
0%
1.5 ms
1.5 ms
plain es6Ignored
bench/cross-framework.benchmark.ts::plain es6
CodSpeed Performance Gauge
+1%
16.1 µs
16 µs
plain mobxIgnored
bench/cross-framework.benchmark.ts::plain mobx
CodSpeed Performance Gauge
-1%
282.4 µs
284.7 µs

Commits

Click on a commit to change the comparison range
Base
accepts-undefined
330abed
-40%
Add support for acceptsUndefined: false to safe references MST proper supports an `acceptsUndefined: false` on safe references that automatically prunes invalid references from parent maps and arrays. I wanna use it in Gadget but noticed that it no worky -- we pass the option through to observable instances fine but didn't do anything with it in readonly instances. This adds handling for the special case, which requires arrays and maps to look at the child type, and if it is a safe reference with the option set, omit unresolved entries from the result. Woop woop.
330abed
4 months ago
by airhorns
+116%
Add support for acceptsUndefined: false to safe references MST proper supports an `acceptsUndefined: false` on safe references that automatically prunes invalid references from parent maps and arrays. I wanna use it in Gadget but noticed that it no worky -- we pass the option through to observable instances fine but didn't do anything with it in readonly instances. This adds handling for the special case, which requires arrays and maps to look at the child type, and if it is a safe reference with the option set, omit unresolved entries from the result. Woop woop.
5488410
4 months ago
by airhorns
Home Terms PrivacyDocs