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

Ember Data addon to support nested JSON documents

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ember-Data 2.14 compat

workmanw opened this issue · comments

It looks like Ember-Data has moved around some files that we import. Here is the error from my tests:

Could not find module `ember-data/-private/system/model/states` imported from `ember-data-model-fragments/states`

Turns out there was an effort to consolidate ember-data's -private exports. See: emberjs/data#4925

As a result, one of the classes we need is completely isolated. I submitted a PR to try to remedy this: emberjs/data#5002


One additional hitch is that moving imports around kind of breaks backwards compatibility. We could use require(...) instead of import { ... } from '...' for the time being to support multiple paths. I'll explore that once the PR lands in beta. Input always welcome :)

@jakesjews et al -- Looking for opinions here. The import paths have changed and you cannot try/catch import failures. So if we want to keep backwards compatible, we'd have to use require() for the time being to import in 3 places so we can catch errors and import alternate paths.

Pros: Backwards Compat.
Cons: Hack. Incompatible w/ tree shaking efforts that are underway (which I have no idea about what the status is).

I'm inclined to just make a clean break here. I'd cut one last 2.11.x with the outstanding code on master. Then my PR would be 2.14.1. But I'm open to using require() for import for a period of time.

Thoughts?

@workmanw I think a clean break is the right way forward too.

@jakesjews 👍 Just released 2.11.4 (the last in the 2.11.x series). Once ember-data ships 2.14, we'll ship ember-data-model-fragments 2.14.