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 react
as peer dependency
#386
Comments
FYI @hawkticehurst is on leave at the moment—I'll wait for him to comment here as I'm pretty sure this was a trade off we had to make for various reasons. |
Howdy, I'm back and am happy to talk about this! This is definitely one of the weirder parts of the toolkit right now... but I am in agreement that this peer dependency is less than ideal (and has personally always bugged me). React doesn't natively support web components 🙃😪 The short version is that React (as you may or may not know) does not natively support web components at this time. It means we have to wrap all the web components in React components and export those for React devs to use. In our case, we use a package from the FAST team to handle this wrapping code and it results in this single file where a React import is needed (and thus the peer dependency). There is hope that native web component support will finally arrive in React v19 and this reality might be able to change a bit, but it's still a little unclear when that will land. An alternative? In the meantime (and in light of this issue), I have been doing a bit of snooping around and looking at other web component libraries to see how they handle React support and have discovered there might be another away to support React devs while being able to remove the React peer dep. I still need to do more research but am happy to allocate a short sprint to this topic and see what's possible sometime in the next few weeks. |
Hope that gives a little bit more insight into this topic, but definitely let me know if you have any follow up questions/concerns. |
Thanks for the input. It's not blocking me in anyway, just wanted to have it noticed by the team. |
Ahh I see, in that case, yes it's definitely on our radar. |
Any updates on this? Not blocking, but annoying :) |
Unfortunately, I don't have any notable updates. I did some explorations on the "alternative" I was hopeful about and it proved to be not super fruitful for our particular scenario/architecture Since that time we have become really tightly resourced (myself and one other person split our time between this project and a handful of others) so we probably won't be able to tackle it for a while since it's a non-blocking issue As I find pockets of time, however, I'll definitely try to revisit this and give updates on anything I discover |
Hey all! As of PR #470, this issue is now resolved by separating the main toolkit components and the toolkit react components into separate NPM packages :) It's part of I'm also going to go ahead and close this issue now to more closely track when this work was completed, however, please feel free to continue posting here with any questions/comments and I'll keep an eye on this thread |
Describe the bug
As described in the readme:
However
react
is explicitly defined as peer dependency which causes warnings during install.To reproduce
Run
yarn add @vscode/extension-telemetry
Expected behavior
There is no peer dependency defined. Even though it is only a warning and it works nonetheless, I suggest to remove it as it suggests something wrong.
Current behavior
Peer dependency is defined and causes warnings during install.
Screenshots
Desktop (please complete the following information):
macOS 11.3.1
]v0.8.0
]Additional context
The text was updated successfully, but these errors were encountered: