-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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): class interface for options/brevity #8674
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.
done
What happens to transpiled unminified js? it looses all comments? Let's check how the JS bundle behaves |
i think my question is, who does import the js bundle and has no access to the packaged, does he find the JSDOCS? i think no because those get stripped away with types at this point. |
I think yes because they have access to fabric.d.ts that is consumed by the code editor |
Who uses it like that? Can you point it out? Is it a real case? |
If you install via package manager you have |
@ShaMan123 we should be able to add any property to a class that is not already defined with a specific type. Can we just add |
The follow up #8677 handles that exactly with success |
Can we continue there? |
so should i close this and look at that? |
merge this and move there or close this and we work there |
ok will get to this today and the next, today |
Moving forward with this, the only thing i m not sold on is removing the jsdocs outside the code. The interface is obviously super useful for types and everything. |
Motivation
Using an interface with class is powerful and reduces the file size because docs can be moved to the interface and leave logic not polluted
The other motivation is that it provides a type for
options
. One would argue that this is one of the most important things for a TS consumer.Description
Extracted props to

ObjectProps
interface and removed comments from logic since VSCODE traces them correctlyChanges
Gist
In Action
Circle.ts.-.fabric.js.-.Visual.Studio.Code.2023-02-08.03-04-33_Trim.mp4