Skip to content

Typescript definitions @types/parse need to be kept up to date #528

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

Closed
TimNZ opened this issue Dec 5, 2017 · 7 comments
Closed

Typescript definitions @types/parse need to be kept up to date #528

TimNZ opened this issue Dec 5, 2017 · 7 comments
Labels
type:feature New feature or improvement of existing feature

Comments

@TimNZ
Copy link
Contributor

TimNZ commented Dec 5, 2017

I submitted a pull to add Parse.liveQueryServerUrl to DefinitelyTyped repo, but it would be nice if that was part of the deployment workflow

@yomybaby
Copy link

👍

@dplewis
Copy link
Member

dplewis commented Mar 15, 2019

This was tried discussed before in a PR #388

As I understand it since this isn't a typescript repo we can't push autogenerated files to @types/parse

An alternative would be to autogenerate a file with dts-gen and submit types on release

Before that can happen two issues exists

Cannot assign to 'serverURL' because it is a read-only property.

https://github.com/DefinitelyTyped/DefinitelyTyped/blob/cbe76dfa861ea28b07433c119d9cf4505c49aa0d/types/parse/index.d.ts

I don't know why this happens as serverURL isn't readonly in the @type/parse but can be fix with the following workaround.

(Parse as any).serverURL = '';

The second issue is that prototypes would be generated. There is a PR opened to address this microsoft/dts-gen#115

Manual pulls are required for now, I can do those for the time being.

@agoldis @flovilmart @acinader @TimNZ Thoughts?

@agoldis
Copy link

agoldis commented Mar 15, 2019

Good idea! I am not sure about the quality of dts-gen output though, it might be worse than we currently have.

Additional aspect is version upgrades - this requires some manipulation to the files structure of typedefs package, those are not frequent though and prob can be handled manually.

@dplewis we can try to run dts-gen it to see if it is good enough. I never used it before, will try to compare during the weekend.

@dplewis
Copy link
Member

dplewis commented Mar 15, 2019

I tried it and it works if you erase the prototype definitions (PR is waiting for approval). The readonly serverURL error still existed tho.

@agoldis
Copy link

agoldis commented Mar 18, 2019

@dplewis sorry I didn't have chance to explore this option. Any chance you can publish / gist the output you've got?

@dplewis
Copy link
Member

dplewis commented Mar 18, 2019

Wheres the gist parse.d.ts

To generate parse globally npm install parse -g, then run dts-gen -m parse

@agoldis
Copy link

agoldis commented Mar 18, 2019

Thanks, @dplewis.
At glance, it isn't able to recognize argument types and abuses any usage. on the other hand it recognizes classes and methods quite well...

To summarize, IMO:

  1. I don't think we can sacrifice already existing detailed definitions.
  2. It does provide quite a lot of information about new / removed entities (methods, classes etc.)

What do you think about some hybrid process that wouldn't touch whatever is already there, but create a PR / notify about additions and / or detected changes?

@dplewis dplewis closed this as completed Mar 26, 2019
@mtrezza mtrezza added type:feature New feature or improvement of existing feature and removed type:improvement labels Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New feature or improvement of existing feature
Projects
None yet
Development

No branches or pull requests

6 participants