-
-
Notifications
You must be signed in to change notification settings - Fork 148
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
Created Sortable component with modifiers #344
Created Sortable component with modifiers #344
Conversation
The |
I expected 3.4 and 3.8 to work. There must be something weird with a computed. Will look into it. I also dont have firefox installed locally. |
This is quite a sizable change, although mostly additions. I'm not too familiar with the |
If Im right and the groupModel is not used anywhere except on the echo back of onChange, a better way to do this is
The above two statements should be equivalent. Except that the component doesnt need to track a variable it doesnt care about. Note: This currying is replaced by the new
|
Yes it is ALL new, there are no changes to the existing components. I still need to look into the computed failing 3.4 and 3.8. So this isnt yet ready to be merged anyway. |
For components there is a |
So ember-modifier says its backward to 3.4, but based on the tests I would says its that addon that is causing the problem. Given that all the code is new, Another option would be to create another addon called ember-sortable-modifier and move the code there. That might make more sense. Both addons installed at the same time wouldnt be a problem either. The only problem with two separate addons is that any changes would have to be made twice. The current components are basically what modifiers are doing but hard coded to ol and li. Change tag names to use them for tables are not really the encourage route, and if you look at your table you will notice there is actually a div around the tds, thats why its indented and the columns dont line up. The nature of this addon really screams for modifiers and why they were invented. |
@cah-briangantzler
@jgwhite @chriskrycho @lifeart , I would appreciate your thoughts on what the best approach would be here. |
Theres a couple things I dont like about the current modifier version and I was able to fix that, look for this PR to be closed and a new one opened. If you are on 3.8 or greater (ie octane) the modifier version is the way to go, there is no reason to use the component version.So two addons are probably better, One if fine but my prediction is that the component version is the one that will fade and the modifier version the one to adopt. Specifically it allows you to use it with tables, the current component version looks like it works with tables, but it actually doesnt correctly. Look for the new PR in a few, its a much cleaner version. |
Given that 3.8 is the current LTS and the modifier works that far back, moving that direction (possibly supporting both during a transition period) is probably the best move. While we shouldn’t intentionally break backwards compatibility, the addon ecosystem also should not (IMO) waste effort supporting unsupported versions of Ember indefinitely. Instead, we should track Ember’s own support. We can cut a 2.x branch and continue to provide big fixes against it for apps like the one we work on, @ygongdev, while supporting the fully Octane-ready version for the ecosystem moving forward (and which we will hopefully be able to use even in our app in less than a month 🤞). |
(I’ll have more comments on the design questions around modifiers and components tomorrow!) |
Closing this in favor #345 |
Do NOT Merge this PR. Possible improved syntax
I did not update the read.me, wasnt sure how you wanted to promote. Did write a migration guide.
Wanted to ask what groupModel was for, it doesnt appear to be used except for echoed back in onChange, there are better ways to do that now if thats all it is. Possibility of simplifying that?
Im sure theres some code to be cleaned up. Still making passes.
I created a new route in the dummy app to have the old and new displayed on two different routes, then just copied the acceptance tests. They were quite extensive and easily told me what wasnt working. To that end I didnt see any reason to have any component or modifier tests as it was already tested.