Skip to content

Lock minor version for plugins #5012

Closed
@haoqunjiang

Description

@haoqunjiang

What problem does this feature solve?

Consider our current version strategy:

  • A patch version may include the following changes:
    • Fixes for regressions introduced in previous versions
    • Fixes for buggy behaviors (of the binary, config or generator)
  • A minor version may include the following changes:
    • New command-line options
    • Generator template changes
      • Most of the time, even if the new template is completely different from the old one, it's still considered a semver-non-breaking change because it does not affect existing users' projects
      • This gives us the flexibility to upgrade a major version of an underlying dependency without bumping Vue CLI's version too aggressively (e.g., we can ship ESLint 5/6 support in a minor release)

But this strategy has its drawbacks.

First, in patch versions, the two types of fixes are not of equal importance:

  • For regressions, they should be fixed as soon as possible because they're unexpected behaviors for all users
  • For a buggy behavior, if exists for too long a time, it may be treated as a feature by some users. So fixing such a bug may be a breaking change for them

Secondly, for generator template changes, though they don't affect existing projects, we, on the other hand, don't have a convenient way to inform users to upgrade their projects' settings. This could become a huge maintenance burden in the long run.
One way to mitigate this issue is to utilize the vue upgrade command and write Migrators. But with current version strategy, people don't often realize its existence unless they're upgrading to a new major version, as npm automatically installs the latest minor versions even if they don't manually update the version ranges in package.json.

So here I'm proposing a new versioning strategy for Vue CLI plugins.

What does the proposed API look like?

  • In the generated project, the version range of the CLI plugins should start with a tilde (~) instead of the current caret (^)
    • It's recommended to periodically vue upgrade in the projects to check for new versions and try automatic migrations;
    • Other third-party peer dependencies are not bound to this versioning strategy because they might have their own concerns on release plans. It's better to be evaluated case by case. For example, we need to use ~ for the TypeScript version, while the ESLint version can start with ^.
  • Patch versions should only include fixes for regressions and security vulnerabilities. All other non-significant bug fixes should be postponed to the next minor release.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions