Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate auto-refresh and 'change' events #130

Closed
clabe45 opened this issue Jul 16, 2022 · 0 comments
Closed

Deprecate auto-refresh and 'change' events #130

clabe45 opened this issue Jul 16, 2022 · 0 comments

Comments

@clabe45
Copy link
Collaborator

clabe45 commented Jul 16, 2022

Feature Overview

By default, paused movies re-render every time any change that could alter the pixels in the frame is made. This can be disabled by setting the autoRefresh option to false when creating the movie.

Implementation

I didn't document this feature very much, and its API and implementation are somewhat magical. Every etro object (movie, layer and effect) is really a proxy. Whenever a public property (or a property of a property, recursively) not included in the object's publicExcludes is modified, refresh() is called on the object's movie.

Deprecation Rationale

This issue is part of an overarching effort to simplify and streamline etro's architecture.

This proxy system is too complicated and prone to bugs. Every time a user creates a new layer or effect, they need to remember to add properties that should not trigger rerenders to publicExcludes. If they don't, confusing errors can arise (it's happened to me many times).

Deprecation Repercussions

The user will have to manually call refresh if a paused movie needs to be re-rendered.

Generic change events are called when a proxy's property is updated. When we remove the proxy system, we will no longer be able to emit these. All change-related events should ideally be removed for consistency.

Should this feature be removed? Leave your thoughts below!

@clabe45 clabe45 moved this to Todo in Simplify API Jul 16, 2022
@clabe45 clabe45 moved this from Todo to In Design in Simplify API Jul 16, 2022
@clabe45 clabe45 moved this from In Design to Todo in Simplify API Jul 17, 2022
@clabe45 clabe45 changed the title Deprecate auto-refresh Deprecate auto-refresh and 'change' events Jul 17, 2022
Repository owner moved this from Todo to Done in Simplify API Jul 17, 2022
clabe45 added a commit that referenced this issue Dec 28, 2022
clabe45 added a commit that referenced this issue Dec 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

No branches or pull requests

1 participant