Closed meck93 closed 2 years ago
Yes you are right. I even started to do it some days ago. I am not sure about path-to-regexp and yamljs thought, because users of next-translate-routes are supposed to use next and react, but not path-to-regexp and yamljs. What do you think?
And I think this would allow using next 11 and react 16.8:
"next": ">=11.x",
"react": ">=16.8"
I guess it depends. Are the dependencies "path-to-regexp": "6.2.0", "querystring": "0.2.1", "yamljs": "0.3.0"
bundled into your library?
Are the dependencies "path-to-regexp": "6.2.0", "querystring": "0.2.1", "yamljs": "0.3.0" bundled into your library?
I am not sure what you mean by "bundled into the library"... What is the difference between bundled and unbundled dependencies? Anyway, if you want to make a PR, you are welcome.
I am not sure what you mean by "bundled into the library"... What is the difference between bundled and unbundled dependencies? Anyway, if you want to make a PR, you are welcome.
As a library author you can decide to list the dependencies your library needs as peer dependencies by this you tell the users of your library that you require them to install the dependencies when they want to use the library. For example, you can say that you support Next 11 and above using "next": ">=11.x"
.
On the other hand, it is possible to bundle dependencies into your library. This means that the dependencies of your library are provided/delivered with the library. They are packaged into the same NPM package. Often that doesn't make a lot of sense as you might end up with a lot of versions of the same dependencies (e.g., image if everyone bundled their version of react for a react library). But I think there exist use cases where this is helpful and desired...
I'm happy to make a PR 👍
@meck93 In the new 1.7.1 version, I moved next and react to peerDependencies. Would you give it a look and tell me if it could be better ?
@cvolant I think it looks good and makes sense this way. The library can anyway only be used together with Next and, therefore, React/Preact.
Hi @cvolant
Thanks a lot for the work on this project! I have a question/suggestion since this is a library can we move the
dependencies
todependencies
andpeerDependencies
. As I understand it the library currently requires the exact version of the specified packages or higher, correct?I would be happy to provide a PR.
old
new