facebook / fbt

A JavaScript Internationalization Framework
https://facebook.github.io/fbt
MIT License
3.88k stars 178 forks source link

Remove `@fbtjs/default-collection-transform` as a peer dep from `babel-plugin-fbt`. #415

Closed cpojer closed 4 months ago

cpojer commented 4 months ago

Summary

The default collection transform is an example, and does not need to be used directly. In my case, I have my own collection transform and it doesn't make sense for package manager to suggest installing the default collection transform in such cases. I suggest removing it as a peer dep.

Test plan

yolo

voideanvalue commented 4 months ago

mark it as optional instead? https://docs.npmjs.com/cli/v7/configuring-npm/package-json#peerdependenciesmeta

cpojer commented 4 months ago

Actually neither might be a good idea since it is actually required in code when no custom transformer is specified: https://github.com/facebook/fbt/blob/45ebf8ce51672478f386ed711f3b9ae5e9da1594/packages/babel-plugin-fbt/src/bin/FbtCollector.js#L124

I feel like it would be better to push this into the config where the collection transform is required to be specified via path or something. 🤷🏻‍♂️