Skip to content

teach ts type gen how to handle nullable return types - #2530

Open
hahn-kev wants to merge 3 commits into
developfrom
generated-types-respect-nullability
Open

teach ts type gen how to handle nullable return types#2530
hahn-kev wants to merge 3 commits into
developfrom
generated-types-respect-nullability

Conversation

@hahn-kev

@hahn-kev hahn-kev commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

now methods with a return type of eg Task<string?> get converted into Promise<string | undefined>

I opted to use undefined instead of null as that fits best with svelte params which are declared as param?: type or $state<type>() which defaults to type | undefined.

@hahn-kev hahn-kev added the self-reviewed 👁️ I reviewed this myself and with AI and decided it was safe to merge without a second set of eyes label Aug 6, 2026
@github-actions github-actions Bot added the 💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related label Aug 6, 2026
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c76149b6-d720-4aa9-b67c-873b99ed35a2

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR adds nullable async return handling to TypeScript generation, removes explicit TsFunction annotations, updates backend method contracts, and aligns generated frontend interfaces with nullable results.

Changes

Nullable API contracts

Layer / File(s) Summary
Nullable return type generation
backend/FwLite/FwLiteShared/TypeGen/ReinforcedFwLiteTypingConfig.cs
The generator preserves nullable return types for asynchronous methods and emits Promise<T | null> when required.
Backend invocation contracts
backend/FwLite/FwLiteShared/Events/JsEventListener.cs, backend/FwLite/FwLiteShared/Services/*.cs
Explicit TsFunction annotations are removed. GetFileStream becomes non-nullable, and TryGetCrdtProjectName returns string? synchronously.
Generated frontend interfaces
frontend/viewer/src/lib/dotnet-types/generated-types/FwLiteShared/**/*.ts
Generated interfaces now allow nullable results for event, project, history, and sync methods. Type imports are consolidated and reordered.
Estimated code review effort: 3 (Moderate) ~20 minutes

Possibly related PRs

Suggested reviewers: myieye

Poem

I’m a rabbit with types in my den,
Nulls now hop through the code again.
Promises speak true,
Interfaces do too,
And annotations rest in their pen.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The description directly addresses nullable return type generation and the rationale for the chosen TypeScript representation.
Title check ✅ Passed The title clearly and concisely identifies the main change: adding nullable return type support to TypeScript generation.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch generated-types-respect-nullability

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@argos-ci

argos-ci Bot commented Aug 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Aug 6, 2026, 8:04 AM
e2e (Inspect) ✅ No changes detected - Aug 6, 2026, 8:11 AM

@hahn-kev hahn-kev removed the self-reviewed 👁️ I reviewed this myself and with AI and decided it was safe to merge without a second set of eyes label Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant