etro-js / etro

Typescript video-editing framework for the browser
https://etrojs.dev
GNU General Public License v3.0
898 stars 86 forks source link

Deprecate function properties #257

Open clabe45 opened 8 months ago

clabe45 commented 8 months ago

Dynamic properties set to functions are unnecessary. The logic used to calculate function properties can easily be moved to JavaScript getters. Alternatively, these properties can be set to different constant values each frame (e.g., in Layer.render() or Effect.apply()). An onDraw option will later be added to Movie.play() (#230), Movie.stream() (#231) and Movie.record() (#232). The effort of maintaining this type of dynamic property is not worth it, since there is no value-add. In fact, providing many different ways to calculate a property with some custom logic can result in antipatterns and technical debt.