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

Restructure TS Client V3 #814

Merged

Conversation

ajimae
Copy link
Contributor

@ajimae ajimae commented Oct 1, 2024

Summary

Restructure and rewrite part of the v3 SDK to fix some serious issues encountered by the customers when using the SDK.

Completed Tasks

  • Rewrite authentication middleware logic
  • Rewrite the concurrent middleware and httpMiddleware logic
  • Restructure tests to conform with new changes

Associated customer issues

@ajimae ajimae requested a review from a team as a code owner October 1, 2024 02:46
Copy link

changeset-bot bot commented Oct 1, 2024

🦋 Changeset detected

Latest commit: 1cef5f0

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

This PR includes changesets to release 1 package
Name Type
@commercetools/ts-client Minor

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

Copy link

codecov bot commented Oct 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.07%. Comparing base (d715006) to head (1cef5f0).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #814   +/-   ##
=======================================
  Coverage   93.07%   93.07%           
=======================================
  Files          25       25           
  Lines         289      289           
  Branches       14       14           
=======================================
  Hits          269      269           
  Misses         20       20           
Flag Coverage Δ
integrationtests 93.07% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ajimae ajimae marked this pull request as draft October 1, 2024 11:23
@ajimae ajimae marked this pull request as ready for review October 1, 2024 11:34
@ajimae ajimae removed request for a team, lojzatran, jenschude and evansinho October 1, 2024 11:34
@ajimae ajimae marked this pull request as draft October 1, 2024 11:34
Copy link
Contributor

@lojzatran lojzatran left a comment

Choose a reason for hiding this comment

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

Can you add why you need this PR? Maybe link the customer issue if there is one and also how you approach to solve the issue.

@ajimae ajimae force-pushed the chore/rewrite-async-and-concurrent-execution-strategy branch from a06d053 to 91598d5 Compare October 4, 2024 20:23
@ajimae ajimae marked this pull request as ready for review October 4, 2024 20:37
@ajimae ajimae requested review from a team, evansinho and jenschude October 4, 2024 20:37
@ajimae
Copy link
Contributor Author

ajimae commented Oct 7, 2024

Can you add why you need this PR? Maybe link the customer issue if there is one and also how you approach to solve the issue.

I have updated the PR description to include this.

@ajimae ajimae requested a review from lojzatran October 7, 2024 12:12
@lojzatran
Copy link
Contributor

Good job! 🚀

ajimae added 7 commits October 8, 2024 20:58
…and concurrent executions

- remove the use of request queue during token fetch
- remove promise chain from dispatch function
- return response to resolver only when async and concurrent executions are done
- remove Buffer module from core SDK packages and replace with browser friendly alternatives
- remove async-mutex packages used for concurrent request locking use pure Promise solution
- add a response cache to prevent unnecessary calls to coco API
- modify type definitions in accordance with the new changes
- rewrite tests to correspond with new changes
- rewrite concurrent middleware integration test
- rollback some changes in the client.ts file
- fix the bug in queue middleware
- modify tests to fit the new implementation
- add new tests to cover new codes blocks
- minor refactor
- remove crypto module reference from SDK
- fix type errors and return type values
- resolve conflicts on yarn.loc
@ajimae ajimae force-pushed the chore/rewrite-async-and-concurrent-execution-strategy branch from 6b663c4 to 1cef5f0 Compare October 8, 2024 19:04
@ajimae ajimae merged commit 57a16d7 into master Oct 8, 2024
6 checks passed
@ajimae ajimae deleted the chore/rewrite-async-and-concurrent-execution-strategy branch October 8, 2024 19:26
@ct-changesets ct-changesets bot mentioned this pull request Oct 8, 2024
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.

2 participants