superfaceai / one-sdk-js

1️⃣ One Node.js SDK for all the APIs you want to integrate with
https://superface.ai
MIT License
47 stars 3 forks source link

streaming map interpreter #295

Closed TheEdward162 closed 1 year ago

TheEdward162 commented 2 years ago

Description

Redesign of map interpreter using async generators. For now, this will only change internal details and should not change any public behavior.

Motivation and Context

This will open the possibility of adding a yield keyword to Comlink and allow us to return partial results - turning perform (or performStream) into a generator.

Types of changes

Checklist:

TheEdward162 commented 2 years ago

I've also run station tests against this by using the https://github.com/superfaceai/station/tree/chore/onesdk_2_1_0 branch + yalc add and ignoring mock.test.ts files with yarn test --testPathIgnorePatterns 'mock.test.ts' --runInBand

TheEdward162 commented 2 years ago

Also - it is not true that this PR doesn't change public API surface. I have added UnexpectedError and SDKExecutionError into the return signature of MapInterpreter and BoundProfileProvider because it was always supposed to be there - so in that sense it is a bugfix rather than a minor change.

TheEdward162 commented 1 year ago

rebased on top of dev

TheEdward162 commented 1 year ago

rebased on dev