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

Updating SDK and Improving Inference #57

Merged
merged 10 commits into from
Nov 8, 2023

Conversation

sordina
Copy link
Contributor

@sordina sordina commented Nov 6, 2023

This PR updates the TS Deno connector with the following changes:

  • Depends on the latest version of the TS SDK which no longer needs multiregion functions
  • Update path dep: https://deno.land/[email protected]/path/mod.ts
  • Defines arraybuffer and blob scalars
  • Sets MAX_INFERENCE_RECURSION = 20 to break any potential infinite recursion loops
  • Types names are now preserved when possible
  • Types referenced from dependencies will be qualified by their path
  • Tests have been created in the test/ directory for the refactored inference cases
  • Other existing tests have been updated to use the new improved type names

Fixes

Fixes: #34
Fixes: #30

Tags

git tag -a v0.10 -m "Updating SDK and Improving Inference"

Issues

Generic type parameters are still not handled correctly, for example, the following will infer Bar.y as a scalar.

#58

type Foo = {
  a: number,
  b: string
}

type Bar<X> = {
  x: number,
  y: X
}

export function bar(): Bar<Foo> {
  return {
    x: 1,
    y: {
      a: 2,
      b: 'hello'
    }
  }
}

@sordina sordina self-assigned this Nov 7, 2023
Copy link
Contributor

@daniel-chambers daniel-chambers left a comment

Choose a reason for hiding this comment

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

This looks great; I especially like the tests.
Just a couple of naming nitpicks.

src/infer.ts Outdated Show resolved Hide resolved
src/infer.ts Outdated Show resolved Hide resolved
src/infer.ts Outdated Show resolved Hide resolved
@sordina sordina merged commit c5679ba into main Nov 8, 2023
1 check passed
@daniel-chambers daniel-chambers deleted the lyndon/update-ts-sdk-improve-inference branch November 24, 2023 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants