Move react-json-view to peer dependency #171
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Move
@microlink/react-json-view
to peer dependency. Reported by @yankovaleraBug
Installing with
npm>7.x
causes an infinite loop due to conflicting React peer deps in client projectsref: npm/cli#6611
Background
npm > 7 now installs peer dependencies by default
When running
npm i @envyjs/webui
in an demo repo,npm
will automatically install peer dependencies and fail with an infinite loop. This is because@microlink/react-json-view
has a dependency onflux
, andflux
has a peer dependency on React@17, whileenvy
has a peer dependency on React@18. The current npm bug then prevents the install and crashes.Locally, within the envy repo everything works as expected because we have a peer dependency resolution in our main
package.json
file.Change
This moves
@microlink/react-json-view
to a peer dependency which has the following effectnpm>7
and used in the default way,@envyjs/webui
will work as expectednpm>7
and used as a custom viewer component,@envyjs/webui
will work as expectedyarn/pnpm
and used in the default way,@envyjs/webui
will work as expectedyarn/pnpm
and used as a custom viewer component, users will also need to install@microlink/react-json-view
as a dependency, sinceyarn/pnpm
do not install peer deps automaticallyFuture
Many dependencies under
@microlink/react-json-view
are either deprecated or outdated. We should look into alternatives for json display. One possible replacement is the component we use in thegroqd
's arcade...monaco-editor