Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Replace ember-validations #1382

Closed
internets opened this issue Feb 28, 2018 · 9 comments
Closed

Replace ember-validations #1382

internets opened this issue Feb 28, 2018 · 9 comments
Labels
deprecation good first issue indicates an issue is good for a first time contributor help wanted indicates that an issue is open for contributions

Comments

@internets
Copy link
Contributor

ember-validations is no longer under active development, and has become a blocker for completion of #1370 (ember-getowner-polyfill.import deprecation). There's a PR that's over a year old that is unlikely to ever be accepted: DavyJonesLocker/ember-validations#442.

The way I see it there are two options: fork or replace.

If fork, it's possible that forking and cherry-picking the commit from that PR will solve the immediate problem.

If replace, the two most common actively developed validation solutions to my knowledge are ember-cp-validations and ember-changeset-validations. I recommend ember-cp-validations for the following reasons:

  • The broad strokes of the API are very similar to ember-validations
  • It doesn't require buying into the ember-changeset way of handling form objects
@broerse
Copy link

broerse commented Feb 28, 2018

@martndemus can you comment on what state ember-validations is in. Is it on the DockYard roadmap to update it to Ember 3.0?

@ghost
Copy link

ghost commented Feb 28, 2018

We are not planning to do anything about ember-validations.

@broerse
Copy link

broerse commented Feb 28, 2018

@martndemus thanks for the info.

@stukalin
Copy link
Contributor

Well, it seems to be a large piece of work, migrating it. I've started the new branch but the process is not so straightforward. See https://github.com/HospitalRun/hospitalrun-frontend/compare/ember-validations?expand=1

The most important problems are:

  • having all validations to be transferred correctly. It is not clear copy-paste unfortunately even though some settings in both libs match
  • conditional validations are the problem as well: our current solution supports some "hacks" in order to make validation conditional. For instance have an acceptance validator with an if function. I tried to get rid of that and use a custom validator.
  • I believe we've lost i18n support. So this part should be verified as well.

To sum up, maybe forking would be a good quick solution.

@stukalin stukalin added the help wanted indicates that an issue is open for contributions label Mar 20, 2018
@donaldwasserman
Copy link
Contributor

@stukalin - What would be the best approach to forking this? Should someone who have repository creation permissions fork it to the Hospital Run Repo? It's probably better than running it off someone's personal fork.

@stukalin
Copy link
Contributor

That'd be the best option. I don't have sufficient right, I've just verified that. @jglovier, could you help forking the https://github.com/DockYard/ember-validations to our repo?

@jglovier
Copy link
Member

Done. See: https://github.com/HospitalRun/ember-validations

Thanks folks!! ❤️ 🙇 ✨

@stukalin stukalin added the good first issue indicates an issue is good for a first time contributor label Jul 19, 2018
@stukalin
Copy link
Contributor

So now it's only matter of applying the fix mentioned in the very first message to our fork and reference it from the main app.

@donaldwasserman
Copy link
Contributor

I'm going to try to get that done this morning (well, morning East Coast US).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
deprecation good first issue indicates an issue is good for a first time contributor help wanted indicates that an issue is open for contributions
Projects
None yet
Development

No branches or pull requests

5 participants