Node-v3 icon indicating copy to clipboard operation
Node-v3 copied to clipboard

Typescript support

Open teyalite opened this issue 2 years ago • 29 comments

Typescript support is needed for the module flutterwave-node-v3

teyalite avatar Apr 19 '22 10:04 teyalite

+1

Marcosmaliki avatar Apr 24 '22 08:04 Marcosmaliki

+1

nejos97 avatar May 24 '22 01:05 nejos97

@Marcosmaliki @teyalite I had a similar issue, I gave a response here on how i was able to use it without types definition

opeolluwa avatar Jun 08 '22 13:06 opeolluwa

Hello @teyalite @Marcosmaliki @nejos97

Thank you for sharing this feedback. We have plans to support TypeScript in the Library. We'd communicate to everyone once support for TS is available.

@opeolluwa Thank you very much for the workaround, We appreciate you helping others out 👍🏾.

corneliusyaovi avatar Aug 01 '22 15:08 corneliusyaovi

@Corvus97 I have the intention of rewriting the SDK in typescript. I would like to know if the project already exist in development or I can just start on a fresh plate

opeolluwa avatar Aug 01 '22 22:08 opeolluwa

@Corvus97 Thanks for letting us know about the plans to support TS. Can you give us a timeline? I for one wants to build a library that is dependent on this feature :pray:

@opeolluwa You don't have to rewrite the SDK in TS. You can write the Types definition instead. We could write it together. Let me know if you're interested.

orimdominic avatar Aug 08 '22 05:08 orimdominic

I'll check through the requirements of add type definition to a package and let you know

opeolluwa avatar Aug 08 '22 07:08 opeolluwa

@orimdominic, I've checked through. It would be awesome to work together, let me know when the plans are

opeolluwa avatar Aug 08 '22 22:08 opeolluwa

@opeolluwa I'll chat you up on LinkedIn and we shoot from there :raised_hands:

orimdominic avatar Aug 09 '22 07:08 orimdominic

Hello @teyalite @Marcosmaliki @nejos97

Thank you for sharing this feedback. We have plans to support TypeScript in the Library. We'd communicate to everyone once support for TS is available.

@opeolluwa Thank you very much for the workaround, We appreciate you helping others out 👍🏾.

I can work on this but will you merge it if I open a PR? I don't want to waste my time to work on something that will not be merged

iamsethsamuel avatar Sep 18 '22 14:09 iamsethsamuel

Hello @orimdominic @opeolluwa @iamsethsamuel

We welcome contributions from the community. Any pull request made would be subject to the guidelines outlined here. If they are acceptable, we would merge after a 48-hour review.

You can reach out on Slack or email if you have any questions regarding contributing to this library.

corneliusyaovi avatar Sep 18 '22 14:09 corneliusyaovi

@Corvus97 Thank you

I would like to suggest that a branch should be created for this so that all changes to this end would be merged to and compared against. This would help prevent merging code to work that already exists on the main branch. It would also help in managing reviews. When the work is complete, it can then be merged to the main branch.

I also suggest a step-wise procedure for converting the codebase to TS, with explanations.

  1. Convert in loose mode Here we convert all JS files to TS, allow implicit anys (loose types, no types) and set types for primitive identifiers

  2. Forbid implicit anys We set the noImplicitAny tsconfig setting to true to prohibit all untyped identifiers and add types for semi-complex identifiers

  3. Enable strict mode We enable strict mode and make sure that all identifiers are typed

  4. Prepare library for use Here we set up tsconfig to allow for non-breaking changes and well-typed use when clients install it from npm.

Kindly share your thoughts about this

orimdominic avatar Sep 28 '22 22:09 orimdominic

@orimdominic, Sounds like a plan to me

opeolluwa avatar Sep 28 '22 22:09 opeolluwa

@orimdominic, Sounds like a plan to me Thank you

Let us hear what the Flutterwave engineering team has to say

orimdominic avatar Sep 28 '22 22:09 orimdominic

I am already working on it on this PR https://github.com/Flutterwave/Node/pull/85

iamsethsamuel avatar Sep 29 '22 08:09 iamsethsamuel

Hello Flutterwave devs. Up to today, No types yet. It's very difficult working without types (No difference with using HTTP request).

It there any plan of adding TypeScript ???

dilane-goune avatar Jul 23 '23 20:07 dilane-goune

1year now TS support not manifest

abbaty48 avatar Aug 08 '23 22:08 abbaty48

@corneliusyaovi please you guys should do something about this, please. It's really annoying.

@iamsethsamuel @orimdominic @opeolluwa how were you guys able to resolve this issue.

Mishael-Joe avatar Jan 02 '24 20:01 Mishael-Joe

@Marcosmaliki @teyalite I had a similar issue, I gave a response here on how i was able to use it without types definition

@Mishael-Joe

opeolluwa avatar Jan 02 '24 20:01 opeolluwa

I can start working on this later this week or next week, fear is would the team review and merge it

opeolluwa avatar Jan 02 '24 21:01 opeolluwa

I can start working on this later this week or next week, fear is would the team review and merge it

I have tried this too, it's not working, it's throwing syntax error: package is a reserved name. And it's keeps breaking my code. Any help please?

Mishael-Joe avatar Jan 02 '24 21:01 Mishael-Joe

Would you like to mail me your mobile number, [email protected] let's have a meet call, perhaps we can fix it.

opeolluwa avatar Jan 02 '24 21:01 opeolluwa

I can start working on this later this week or next week, fear is would the team review and merge it

I have tried this too, it's not working, it's throwing syntax error: package is a reserved name. And it's keeps breaking my code. Any help please?

Here is the full error message:

I have been getting this error whenever I tried bundling the flutterwave_node_vs package and then on further research, I found out that the flutterwave_node_v3 package uses javascript-reserved words. and thus the error. here was the error when bundling with rollup

 [!] (plugin commonjs--resolver) SyntaxError: The keyword 'package' is reserved (4:6) in C:\Users\name\Desktop\elias\repo\repo\node_modules\flutterwave-node-v3\services\banks\rave.banks-branches.js
 2: const q = require('q');
 3: const axios = require('axios');
 4: const package = require('../../package.json');
          ^
5:
 6: const spec = morx.spec()
 SyntaxError: The keyword 'package' is reserved (4:6) in C:\Users\computer name\Desktop\name\name\name\node_modules\flutterwave-node-v3\services\beneficiaries\rave.create.js

Mishael-Joe avatar Jan 02 '24 21:01 Mishael-Joe

Would you like to mail me your mobile number, [email protected] let's have a meet call, perhaps we can fix it.

Great idea, I love it.

Mishael-Joe avatar Jan 02 '24 21:01 Mishael-Joe

@corneliusyaovi please you guys should do something about this, please. It's really annoying.

@iamsethsamuel @orimdominic @opeolluwa how were you guys able to resolve this issue.

I rewrote the library with Typescript and opened a PR. But it seems like Flutterwave really don't want to support typescript so I uploaded the Typescript version to NPM

Here is the link https://www.npmjs.com/package/flutterwave-node-v3-withtypes

iamsethsamuel avatar Jan 02 '24 23:01 iamsethsamuel

I can start working on this later this week or next week, fear is would the team review and merge it

They won't

iamsethsamuel avatar Jan 02 '24 23:01 iamsethsamuel

I have tried this too, it's not working, it's throwing syntax error: package is a reserved name. And it's keeps breaking my code. Any help please?

Here is the full error message:

I have been getting this error whenever I tried bundling the flutterwave_node_vs package and then on further research, I found out that the flutterwave_node_v3 package uses javascript-reserved words. and thus the error. here was the error when bundling with rollup

 [!] (plugin commonjs--resolver) SyntaxError: The keyword 'package' is reserved (4:6) in C:\Users\name\Desktop\elias\repo\repo\node_modules\flutterwave-node-v3\services\banks\rave.banks-branches.js
 2: const q = require('q');
 3: const axios = require('axios');
 4: const package = require('../../package.json');
          ^
5:
 6: const spec = morx.spec()
 SyntaxError: The keyword 'package' is reserved (4:6) in C:\Users\computer name\Desktop\name\name\name\node_modules\flutterwave-node-v3\services\beneficiaries\rave.create.js

@iamsethsamuel will the 'types' resolve this issue I'm facing? Can I use it?

Mishael-Joe avatar Jan 03 '24 02:01 Mishael-Joe

@corneliusyaovi please you guys should do something about this, please. It's really annoying. @iamsethsamuel @orimdominic @opeolluwa how were you guys able to resolve this issue.

I rewrote the library with Typescript and opened a PR. But it seems like Flutterwave really don't want to support typescript so I uploaded the Typescript version to NPM

Here is the link https://www.npmjs.com/package/flutterwave-node-v3-withtypes

Wow, didn't even see this. Thanks for saving me a lot of stress - apparently I had already begun working on adding types to the library.

Sad to see that adding Typescript support isn't a major concern for the Flutterwave Team.

nikeokoronkwo avatar Jul 05 '24 01:07 nikeokoronkwo

I have tried this too, it's not working, it's throwing syntax error: package is a reserved name. And it's keeps breaking my code. Any help please?

Here is the full error message: I have been getting this error whenever I tried bundling the flutterwave_node_vs package and then on further research, I found out that the flutterwave_node_v3 package uses javascript-reserved words. and thus the error. here was the error when bundling with rollup

 [!] (plugin commonjs--resolver) SyntaxError: The keyword 'package' is reserved (4:6) in C:\Users\name\Desktop\elias\repo\repo\node_modules\flutterwave-node-v3\services\banks\rave.banks-branches.js
 2: const q = require('q');
 3: const axios = require('axios');
 4: const package = require('../../package.json');
          ^
5:
 6: const spec = morx.spec()
 SyntaxError: The keyword 'package' is reserved (4:6) in C:\Users\computer name\Desktop\name\name\name\node_modules\flutterwave-node-v3\services\beneficiaries\rave.create.js

@iamsethsamuel will the 'types' resolve this issue I'm facing? Can I use it?

Most likely. Try the version with types here flutterwave-node-v3-withtypes

iamsethsamuel avatar Jul 05 '24 11:07 iamsethsamuel