Closed JavascriptIsMagic closed 7 years ago
My apologies @JavascriptIsMagic for the version mismatch. Publishing the updated version of teact to npm should resolve the immediate problem.
I'm open to the peer dependency solution as well.
@JavascriptIsMagic I've published the latest version on master to npm.
@hurrymaplelad any opinions on this PR?
In the situaton described above, a peer dep on reat@0.14 would have made Teact error at install time. I suppose that's failing faster and with a better error message.
At the time this was written, peer deps appeared to be falling out of favor due their propensity to create dependency nightmares, so I used a good ol regular dep. it looks like peer deps are still around in npm3, just nerfed a little.
If we go with peer deps, we'll need to include React as a devDependency as well to make sure it's installed for tests and such. @JavascriptIsMagic you up for adding the dev dependency?
:+1:
Added react
as a devDependency
.
I was fiddling around with it quite a lot in both npm
and yarn
and neither had a great solution on the package manager side. I was able to find a webpack
based work around by aliasing react
to always resolve exactly the version I wanted, but it's still nice to have this throw a warning or something when the version gets a little behind.
Published as v1.3.0. Thanks!
So I was trying to use Teact in a new project and keep
React
up to date. Currently at the time of this writingteact
on npm isteact@1.1.2
and has a dependency ofreact@^0.14.2
and I'm usingreact@latest
creating a structure like:Unfortunately common bundlers today will include both versions of
react
in the bundle, and Teact completely explodes because of it.Is there any reason why
react
must be adependency
rather then apeerDependency
so you can choose which version ofreact
to use in your project even if Teact is behind a few versions onnpm
?