Skip to content
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

Ember 4.0 compatibility - drops support for Ember < 3.28 #717

Merged
merged 14 commits into from Oct 13, 2022

Conversation

fsmanuel
Copy link
Contributor

@fsmanuel fsmanuel commented Aug 17, 2022

Breaking changes:

  • Drop support for Ember < 3.28

First attempt to make it ember 4.0 compatible.

Thanks to @zeppelin and @qonto I could cherry pick a lot from the fork.

ref #716
closes #701

This was referenced Aug 17, 2022
@fsmanuel fsmanuel force-pushed the ember-4-compatibility branch 7 times, most recently from 926bd77 to 986eb89 Compare August 26, 2022 20:35
@fsmanuel fsmanuel self-assigned this Sep 10, 2022
@fsmanuel
Copy link
Contributor Author

@tehhowch wanna do another review?

@fsmanuel fsmanuel changed the title Ember 4.0 compatibility Ember 4.0 compatibility - drops support for Ember < 3.28 Sep 21, 2022
Copy link

@tehhowch tehhowch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have an ember 3.28/4+ app to use to verify this PR remains / fix compatibility. Didn't look at changes to tests or lines not modified, either (i.e. not a substantiative review).

Comment on lines 142 to 144
this._super(...arguments);
get(this, 'validations').destroy();
this.validations.destroy();
},

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I always feel the call to super in "unwinding" contexts should be last, not first.

Comment on lines 800 to +804
let whiteList = makeArray(options.on);
let blackList = makeArray(options.excludes);

let validationResults = get(this, 'validatableAttributes').reduce(
(v, name) => {
if (!isEmpty(blackList) && blackList.indexOf(name) !== -1) {
return v;
}

if (isEmpty(whiteList) || whiteList.indexOf(name) !== -1) {
let validationResult = get(this, `attrs.${name}`);
let validationResults = this.validatableAttributes.reduce((v, name) => {
if (!isEmpty(blackList) && blackList.indexOf(name) !== -1) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can rename these to e.g. allowed and forbidden.

The indexOf checks should be replaced by includes, too

addon/validations/factory.js Show resolved Hide resolved
Copy link
Contributor

@MelSumner MelSumner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move forward with this. 👍

@tehhowch
Copy link

@fsmanuel i was able to pull this down and run unit & integration tests for some just-migrated-to-3.28 apps, without issues. We have more extensive test suites but they are more costly to run, so they'll need to wait until this PR is released in 5.0

I'm curious: does this PR drop support for Ember 3.24 just because, or are there things only in 3.28 or later that are necessary for the current implementation?

@kiwi-josh
Copy link

As another data point (as someone running a large ember app in production on the qonto@3767e41 fork).
I pointed our repo at this PR, smoke tested a bunch of validation functionality, and ran our test suite, and all green 😄

@fsmanuel fsmanuel merged commit 754bebc into adopted-ember-addons:master Oct 13, 2022
@fsmanuel fsmanuel deleted the ember-4-compatibility branch October 13, 2022 08:18
@fsmanuel
Copy link
Contributor Author

@MelSumner thanks for approving!
@tehhowch @kiwi-josh thanks for testing with a real app.

@tehhowch I think I needed to drop support for 3.24 but I'm not 100% sure. The general problem with old versions is that the maintaining efforts for the test coverage increases a lot. For example ember bootstrap was used in this addon for the docs and then you need to figure out which ember, addon and ember bootstrap versions work well together.
Because ember 4 is significantly different it's best to drop the test coverage for the old versions to make life easier with the upcoming changes to this addon.

@fsmanuel
Copy link
Contributor Author

Released as 5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Installing this addon breaks build on Ember 4
4 participants