miguelcobain / ember-yeti-table

Yeti Table
https://miguelcobain.github.io/ember-yeti-table
MIT License
61 stars 15 forks source link

Updated yeti-table and pagination to glimmer components #382

Closed cah-brian-gantzler closed 2 years ago

cah-brian-gantzler commented 3 years ago

https://github.com/miguelcobain/ember-yeti-table/issues/344

This is everything converted with one failing test.

Its the one that says loadData should be called only once but its called twice. I tried several options, but the way tracking works I just couldnt find a way to know the value changed but treat undefined and "" the same.

Perhaps you can find a way if you wish to play with it. Else we just change the test to say its called twice, or remove the test if it is no longer testing something.

The main key to things reacting to changes without using the didReceiveAttrs methods if the following

  {{did-update this.notifyPropertyChange @theme @data @loadData @pagination @pageSize @pageNumber @filter @filterFunction
               @filterUsing @sortable @sortFunction @compareFunction @sortSequence @isColumnVisible}}

And that is only needed because of data taking a function. All the rest of the screen is reactive off tracked.

Computeds are still used as they will still allow POJOs to still work. Although @tracked is the new way in your code, when you have to watch on objects you are not in control of, I have not seen that ember computed has been deprecated for that use.

cah-brian-gantzler commented 3 years ago

I wanted to followup here. This is ready to go with one failing test and needed what direction I should go with this final piece

Its the one that says loadData should be called only once but its called twice. I tried several options, but the way tracking works I just couldnt find a way to know the value changed but treat undefined and "" the same.

Perhaps you can find a way if you wish to play with it. Else we just change the test to say its called twice, or remove the test if it is no longer testing something.

cah-brian-gantzler commented 3 years ago

Do we have a decision on what to do about this final test?

cah-brian-gantzler commented 3 years ago

Bump

cah-brian-gantzler commented 2 years ago

Looks they are Glimmer components now.