Skip to content

Commit

Permalink
checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
tannerlinsley committed Jun 1, 2022
1 parent c57eee7 commit a475371
Show file tree
Hide file tree
Showing 18 changed files with 1,771 additions and 1,684 deletions.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

6 changes: 3 additions & 3 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,27 @@ const cjs = NODE_ENV === 'test' || BABEL_ENV === 'commonjs'
const loose = true

module.exports = {
targets: 'defaults, not ie 11, not ie_mob 11',
presets: [
[
'@babel/env',
{
loose,
modules: false,
// useBuiltIns: false,
// exclude: ['@babel/plugin-transform-regenerator'],
},
],
'@babel/react',
'@babel/preset-typescript',
],
plugins: [
'babel-plugin-transform-async-to-promises',
// 'babel-plugin-transform-async-to-promises',
cjs && ['@babel/transform-modules-commonjs', { loose }],
// [
// '@babel/transform-runtime',
// {
// useESModules: !cjs,
// version: require('./package.json').devDependencies[
// version: require('./package.json').dependencies[
// '@babel/runtime'
// ].replace(/^[^0-9]*/, ''),
// },
Expand Down
1 change: 1 addition & 0 deletions examples/react/dynamic/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
<script type="module" src="https://cdn.skypack.dev/twind/shim"></script>
</head>
<body>
<div id="root"></div>
Expand Down
11 changes: 6 additions & 5 deletions examples/react/dynamic/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "dynamic",
"name": "tanstack-react-virtual-example-dynamic",
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "vite",
Expand All @@ -10,11 +11,11 @@
"dependencies": {
"react": "^17.0.2",
"react-dom": "^17.0.2",
"@tanstack/react-virtual": "3.0.0-alpha.0"
"@tanstack/react-virtual": "1.0.0"
},
"devDependencies": {
"@rollup/plugin-replace": "^3.0.1",
"@vitejs/plugin-react": "^1.1.4",
"vite": "^2.7.13"
"@rollup/plugin-replace": "^4.0.0",
"@vitejs/plugin-react": "^1.2.0",
"vite": "^2.8.6"
}
}
6 changes: 0 additions & 6 deletions examples/react/dynamic/sandbox.config.json

This file was deleted.

26 changes: 16 additions & 10 deletions examples/react/dynamic/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,24 @@ html {
font-size: 14px;
}

.List {
border: 1px solid #e6e4dc;
max-width: 100%;
table {
border: 1px solid lightgray;
}

.ListItemEven,
.ListItemOdd {
display: flex;
align-items: center;
justify-content: center;
tbody {
border-bottom: 1px solid lightgray;
}

.ListItemEven {
background-color: #e6e4dc;
th {
border-bottom: 1px solid lightgray;
border-right: 1px solid lightgray;
padding: 2px 4px;
}

tfoot {
color: gray;
}

tfoot th {
font-weight: normal;
}
12 changes: 6 additions & 6 deletions examples/react/dynamic/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function RowVirtualizerDynamic({ rows }) {
position: 'relative',
}}
>
{rowVirtualizer.virtualItems.map(virtualRow => (
{rowVirtualizer.virtualItems.map((virtualRow) => (
<div
key={virtualRow.index}
ref={virtualRow.measureRef}
Expand Down Expand Up @@ -116,7 +116,7 @@ function ColumnVirtualizerDynamic({ columns }) {
position: 'relative',
}}
>
{columnVirtualizer.virtualItems.map(virtualColumn => (
{columnVirtualizer.virtualItems.map((virtualColumn) => (
<div
key={virtualColumn.key}
ref={virtualColumn.measureRef}
Expand Down Expand Up @@ -162,7 +162,7 @@ function GridVirtualizerDynamic({ rows, columns }) {

return (
<>
<button onClick={() => setShow(old => !old)}>Toggle</button>
<button onClick={() => setShow((old) => !old)}>Toggle</button>
<button onClick={() => rowVirtualizer.scrollToIndex(halfWay)}>
Scroll to index {halfWay}
</button>
Expand All @@ -186,12 +186,12 @@ function GridVirtualizerDynamic({ rows, columns }) {
position: 'relative',
}}
>
{rowVirtualizer.virtualItems.map(virtualRow => (
{rowVirtualizer.virtualItems.map((virtualRow) => (
<React.Fragment key={virtualRow.key}>
{columnVirtualizer.virtualItems.map(virtualColumn => (
{columnVirtualizer.virtualItems.map((virtualColumn) => (
<div
key={virtualColumn.key}
ref={el => {
ref={(el) => {
virtualRow.measureRef(el)
virtualColumn.measureRef(el)
}}
Expand Down
12 changes: 12 additions & 0 deletions examples/react/dynamic/tsconfig.dev.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"composite": true,
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./build/types"
},
"files": ["src/main.tsx"],
"include": [
"src"
// "__tests__/**/*.test.*"
]
}
10 changes: 0 additions & 10 deletions examples/react/dynamic/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,4 @@ export default defineConfig({
}),
react(),
],
resolve: process.env.USE_SOURCE
? {
alias: {
'@tanstack/react-virtual': path.resolve(
__dirname,
'../../packages/react-virtual/src/index.tsx',
),
},
}
: {},
})
Loading

0 comments on commit a475371

Please sign in to comment.