-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Typescript conversion for some BBUI components #15623
Conversation
QA Wolf here! As you write new code it's important that your test coverage is keeping up. |
export const createNotificationStore = () => { | ||
const timeoutIds = new Set() | ||
const _notifications = writable([], () => { | ||
const timeoutIds = new Set<NodeJS.Timeout>() |
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.
We had some issues with this when running on the frontend.
const timeoutIds = new Set<NodeJS.Timeout>() | |
const timeoutIds = new Set<ReturnType<typeof setTimeout>>() |
export let schema: any | ||
export let value: any | ||
export let customRenderers: { column: string; component: any }[] = [] | ||
export let snippets: any |
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.
Same
|
||
// adding the 0- will turn a string like 00:00:00 into a valid ISO | ||
// date, but will make actual ISO dates invalid | ||
$: time = new Date(`0-${value}`) | ||
$: isTimeOnly = !isNaN(time) || schema?.timeOnly | ||
$: isTimeOnly = !isNaN(time.getTime()) || schema?.timeOnly |
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.
Is this expected? Would this not change its behaviour?
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.
So isNan only takes a number, but we were passing a date to it here, but it was getting coerced internally by isNan. I've casted it to any instead, just to be safe in this instance and to not change any behaviour it relies on.
…ons' into feat/pc-ts-conversions
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.
LGTM!
Description
Converts a number of BBUI components to Typescript