facebookarchive / fixed-data-table

A React table component designed to allow presenting thousands of rows of data.
http://facebook.github.io/fixed-data-table/
Other
4.3k stars 553 forks source link

Migration to 0.6/0.7 #369

Open irumgodil opened 8 years ago

irumgodil commented 8 years ago

Hi,

I am migrating my code to version 0.6, however, it appears that old code is still being used underneath in the "dist" version. Is it true that to use the new version, we have to manually delete all the transitionary code (so new apis are called)? For now, if even I am providing the "cell" property on the Column, it is not getting hit at all.

When I looked at the code, it appears that it is still hitting the cellRenderer. Looks like that we have to manually delete the transition code and build the dist for it to work. Is there something I am missing here?

Also, when is 0.7 version going to be released exactly?

Thanks.

vineetbatta commented 8 years ago

I was also looking for timelines around version 0.7.

Thanks

juliuszc commented 8 years ago

I also ran into the same issue. Could someone please advise?

KamranAsif commented 8 years ago

If you are using any of the old API's, it seems the transition code will try and cover you over to the new APIs. Make sure you aren't using any of the old code (see https://github.com/facebook/fixed-data-table/blob/master/src/transition/FixedDataTable.react.js#L316)

We have a fork that removed the transition code, you can test on there to make sure you aren't using any deprecated props: https://github.com/schrodinger/fixed-data-table

As for 0.7, it seems the maintainers haven't been active in quite a while so no idea when the official version is coming out.

fixedtablev6Update commented 8 years ago

Thanks.

We have our own fork too, where we deprecate all of the old APIs: https://github.com/fixedtablev6Update/fixed-data-table.git

We want to be sure that - this is the only way around to use the new APIs, and that there is no other way directly supported by facebook to do this (in their own branch/fork).

fixedtablev6Update commented 8 years ago

Hi, Someone in my team has pointed out a way where we can use 0.6 version without our own fork.

This will be useful for everyone.

I debugged through the code to see how is it working and it looks like that “TransitionTable (Old Table)” has this API below. If “needsMigration” is true then it goes to the Old code, otherwise to new code.

Originally, I had not removed the old definitions at all in my Definition file, so “needsMigration” was always true – and hence even if I provided new cell code, it was not getting hit.

_checkDeprecations: function _checkDeprecations() { var needsMigration = false; if (this.props.rowGetter) { notifyDeprecated('rowGetter', 'Please use the cell API in Column to fetch data for your cells.'); // ROWGETTER??? You need to migrate. needsMigration = true; }…. }

So, to use the new APIs - you need to delete all references to deprecated definitions (but mainly the rowGetter - as that is the only flag that causes needsMigration to be true/false).

Thanks.