This repository has been archived by the owner on Nov 28, 2022. It is now read-only.
chore: pinning react and react-dom across every dependency #1005
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.
🧰 What's being changed?
We're running into some React hook hell when running the latest version of the explorer with tutorials integration in ReadMe with tutorials present on a project. We think it's because the versions of React that the explorer, ReadMe, the UI library, and
@readme/syntax-highlighter
aren't all the same so what I'm doing here is:react
andreact-dom
over to being dev dependencies, pinning them at the latest of the v16 series.16.x
into beingpeerDependencies
.@readme/syntax-highlighter
across the explorer andoas-to-snippet
to 10.1.0 which does the same peerdep work chore: moving react and react-dom into being peerdeps syntax-highlighter#24markdown-magic
is being excluded from this because upgrading is changingspan
tags todiv
and inserting empty<code></code>
elements where there weren't before. Since its the legacy engine, it should be fine? Hopefully that not being the same as everything else isn't the linchpin in all of this.I'm also extracting
react
andreact-dom
from being compiled into the explorer dist. Since the explorer is a reusable React component, it's always going to be used in an environment where React is present so we don't need to bloat up its bundle with another copy of React. The result is some wild drops in dist sizes:@readme/api-explorer
: 5,199,205K to 4,644,622K. 11% reduction 👀@readme/api-logs
: 33,273K to 25,863K@readme/variable
: 15,266K to 7,919K