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

Remove usages of jQuery #98

Merged

Conversation

donaldwasserman
Copy link
Contributor

note: I am waiting to update the tests because of

Copy link
Contributor

@alexander-alvarez alexander-alvarez left a comment

Choose a reason for hiding this comment

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

When you do the change if you could verify locally that would be great.
Apparently we don't have a test that verifies that the scrollbar actually renders 😢

addon/classes/scrollable.js Outdated Show resolved Hide resolved
@donaldwasserman
Copy link
Contributor Author

@alexander-alvarez So I went through and tried best I could to compare a lot of the measurements between the jquery/non-jqery version.

This appears to work for me locally, although I'm really not sure why the tests were passing, because it seems like they shouldn't.

@@ -228,8 +227,8 @@ export default Component.extend(InboundActionsMixin, DomMixin, {
},

resizeScrollContent() {
const width = this.$().width();
const height = this.$().height();
const width = this.element.offsetWidth;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm a little confused now, why did this one switch to offset and why did https://github.com/alphasights/ember-scrollable/pull/98/files#diff-3fa203c13b3ee2249dcb66b55d4c297fR22 switch to getHeight?

Is that simply what you needed to do to get it working?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wish I could say I sat down and did the math to figure out all the details of why and how each piece interacted, but I basically just put a few console logs across the critical paths and both this branch and master, and this is the measurement that worked.

If you could try it out too, that would be great, but it does seem like it's working.

I'd like to add another test to make sure the onScrolledToBottom action gets called, because that should have been failing, but wasn't. However, I'm not 100% sure how to get the elements to scroll.

Copy link
Contributor

Choose a reason for hiding this comment

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

I haven't forgotten about this, just haven't gotten around to it. Hopefully before or during this coming Thanksgiving holiday.

Copy link
Contributor

Choose a reason for hiding this comment

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

so yeah... I forgot ....

@donaldwasserman
Copy link
Contributor Author

Hey @alexander-alvarez I sort of lost track of this over the holidays and am now resuming my quest to remove jquery from Ember-light-table.

What do you think we need to check to get those over the finish line?

@alexander-alvarez
Copy link
Contributor

I think I'd want some reasoning or extensive testing on many browsers to make sure this is a.o.k given the discrepancy mentioned above. This space is filled with subtitles that I am pretty unfamiliar with that I'm hesitant to make changes to it without knowing it will be g2g for our downstream consumers

@donaldwasserman
Copy link
Contributor Author

You know, I don’t remember a single thing about this PR. Looking back through it, I’ll just redo everything with the getHeight replacement.

I have an app that depends pretty heavily on ELT, so getting this done correctly is a high priority.

@alexander-alvarez
Copy link
Contributor

Apologies for delaying you @donaldwasserman

@donaldwasserman
Copy link
Contributor Author

@alexander-alvarez no prob! I was really motivated to get rid of jQuery from my app in december, but then lost interest when i realized how much i depended on liquid fire, lol. I'll hopefully have some time this week to get this wrapped up.

@richard-viney
Copy link
Contributor

richard-viney commented Aug 17, 2019

@donaldwasserman Is the only thing remaining here the more consistent use of the getHeight replacement function?

@donaldwasserman
Copy link
Contributor Author

Hey @richard-viney - Thanks for the bump on this. I actually have this somewhat working locally. But the issue I'm having some outdated test dependencies. So I'm just trying to get that fixed up this morning and pushed up.

@donaldwasserman
Copy link
Contributor Author

@richard-viney, @alexander-alvarez another quick update, I switched up some various things:

  • I added back jquery & non-jquery tests so we can have some certainty about the test coverage
  • Now there's some failing tests that I can't quite figure out why, and have run out of time this AM to work on it. I'll pick it back up hopefully next week.

If anyone has any suggestions or notices a quick fix, let me know.

@alvinvogelzang
Copy link

@donaldwasserman you accidentally changed firstMovement to secondMovement in scroll-content-element-test.js. I've fixed it in the following PR: donaldwasserman#1

All the ember tests succeed locally but somehow the tests in Travis are failing but I'm not sure what to do about that.

@donaldwasserman
Copy link
Contributor Author

donaldwasserman commented Dec 16, 2019

@alexander-alvarez - Looks like this should be good to go now, but i don't see travis reporting anything on here anymore. I know this is sort of off the radar for you, but any ideas? It would be nice to get this wrapped up, and desipite it taking me a year plus on this project, i'd be happy to take this over for you and get the outstanding PR's fixed up.

Or @alexander-alvarez, we could move this whole repo over to the adopted-ember-addons thing.

@alexander-alvarez
Copy link
Contributor

@donaldwasserman not sure what is going on with travis will have to take a closer look. I agree it would be nice to get this wrapped up & thank you for your continued contributions.

Also I'm in favor of moving this to an area where it gets more love. Unfortunately I'm not the project maintainer, and I don't know who is. It seems the listed maintainer left Alphasights a while ago @eugeniodepalo any ideas as to who succeeded you?

@donaldwasserman
Copy link
Contributor Author

@alexander-alvarez Not sure what the deal with Jenkins either, but it looks like there may be some random errors left: https://travis-ci.com/donaldwasserman/ember-scrollable

@RobbieTheWagner
Copy link

@donaldwasserman @alexander-alvarez anything I can do to help with these efforts? Ember-light-table, which uses ember-scrollable, is pretty much the only thing left in our app using jQuery.

@donaldwasserman
Copy link
Contributor Author

So the only error left is on the latest ember versions, and I think it’s an issue in the dummy app itself, but that’s just a wild guess.

I’ll set aside some time on Monday to investigate

@RobbieTheWagner
Copy link

@donaldwasserman where can I see the errors? Happy to take a look.

@donaldwasserman
Copy link
Contributor Author

donaldwasserman commented Jan 11, 2020

If you want to check it out it’s right here: https://travis-ci.com/donaldwasserman/ember-scrollable

I don’t have access to this repo, so I don’t know why Travis has disappeared here

I don’t have my computer in front of me, but basically the error is something like “cannot getOwner of undefined”

@RobbieTheWagner
Copy link

@donaldwasserman ah, looks like it is saying the owner is undefined when it tries to use .lookup on it. Are the tests using the new testing syntax?

@donaldwasserman
Copy link
Contributor Author

Thanks @rwwagner90. I was trying to not touch any of the test code (since i'm just dropping in on this...uh...2 years ago)

I'll run the codemod on that see what happens

@donaldwasserman
Copy link
Contributor Author

donaldwasserman commented Jan 12, 2020

Thanks for the pointer @rwwagner90 - things are working on my machine ™️ .

Here's travis: https://travis-ci.com/donaldwasserman/ember-scrollable/builds/144037283

(Note, I didn't actually wait around for this to build, but am going to bed. So it may or may not actually be passing by the time anyone looks at this)

Narrator: It Didn't Work

But this one may: https://travis-ci.com/donaldwasserman/ember-scrollable/builds/144037363

@RobbieTheWagner
Copy link

@donaldwasserman looks like everything is green! 🎉

@donaldwasserman
Copy link
Contributor Author

Thanks for the bump @rwwagner90.

@alexander-alvarez See #121 where i added github actions for tests

I'll squash all the commits in here after that gets merged so we get a clean test run, then I think we can talk about pushing this out & cutting a release for downstream

@RobbieTheWagner
Copy link

Thanks for all your work on this @donaldwasserman!

@donaldwasserman
Copy link
Contributor Author

Hey @alexander-alvarez can you take a second to review + merge + maybe cut a new release?

@eelke
Copy link

eelke commented Jan 14, 2020

@donaldwasserman I tried out the latest commit from your feature branch in a project that I'm working on, but it doesn't work correctly: the drag handle cannot be dragged, and clicking on the scrollbar works neither.

I just ran the dummy app from that same commit and confirmed that this problem exists there as well.

@donaldwasserman
Copy link
Contributor Author

thanks @eelke - thanks for pointing it out should be fixed now. Must have missed it some of the rebasing i did.

@alexander-alvarez
Copy link
Contributor

alexander-alvarez commented Jan 15, 2020

@donaldwasserman thanks for all the work on this, once the typo update is in and side scrolling should work, hence this PR should finally be G2G

@donaldwasserman
Copy link
Contributor Author

@alexander-alvarez sorry about that. TV + bug fixing don't mix. We shoudl figure out a way to add a test for that whole flow anyway...

@alexander-alvarez alexander-alvarez merged commit 084c9d6 into alphasights:master Jan 16, 2020
@RobbieTheWagner
Copy link

Now that this is merged, can we release a new version and update ember-light-table?

@alexander-alvarez
Copy link
Contributor

We've released https://github.com/alphasights/ember-scrollable/releases/tag/v1.0.0
Thanks again @donaldwasserman and everyone who's helped get this done

@alexander-alvarez
Copy link
Contributor

@donaldwasserman @rwwagner90 see https://github.com/offirgolan/ember-light-table/releases/tag/2.0.0-beta.5

@donaldwasserman
Copy link
Contributor Author

@alexander-alvarez Thanks a bunch! Glad we've finally got this across the finish line.

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

Successfully merging this pull request may close these issues.

6 participants