-
Notifications
You must be signed in to change notification settings - Fork 94
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
Remove namespace from Typescript definition #64
Conversation
Codecov Report
@@ Coverage Diff @@
## master #64 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 10 10
Lines 204 204
=====================================
Hits 204 204 Continue to review full report at Codecov.
|
@Fabiantjoeaon care to elaborate? |
Hi @Fabiantjoeaon, I don't understand how to reproduce the bug you were having. Is it building the lib itself? import { CustomPIXIComponent } from 'react-pixi-fiber'; so that's probably what I want to do also in TS. If I'm forced to write import { CustomPIXIComponentNamespace } from 'react-pixi-fiber'; that just resolves to I honestly thought that nobody was using this lib from TS since it just doesn't compile. You can see it even in |
0f5afa2
to
8b96536
Compare
I just updated the branch to include a functional TS test that you can run, just type
and it will compile the test. |
Hi @smvilar I tried running your tests. All good. Regarding reproducing my bug, whenever I remove the namespace from the package in my To be fair, I agree with you that this namespace should be removed, because my solution to solve this error was not very clean, and I think it should be solved in a different way. Perhaps it has something to do with my Typescript version? What version are you running, and is this installed globally? (because I don't have TS installed globally) I get the error whenever I use my workspace's version (2.8.3), and when I use my VSCode's version (2.9.1), |
Okay I figured it out!
I guess you can merge this fix. |
@Fabiantjoeaon thanks for clarification! @smvilar I'm going to merge your fix, thanks for bringing that problem up :) can you just update |
@michalochman ready. Please note that I added a script to test Typescript typings, maybe you want to add this to the CI? |
@Fabiantjoeaon so glad we could figure this out! |
@smvilar can you just add the following line to
Thanks! |
@michalochman done! Let's see how it works |
@smvilar cool! Much appreciated |
I'm not sure if it's a bug or it's just that I don't understand how the namespace works, but currently in order to do
instead Typescript requires me to write
and then the compiled JS code fails because
Uncaught TypeError: Cannot read property 'CustomPIXIComponent' of undefined
I think this namespace should be removed.