clauderic / react-tiny-virtual-list

A tiny but mighty 3kb list virtualization library, with zero dependencies 💪 Supports variable heights/widths, sticky items, scrolling to index, and more!
https://clauderic.github.io/react-tiny-virtual-list/
MIT License
2.46k stars 165 forks source link

Convert project to TypeScript #21

Closed clauderic closed 7 years ago

clauderic commented 7 years ago

This PR converts the project to use TypeScript, and involves a number of changes to the build toolchain. Since nwb doesn't support building TypeScript-based projects, I'm now using a custom build script to run tsc followed by Rollup to build out an es6, commonjs and umd build.

This PR also introduces a new prop called onRowsRendered (as requested in #14), which is a callback invoked with information about the slice of rows that were just rendered. It has the following signature: ({startIndex: number, stopIndex: number}).

There is also a new behaviour for scrollToAlignment called 'auto', which scrolls the least amount possible to ensure that the specified scrollToIndex item is fully visible (as requested in #19).

codecov[bot] commented 7 years ago

Codecov Report

Merging #21 into master will increase coverage by 1.93%. The diff coverage is 94.91%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #21      +/-   ##
=========================================
+ Coverage   91.66%   93.6%   +1.93%     
=========================================
  Files           3       3              
  Lines         144     125      -19     
  Branches        0      14      +14     
=========================================
- Hits          132     117      -15     
+ Misses         12       8       -4
Impacted Files Coverage Δ
src/constants.ts 100% <100%> (ø)
src/index.tsx 100% <100%> (ø)
src/SizeAndPositionManager.ts 92.52% <93.18%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update dcf8b95...07be562. Read the comment docs.