levrik / mdi-react

Material Design Icons for React/Preact packaged as single components
Other
147 stars 23 forks source link

Rethink versioning #9

Closed levrik closed 6 years ago

levrik commented 7 years ago

See #8

Edit: Solution is on its way: https://github.com/levrik/mdi-react/issues/9#issuecomment-357510278

levrik commented 7 years ago

When doing a npm install mdi-react or yarn add mdi-react I'm getting 2.0.46-hotfix.0 instead of 2.0.46. So maybe it's fine to use pre-releases for hotfixes for now. Not the best way but hopefully it won't happen that often. Leaving this issue open for suggestions.

jonotron commented 7 years ago

IMO, I don't think the versions need to line up with mdi-sdk/mdi... I can image situations when you want to add extra functionality to the components and that shouldn't be restricted by the versioning.

levrik commented 7 years ago

@jonotron I've already thought about just providing the package which then downloads the latest version on install. That's not an big issue for newly added icons but for example Google sometimes changes their icons (not sure if community icons getting changed). This could result in shipping a different looking icon to production than you have on your local dev machine or a test environment. So that's the reason why I wanted the versions to line up with mdi. I will try to come up with something different that supports fixed version of mdi but detached from the version of mdi-react.

jonotron commented 7 years ago

An inconsistency like that would be less than ideal. Wouldn't newly added icons not have a corresponding component then? I guess if the post install also ran the build.

If you clearly indicated which version of mdi was included in each version of mdi-react (and also bumped whenever mdi updates) the user can still choose.

levrik commented 7 years ago

@jonotron Yes. That would be an option to maybe have something in the README which indicates which version of mdi-react includes which version of mdi. Let me think about that. Will come back to it coming weekend.

levrik commented 6 years ago

I've decided on a versioning scheme:

mdi-react gets it's own version number (starting from 3.0.0) and I'm using the pre-release part for specifying the version of mdi itself.

Example 3.0.0-2.1.9:

  3.0.0     -     2.1.19
    ↑               ↑
mdi-react          mdi

Without specifiying any version I'm getting the newest version of mdi-react with the newest version of mdi. If a new version of mdi comes out npm will flag the same mdi-react version but with an older mdi version as outdated.

I'll start to work on the release pipeline for that very soon.

/cc @jonotron

jonotron commented 6 years ago

This seems like a reasonable solution.

felixfbecker commented 6 years ago

That sounds like an abuse of prereleases that will take away benefits of semantic versioning.

Why not simply have mdi-react versioning be independent and the mdi SVGs be a proper npm devDependency (instead of a git submodule)? That way it is always clear what version of mdi a version of mdi-react is based on, while still allowing improvements in mdi-react itself that follow semantic versioning.

It's even possible to automatically release on every update of mdi through a combination of semantic-release and Renovate/dependencies.io.

If the goal is just to have the mdi version in the version number without any implications on semver, that could be done with a build tag like 1.2.3+mdi1.2.3.

levrik commented 6 years ago

@felixfbecker Yeah, I know that this is kinda hacky but I couldn't find another good solution.

The goal was to be able to release mdi-react completely independent from mdi. That means that a user would be able to pick their combination of mdi-react and mdi. So I had this idea of "abusing" pre-releases to achieve that. There were other ideas like just releasing some builder package which expects mdi as peer dependency. But this wouldn't work if multiple people are working on a project and someone updates mdi. mdi-react wouldn't automatically re-build mdi.

Maybe I should just completely scrap this whole idea and release a new version of mdi-react when a new version of mdi comes out.

I don't think build tags are working. Does they get displayed somewhere on npm? I never managed to release a package with a build tag on npm. Maybe I just did something wrong.

levrik commented 6 years ago

Moved to just putting the version into the README. First released version is 3.0.0

felixfbecker commented 6 years ago

Nice. Is there a reason for git submodules over a devDependency?

levrik commented 6 years ago

See #17