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

TypeScript type definition file #42

Open
kseo opened this issue Mar 1, 2017 · 12 comments
Open

TypeScript type definition file #42

kseo opened this issue Mar 1, 2017 · 12 comments

Comments

@kseo
Copy link

kseo commented Mar 1, 2017

Adding a TypeScript type definition file for transit-js will be helpful for TypeScript developers.

@phreed
Copy link

phreed commented Apr 10, 2017

I know...
" Because transit is incorporated into products and client projects, we prefer to do development internally and are not accepting pull requests or patches."
...but here is hoping.

@swannodette
Copy link
Contributor

@phreed @kseo I finally found time to update the project so it can build again at least locally. It would be nice to get some outside confirmation before we proceed. Thanks.

@phreed
Copy link

phreed commented May 12, 2017 via email

@swannodette
Copy link
Contributor

@phreed try now, I've updated all the build scripts to reflect the latest Closure CLI.

@phreed
Copy link

phreed commented May 19, 2017 via email

@phreed
Copy link

phreed commented Jun 27, 2017

The typings seem to be working but I am getting a bug in the execution.
In ./node_modules/transit-js/src/com/cognitect/transit/handlers.js : 338

 if (typeof goog.global.Buffer != "undefined") {
     hs.set(goog.global.Buffer, new handlers.BufferHandler());
 }

...which in the Closure compiler converts into ./target/transit.js as...

 "undefined" != typeof h.G && this.set(h.G, new lb);

In that context h is undefined and an exception is thrown.
A couple questions:

  • What is goog.global and why is it undefined?
  • How should I be debugging this?

I should mention this is in a Node.js context.

@swannodette
Copy link
Contributor

@phreed Google Closure doesn't know about Node.js buffer, let me think about this some more.

@phreed
Copy link

phreed commented Jul 5, 2017

As an aside...
Are there clojure.spec definitions for the transit api?
[I made a cursory check but did not see any.]
I am curious if the specs are sufficiently rich to be able to generate typings.
And if they are not what would be needed to make them so?
The question is inspired by this guy...
https://youtu.be/Rlu-X5AqWXw?t=3m

@swannodette
Copy link
Contributor

No spec. Forgot to check the issue and realize I need to look into this Buffer issue, will do so tomorrow.

@swannodette
Copy link
Contributor

@phreed can you please describe steps to reproduce that issue? I cannot reproduce it. goog.global is provided by goog/base.js it should be defined.

@phreed
Copy link

phreed commented Sep 2, 2017 via email

@phreed
Copy link

phreed commented Sep 5, 2017

I am made a pull request #43

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

No branches or pull requests

3 participants