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 support #69

Open
teyalite opened this issue Apr 19, 2022 · 29 comments
Open

Typescript support #69

teyalite opened this issue Apr 19, 2022 · 29 comments

Comments

@teyalite
Copy link

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

@Marcosmaliki
Copy link

+1

1 similar comment
@nejos97
Copy link

nejos97 commented May 24, 2022

+1

@opeolluwa
Copy link

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

@corneliusyaovi
Copy link
Collaborator

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 👍🏾.

@opeolluwa
Copy link

opeolluwa commented Aug 1, 2022

@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

@orimdominic
Copy link

orimdominic commented Aug 8, 2022

@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 🙏

@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.

@opeolluwa
Copy link

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

@opeolluwa
Copy link

opeolluwa commented Aug 8, 2022

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

@orimdominic
Copy link

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

@iamsethsamuel
Copy link

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

@corneliusyaovi
Copy link
Collaborator

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.

@orimdominic
Copy link

@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

@opeolluwa
Copy link

@orimdominic, Sounds like a plan to me

@orimdominic
Copy link

@orimdominic, Sounds like a plan to me
Thank you

Let us hear what the Flutterwave engineering team has to say

@iamsethsamuel
Copy link

I am already working on it on this PR #85

@dilane-goune
Copy link

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 ???

@abbaty48
Copy link

abbaty48 commented Aug 8, 2023

1year now TS support not manifest

@Mishael-Joe
Copy link

@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.

@opeolluwa
Copy link

@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
Copy link

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

@Mishael-Joe
Copy link

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?

@opeolluwa
Copy link

Would you like to mail me your mobile number, adefemiadeoye@yahoo.com let's have a meet call, perhaps we can fix it.

@Mishael-Joe
Copy link

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
Copy link

Would you like to mail me your mobile number, adefemiadeoye@yahoo.com let's have a meet call, perhaps we can fix it.

Great idea, I love it.

@iamsethsamuel
Copy link

@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
Copy link

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

They won't

@Mishael-Joe
Copy link

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?

@nikeokoronkwo
Copy link

@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.

@iamsethsamuel
Copy link

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

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