Skip to content

refactor: migrate nativeSdkHelpers module to TS#1262

Open
jaissica12 wants to merge 2 commits into
developmentfrom
refactor/SDKE-1110-update-helpers-to-TS
Open

refactor: migrate nativeSdkHelpers module to TS#1262
jaissica12 wants to merge 2 commits into
developmentfrom
refactor/SDKE-1110-update-helpers-to-TS

Conversation

@jaissica12
Copy link
Copy Markdown
Contributor

@jaissica12 jaissica12 commented May 12, 2026

Background

  • Continuing the effort to migrate remaining JavaScript modules to TypeScript for improved type safety and developer experience across the SDK codebase.

What Has Changed

  • Converted src/nativeSdkHelpers.js to src/nativeSdkHelpers.ts with full type annotations on all methods, parameters, and return types
  • Updated src/nativeSdkHelpers.interfaces.ts to correct the sendViaBridgeV2 parameter type from boolean to string

Screenshots/Video

  • {Include any screenshots or video demonstrating the new feature or fix, if applicable}

Checklist

  • I have performed a self-review of my own code.
  • I have made corresponding changes to the documentation.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have tested this locally.

Additional Notes

  • {Any additional information or context relevant to this PR}

Reference Issue (For employees only. Ignore if you are an outside contributor)

@jaissica12 jaissica12 changed the base branch from master to development May 13, 2026 00:02
@jaissica12 jaissica12 marked this pull request as ready for review May 26, 2026 10:26
@jaissica12 jaissica12 requested a review from a team as a code owner May 26, 2026 10:26
@cursor
Copy link
Copy Markdown

cursor Bot commented May 26, 2026

PR Summary

Low Risk
Mechanical TS migration and an interface typo fix; native bridge routing logic is unchanged aside from typing.

Overview
Migrates nativeSdkHelpers from JavaScript to TypeScript: the constructor is typed against INativeSdkHelpers and IMParticleWebSDKInstance, and bridge helpers use explicit parameter/return types plus Dictionary casts for dynamic window / mpInstance fields.

The public contract is tightened by fixing sendViaBridgeV2’s third argument in nativeSdkHelpers.interfaces.ts from boolean to string (the bridge name), matching how requiredWebviewBridgeName is actually passed. Style-only updates include const/let, arrow methods, and this instead of a closure self reference—behavior for native v1/v2 webview messaging should stay the same.

Reviewed by Cursor Bugbot for commit 40cc85e. Bugbot is set up for automated code reviews on this repo. Configure here.

@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant