You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recent API refactoring replaced accessor properties and plain properties with methods. This will inadvertently increase the maintenance burden for maintainers of react-posprocessing if left as-is.
Describe the solution you'd like
Reconsider using a hybrid approach of methods and accessors properties if applicable.
we won't be able to set and, more importantly, spread props over passes, we'll have to know all props beforehand and translate them to functions. functions cannot be expressed declaratively, they are not serializable either.
good examples could be threejs, or the dom, they strike a sensible balance between atomics and more complex functions that will either carry out calculations or set multiple props at once. the upside for atomics is that they can easily by driven by state models and spread over the surface.
another upside is maintenance for abstractions of pp. if pp updates and introduces a new atomic, say foo, the userland solution or library using it just needs to npm update and foo will work without having to adjust the abstraction.
good examples could be threejs, or the dom, they strike a sensible balance between atomics and more complex functions that will either carry out calculations or set multiple props at once.
That sounds reasonable. One motivation behind the move towards methods was that a lot of settings on effects need to trigger shader recompilations to take effect. Using method calls makes it clear that changes will be expensive as opposed to just changing the value of a seemingly harmless property.
Getter and setter methods have been converted into accessor properties in [email protected]. I had my concerns regarding accessors, but it's ultimately ease-of-use and consistency that matters.
Activity
drcmda commentedon Feb 23, 2022
I'll copy the middle in here for reference:
good examples could be threejs, or the dom, they strike a sensible balance between atomics and more complex functions that will either carry out calculations or set multiple props at once. the upside for atomics is that they can easily by driven by state models and spread over the surface.
another upside is maintenance for abstractions of pp. if pp updates and introduces a new atomic, say
foo, the userland solution or library using it just needs to npm update andfoowill work without having to adjust the abstraction.we are also publishing types for raw postprocessing, https://github.com/pmndrs/react-postprocessing/blob/master/types/postprocessing.d.ts that would be another "abstraction" that's currently quite simple to adjust.
vanruesc commentedon Feb 23, 2022
That sounds reasonable. One motivation behind the move towards methods was that a lot of settings on effects need to trigger shader recompilations to take effect. Using method calls makes it clear that changes will be expensive as opposed to just changing the value of a seemingly harmless property.
Replace methods with accessors
Replace methods with accessors
vanruesc commentedon Mar 9, 2022
Getter and setter methods have been converted into accessor properties in
[email protected]. I had my concerns regarding accessors, but it's ultimately ease-of-use and consistency that matters.