Skip to content
This repository has been archived by the owner on Jun 10, 2020. It is now read-only.

Modernize react-infinite #235

Merged
merged 38 commits into from
Aug 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
963d015
Refactor methods into functions.
garetht Aug 4, 2017
c0f2760
Remove annotation.
garetht Aug 4, 2017
4194edb
Finally remove deprecated prop.
garetht Aug 4, 2017
4ae1448
Continue upgrading to Jest 20.
garetht Aug 4, 2017
d3c5557
Continue updating tests.
garetht Aug 4, 2017
beb4770
Fix pointer events tests.
garetht Aug 4, 2017
10598ec
Remove mocking and imports.
garetht Aug 4, 2017
89bf7f6
Continue working on tests.
garetht Aug 4, 2017
dc5dc64
Continue with tests.
garetht Aug 4, 2017
892fde2
Update infinite tests.
garetht Aug 5, 2017
aff218f
Update infinite tests.
garetht Aug 5, 2017
196f5c5
Fix bottom upwards tests.
garetht Aug 5, 2017
e238a94
Continue upgrading tests.
garetht Aug 5, 2017
bd10e42
Add fixes.
garetht Aug 5, 2017
b8b7abf
Convert to ES2015 class.
garetht Aug 5, 2017
9c80491
Fix tests after component upgrade.
garetht Aug 5, 2017
507a2b6
Update package.json.
garetht Aug 5, 2017
9dbfb55
Upgrade ESLint to standard SeatGeek configuration.
garetht Aug 5, 2017
f020bab
Fix flowtype linting.
garetht Aug 5, 2017
5f940cc
Format with prettier.
garetht Aug 5, 2017
807ce28
Fix dependencies.
garetht Aug 5, 2017
49f2a6a
Add JSX files.
garetht Aug 5, 2017
c857799
Cache node_modules and install dependencies.
garetht Aug 5, 2017
8e5483e
Fix Gulpfile.
garetht Aug 5, 2017
3c366e9
Upgrade build pipeline.
garetht Aug 5, 2017
ec2bcbd
Add Cypress.
garetht Aug 5, 2017
5c6ebab
Add first spec.
garetht Aug 5, 2017
6ee181e
Fix for cypress.
garetht Aug 5, 2017
b2cc7ac
Remove argument.
garetht Aug 5, 2017
6ca75e9
Install peer dependencies.
garetht Aug 5, 2017
22ae28f
Tweak config.
garetht Aug 5, 2017
3848461
Cache cypress and build examples.
garetht Aug 5, 2017
4e8b6bb
Exclude prop-types from the build.
garetht Aug 6, 2017
b324f73
Package and package lock updates.
garetht Aug 6, 2017
9549cd3
Touch up tests and eslint.
garetht Aug 6, 2017
fa40c97
Focus on specific properties.
garetht Aug 6, 2017
1dcfb89
Update examples.
garetht Aug 6, 2017
1596a17
Strip prop types for production builds.
garetht Aug 6, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"presets": ["es2015", "flow", "react"],
"plugins": ["transform-class-properties", "transform-object-rest-spread"],
"env": {
"production": {
"plugins": ["transform-react-remove-prop-types"]
}
}
}
50 changes: 12 additions & 38 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,52 +1,26 @@
{
"parser": "babel-eslint",

"rules": {
"curly": [2, "all"],
"indent": [2, 2, {"VariableDeclarator": 2}],
"linebreak-style": [2, "unix"],
"one-var": 0,
"space-before-function-paren": [2, "never"],

"react/jsx-boolean-value": 1,
"react/jsx-curly-spacing": [2, "never"],
"react/jsx-no-undef": 1,
"react/no-danger": 1,
"react/react-in-jsx-scope": 1
},

"globals": {
"require": false,
"module": false,
"global": false,

"SyntheticEvent": false,
"ReactElement": false,

"PreloadType": false,
"ElementHeight": false,
"CSSStyle": false,
"ReactInfiniteUtilityFunctions": false,
"ReactInfiniteProvidedDefaultProps": false,
"ReactInfiniteProps": false,
"ReactInfiniteComputedProps": false,
"ReactInfiniteState": false,
"InfiniteComputer": false
"global": false
},

"env": {
"es6": true,
"browser": true
},

"extends": ["semistandard"],

"ecmaFeatures": {
"jsx": true,
"experimentalObjectRestSpread": true
"rules": {
"react/no-did-update-set-state": "off",
"flowtype/define-flow-type": 1
},

"extends": [
"seatgeek-standard",
"seatgeek-react-standard"
],
"plugins": [
"react"
"react",
"prettier",
"flowtype"
]
}

9 changes: 6 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
sudo: false
language: node_js
node_js:
- 6
- lts/*
cache:
directories:
- node_modules
- /home/travis/.cypress/Cypress
env:
- TEST=1
- TYPECHECK=1
- LINT=1

- BROWSER=1
script:
- ./config/travis/test.sh
before_install: npm install react react-dom prop-types create-react-class
after_success: cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
58 changes: 31 additions & 27 deletions Gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ var del = require('del');

var browserifyCreator = require('./pipeline/browserify');

var args = require('yargs').alias('P', 'production')
.alias('D', 'development')
.alias('E', 'example').argv;
var args = require('yargs')
.alias('P', 'production')
.alias('D', 'development')
.alias('E', 'example').argv;

var envObject = {
production: args.production,
Expand All @@ -20,17 +21,21 @@ var buildFunction = browserifyCreator(false, envObject, INFINITE_SOURCE);

gulp.task('build-bundle', buildFunction);
gulp.task('cleanly-build-bundle', ['clean'], buildFunction);
gulp.task('watch-develop-bundle', browserifyCreator(true, {development: true}, INFINITE_SOURCE));
gulp.task(
'watch-develop-bundle',
browserifyCreator(true, { development: true }, INFINITE_SOURCE)
);

// This task builds everything for release: the dist
// folder is populated with react-infinite.js and
// react-infinite.min.js, while the build folder is
// provided with a copy of the source transpiled to ES5.
gulp.task('release', ['cleanly-build-bundle'], function() {
// Transpile CommonJS files to ES5 with React's tools.
gulp.src(['./src/**/*.js', './src/**/*.jsx'])
.pipe(babel())
.pipe(gulp.dest('build'));
gulp
.src(['./src/**/*.js', './src/**/*.jsx'])
.pipe(babel())
.pipe(gulp.dest('build'));
});

gulp.task('clean', function() {
Expand All @@ -40,31 +45,30 @@ gulp.task('clean', function() {
// This task is used to build the examples. It is used
// in the development watch function as well.
gulp.task('examples', function() {
gulp.src('./examples/*.jsx')
.pipe(babel())
.pipe(gulp.dest('examples'));
gulp.src('./examples/*.jsx').pipe(babel()).pipe(gulp.dest('examples'));
});

gulp.task('server', function() {
gulp.src(__dirname)
.pipe(server({
port: 8080,
directoryListing: true,
livereload: {
enable: true,
filter: function(filename) {
if (filename.match(__dirname + '/examples')) {
return true;
// The examples draw from /dist, which should change
// when the source files change
} else if (filename.match(__dirname + '/dist')) {
return true;
} else {
return false;
}
gulp.src(__dirname).pipe(
server({
port: 8080,
directoryListing: true,
livereload: {
enable: true,
filter: function(filename) {
if (filename.match(__dirname + '/examples')) {
return true;
// The examples draw from /dist, which should change
// when the source files change
} else if (filename.match(__dirname + '/dist')) {
return true;
} else {
return false;
}
}
}));
}
})
);
});

// This task is used for development. When run, it sets up
Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,6 @@ When working with the window as the scroll container, it is sometimes useful to
#### **Function** `handleScroll(DOMNode node)`
Defaults to `function(){}`. A function that is called when the container is scrolled, i.e. when the `onScroll` event of the infinite scrolling container is fired. The only argument passed to it is the native DOM [Node](https://developer.mozilla.org/en-US/docs/Web/API/Node) of the scrolling container.

#### **Number** `infiniteLoadBeginBottomOffset`
**Deprecated as of 0.6.0. Please use `infiniteLoadBeginEdgeOffset`, which is identical but renamed.**

#### **Number** `infiniteLoadBeginEdgeOffset`
Defaults to `undefined`, which means that infinite loading is disabled. To disable infinite loading, do not provide this property or set it to undefined.

Expand Down
Loading