-
-
Notifications
You must be signed in to change notification settings - Fork 113
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
Q: Support for v4.8+ #471
Comments
I'm also curious, tried investigate by our self but internal changes in |
Based on this blog post, I believe efforts are going to target ember-data 4.12. |
@dwickern and @runspired probably have the most insight into this |
ember-data 3.28 - 4.6 uses RecordData v1 which is implemented by model-fragments v6 In #417 (comment) Chris suggested we end support for this addon at ember-data 4.6 and have users upgrade straight to 4.12. @runspired is this still what you would recommend? How would a migration look? |
TL;DR The path ahead is as follows. I'll be working with @RSG and anyone else interested to achieve this. The Promised Land: 4.12+Our main goal should be to make ModelFragments compatible with 4.12. The release with 4.12 support will be ModelFragment's last, though obviously patches as necessary as long as some folks are on it. Users of ModelFragments would then upgrade to 4.12, install (at least) The Road to 4.12First Stop, Improve 4.6 supportAs the Compatibility table points out, currently ModelFragments hopes to support up to 4.6. In practice so far @RSG has noted that at least for Square there seem to be blockers to getting beyond 4.0. So for starters we'll want to figure out what those are and ensure they and anyone else that hasn't quite been able to get to 4.6 gets to 4.6. Second Stop, Choose Our PathOption 1 - Write A Custom Cache for 4.7+ In this approach the bulk of the application's refactoring responsibility occurs in 4.12. In this path, we focus on keeping the public DX and APIs that ModelFragments has today, but change the underlying implementation to conform to expected cache behaviors. For non-ModelFragments users, 4.11 was a pretty solid landing version before more substantive changes to the internals in 4.12 introduced a number of dragons. The V2 RecordData version in 4.7-4.11 is very similar to the final version that shipped in 4.12. If we focus on building a custom singleton RecordData to support 4.7-4.11, the leap to supporting 4.12 is likely such that we can handle 4.7-4.12 in one go, but even if we can't easily we should be close enough that it won't be a big ModelFragments rewrite to get to 4.12 But this is also dicey, as this means one big-bang rewrite for ModelFragments. And that rewrite will inevitably come with its own unexpected, unintentional but observable and frustrating deviations in behavior. And to be clear, I do mean a full rewrite, because ultimately the way ModelFragments reasons about and uses the cache and transforms today is incorrect and is what drives the private API usage. Option 2 - Write A Custom Model for 4.6+ In this approach the bulk of the application's refactoring responsibility occurs in 4.6 We keep EmberData's cache (likely zero changes needed) and instead focus on changing the ModelFragments DX and APIs. We would effectively be attempting to adopt EmberData's SchemaModel ~6 versions early. I think it is possible; though it would not be an exact match due to some limitations of the cache in versions before 4.12. The migration path for this then involves users getting to 4.6 + Today's ModelFragments, and then incrementing ModelFragments to the major that supports 4.6+ and incrementally rewriting from ModelFragments to the "FragmentSchemaModel", and finally bumping to 4.12 and replacing model-fragments with just EmberData. I believe in this approach the risks are likely similar, but that if we are careful we can keep SchemaModel and FragmentSchemaModel close enough aligned that the 4.12 swap is relatively painless. The downside is that users won't gain access to any other new features of EmberData (Request, Collection, Pagination primitives, builders) until after a potentially long migration spent on 4.6, and EmberData's patterns will change substantially during 5.x pushing towards newer DX that 4.x supports today. Parting ThoughtsI leave it to the community to decide which of these paths feels best. I have no apps which use ModelFragments and thus cannot accurately judge the right path before you. I'll be talking quite a bit in depth about the DX and Feature set of SchemaModel at EmberConf this year. Likely that talk will serve as a good grounding point to reflect on which approach feels more correct. |
I don't know if I understood correctly, but I assume that v4.12 is the last version of Ember Data this library is going to support because a similar behavior is available to develop in ED v5.x+. @runspired Is it possible to have docs of how to migrate from ModelFragments to SchemaModel? |
@Gorzas the migration path hasn't been built as its something we'll discover together as we build SchemaRecord / figure out the nice path for folks here. This said, 4.12 is a key part of that path. I recently added a |
Is someone working on bringing support for ember-data 4.8+?
The text was updated successfully, but these errors were encountered: