react-native-cn-richtext-editor
react-native-cn-richtext-editor copied to clipboard
Typescript migration ?
First of all ; thanks so much for this amazing work!
If you're interested in migrating this repo to Typescript, I would be glad to participate. I was also thinking about using a linter, as the source code is sometimes missing style consistency and a bit difficult to read.
To be honest we doubt about moving to Typescript at this point and we should think and talk about that a little bit more. But, I agree that Linter will benefit us a lot. I would say go ahead and make pr for that. I am happy that you are also excited as much as we are and you like to contribute to this project.
@ohpax In my experience, typescript projects are much easier to maintain in the middle-long run. The "cost" is working on types which has it's own learning curve. I've been using Typescript in my projects for 3 years now, and I'm really glad I did.
Anyway, that's of course up to you! On the linter side, do you have presets / preferences ? I'm usually using airbnb javascript guide.
For the Linter I also like the airbnb one, let's go with that. I don't think we will have any issue with using types because our first language is C# but our main issue is the most react libraries and examples are on plain Javascript and there might be more people who are interested to contribute if its plain JS. I have used some Typescript before and I like it. What do you think @imnapo ?
I can tell you a vast majority of RN libraries offer typings ; and some of them are written / migrating to typescript (example here — and here). Typescript is supported by React Native (you can use the --template=typescript
flag with react-native init
). However, your concern about contributions is legitimate, even though TS is relatively easy to learn.
We could also offer flow types with tools such as flowgen.
EDIT Some stuff I really like about TS (which should be true about flow too):
- handling dependency upgrades. You will witness breaking changes with a simple command ; which is very handy when some maintainers don't comply with semantic versioning or upgrading to a new major.
- efficient intellisense and renaming / refactorings
- 15% decrease of risks of bugs in a project
- programming with interfaces which helps with modularity
There is no doubt about advantages of using TypeScript but I'm agree with @ohpax about keep this package in javascript, at least for a while until we have more contributors. but we can support typing like other packages written with JavaScript having type definitions. (like react-native-elements) For the Linter side I also like the airbnb, so we can go with it.
And also thank you very much for your active participation and contribution.
@imnapo OK ; I'll work on eslint integration :slightly_smiling_face: I already wrote typings for this package ; I'll wait to test those a bit more before offering a PR.
@imnapo I've started working on eslint ; it seems like there are both yarn and package-lock ; this is probably unwanted ; which package manager would you pick ?
I would personally prefer yarn.