Packages upgrade in v0.24.0 introduce many breaking changes
@satya164 y travaille déjà.
Depuis le 4/11/2020.
Évaluation
Cette issue n'a pas encore été évaluée.
Description
Environment
- macOS 10.15
- Node.js 12.18.4
component-docs@ 0.24.0
Description
Although the example in this repo work as expected, if we use component-docs@0.24.0 as a dependency in another project, the new version breaks the serve as well as build command like in below screenshot:
Another escalation of the issue I found out next is that, if my main project has react as direct dependency but its major version is different from [email protected]'s one (which is ^17.0.1). Say, my project still has react@^16.14.0, then when I execute the component-docs serve command, I got this error:
Error: Cannot find module '@mdx-js/tag'
...
I have to install @mdx-js/tag as direct dependency now, then get a couple of errors regarding missing: react-dom and redbox-react. However, once I installed those missing dependencies, I get this run time error:
Error: Invalid hook call. Hooks can only be called inside of the body of a function component.
This could happen for one of the following reasons:
1. You might have mismatching versions
of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.
Reproducible Demo
cd into example folder, and init a package.json. Add [email protected] as dependency and with some scripts like so:
{
"name": "test-component-docs",
"version": "1.0.0",
"license": "MIT",
"scripts": {
"build": "component-docs build",
"docs": "component-docs serve"
},
"devDependencies": {
"component-docs": "^0.24.0"
}
}
- First execute
yarn docsand observe the broken layout of the preview site. - Add
[email protected]as direct dependency and observe the compile time error - Add the missing dependencies and observe the errors.
Suggestion
I don't know what happen yet but regarding the mismatch react version, I think we should move react, react-dom to devDependencies and peerDependencies so that component-docs should use the react version in consuming projects and avoid versions conflict.
- Langage dominant
- TypeScript
- Étoiles
- 140
- Forks
- 12
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de callstack/component-docs
-
Difficulté 3/5 1-2 jours Accessibilité débutants 35/100
callstack/component-docs#48 · 1 réaction ·
-
Add support for iframeOuverte
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
callstack/component-docs#44 ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 35/100
callstack/component-docs#34 ·
-
Support RNWOuverte
Difficulté 4/5 3-5 jours Accessibilité débutants 30/100
callstack/component-docs#30 · 1 réaction ·
-
greenkeeper
Difficulté 4/5 3-5 jours Accessibilité débutants 25/100
callstack/component-docs#18 ·
Toutes les issues de callstack/component-docs
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
kind/chore priority/must
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
sidereal-io/sidereal#380 ·
Les mainteneurs répondent en général sous 1 jour
-
Mend: dependency security vulnerability
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
opfab/operatorfabric-core#10653 ·
Les mainteneurs répondent en général sous 1 jour
-
backend bug size:sm
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
chrisbenincasa/tunarr#2237 ·
Les mainteneurs répondent en général sous 1 jour
-
documentation
Difficulté 2/5 Une demi-journée Accessibilité débutants 69/100
Lam30ne/regulate-app#39 ·