Commit graph

805 commits

Author SHA1 Message Date
Aria Minaei
391958f5cf Use EventEmitter instead of Emitter in Box
... so that we have one less dependency on `Tappable`
2023-01-04 20:49:44 +01:00
Aria Minaei
d2876a7c9a Unify Derivation and Prism 13/13 2023-01-04 20:49:44 +01:00
Aria Minaei
d9644f2370 Unify Derivation and Prism 12/n 2023-01-04 20:49:44 +01:00
Aria Minaei
b2116e9a5d Unify Derivation and Prism 11/n
`useDerivation()` => `usePrismInstance()`
2023-01-04 20:49:44 +01:00
Aria Minaei
1236900ddf Unify Derivation and Prism 10/n 2023-01-04 20:49:44 +01:00
Aria Minaei
53ab4dbf9d Fix a bug causing Sequences to not be playable 2023-01-04 20:49:44 +01:00
Aria Minaei
3552f50613 Unify Derivation and Prism 9/n 2023-01-04 20:49:44 +01:00
Aria Minaei
27b9c96afd Unify Derivation and Prism 8/n 2023-01-04 20:49:44 +01:00
Aria Minaei
acf34d393d Unify Derivation and Prism 7/n 2023-01-04 20:49:44 +01:00
Aria Minaei
859cb40e0f Unify Derivation and Prism 6/n 2023-01-04 20:49:44 +01:00
Aria Minaei
0a0c35a7b7 Unify Derivation and Prism 5/n 2023-01-04 20:49:44 +01:00
Aria Minaei
a38d96ec95 Unify Derivation and Prism 4/n 2023-01-04 20:49:43 +01:00
Aria Minaei
06808f99e9 Unify Derivation and Prism 3/n 2023-01-04 20:49:43 +01:00
Aria Minaei
bfba1d4879 Unify Derivation and Prism 2/n 2023-01-04 20:49:43 +01:00
Aria Minaei
12b3f477bc Unify Derivation and Prism (1/n) 2023-01-04 20:49:43 +01:00
Aria Minaei
e9bbb0ef41 Remove PrismDerivation.map/flatMap() 2023-01-04 20:49:43 +01:00
Aria Minaei
a073984b2f Mark add/removeDependent() as internal 2023-01-04 20:49:43 +01:00
Aria Minaei
194de8d833 Simplify Derivation.onChange()
It no longer uses `DerivationEmitter`.
2023-01-04 20:49:43 +01:00
Aria Minaei
a24a149a52 Remove Derivation.tapImmediate()
This is now just an extra flag on `Derivation.onChange()`
2023-01-04 20:49:43 +01:00
Aria Minaei
f2bb24ef99 Change the signature of Derivation.changes() to Derivation.onChange()
This way, we no longer expose the `Tappable` interface so we can remove it later.
2023-01-04 20:49:43 +01:00
Aria Minaei
f1cb8edc91 Simplify Derivation.onStale() 2023-01-04 20:49:43 +01:00
Aria Minaei
5c1aa1cd50 Remove Derivation.changesWithoutValues()
And replace it with `Derivation.onStale()`
2023-01-04 20:49:43 +01:00
Aria Minaei
9094e3041e Remove AbstractDerivation
At this point, the only derivation that we have is `PrismDerivation`.
2023-01-04 20:49:43 +01:00
Aria Minaei
63228fd86a Simplify prism.state() 2023-01-04 20:49:43 +01:00
Aria Minaei
ee68112867 Implement prism.source() 2023-01-04 20:49:43 +01:00
Aria Minaei
b117ee0aff Retire DerivationFromSource (1/2)
This is supposed to break the build. In the next commit, I'll implement `HotScope.source()` to fix the build.
2023-01-04 20:49:43 +01:00
Aria Minaei
918dd754a7 Retire ConstantDerivation 2023-01-04 20:49:43 +01:00
Aria Minaei
ed322b66de Separate the hot path from the cold path in prisms 2023-01-04 20:49:43 +01:00
Aria Minaei
c81fe11e52 Rename Prism.changesWithoutValues() to onStale() 2023-01-04 20:49:43 +01:00
Aria Minaei
a71fff0c73 Don't expose PrismDerivation as a class 2023-01-04 20:49:43 +01:00
Aria Minaei
e0a61981c9 Have PrismDerivation no longer extend AbstractDerivation 2023-01-04 20:49:43 +01:00
Aria Minaei
0655e5b1c4 Add performance note about prism scopes 2023-01-04 20:49:43 +01:00
Aria Minaei
83832ef85b Note down that map/flatMap must be removed 2023-01-04 20:49:43 +01:00
Aria Minaei
6d7d461223 Remove all WeakMaps from prism's scope
... making it easier to debug prism scopes. Again, there is a perf regression here.
2023-01-04 20:49:43 +01:00
Aria Minaei
1c69cb7055 Save prism effects in the prism scope, rather than a WeakMap
... for easier debugging, but there is a perf regression which I
can't yet quantify as the benchmark suit doesn't support comparisons.
2023-01-04 20:49:43 +01:00
Aria Minaei
ae8be59366 Implement a basic benchmark test, and deprecate derivation.map()/flatMap()
This starts a new workspace at `packages/benchmarks` where future benchmarks
are going to sit. For now, it only contains a basic profile of a `sequence.play()`
setup.

It also removes all uses of `AbstractDerivation.map()/flatMap()` and uses prisms
instead.
2023-01-04 20:49:35 +01:00
Aria Minaei
45b548660c 0.6.0-dev.3 2023-01-04 20:35:56 +01:00
Andrew Prifer
ccabda65a3
Move studio-related asset storage code out of core (#369)
* Move studio asset storage code out of core

* Require blob-compare conditinally

Co-authored-by: Aria <aria.minaei@gmail.com>
2023-01-04 20:34:27 +01:00
Aria
718beb4d7b
Catch more SSR issues and improve compat tests (#353)
This will cause the build to fail, as this will catch an SSR issue, which will be fixed after merging #369
2023-01-04 20:03:47 +01:00
Andrew Prifer
71f08e171a
Implement a way for users to be able to add buttons to the details panel (#372)
* Implement actions

* Add action button styles

* Add docs for actions
2023-01-04 15:00:46 +00:00
Aria
feb3ad34b8
Compact and collapsible compound prop editor
* Create compact vector prop editor

* MAke all compound props collapsible

* Add collapsed indicator for compound props

* Persist collapsed state accross component rerenders

* Adjust dom playground to use the new vector prop

Co-authored-by: Andrew Prifer <andrew.prifer@gmail.com>
2023-01-04 12:43:49 +01:00
Aria Minaei
f6361e7905 0.6.0-dev.2 2023-01-02 22:34:50 +01:00
Aria Minaei
fd3a8cec35 Nudging numbers will now use nudgeMultiplier even if the number has a range
Possibly fixes #314
2023-01-02 22:11:34 +01:00
Aria Minaei
438a83d2d4 0.6.0-dev.1 2023-01-02 19:47:23 +01:00
Clément Roche
6558181dbb
Make items in the outline menu collapsable (#367)
Co-authored-by: Clement Roche <rchclement@gmail.com>
Co-authored-by: Cole Lawrence <cole@colelawrence.com>
Co-authored-by: Aria <aria.minaei@gmail.com>
2023-01-02 18:43:19 +00:00
Clément Roche
a727ee277b Fix typo
Fix https://github.com/theatre-js/theatre/issues/361
2023-01-01 00:05:16 +01:00
Andrew Prifer
0d5b4bd8c8 Rename vague variable 2022-12-31 23:25:57 +01:00
Aria Minaei
c58bc694ee Fix: Re-render the panels when object identity change
This fixes the pesky "Argument 'der' in 'useDerivation(der)' should not change between renders."
2022-12-31 22:54:52 +01:00
Aria Minaei
4596c2233c fix: Don't show the visual regression warning outside of CI 2022-12-31 21:26:41 +01:00
Colin Duffy
103c35737c
New feature: Keyframe "hold" as a new easing type (#360) 2022-12-31 19:20:57 +00:00