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): export util types #8915
Conversation
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.
What about * exports?
You said you are against, right?
export type { IntersectionType } from './src/Intersection'; | ||
export { Intersection } from './src/Intersection'; |
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.
export type { IntersectionType } from './src/Intersection'; | |
export { Intersection } from './src/Intersection'; | |
export * from './src/Intersection'; |
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.
look at src/util/misc/svgParsing.ts
What should be exported etc.?
Please decide about enums. Do we want/need them?
IMO string types are more straight forward so I don't see a need for them.
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.
If you disapprove * exports I will refactor
Feel free to commit changes |
I m not against, i would like to divide exports of types from the one of code. |
Trying to figure out if again code bloat is because of what. Still the bundle grows. New types shouldn't even introduce new variables that could lead to move some commonly used variable from 2 letter to 3 letter because we finished the combinations of 2. How this stuff works? |
ok we are exporting some new stuff as code that shouldn't be part of the interface probably. i m not sure. |
export type { | ||
EnlivenObjectOptions, | ||
LoadImageOptions, | ||
} from './misc/objectEnlive'; |
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.
here is where i start to have some doubts.
How do i access those types then? Are they on the main export root or do i need and grab them from inside util?
For how we are use enums, enums are useless. So for example: const enum configurationBits = {
vgaScaler: 1,
hdmi96k: 2,
usbHub: 4,
stereomode: 8,
syncOnGreen: 16,
} So that then in the code you can use configurationBits.vgaScaler & configurationBits.hdmi96k And then you know that at compilation time it goes back to
That we would consider unreadable and would make every configuration that uses numbers the same to the other. Enums are more straight forward to use to me compared to strings union, but are the wrong tool for the job to pick up from a choice of strings, so we shouldn't use them to differentiate between jpg/png for example. I don't think we have a valid use case for enums in our codebase right now |
@ShaMan123 do you think it make sense ot use the type or typedef file as index file for types? Should types be all first level exports even if we have utils and controls objects exports? |
so the extra code was indeed us exporting the enums as code. |
let's merge as it is, since it has no bad side effects. |
I am not sure about top level type exports. IMO it makes sense to have types at the same level as what they are describing. For discovery.
But then we need to think how 'fabric/node' fits into this pattern. What are your thoughts and preferences? |
This is a good point. |
Ok. |
Thinking a bit more about entry points. |
Motivation
More type exports
Description
Changes
src/util/fireEvent
=>src/controls/fireEvent
src/util/type
=>src/controls/typeAssertions
Gist
In Action