Skip to content
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

Merged
merged 9 commits into from
Oct 28, 2020

Conversation

erunion
Copy link
Member

@erunion erunion commented Oct 22, 2020

🧰 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:

I'm also extracting react and react-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

@erunion erunion added scope:dependency Pull requests that update a dependency file type:refactor Issues about tackling technical debt labels Oct 22, 2020
@erunion erunion changed the title chore: moving react and react-dom over to being dev dependencies chore: pinning react and react-dom across every dependency Oct 22, 2020
@erunion erunion marked this pull request as ready for review October 23, 2020 00:07
Copy link
Contributor

@rafegoldberg rafegoldberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great. Changes look okay to me. Have you tried running an integration test against ReadMe proper?

packages/api-explorer/package.json Show resolved Hide resolved
@erunion erunion merged commit 4c76046 into next Oct 28, 2020
@erunion erunion deleted the feat/react-peerdeps branch October 28, 2020 21:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
scope:dependency Pull requests that update a dependency file type:refactor Issues about tackling technical debt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants