-
Notifications
You must be signed in to change notification settings - Fork 1.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
BBUI TS scaffolding + helpers conversion #15385
Conversation
QA Wolf here! As you write new code it's important that your test coverage is keeping up. |
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.
Thanks for that!
export let noPadding = false | ||
export let weight = "default" // light, heavy, default | ||
export let size: "XS" | "S" | "M" | "L" = "M" | ||
export let textAlign: string | undefined = undefined |
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 think that the | undefined
is not required, as it gets inferred by the = undefined
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.
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.
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.
Oh, I see. It's caused to adding the default tsconfig. The strictNullChecks
is the culprit
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.
Ah I think I understand the difference. In this case textAlign
actually is optional, so I want to type is as possibly undefined. If i change strictNullChecks
to false then it lets me set it as undefined, but it is typed as string
only which is incorrect for this use case and potentially dangerous (unless all our code was TS, then it would be easy to spot any errors).
I'll keep this as-is, because I think it's more correct for this use case, in that it actually is optional 👍
Description
This PR adds the required config so that BBUI can properly build typescript code in both svelte components and .ts files.
I've converted the helpers and the Heading component to TS as an example of both.
I've also added a
dev
script so thatbbui
is continually built in dev, highlighting any build issues which may otherwise go unnoticed.