wix-incubator / vscode-glean

The extension provides refactoring tools for your React codebase
MIT License
1.46k stars 56 forks source link

Fix React Version check in settings #117

Closed tylerbuchea closed 3 years ago

tylerbuchea commented 4 years ago

npm list react --version --depth=0 appears to return the version of the npm cli not the version of React. Maybe something changed in the npm API? I'm using npm:v6.14.4/node:v12.16.2 and all of these commands return the same value (the version of npm I'm using):

npm --version # output: 6.14.4
npm list --version  # output: 6.14.4
npm list react --version  # output: 6.14.4
npm list react --version --depth=0  # output: 6.14.4

This command seems to be a good alternative npm view react version. I tested it as far back as npm:v5.3.0/node:v8.4.0.

loonydev commented 4 years ago

Codacy Here is an overview of what got changed by this pull request:


Issues
======
+ Solved 1
- Added 2

See the complete overview on Codacy

asktree commented 3 years ago

@loonydev I'd like to see this PR get merged given that it is a major fix.

loonydev commented 3 years ago

Hi @asktree, you can merge it if you want. Comment lefts by Codacy app, which use my identities for a some reason. We will fix it soon.

borislit commented 3 years ago

@loonydev @tylerbuchea Hey guys! I've been away for a while. Sorry for ghosting. Today i've released a new version that supports React 16.8 and hooks by default. Regarding your PR - using npm view will not solve the issue, since it will return the version in the NPM registry, rather than the local one Unfortunately, the issue you've raised is real, but there is no easy fix, due to various limitations in how VScode can interact with the codebase. This is why the decision was made to look to the future and support hooks-enabled React.

Thank you for being involved and for the PR