adopted-ember-addons / ember-data-model-fragments

Ember Data addon to support nested JSON documents
MIT License
370 stars 114 forks source link

Ember-data version compatibility #242

Open ctjhoa opened 7 years ago

ctjhoa commented 7 years ago

Hi, I run through compatibility issue with the latest version of ember data (2.11.0) and I would like to know if there no other solution than the compatibility table existing in the README.md.

I know that some other ember-addon like ember-modal-dialog handle ember compatibility in their package.json.

Is there no way to write something similar for ember-data-model-fragments? E.g. for the ember-data-model-fragments v2.3.x it could be something like:

  "ember-addon": {
    "versionCompatibility": {
      "ember-data": ">= 2.3.0 < 2.11.0"
    }
  }

With this, if I'm right, ember install ember-data-model-fragments will lead to the installation of the right version of the addon whatever your version of ember-data is.

PS: I cannot find any documentation on this versionCompatibility it's only supposition

workmanw commented 7 years ago

To be honest, I'm not really much of an NPM expert. I think one option would be if this addon moved the ember-data dependency from devDependencies to dependencies and that would force conflict resolution in during npm install. But it doesn't seem like very many, if any, ember addons do this. It seems they keep ember in the devDependencies and I'm not sure if there is a specific reason for that.

I would absolutely accept a PR for adding versionCompatibility to the package.json file.

workmanw commented 7 years ago

Actually I saw this PR come through. https://github.com/jamesarosen/ember-i18n/pull/433/files It seems very relevant here. I'll investigate this in the near future when I have time.

runspired commented 6 years ago

@workmanw moving to dependencies would cause a very odd set of bugs because you'd get the merge of the two instead of resolving one or the other.

versionCompatibility is definitely something I'd recommend.