hot-loader / react-dom

🔥 version of React-DOM
110 stars 11 forks source link

Conflicting scheduler version with new React release #31

Closed avindra closed 4 years ago

avindra commented 4 years ago

Updated all my deps and saw 2 scheduler packages in yarn.lock. It seems this package is using the older one:

 # yarn why scheduler
yarn why v1.19.1
[1/4] Why do we have the module "scheduler"...?
[2/4] Initialising dependency graph...
[3/4] Finding dependency...
[4/4] Calculating file sizes...
=> Found "scheduler@0.17.0"
info Reasons this module exists
   - "@hot-loader#react-dom" depends on it
   - Hoisted from "@hot-loader#react-dom#scheduler"
info Disk size without dependencies: "212KB"
info Disk size with unique dependencies: "260KB"
info Disk size with transitive dependencies: "288KB"
info Number of shared dependencies: 3
=> Found "react-dom#scheduler@0.18.0"
info This module exists because "react-dom" depends on it.
info Disk size without dependencies: "208KB"
info Disk size with unique dependencies: "256KB"
info Disk size with transitive dependencies: "284KB"
info Number of shared dependencies: 3
Done in 1.39s.
Bnaya commented 4 years ago

Use yarn-deduplicate and many of your duplicate will go away https://github.com/atlassian/yarn-deduplicate

KubaJastrz commented 4 years ago

@Bnaya cool library, but not sure how this is relevant here.

There is a new react-dom@16.12.0 which has scheduler@^0.18.0 as a dependency [source] and the latest @hot-loader/react-dom is at version 16.11.0 which has scheduler@^0.17.0 [source].

Semver doesn't treat ^0.17.0 as compatible with ^0.18.0, therefore yarn installs both, and the first one gets picked up by many other tools. In my case it seems to break now dev with Gatbsy.

Bnaya commented 4 years ago

if you are using yarn, you may use yarn resolutions as a workaround

KubaJastrz commented 4 years ago

Do you mean to use yarn resolutions to downgrade gatsby to downgrade gatsby-cli to downgrade react-dom to downgrade scheduler so it can work with @hot-loader/react-dom? Seems like just releasing new version of this library would be easier and less of a hack.

Bnaya commented 4 years ago

you can specify scheduler version directly. no need the entire chain. i'm offering a workaround :)

KubaJastrz commented 4 years ago

Yeah, seems like locking scheduler at 0.17.0 does work, for now at least. Thanks.

Btw, is there a reason for this version mismatch from @hot-loader/react-dom side?

theKashey commented 4 years ago

Because updates have to be published manually

avindra commented 4 years ago

Thanks for the discussion lads. It looks like react fast refresh is the way forward, so this library will probably go away entirely. Closing this issue now