Commit graph

880 commits

Author SHA1 Message Date
Cole Lawrence
963b03ab6e dev: Add warning for unbound .tick() call 2022-08-03 11:38:44 -04:00
Cole Lawrence
74b338ac17 refactor: Remove unecessary data-header & ?? noop for event listener 2022-08-03 11:38:44 -04:00
Cole Lawrence
704f74a2c5 typo: Remove unused keyframe in destructure 2022-08-03 11:38:44 -04:00
Cole Lawrence
a0994051d6 GraphEditorToggle: Remove unecessary sheet access 2022-08-03 11:38:44 -04:00
Cole Lawrence
63056c5a58 fix validate path call (warning) & playground dom: Fix namespace warning 2022-08-03 11:38:44 -04:00
Cole Lawrence
efc33d4989 Remove unused className on OutlinePanel 2022-08-03 11:38:44 -04:00
Cole Lawrence
4de899b2ae Remove dead code, simply inset 2022-08-03 11:38:44 -04:00
Cole Lawrence
a4b24313a0 fix: deriver props type checking 2022-08-03 11:38:44 -04:00
Cole Lawrence
2ef9d5e346
Handle requestPointerLock error cases in iframes P-199 (#272)
See https://linear.app/theatre/issue/P-199/dont-use-pointer-lock-when-in-an-iframe
2022-08-03 13:55:09 +00:00
Cole Lawrence
8bd37a28d6 r3f fix: Pinching creates more than one undo level in r3f P-202
See https://linear.app/theatre/issue/P-202/pinching-creates-more-than-one-undo-level-in-r3f-history-bug
2022-08-02 16:06:15 -04:00
Cole Lawrence
56a059fdd2 Remove REMOVEME.md dev file 2022-07-28 09:51:51 -04:00
vezwork
1459163420 Fix compound props showing wrong control indicator 2022-07-26 10:22:08 -04:00
vezwork
0ed466f404 Hide toolbar divider when no extensions are there 2022-07-26 08:56:42 -04:00
Fülöp Kovács
e3226da492 Add namespacing to dom example 2022-07-26 10:43:36 +01:00
Cole Lawrence
0b98750063 docs: Use http for localhost example audio 2022-07-25 12:12:46 -04:00
Cole Lawrence
6d550d850d fix(studio): capture [space] key after scrubbing fixes P-177
See https://linear.app/theatre/issue/P-177/beginners-scrubbing-the-playhead-from-within-an-iframe-then-[space]
2022-07-25 12:01:26 -04:00
Cole Lawrence
01729bf45e fix(studio): styles & placement for MoreMenu fixes P-178
See https://linear.app/theatre/issue/P-178/bug-broken-updater-ui-in-simple-html-page
2022-07-25 12:01:26 -04:00
Cole Lawrence
fcc23b3863 Add variants of the extension example 2022-07-25 12:01:26 -04:00
Cole Lawrence
984a61347f Use "Theatre.js" for name consistency
Co-authored-by: Fülöp <fulopkovacs@users.noreply.github.com>
2022-07-25 12:01:26 -04:00
Cole Lawrence
217f191981 Export better named files to reduce confusion of state.json 2022-07-25 12:01:26 -04:00
Cole Lawrence
0b09751ada docs: Use US English spelling of "behavior" 2022-07-25 12:01:26 -04:00
Cole Lawrence
58f04685ad r3f: Accept function for objRef like for setState 2022-07-25 12:01:26 -04:00
Cole Lawrence
415e493834 doc: Add doc to Ticker.raf 2022-07-25 12:01:26 -04:00
Cole Lawrence
a48155f8dc r3f readme: Update with corrected API 2022-07-25 12:01:26 -04:00
Cole Lawrence
5ca3edead8 dev: Fix r3f tsconfig to include TSX files 2022-07-25 12:01:26 -04:00
Cole Lawrence
7041c9f56f dev: Add @type to .eslintrc.js 2022-07-25 12:01:26 -04:00
Cole Lawrence
ca65280b93 Fix local imports of same module for @theatre/core 2022-07-25 12:01:26 -04:00
Cole Lawrence
11b5d175f4
Fix github checks (#263)
* Update dependencies which pass tests locally

* Break the yarn cache in an attempt to fix checks

* playground: Add wrapping error info for build.ts

* playground: Don't use dev mode in CI tests

* playground: Use tsc for typecheck

* playground: Specify working esbuild version 0.13.15

* playground: Use only promises in build.ts

* playground: Ensure serving in ci e2e

 * Add echo for vercel for build:static
2022-07-25 10:37:34 +02:00
Cole Lawrence
00265471ba
Fix namespace and object with same name ordering in OutlinePanel (#262)
Fix P-206 namespace and object name rendered in wrong order
2022-07-21 18:04:00 +00:00
Aria Minaei
a8176a36f7 0.5.0-rc.3 2022-07-12 18:37:04 +02:00
Aria Minaei
00a039a713 Fix exports of @theatre/r3f so it is consistently interpreted across bundlers
Before this commit, the exports field of `@theatre/r3f` was:

```
"exports": {
  ".": "./dist/index.js",
  "./extension": "./dist/extension/index.js"
 },
 ```
So users could import the extension from '@theatre/r3f/extension'

However, if the user’s bundler doesn’t support the exports field, they’d have to import from @theatre/r3f/dist/extension. There are 3 problems with this approach:

1. We have to ask users to try both paths and see which works for their bundler.
2. Users can’t copy code from each other if their bundler setups are different.
3. To make matters worse, if a user’s bundler supports exports, they can’t import from @theatre/r3f/dist/extension.

This is all confusing, so we're fixing it by exposing @theatrer/3f/dist/extension and not @theatre/r3f/extension. Uglier, but more consistent, and avoids the above 3 problems.
2022-07-12 17:49:09 +02:00
Cole Lawrence
24ee1b3597 Fix typos in Project.ts 2022-07-12 11:11:19 -04:00
Aria Minaei
707a27462d Perf: Make <AggregateKeyframeTrack> render its children with memoized props 2022-07-12 13:34:29 +02:00
Aria Minaei
86dd2cbf86 Memoize comopnents of deriver() 2022-07-12 13:34:29 +02:00
Aria Minaei
558882ff0a Perf: memoize AggregateKeyframeEditor 2022-07-12 13:34:29 +02:00
Aria Minaei
b37ccb1e4e Perf: first-pass at reducing number of re-renders in <NextPrevKeyframeCursors> 2022-07-12 13:34:29 +02:00
Aria Minaei
f82c9d1155 Perf: Avoid re-rendering keyframes when snap targets change 2022-07-12 13:34:29 +02:00
Aria Minaei
8f08499fb6 Perf: Memoize SingleKeyframeEditor 2022-07-12 13:34:29 +02:00
Aria Minaei
10f21224f4 Perf: Memoize useEditingToolsForSimpleProp() as it is used in several place with the same arguments 2022-07-12 13:34:29 +02:00
Aria Minaei
bac27777c4 Perf-gain: memoize the sequence editor panel's dims to avoid unnecessary re-renders 2022-07-12 13:34:29 +02:00
Aria Minaei
667f9d4fa2 Massive perf-gain in @theatre/react
Remove cold derivation reads

Prior to this commit, the first render of every `useDerivation()` resulted in a cold read of its inner derivation. Cold reads are predictably slow. The reason we'd run cold reads was to comply with react's rule of not running side-effects during render. (Turning a derivation hot is _technically_ a side-effect).

However, now that users are animating scenes with hundreds of objects in the same sequence, the lag started to be noticable.

This commit changes `useDerivation()` so that it turns its derivation hot before rendering them.

Freshen derivations before render

Previously in order to avoid the zombie child problem (https://kaihao.dev/posts/stale-props-and-zombie-children-in-redux) we deferred freshening the derivations to the render phase of components. This meant that if a derivation's dependencies changed, `useDerivation()` would schedule a re-render, regardless of whether that change actually affected the derivation's value. Here is a contrived example:

```
const num = new Box(1)
const isPositiveD = prism(() => num.derivation.getValue() >= 0)

const Comp = () => {
  return <div>{useDerivation(isPositiveD)}</div>
}

num.set(2) // would cause Comp to re-render- even though 1 is still a positive number
```

We now avoid this problem by freshening the derivation (i.e. calling `der.getValue()`) inside `runQueue()`, and then only causing a re-render if the derivation's value is actually changed.

This still avoids the zombie-child problem because `runQueue` reads the derivations in-order of their position in  the mounting tree.

On the off-chance that one of them still turns out to be a zombile child, `runQueue` will defer that particular `useDerivation()` to be read inside a normal react render phase.
2022-07-12 13:34:29 +02:00
Aria Minaei
cbfc8861b5 Add comment about bundling deps in r3f/extension 2022-07-08 14:08:57 +02:00
Aria Minaei
8f1d26536b Sanitize sequence's length and subUnitsPerUnit
Possibly fixes P-173
2022-07-08 14:08:57 +02:00
Aria Minaei
ac9345ddbd Fix for OutlinePanel not being scrollable sometimes
Fixes P-179
2022-07-08 14:08:57 +02:00
Aria Minaei
7f17f985ee Fix PlayheadPositionPopover not accepting '0' as input 2022-07-08 14:08:57 +02:00
Aria Minaei
0631d02d31 0.5.0-rc.2 2022-07-07 22:34:51 +02:00
Aria Minaei
8d977ed6ba Don't minify @theatre/r3f/dist/extension.js 2022-07-07 22:34:51 +02:00
Aria Minaei
0bb97f14d3 Add @theatre/r3f to set of packages with locked version numbers 2022-07-07 22:34:51 +02:00
Aria Minaei
0e5b27d76d Add an extra test case to removePathFromObject() 2022-07-07 20:32:55 +02:00
Aria Minaei
ebf2a19900 Initialize the studio only once in tests 2022-07-07 20:32:55 +02:00