-
-
Notifications
You must be signed in to change notification settings - Fork 170
Makes it work regardless of exact React version #62
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
Conversation
...and with an interative development and test cycle.
Hey @mattes3! Thanks for your pull request. I never though of / encountered this problem, thanks for bringing it up. Lot's of questions. But first of all, your approach is interesting. Is this the regular way this problem is solved? It looks like I have to compile using TypeScript, pack, uninstall and install every time I want to test my component. That would make the development progress very painfully. And the typing dependency, this way it should match the version in your project, which can also be different, right? Can you give a little more details on the development cycle? |
Hey @jeffreylanters , you're welcome! Regarding the dev/test cycle: I would only use it just before publishing a new version of react-unity-webgl to npm, just to make sure that everything is perfectly OK. I would not use it during day-to-day development, although the cycle takes only 3 seconds on my machine (I put all the statements into one command line, separated by semicolons). I tried to use your dev cycle with the test repo because it will be even faster. I simply cloned the test repo and tried "npm install", then "npm start". However, on my machine it did not work because the webpack dev server did not open any port on the local machine. Webpack listens for changes to the source files but it does not serve them on any port. Do you know why this happens? |
Thanks for your explanation. One more thing I'm not quite understanding is, before packing the module, it has to be compiled from TypeScript to JavaScript. How can this be done when the React dependency is missing? |
To compile some code from Typescript to Javascript, you don't need the code of the dependencies, you only need to add the types as a devDependency. In this case: Add @types/react as a devDependency. |
The version of the typing dependency is not that critical because your code only uses a small portion of the React API that will likely remain as it is in future versions (e.g. React.Component). |
Hi Jeffrey, please forget about my development cycle stuff in README.md. It's not really necessary for this patch and is more or less a matter of taste. However, the removed React dependency is important for me. When do you plan to merge this (without the README)? I could then remove my local version of react-unity-webgl and charge ahead. :-) Cheers, |
Hi @mattes3, thank you very much for your explanation. I've learned something new today! I'll be merging this today, but will probably release it later today or tomorrow. Because I have another branch with an important fix we've been testing I want to release with it. I will add your readme section to the wiki. 😄 |
I've merged everything into the development branch and added the development section of the readme to the wiki. I'll be doing some tests on some environments (feel free to test with me), I'll let you know when I'll be releasing the new version 7.1.0. Thanks you so much for helping and contributing to this module! :) |
Good news, all the tests have been successful. I've updated the test repository and released React Unity WebGL version 7.1.0 / 7.1.1 🎉 thanks again for all your help and contributing! Have a great weekend! |
Wow, thanks a lot, Jeffrey. I'll test it during this month when I get on with the project. |
The new version 7.1.1 works for me! Thanks, Jeffrey. |
I had problems because I am using a newer version of React. Because react-unity-webgl has its own dependency on a particular React version, this caused two versions of React to be loaded.
I have contributed this patch that makes it work regardless of the exact version of React.