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
chore(gatsby-cli): bundle ink logger #26887
Conversation
Gatsby Cloud Build Reportgatsby 🎉 Your build was successful! See the Deploy preview here. Build Details🕐 Build time: 25m |
6828bad
to
379704b
Compare
This is needed for PnP as setting `yoga-layout-prebuilt` as external imports it from node_modules, but it's not declared by gatsby-cli itself. Alternatively we could bundle it too, but this has problems too: facebook/yoga#798 the solution there is pretty hacky and I would rather not use it.
// Next one deserve explanation: ... it's because ink logger imports | ||
// getStore, onLogAction from higher up (../../redux). But we don't want | ||
// two copies of it - one bundled and one not, because it would result | ||
// in multiple store copies | ||
`../../redux` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adding inline comment here to highlight this - this is the most fragile part of this setup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and it fixes the npm issue when react is a lower version than 16.8.0.
Published in |
Description
This PR looks to bundle parts of
gatsby-cli
which useink
andreact
. In some scenarios multiple versions ofreact
can be installed innode_modules
and this can lead to very weird errors and warnings related to multiple react instances. This change work around it, so react is being bundled and is part of published npm package instead as dependency that users need to download.For more information check on description of #21522 which highlights some problems with multiple versions of
react
(it seems that peerDependency is not really honored bynpm
when resolvingnode_modules
hierarchy and this is why it cause such a problems).Related Issues
Related to #19827, #21522