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

WIP: POC for new sdk js lib implementation #159

Merged
merged 7 commits into from
Jun 29, 2023

Conversation

karthik2804
Copy link
Collaborator

@karthik2804 karthik2804 commented Apr 2, 2023

This is a very work-in-progress implementation of the SDK lib. This PR attempts to replace the current spin-sdk package which hosts only type to a package that provides implementations as well. This allows for there to be an explicit import of types in both ts/js as per #158.

Currently, there are examples for both ts/js In

  • examples/javascript/sdk-poc-js
  • examples/javascript/sdk-poc-ts

The advantage to this is that helper functions can be added without a need for there to be a new build of the plugin along with allowing us to create explicit imports allowing for the removal of magic imports.

The one downside to this approach is that there will be slightly more work maintaining both the code that is internal to the SDK as well as this package.

There definitely needs to be a lot more of the cleanup if this is an approach we want to pursue.

Thoughts?

@karthik2804 karthik2804 force-pushed the poc/spin-sdk-library branch 2 times, most recently from db80273 to c8de545 Compare April 14, 2023 19:09
@karthik2804 karthik2804 marked this pull request as ready for review April 27, 2023 20:29
*/
const spinSdk: SpinSdk = __internal__.spin_sdk
spinSdk.utils = utils
spinSdk.Router = () => {
Copy link
Member

Choose a reason for hiding this comment

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

nit: could we have Router as a top-level import from the SDK, instead of it being namespaced as spinSdk.Router?

Copy link
Member

@radu-matei radu-matei left a comment

Choose a reason for hiding this comment

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

This is looking great, LGTM!
(post this merging we need to update the docs for the JS SDK as well)

@karthik2804 karthik2804 force-pushed the poc/spin-sdk-library branch 4 times, most recently from 3b0c897 to 73d99a8 Compare June 20, 2023 22:51
@karthik2804 karthik2804 mentioned this pull request Jun 22, 2023
Signed-off-by: karthik2804 <karthik.ganeshram@fermyon.com>
Signed-off-by: karthik2804 <karthik.ganeshram@fermyon.com>
Signed-off-by: karthik2804 <karthik.ganeshram@fermyon.com>
Signed-off-by: karthik2804 <karthik.ganeshram@fermyon.com>
Signed-off-by: karthik2804 <karthik.ganeshram@fermyon.com>
Signed-off-by: karthik2804 <karthik.ganeshram@fermyon.com>
Signed-off-by: karthik2804 <karthik.ganeshram@fermyon.com>
@karthik2804 karthik2804 merged commit 03d25ce into fermyon:main Jun 29, 2023
2 checks passed
@karthik2804 karthik2804 deleted the poc/spin-sdk-library branch June 29, 2023 16:39
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