-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
chore(TS): Remove stateful mixin #8663
Conversation
Build Stats
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great
Can stateProps and cacheProps become static as well??
src/shapes/IText/IText.ts
Outdated
@@ -149,6 +150,8 @@ export class IText< | |||
*/ | |||
declare caching: boolean; | |||
|
|||
static textLayoutProperties = Text.textLayoutProperties; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for this
static props are inherited
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see #8662
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are they? my understand is that they are inherited only in static methods.
If is not needed even better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isAddingPath = isAddingPath || _key === 'path'; | ||
} | ||
} else { | ||
needsDims = this._dimensionAffectingProps.indexOf(key) !== -1; | ||
needsDims = this.constructor.textLayoutProperties.includes(key); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This thing here remind me of te issue we have with side effects.
sometimes those fit in _set, but if those are slightly expensive we want to run them only once for set.
But this bring us to handle in set both single and multi key use case.
@ShaMan123 should check your side effects pr solves this issue with 10 lines of code or find a valid way to remove those with a little footprint.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't think it is 10 lines but it solves this bad design
Another thought |
they compile to a sideEffect you mean they become Seems like classes aren't ready if i have to create a getter for a prop because they are handled differently. |
yes so they become side effects. I m kind of tired to spinning in circle to js/ts issues |
This is ready to go, not tackling side effects now, the scope is removing stateful. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
The maintenance is a really unpleasant part.
I looked at the links of tree shaking in rollup
https://rollupjs.org/configuration-options/#treeshake-modulesideeffects
We can expose a rollup config for consumers or whatever
Never mind that lets move fabric forward
It has taken a toll on me too
Motivation
The Stateful mixin had 2 defects.
The direction
Description
Changes
Gist
In Action