Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v2] Fix v1 / v2 version conflicts #5899

Merged
merged 6 commits into from
Jun 16, 2018
Merged

[v2] Fix v1 / v2 version conflicts #5899

merged 6 commits into from
Jun 16, 2018

Conversation

m-allanson
Copy link
Contributor

@m-allanson m-allanson commented Jun 14, 2018

  • Remove plugins that are no longer needed in v2
  • Update versions so that v2 versions are all newer than v1 versions
  • Update peerDepencies to require Gatsby v2 and above

Ref #5891 (comment)

Edit to explain how we've updated the versions here. These new versions aim to do the following:

  • ensure all plugin version numbers end with -alpha.x
  • ensure any -alpha.x plugin is ahead of its non-alpha version
  • ensure all plugin version numbers are one major version ahead of their Gatsby v1 version

examples:

`master` version: 1.2.3
`v2` version:     1.2.3
this PR version:  2.0.0-alpha.0

`master` version: 1.2.3
`v2` version:     2.0.5-3
this PR version:  2.0.6-alpha.0

`master` version: 2.4.2
`v2` version:     1.3.4-13
this PR version:  3.0.0-alpha.0

`master` version: 2.4.22
`v2` version:     2.4.12-10
this PR version:  3.0.0-alpha.0

`master` version: 1.0.5
`v2` version:     2.2.5-alpha.12
this PR version:  2.2.5-alpha.12

`master` version: doesn't exist
`v2` version:     2.0.1-12
this PR version:  2.0.2-alpha.0

@@ -12,7 +12,7 @@
"dependencies": {
"@babel/preset-typescript": "7.0.0-beta.47",
"@babel/runtime": "7.0.0-beta.47",
"babel-plugin-remove-graphql-queries": "^2.0.1-12"
"babel-plugin-remove-graphql-queries": "2.0.2-alpha.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a major version bump?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems to be v2 specific

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@calcsam I updated the description to describe the rules behind the version bumps in this PR

@nihgwu
Copy link
Contributor

nihgwu commented Jun 14, 2018

is there any chance to land #5895 before bumping the version of gatsby-link

Copy link
Contributor

@nihgwu nihgwu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. does "gatsby": ">2.0.0-alpha" is a valid pattern? can we use something like "gatsby": "2.x"

  2. do we really want drop the support for v1 as some of the packages do support both v1 and v2

@m-allanson
Copy link
Contributor Author

is there any chance to land #5895 before bumping the version of gatsby-link

We'd like to try and get a v2 beta out before merging in any more PRs as we've done a fair bit of manual testing on the current v2 branch. While still in beta / alpha I think it'd be ok to bump the version again for #5895.

does "gatsby": ">2.0.0-alpha" is a valid pattern? can we use something like "gatsby": "2.x"

I think ">2.0.0-alpha" is ok? It should pick up any 2 versions but "2.x" won't pick up alpha / beta / rc releases. Tried with https://semver.npmjs.com/

do we really want drop the support for v1 as some of the packages do support both v1 and v2

We'll still have the v1 branch and be able to publish new v1 versions of plugins. We don't have testing infrastructure to test plugins against Gatsby v1 and v2 at the same time yet (better testing infrastrucure is being worked on though). In the worst case a peerDependency mismatch will only be a warning, you can ignore it if you know the plugin is compatible.

@@ -25,6 +25,7 @@
"remark"
],
"peerDependencies": {
"gatsby": ">2.0.0-alpha",
"gatsby-remark-prismjs": "^2.0.3-1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the one I forgot about

Copy link
Contributor

@KyleAMathews KyleAMathews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious about the rational around doing a major release for all plugins? Not sure it matters but many/most of the plugins don't have any breaking changes. Doing major releases for them might cause more confusion as then people would want to know how to "upgrade" those plugins despite there being nothing to do.

@@ -1,7 +1,7 @@
{
"name": "gatsby-dev-cli",
"description": "CLI helpers for contributors working on Gatsby",
"version": "1.2.12-10",
"version": "2.0.0-alpha.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do major version?

@m-allanson
Copy link
Contributor Author

@KyleAMathews I think major version bumps make sense as a way of framing which plugins support which versions of Gatsby.

Some plugins support Gatsby v1 and Gatsby v2 at the moment. Once Gatsby v2 is released, our tests will be running plugins against Gatsby v2 only. If any of the plugins that support v1 and v2 stop working for v1, we won't know about it.

Bumping the major version for each plugin means we can say:

  • gatsby-plugin-foo v1 is for Gatsby v1
  • gatsby-plugin-foo v2 is for Gatsby v2

Or slightly trickier, but still easy to understand is:

  • gatsby-plugin-bar v2 is for Gatsby v1
  • gatsby-plugin-bar v3 is for Gatsby v2

I agree this could be confusing for people who'd want to know how to "upgrade" those plugins despite there being nothing to do. Made more so by our current lack of changelogs.

But I think bumping the major versions is the least confusing overall choice.

Future plugin releases will all be tested against Gatsby v2, but we can still release new versions of Gatsby v1 plugins from the v1 branch.

@pieh
Copy link
Contributor

pieh commented Jun 15, 2018

Curious about the rational around doing a major release for all plugins? Not sure it matters but many/most of the plugins don't have any breaking changes.

My reasoning for advocating for this for all packages (even if they don't have breaking changes, so not really in line with semver) is because of current workflow using lerna (releasing stable/latest from v1 and releasing next from v2). If we could easily release plugins without breaking changes to both next and latest dist-tags then I agree that we could remove major version bumps from a lot of plugins in this PR, but I just don't see how this could be managed + what @m-allanson said about making sure new stuff will be compatible with v1 would need to be done "manually".

There is also issue that some plugins that didn't have major version bump in v2 actually do have breaking changes - for example gatsby-link (with changes to pathPrefix and use of basename in react-router) so this one defenitely need a bump. This one is known - but how many are unknown? We would have to go through ~80 packages that didn't have major version bump and manually check if there was breaking changes for them in v2 but this is a) prone to errors and b) will be very time consuming and not sure if we have bandwidth to do it.

@m-allanson m-allanson mentioned this pull request Jun 15, 2018
22 tasks
@KyleAMathews
Copy link
Contributor

Ok, makes sense. Better safe than sorry.

I think we do need then a plugins section in the upgrade guide to a) add upgrade instructions for specific plugins e.g. add this new dependency to your package.json and b) say something like "Most people should not experience any breaking changes when upgrading this plugin" as there are people working on high profile sites or that are more fastidious about upgrades and will want to see an upgrade guide for every plugin the upgrade.

@KyleAMathews KyleAMathews merged commit 8780c1c into v2 Jun 16, 2018
@KyleAMathews KyleAMathews deleted the v2-alpha-versions branch June 16, 2018 18:38
mwfrost pushed a commit to mwfrost/gatsby that referenced this pull request Apr 20, 2023
* Remove old / v1-specific plugins

* Fix conflicting versions between v1 and v2, update gatsby peerdep to v2

* Update dependencies for version check

* Update snapshot

* Update peerDep to match new version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants