Ember-cp-validations not compatible with Ember Data 5.4+

Hi everyone! :waving_hand:

While updating my application to Ember CLI 6+, I encountered a compatibility issue between the ember-cp-validations library (latest version 7.0.0) and Ember Data starting from version 5.4. Is further support for ember-cp-validations planned? What alternatives to this library would you recommend?

I was just looking into updating cp-validations as well and am working my way into Ember 5.x right now :see_no_evil_monkey: I’m keeping our Ember Data version pinned at 4.12 but this is good to know.

Did you see the issue in the repo? Sounds like there’s definitely some issues here.

Here’s my understanding of where it stands now and my best guess as to what happens from here (but don’t take this too seriously, i’m not a maintainer and i don’t know all that much about the package or the plans for it):

  1. it was always sort of an awkward fit once we switched reactivity models and adopted native classes in the Glimmer era, so it’s been somewhat discouraged since then (at least iirc). My team has been migrating away from it for some time now but we still have some old code using it.
  2. considering the above it has received a significant amount of attention in terms of updates and bugfixes, likely due to how many apps were dependent on it
  3. the current incompatibilities appear surface level (macro checks) but also deeper (relationship tracking and maybe array prototype issues) and possibly also build related (i see some embroider related issues filed) so it’s probably nontrivial to update it for compatibility with new Ember Data versions
  4. given 1-3 i’d estimate it’s not super likely to happen soon or ever. That’s not to say it won’t, but the likelihood that the limited time and energy of the community and core team is spent updating an addon which is not longer a great fit for the programming model is a hard sell.
  5. even if it is updated it feels like it’s only a matter of time before we hit this state again (due to #1) so you probably want to explore moving off of it

Obviously replacing it is not trivial in any size application so maybe do some more inquiry before making that decision, but it seems like the right strategy to me. Like I said my team has been migrating away from it for a while now and are mostly done.

I’m not aware of a slam dunk “use this not that” alternative. We use ember changeset and ember changeset validations as a replacement. I’m not sure I’d wholeheartedly recommend that path either tbh, but it’s at least a step in the right direction and is easier to replace if needed. Basically we used ember-cp-validations in form components, and we’ve created a lot of form primitives that use ember-changeset/validations under the hood, but if we needed i think we could swap that out relatively easily vs ember-cp-validations which were scattered everywhere.

How heavily do you use ember-cp-validations? And what are your use cases? Answering those questions might help make the decision clearer.

Also again note that some of what I said might be off base so consider doing more research in discord/here.