Skip to content

Commit 1b91165

Browse files
authored
v3: remove intersection observer shim (#130)
* remove intersection observer shim * update package * fix lin
1 parent 78cf50b commit 1b91165

File tree

4 files changed

+1961
-1244
lines changed

4 files changed

+1961
-1244
lines changed

.eslintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"function-paren-newline": 0,
2424
"react/destructuring-assignment": 0,
2525
"react/require-default-props": 0,
26-
"no-confusing-arrow": 0
26+
"no-confusing-arrow": 0,
27+
"react/sort-comp": 0
2728
},
2829
"env": {
2930
"browser": true,

package.json

Lines changed: 32 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"testw": "yarn test -- --watchAll",
2121
"coverage": "jest --config ./jestConfig.json --coverage --coverageReporters=text-lcov | coveralls",
2222
"build": "rollup -c",
23-
"lint": "eslint ./src",
23+
"lint": "eslint ./src --fix",
2424
"prepublish": "yarn test && yarn flow && yarn lint && yarn run clean && yarn build",
2525
"flow": "flow"
2626
},
@@ -32,42 +32,42 @@
3232
"url": "https://github.com/bluebill1049/react-simple-img/issues"
3333
},
3434
"devDependencies": {
35-
"@babel/cli": "^7.0.0",
36-
"@babel/core": "^7.3.3",
37-
"@babel/plugin-proposal-class-properties": "^7.3.3",
38-
"@babel/plugin-proposal-decorators": "^7.3.0",
39-
"@babel/plugin-proposal-do-expressions": "^7.0.0",
40-
"@babel/plugin-proposal-export-default-from": "^7.0.0",
41-
"@babel/plugin-proposal-export-namespace-from": "^7.0.0",
42-
"@babel/plugin-proposal-function-bind": "^7.0.0",
43-
"@babel/plugin-proposal-function-sent": "^7.0.0",
44-
"@babel/plugin-proposal-json-strings": "^7.0.0",
45-
"@babel/plugin-proposal-logical-assignment-operators": "^7.0.0",
46-
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0",
47-
"@babel/plugin-proposal-numeric-separator": "^7.0.0",
48-
"@babel/plugin-proposal-optional-chaining": "^7.0.0",
49-
"@babel/plugin-proposal-pipeline-operator": "^7.3.2",
50-
"@babel/plugin-proposal-throw-expressions": "^7.0.0",
51-
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
52-
"@babel/plugin-syntax-import-meta": "^7.0.0",
53-
"@babel/plugin-transform-flow-strip-types": "^7.0.0",
54-
"@babel/preset-env": "^7.3.1",
55-
"@babel/preset-flow": "^7.0.0",
56-
"@babel/preset-react": "^7.0.0",
35+
"@babel/cli": "^7.16.0",
36+
"@babel/core": "^7.16.0",
37+
"@babel/plugin-proposal-class-properties": "^7.16.0",
38+
"@babel/plugin-proposal-decorators": "^7.16.0",
39+
"@babel/plugin-proposal-do-expressions": "^7.16.0",
40+
"@babel/plugin-proposal-export-default-from": "^7.16.0",
41+
"@babel/plugin-proposal-export-namespace-from": "^7.16.0",
42+
"@babel/plugin-proposal-function-bind": "^7.16.0",
43+
"@babel/plugin-proposal-function-sent": "^7.16.0",
44+
"@babel/plugin-proposal-json-strings": "^7.16.0",
45+
"@babel/plugin-proposal-logical-assignment-operators": "^7.16.0",
46+
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.0",
47+
"@babel/plugin-proposal-numeric-separator": "^7.16.0",
48+
"@babel/plugin-proposal-optional-chaining": "^7.16.0",
49+
"@babel/plugin-proposal-pipeline-operator": "^7.16.0",
50+
"@babel/plugin-proposal-throw-expressions": "^7.16.0",
51+
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
52+
"@babel/plugin-syntax-import-meta": "^7.10.4",
53+
"@babel/plugin-transform-flow-strip-types": "^7.16.0",
54+
"@babel/preset-env": "^7.16.0",
55+
"@babel/preset-flow": "^7.16.0",
56+
"@babel/preset-react": "^7.16.0",
5757
"babel-core": "^7.0.0-bridge.0",
58-
"babel-eslint": "^10.0.1",
58+
"babel-eslint": "^10.1.0",
5959
"babel-jest": "^24.1.0",
6060
"babel-polyfill": "^6.26.0",
61-
"coveralls": "^3.0.2",
62-
"enzyme": "^3.9.0",
63-
"enzyme-adapter-react-16": "^1.9.1",
61+
"coveralls": "^3.1.1",
62+
"enzyme": "^3.11.0",
63+
"enzyme-adapter-react-16": "^1.15.6",
6464
"eslint": "^5.14.1",
6565
"eslint-config-airbnb": "^17.1.0",
66-
"eslint-plugin-babel": "^5.3.0",
66+
"eslint-plugin-babel": "^5.3.1",
6767
"eslint-plugin-flowtype": "^3.4.2",
68-
"eslint-plugin-import": "^2.16.0",
69-
"eslint-plugin-jsx-a11y": "^6.2.1",
70-
"eslint-plugin-react": "^7.12.4",
68+
"eslint-plugin-import": "^2.25.2",
69+
"eslint-plugin-jsx-a11y": "^6.4.1",
70+
"eslint-plugin-react": "^7.26.1",
7171
"flow-bin": "^0.93.0",
7272
"flow-typed": "^2.1.5",
7373
"jest": "^24.1.0",
@@ -76,16 +76,13 @@
7676
"react-test-renderer": "^16.8.3",
7777
"rimraf": "^2.6.3",
7878
"rollup": "^1.2.2",
79-
"rollup-plugin-babel": "^4.3.2",
79+
"rollup-plugin-babel": "^4.4.0",
8080
"rollup-plugin-commonjs": "^9.2.0",
8181
"rollup-plugin-copy": "3.1.0",
8282
"rollup-plugin-flow": "^1.1.1"
8383
},
8484
"peerDependencies": {
8585
"react": ">= 16.3.0",
8686
"react-dom": ">= 16.3.0"
87-
},
88-
"dependencies": {
89-
"intersection-observer": "^0.5.1"
9087
}
9188
}

src/logic/observerStart.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ export default function observerStart(
2424
disableAnimateCachedImg: boolean = false,
2525
logConsoleError: boolean,
2626
) {
27-
if (!window.IntersectionObserver) require('intersection-observer');
2827
// $FlowIgnoreLine:
2928
const observer = new IntersectionObserver(entries => onIntersection(entries), config);
3029

0 commit comments

Comments
 (0)