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

Add typescript definitions #64

Closed
pspeter3 opened this issue May 16, 2014 · 20 comments
Closed

Add typescript definitions #64

pspeter3 opened this issue May 16, 2014 · 20 comments

Comments

@pspeter3
Copy link

Has anyone asked for Typescript definitions or tried using feathers with Typescript? I'm tempted to make them but unsure if they're actually wanted.

@ekryski
Copy link
Contributor

ekryski commented Jun 13, 2014

Not that I am aware of. If you wanted to add definitions that would be great. I personally haven't done much Typescript if you want to submit an example we'll definitely add it to the readme.

@ekryski
Copy link
Contributor

ekryski commented Jul 17, 2014

Closing for now due to inactivity on this subject. I'm also not much of a typescript user. Will reopen if it becomes a more requested feature.

@ekryski ekryski closed this as completed Jul 17, 2014
@omeid
Copy link

omeid commented Mar 23, 2016

Typescript is now a pretty solid product. Having typings for feathers would be nice.

@omeid
Copy link

omeid commented Mar 23, 2016

@talensjr Maybe interested to help out? :)

@ekryski
Copy link
Contributor

ekryski commented Mar 23, 2016

It will definitely need to be community driven. No one on the core team currently uses Typescript. If someone wants to take on the challenge I'll re-open the issue and we can slot it into a milestone.

@talensjr
Copy link

Yes I would like to help, I don't know how much time can I spend on it right now, but sure I will try to help out

@ekryski
Copy link
Contributor

ekryski commented Mar 23, 2016

Ok re-opening and renaming. @omeid and @talensjr I'm going to pass the baton to you guys on this.

@ekryski ekryski reopened this Mar 23, 2016
@ekryski ekryski changed the title Typescript users? Add typescript bindings Mar 23, 2016
@ekryski ekryski changed the title Add typescript bindings Add typescript definitions Mar 23, 2016
@ekryski ekryski added this to the 3.0.0 milestone Mar 23, 2016
@omeid
Copy link

omeid commented Mar 24, 2016

I will try to give this a crack and see how it goes.

@daffl
Copy link
Member

daffl commented Apr 11, 2016

This may be fairly quick to add to https://github.com/DefinitelyTyped/DefinitelyTyped. It can probably just extend the Express definitions from the same repository and then add the definitions for the API. It probably also makes sense to add definitions for the service interface.

@daffl daffl modified the milestones: Auk, Buzzard Apr 13, 2016
@daffl
Copy link
Member

daffl commented Apr 13, 2016

I just added this to the next release which is currently set for July 15th. @omeid please let me know if you or anybody else can take this on until then.

@omeid
Copy link

omeid commented Apr 13, 2016

Hi @daffl,

Unfortunately I am pretty caught up with work and can't look into this any time soon.

@daffl
Copy link
Member

daffl commented Apr 13, 2016

I'm going to leave this open and on the milestone until it gets closer to the release date in case anybody else is interested in picking this up. It seems to be fairly doable for anybody familiar with TypeScript interfaces.

@daffl daffl removed this from the Auk milestone Jun 10, 2016
@daffl
Copy link
Member

daffl commented Jun 10, 2016

Of course we will do everything we can to help anybody who would like to contribute TypeScript definitions but I am going to close this issue since it does not look like anybody is going to pick it up.

@ForsakenHarmony
Copy link
Contributor

ForsakenHarmony commented Dec 4, 2016

I'd really like to have this as well, because webstorm can't analyse the package
this is probably because of your bundling with babel
webstorm says that i.e. app.configure is an undefined function

looking for community stubs http://definitelytyped.org/

I'm not using Typescript itself, but it's still annoying to have everything underlined

@daffl
Copy link
Member

daffl commented Dec 5, 2016

Bundling with Babel shouldn't really make a difference. Maybe it can't statically analyze it because of the way it is added to the app. Webstorm usually also takes JSDocs into consideration (which we don't publish either though).

Either way, the open issue for TypeScript definitions is #381. Apparently making TypeScript definitions is really really hard because everybody keeps asking for them but nobody seems to be able to actually make it happen :trollface:

@pspeter3
Copy link
Author

pspeter3 commented Dec 5, 2016

The issue is that maintaining them requires keeping the definitions and the code base in sync which is not always obvious.

@AbraaoAlves
Copy link
Contributor

@daffl write typescript definitions is hard, because this is:

A way of making explicit what is implicit.

I had to study a lot of source code and documentation to make this:#381

@alejandrohn
Copy link

How I can program with typescript in featherjs?

@eddyystop
Copy link
Contributor

Here's part of a Slack discussion:

alehn [11:56 AM]
it's possible feathers with typescript?

smixx
[12:11 PM]
https://github.com/feathersjs/feathers-typescript, none of us on the core team use TypeScript so they are maintained by the community

alehn [12:28 PM]
how use typescript?

harmony
[12:31 PM]
wait, do you want to use feathers with typescript but don't know how typescript works?

alehn [12:36 PM]
yes I know with typescript work , That's why I'm asking how I programn in feathers with ts

[12:37]
or I have to program with es6 obligatory

eddyystop
[12:39 PM]
@alehn .d.ts files are fundamental to TypeScript https://blog.mariusschulz.com/2014/05/19/using-typescripts-type-definition-files-to-get-tooling-support-for-plain-javascript#utilizing-type-definition-files-for-plain-javascript
Marius Schulz
Using TypeScript's Type Definition Files to Get Tooling Support for Plain JavaScript
TypeScript's type definition files are great to describe the public interface of JavaScript libraries. Here's how you can use them to get autocompletion and documentation for plain JavaScript code using Visual Studio and ReSharper.
May 19th, 2014 at 7:17 PM

(edited)

[12:40]
There is a whole ecosystem for them https://github.com/DefinitelyTyped/DefinitelyTyped

alehn [12:40 PM]
somewhere is using typescript in feathers? .ts

alehn [12:51 PM]
I use angular 4 for frontend and I need use feather for backend for web service but I have programming with ts and I dont want put js

eddyystop
[12:52 PM]
Your choice then is using the .d.ts. It is a perfectly satisfactory, perfectly accepted way to use TypeScript. Hundreds of packages are delivered like this.

[12:54]
I assume you will have inline TypeScript definitions for your own code, so you'll have to run a build step before executing your server code. (edited)

alehn [1:00 PM]
no I use webpack

[1:01]
I programing in ts only

bazaglia [1:36 PM]
joined #general

j2l4e [1:38 PM]
@alehn the current ts definitions are a work in progress. If you want everything to just work, delete any *.d.ts files in node-modules/feathers* and put declare module feathers; declare module feathers-*; in your typings.d.ts file. It doesn't get you intellisense, but makes it work (edited)

[1:39]
how do you escape the asterisk in markdown?

teddy-error [1:40 PM]

alehn [1:40 PM]
thanks

j2l4e [1:41 PM]
if you are into fiddling... the typings generally work, but there may be some packages that would need you to remove their definitions and put a wildcard definition in place

[1:42]
so you can try out what works for you

[1:43]
That aside, you should have a look at typescripts 'allowJS' setting, that was introduced recently. It should allow you to work with TS and JS files side-by-side regardless of the availability of definitions

daffl pushed a commit that referenced this issue Aug 21, 2018
daffl pushed a commit that referenced this issue Aug 22, 2018
daffl pushed a commit that referenced this issue Aug 28, 2018
…#64)

* added support for nested password fields option

* Small code tweak
daffl pushed a commit that referenced this issue Aug 29, 2018
…#64)

* added support for nested password fields option

* Small code tweak
@lock
Copy link

lock bot commented Feb 7, 2019

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue with a link to this issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Feb 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants