Skip to content

Next.js version support #25

Closed
netlify/next-on-netlify
#167
@ehmicky

Description

@ehmicky

next-on-netlify requires users to install next themselves, i.e. it is a peerDependency.

https://github.com/netlify/next-on-netlify/blob/a48735f625cc7ad1a080b322673d3e9a11f42d27/package.json#L37-L39

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

https://github.com/netlify/netlify-plugin-nextjs/blob/2849dc5f7c57e9fd827a939e067a871e4cb487b1/index.js#L7

https://github.com/netlify/netlify-plugin-nextjs/blob/2849dc5f7c57e9fd827a939e067a871e4cb487b1/package.json#L30

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 and next-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 a peerDependencies instead of a dependencies in this plugin's package.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?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions