absinthe-graphql / absinthe-socket

Core JavaScript support for Absinthe WS-based operations
MIT License
150 stars 75 forks source link

Provide TS typedefs #43

Open slorber opened 5 years ago

slorber commented 5 years ago

Hi,

It would be convenient for TS users have type definitions shipped with the packages

ffloyd commented 4 years ago

Yeah, it'll be so helpful.

So far, only this JS dependencies have no typedefs in my project. And now I'm forced to spend hours to realize how to provide minimal type definitions to make TS compile again.

Maybe I'm missing some easy ways. If so - it will be convenient to have small section in documentation dedicated to TypeScript users.

I'm constantly trying to propagate Elixir/Phoenix to my colleagues and such time wasting points makes evangelism harder.

kurund commented 4 years ago

I am also stuck with typescript errors. Any thoughts about how to get this working with Typescript or any references?

slorber commented 4 years ago

Quick fix:

// @ts-ignore
import X from "y";

It will consider X as any.

eisnstein commented 4 years ago

I started to integrate subscriptions in a React/TypeScript app and besides the needed packages I installed the types like this:

npm install -D @types/absinthe__socket @types/absinthe__socket-apollo-link @types/phoenix

jamestalmage commented 4 years ago

@eisnstein Those typedefs are flawed. In particular, toObservable has the wrong return type. The typedef says it returns withAbsintheSocket.Observer, but the actual implementation returns a zen-observable.Observable

mgtitimoli commented 2 years ago

I'm starting the engines again, the idea is to move forward with the following:

  1. Automate release process
  2. Migrate to TS / Upgrade deps

Once we get here, it will be easier for people to contribute (TS vs Flow, and PR merged => released).

I will close this issue once we have finished the migration to TS, thanks for the patience.

joshsmith commented 2 years ago

Asking not out of impatience (really, open source work is hard and I'm very grateful) but for timing – should someone implementing today wait on this (and be okay without types) vs using a fork with types right now?

davidspek commented 2 years ago

I'm just looking into setting up semantic release for a forked version we have of this repo and was also thinking it might make sense to migrate to typescript. Using semantic release alongside Renovate should make it pretty low maintenance to keep it up to date.

@mgtitimoli Would you be open to a contribution to set this up?

davidspek commented 1 year ago

@joshsmith The repo is still a bit messy from me trying to get the release process working but in this fork I've setup Semantic Release and NX so that new release are created for every PR.