Description
next-on-netlify
requires users to install next
themselves, i.e. it is a peerDependency.
Furthermore, it requires them to install a specific Next.js version (v9
even though v10
is the latest).
In this plugin, we are using the next
package to load the configuration file
We might be missing a clear strategy on Next.js versioning compatibility:
- When a new release of Next.js is made (e.g. Next 10), users of that new release would not be able to use it on both
next-on-netlify
and this plugin, because both are pinning a specific Next.js major version - Users with older Next.js versions (e.g. Next 8) might not be able to use both
next-on-netlify
and this plugin
As new versions of Next.js will be released, the lack of a clear strategy might become a bigger problem.
I would recommend the following:
- Enforcing a minimum Next.js version with this plugin
- Using a looser
>=
range for both this plugin andnext-on-netlify
in the peerDependency version range, so that we can support multiple Next.js major releases - Using the user's Next.js version to load the configuration file, i.e. making
next
apeerDependencies
instead of adependencies
in this plugin'spackage.json
- Ensure Next 10 is supported
- When time comes to make this plugin opt-out instead of opt-in for all Netlify users, builds should check the site's Next.js version to ensure it is recent enough to use this plugin
What do you think?