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

fix(javascript): remove duplicate types, add some type descriptions #644

Merged
merged 3 commits into from
Jun 7, 2022

Conversation

shortcuts
Copy link
Member

🧭 What and Why

🎟 JIRA Ticket: -

Changes included:

  • Rename the local storage key to prevent conflict with v4 (just for precaution)
  • Re-use types where possible

🧪 Test

CI :D

@shortcuts shortcuts requested a review from a team June 7, 2022 10:10
@shortcuts shortcuts self-assigned this Jun 7, 2022
@shortcuts shortcuts requested review from eunjae-lee and millotp and removed request for a team June 7, 2022 10:10
@netlify
Copy link

netlify bot commented Jun 7, 2022

Deploy Preview for api-clients-automation ready!

Name Link
🔨 Latest commit 9531c91
🔍 Latest deploy log https://app.netlify.com/sites/api-clients-automation/deploys/629f4312d190df000815d775
😎 Deploy Preview https://deploy-preview-644--api-clients-automation.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@algolia-bot
Copy link
Collaborator

algolia-bot commented Jun 7, 2022

✗ The generated branch has been deleted.

If the PR has been merged, you can check the generated code on the main branch.
You can still access the code generated on main via this commit.

Copy link
Collaborator

@millotp millotp left a comment

Choose a reason for hiding this comment

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

Very clean ! A few picky comments

readonly headers: () => Readonly<Record<string, string>>;
readonly queryParameters: () => Readonly<Record<string, string>>;
readonly headers: () => Headers;
readonly queryParameters: () => QueryParameters;
Copy link
Collaborator

Choose a reason for hiding this comment

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

the QueryParameters type should be stricter IMO, it should be Record<string | number | boolean | Array<string | number | boolean>> (I think we already have this type somewhere).
In serializeQueryParameters we also accept Object, I'm sure if we ever use it in the api

Copy link
Member Author

Choose a reason for hiding this comment

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

IIRC I've went with a stricter type when adding the requestOptions but since it was any in v4 I've followed the same implem

@shortcuts shortcuts enabled auto-merge (squash) June 7, 2022 12:22
@shortcuts shortcuts merged commit 19dc918 into main Jun 7, 2022
@shortcuts shortcuts deleted the fix/js-common-types branch June 7, 2022 12:29
algolia-bot added a commit to algolia/algoliasearch-client-javascript that referenced this pull request Jun 7, 2022
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.

None yet

3 participants