react-tiny-link
react-tiny-link copied to clipboard
Typescript definitions planned for release any soon?
Thank you!
Hi @vladimirmoushkov .Thanks for the issue, I m willing to release Typescript definitions too , As I m not that fluent in TypeScript I may need some one's help. I do appreciate if you could help me to migrate to typescript.
Thanks
I have created a #2.
Still failing to active the full functionality. Could you help me with fixing the parsing error?
Sure @vladimirmoushkov . Can you please check the comments from #2 before we proceed? Thanks
Btw, The library package produced is quite big. I did ran webpack-bundle-analyzer and found out that the most of it comes from parse5 (unused library) and lodash (used just for isEmpty function).
Removing these could improve the library size footprint.
Are you interested in me doing this?
On Sat, Mar 30, 2019 at 11:05 AM Win Htaik Aung [email protected] wrote:
Sure @vladimirmoushkov https://github.com/vladimirmoushkov . Can you please check the comments from #2 https://github.com/winhtaikaung/react-tiny-link/pull/2 before we proceed? Thanks
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/winhtaikaung/react-tiny-link/issues/1#issuecomment-478223378, or mute the thread https://github.com/notifications/unsubscribe-auth/AUPfoGeWknUlYCXyHG6tAd_JmZYdTAabks5vbyjygaJpZM4cEx6h .
Sure please feel free to improve @vladimirmoushkov
Have a look at the latest commit.
- substituted parse5/ cheerio with QuerySelector https://caniuse.com/#search=queryselector.
- substituted axis with Fetch https://caniuse.com/#search=fetch. Warning, no IE support, but Edge works. I believe if you insist on internet explorer support this Axios will still need to be eliminated by lighter substitute.
- removed image|audio|video-extensions and path npm packages dependancy by simple mimeType check (see utils.ts).
- added webpack-bundle-analyzer as part of the build process. You will see now on npm run start and npm run build:lib run summary of the dependancies sizes. Side note - you will see *sockjs *library inclusions in the bundle for the npm run start as it is included by the hot reload process of webpack dev server. However its s not part of the final product resulted by npm run build:lib.
- please see my changes to the ScrapperImage, I did not understand the need of image selection as if data is html if detected that it is image before that so removed it.
I believe those changes worth the inclusion in the next release. The library is now uncompressed 270 kb (of which > 100 kb belong to React) comparing to 1.16 MB.
Regards, Vladimir Moushkov
On Mon, Apr 1, 2019 at 9:27 AM Win Htaik Aung [email protected] wrote:
Sure please feel free to improve @vladimirmoushkov https://github.com/vladimirmoushkov
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/winhtaikaung/react-tiny-link/issues/1#issuecomment-478451994, or mute the thread https://github.com/notifications/unsubscribe-auth/AUPfoLvdhpnJNF6DjgQtbkn10AL6uN03ks5vcabqgaJpZM4cEx6h .
@all-contributors please add @vladimirmoushkov for code
Thank you @vladimirmoushkov for you help.Released the react-tiny-link
typescript version 1.0.0 to npm.
Cheers 🍻
@winhtaikaung,
I feel like I'm missing something really obvious, but I'm not able to use this package in TypeScript at all.
There is no d.ts file in the react-tiny-link/lib folder in node_modules:
There is no @types/react-tiny-link in NPM:
And I am not able to import the module as specified in the docs:
Please help 🙏
Follow-up:
It looks like the main problem is with "typings": "src/lib/index.d.ts",
in package.json. When I install the package, there is no lib folder inside src, so typings cannot be found. If I remove "/lib", it seems to work.
That said, there seem to be other problems which prevent the TypeScript compiler from succeeding, such as missing types for styled-components.
Follow-up:
It looks like the main problem is with
"typings": "src/lib/index.d.ts",
in package.json. When I install the package, there is no lib folder inside src, so typings cannot be found. If I remove "/lib", it seems to work.That said, there seem to be other problems which prevent the TypeScript compiler from succeeding, such as missing types for styled-components.
Hey @devuxer thanks for reporting I will take alook,
Any update the issue? Please help! Waiting for the TypeScript version :)
Not usable in typescript. Any updates?
Any new updates on using this with typescript?
Hi, I'm facing the same issue here. It's working fine when I used npm run dev
, but it's showing error when I want to build the app.