Skip to content

Make Global Functions Non-Optional [AARD-1986] - #1204

Merged
BrandonPacewic merged 4 commits into
devfrom
zachr/1986/globalfunctions
Jul 10, 2025
Merged

Make Global Functions Non-Optional [AARD-1986]#1204
BrandonPacewic merged 4 commits into
devfrom
zachr/1986/globalfunctions

Conversation

@rutmanz

@rutmanz rutmanz commented Jul 9, 2025

Copy link
Copy Markdown
Member

Task

AARD-1986

Very small task to improve the typing on the Global_* functions

Symptom

Currently the Global_DoWhatever functions are typed as potentially undefined and require optional chaining (Global_DoWhatever?.(...)) whenever they're called. This is ugly and somewhat unintuitive because these functions are, in practice, always defined when they'd be called

Solution

I provided a default () => {} implementation so that they're always callable and don't include undefined in their type signature

Verification

Type checking handles most of it, and I ran synthesis and checked that toasts still worked (they did)


Before merging, ensure the following criteria are met:

  • All acceptance criteria outlined in the ticket are met.
  • Necessary test cases have been added and updated.
  • A feature toggle or safe disable path has been added (if applicable).
  • User-facing polish:
    • Ask: "Is this ready-looking?"
  • Cross-linking between Jira and GitHub:
    • PR links to the relevant Jira issue.
    • Jira ticket has a comment referencing this PR.

@rutmanz rutmanz self-assigned this Jul 9, 2025
@rutmanz
rutmanz requested review from a team as code owners July 9, 2025 21:39
@rutmanz rutmanz added the refactor The most important part of software development. label Jul 9, 2025

@azaleacolburn azaleacolburn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@BrandonPacewic BrandonPacewic mentioned this pull request Jul 10, 2025

@BrandonPacewic BrandonPacewic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Love stuff like this, nice clear win for the codebase.

@BrandonPacewic
BrandonPacewic merged commit 330d333 into dev Jul 10, 2025
17 checks passed
@BrandonPacewic
BrandonPacewic deleted the zachr/1986/globalfunctions branch July 10, 2025 17:59
@rutmanz rutmanz mentioned this pull request Jul 10, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor The most important part of software development.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants