Skip to content
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

Merged
merged 10 commits into from
Mar 3, 2025
Merged

Conversation

PClmnt
Copy link
Collaborator

@PClmnt PClmnt commented Feb 25, 2025

Description

Converts a number of BBUI components to Typescript

Copy link

qa-wolf bot commented Feb 25, 2025

QA Wolf here! As you write new code it's important that your test coverage is keeping up.
Click here to request test coverage for this PR!

@github-actions github-actions bot added firestorm Data/Infra/Revenue Team size/m labels Feb 25, 2025
@github-actions github-actions bot added size/l and removed size/m labels Feb 25, 2025
export const createNotificationStore = () => {
const timeoutIds = new Set()
const _notifications = writable([], () => {
const timeoutIds = new Set<NodeJS.Timeout>()
Copy link
Collaborator

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.

Suggested change
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
Copy link
Collaborator

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
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

Copy link
Collaborator

@adrinr adrinr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@PClmnt PClmnt enabled auto-merge March 3, 2025 11:25
@PClmnt PClmnt merged commit 355fbd1 into master Mar 3, 2025
21 checks passed
@PClmnt PClmnt deleted the feat/pc-ts-conversions branch March 3, 2025 11:34
@github-actions github-actions bot locked and limited conversation to collaborators Mar 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
firestorm Data/Infra/Revenue Team size/l
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants