Skip to content

Conversation

nbierdeman
Copy link
Contributor

@nbierdeman nbierdeman commented Oct 2, 2025

This PR adds JSDoc comments to v6 public interface types.

Copy link

changeset-bot bot commented Oct 2, 2025

🦋 Changeset detected

Latest commit: 87cea48

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@paypal/paypal-js Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@nbierdeman nbierdeman marked this pull request as ready for review October 2, 2025 15:12
@nbierdeman nbierdeman requested a review from a team as a code owner October 2, 2025 15:12

export interface PayPalV6Namespace {
/**
* Creates an SDK instance with the specified components and configuration.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Creates an SDK instance with the specified components and configuration.
* Creates a SDK instance which is the first step in a SDK integration. This instance serves as the base layer for all SDK components.

* Creates an SDK instance with the specified components and configuration.
*
* This is an asynchronous method that initializes the PayPal SDK with the provided
* client token and components. The SDK is designed to be lightweight and modular,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should remove this part about the SDK design. It feels like marketing material.

Suggested change
* client token and components. The SDK is designed to be lightweight and modular,
* client token and components.

* allowing you to load only the functionality you need.
*
* @param {CreateInstanceOptions} createInstanceOptions - Configuration options for creating the SDK instance
* @returns {Promise<SdkInstance<T>>} - A promise that resolves to an SDK instance with methods based on the specified components
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think there's any context about what T is here for the generic to make sense. I wonder if we can replace with

Suggested change
* @returns {Promise<SdkInstance<T>>} - A promise that resolves to an SDK instance with methods based on the specified components
* @returns {Promise<SdkInstance<Components[]>>} - A promise that resolves to an SDK instance with methods based on the specified components

Copy link
Contributor

@gregjopa gregjopa left a comment

Choose a reason for hiding this comment

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

Awesome work @nbierdeman! 💯

I left a minor comment about the createInstance description. After that's addressed, I'm happy to see this get merged.

@nbierdeman nbierdeman force-pushed the feature/DTPPCPSDK-3708-add-jsdoc-comments-to-types branch from 5596195 to b9f0713 Compare October 6, 2025 17:41
@nbierdeman nbierdeman merged commit 61aba9f into main Oct 6, 2025
5 checks passed
@nbierdeman nbierdeman deleted the feature/DTPPCPSDK-3708-add-jsdoc-comments-to-types branch October 6, 2025 18:03
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.

3 participants