Closed jacobbuck closed 6 years ago
The motivation for making prettier a peer dep is because I'm locked on a specific version of prettier for a project I'm working on, and want to ensure I'm always using that version. It also means that you don't need to rely on prettier-webpack-plugin to always be up to date, or on a specific version (of 1.x.)
I made the change assuming that if prettier was following semver, the API shouldn't change so much in version 1.x.
Thanks a bunch for your feedback! I'm worried the API will become out of sync as they've followed semver but continue to add new features in minor version upgrades that users of this plugin would surely want. If we could eliminate the coupling there, this would be a perfect idea. I'll have to think on this a bit as it stands
I'm going to merge this since ideally I want to reduce coupling as much as possible, as I get time to work on this. Moving to peerdeps is naturally the first step to force my hand there. Thanks for the PR, Jacob 👍
That's great, thank you! Do you plan to publish a new version soon?
I do, likely tomorrow morning. I was hoping to get webpack 4 support implemented as well but wasn’t able to fit that in tonight, so I’ll try to tackle that first chance tomorrow. As it stands, the next version will have peer deep and better default extensions, but only webpack 3 support.
Published now as 0.2.3
🎉
Hey there, thanks for the PR! 👍
I've thought about this a little bit and am just a bit torn on it. The reason I have the dependency explicit and not peered is that we're depending on its present API, which changes frequently. To say that we just handle any version of prettier from version 1-2 seems misleading to me in what we actually can support well.
It's this close coupling between prettier updating and updating their API demanding we update that has me stumped. Is a peer dep really the right choice, when we may well be incompatible with newer or older versions of prettier that users choose to install? I would love to hear your thoughts on this since you were keen to make the change to the plugin, I hope I'm just missing something here. 😃