bvaughn / react-virtualized

React components for efficiently rendering large lists and tabular data
http://bvaughn.github.io/react-virtualized/
MIT License
26.29k stars 3.06k forks source link

Version 10 breaking changes #658

Open bvaughn opened 7 years ago

bvaughn commented 7 years ago

This issue doesn't imply that version 10 will be released any time soon. I just want a place to list some ideas so I won't forget them.

avocadowastaken commented 7 years ago

Currently I'm using only Table component (didn't have a chance to use other components) and got lot of custom editable columns like checkboxes, inputs and selects.

To make them reusable i'm using factories like that:

const createCheckboxColumn = props => (
  <Column
    width={56}
    minWidth={56}
    label={props.label}
    dataKey={props.dataKey}
    disableSort={true}
    style={{ minWidth: `${56}px` }}
    headerClassName={cx(props.headerClassName, classes.checkboxColumn)}
    headerRenderer={() => (
      <Checkbox
        disabled={!props.rowCount}
        value={props.allRowsSelected}
        onChange={value => props.onAllRowsSelect(value)}
      />
    )}
    className={cx(props.className, classes.checkboxColumn)}
    cellDataGetter={row => row.rowData}
    cellRenderer={row => (
      <Checkbox
        value={props.rowSelected(row)}
        onChange={selected => props.onRowSelect({ selected, ...row })}
      />
    )}
  />
);

const table = (
  <Table {...props}>
    {createCheckboxColumn(checkboxProps)}
  </Table>
);

Not sure if it's even a good idea in case of perf, but It would be great to have an option to make it work in "react way":

const table = (
  <Table {...props}>
    <CheckboxColumn {...checkboxProps} />
  </Table>
);
nkt commented 7 years ago

You should be noticed react-measure works different than AutoSizer. AutoSizer measures dimensions outside of container, it helps underlying components, like Grid to calculate visible rows. react-measure measures dimensions inside of container.

souporserious commented 7 years ago

Just came across this. Was going to file an issue to see if you wanted to consider a ResizeObserver 😆 I'd be willing to help try and push this through. I would suggest using the polyfill direct. It's a pretty small amount of code to get it setup. As far as measuring goes, we can attach the observer to the parent node if we need to.

bvaughn commented 7 years ago

Cool. Thanks @souporserious. Sounds worth giving it a shot. Could maybe use a that API for CellMeasurer as well although I haven't given that much consideration.

pke commented 6 years ago

When is "soon" as in the OP mentioned? I wanted to put in RV in one of my project now and use AutoSizer but read now here that it will be deprecated "soon".

bvaughn commented 6 years ago

No, @pke. 😄 I definitely didn't say that it would be deprecated soon.

This issue doesn't imply that version 10 will be released any time soon.

This is just a placeholder issue for ideas that I don't have time to work on now, and I don't know when I will have time to work on them.

TrySound commented 6 years ago

Want to formulate my ideas

TrySound commented 6 years ago
TrySound commented 6 years ago

Prefer named exports over defaults for better treeshakability.

bvaughn commented 6 years ago

Prefer named exports over defaults for better treeshakability.

I assume you mean this about default exports of objects that contain many (non-tree-shakeable) keys?

It wouldn't actually make a difference in a case like:

export default SomeReactComponent
// vs
export SomeReactComponent

...right?

TrySound commented 6 years ago

Not sure. I rely mostly on @Andarist issues.

bvaughn commented 6 years ago

I'd love to learn more if the above really does have an impact on tree shaking. I assume it does not.

Andarist commented 6 years ago

From what i know there is no difference in named an default exports in terms of tree shakeability. default is just another named export which is treated in a little bit of special manner sometimes.

The problem with default export is that people sometimes use it in slightly wrong manner.

Exhibit A:

const Package = ...
Package.Other = ....
export default Package

Exhibit B

export default {
  foo,
  bar
}

What I think should not be dane is that a default export should not act as a namespace and should not gather other things that are intended to be reexported from the package.

bvaughn commented 6 years ago

thanks for clarifying 👍

somi92 commented 5 years ago

Hi @wuweiweiwu,

Is there any info on version 10 release. I'm asking mainly in regards to this https://github.com/bvaughn/react-virtualized/issues/999#issuecomment-439072525.

wuweiweiwu commented 5 years ago

@somi92 please follow the https://github.com/bvaughn/react-virtualized/milestone/1 milestone for updates!