Skip to content

Commit b9105c8

Browse files
authored
Updated all npm + Python deps except React Router [Feb 2025] (#224)
1 parent 0298597 commit b9105c8

File tree

8 files changed

+382
-511
lines changed

8 files changed

+382
-511
lines changed

requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
flask == 3.1.0
22
flask-compress == 1.17
33
flask-cors == 5.0.0
4-
litecli == 1.13.2
5-
google-cloud-logging == 3.11.3
4+
litecli == 1.14.4
5+
google-cloud-logging == 3.11.4
66
google-compute-engine == 2.8.13
77
gunicorn == 23.0.0
8-
protobuf == 5.29.2
8+
protobuf == 5.29.3
99
requests == 2.32.3
1010
supervisor == 4.2.5

website/package-lock.json

Lines changed: 299 additions & 368 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

website/package.json

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,36 @@
44
"private": true,
55
"type": "module",
66
"dependencies": {
7-
"@tsparticles/react": "^3.0.0",
87
"d3": "^7.9.0",
98
"lodash": "^4.17.21",
10-
"react": "^18.3.1",
9+
"react": "^19.0.0",
1110
"react-autosuggest": "^10.1.0",
12-
"react-dom": "^18.3.1",
11+
"react-dom": "^19.0.0",
1312
"react-helmet": "^6.1.0",
14-
"react-lazyload": "^3.2.1",
1513
"react-modal": "^3.16.3",
1614
"react-router-dom": "^6.27.0",
17-
"styled-components": "^6.1.13",
15+
"styled-components": "^6.1.14",
1816
"typeface-crimson-text": "1.1.13",
1917
"typeface-quicksand": "1.1.13"
2018
},
2119
"devDependencies": {
22-
"@ianvs/prettier-plugin-sort-imports": "^4.4.0",
20+
"@ianvs/prettier-plugin-sort-imports": "^4.4.1",
2321
"@types/d3": "^7.4.3",
24-
"@types/lodash": "^4.17.13",
25-
"@types/node": "^22.10.3",
26-
"@types/react": "^18.3.12",
22+
"@types/lodash": "^4.17.15",
23+
"@types/node": "^22.13.0",
24+
"@types/react": "^19.0.8",
2725
"@types/react-autosuggest": "^10.1.11",
28-
"@types/react-dom": "^18.3.1",
26+
"@types/react-dom": "^19.0.3",
2927
"@types/react-helmet": "^6.1.11",
30-
"@types/react-lazyload": "^3.2.3",
3128
"@types/react-modal": "^3.16.3",
3229
"@vitejs/plugin-react": "^4.3.4",
33-
"eslint": "^9.17.0",
30+
"eslint": "^9.19.0",
3431
"eslint-plugin-react-hooks": "^5.1.0",
3532
"globals": "^15.14.0",
3633
"prettier": "^3.4.2",
3734
"source-map-explorer": "^2.5.3",
38-
"typescript": "^5.7.2",
39-
"typescript-eslint": "^8.19.0",
35+
"typescript": "^5.7.3",
36+
"typescript-eslint": "^8.22.0",
4037
"vite": "^6.0.11"
4138
},
4239
"scripts": {

website/src/components/App.tsx

Lines changed: 23 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
import Particles from '@tsparticles/react';
21
import React, {lazy, Suspense} from 'react';
32
import {BrowserRouter, Navigate, Route, Routes} from 'react-router-dom';
43
import {ThemeProvider} from 'styled-components';
54

6-
import particlesConfig from '../resources/particles.config.json';
75
import theme from '../resources/theme.json';
86
import {Home} from './Home';
97

@@ -15,40 +13,29 @@ const AsyncBlogPost = lazy(() =>
1513
export const App: React.FC = () => {
1614
return (
1715
<ThemeProvider theme={theme}>
18-
<>
19-
<Particles
20-
options={particlesConfig}
21-
style={{
22-
position: 'fixed',
23-
top: 0,
24-
left: 0,
25-
zIndex: -1,
26-
}}
27-
/>
28-
<BrowserRouter>
29-
<Routes>
30-
<Route path="/" element={<Home />} />
31-
<Route
32-
path="/blog"
33-
element={
34-
<Suspense fallback={null}>
35-
<AsyncBlog />
36-
</Suspense>
37-
}
38-
/>
39-
<Route
40-
path="/blog/:postId"
41-
element={
42-
<Suspense fallback={null}>
43-
<AsyncBlogPost />
44-
</Suspense>
45-
}
46-
/>
47-
{/* Redirect unmatched routes to home page, replacing history stack. */}
48-
<Route path="*" element={<Navigate to="/" replace />} />
49-
</Routes>
50-
</BrowserRouter>
51-
</>
16+
<BrowserRouter>
17+
<Routes>
18+
<Route path="/" element={<Home />} />
19+
<Route
20+
path="/blog"
21+
element={
22+
<Suspense fallback={null}>
23+
<AsyncBlog />
24+
</Suspense>
25+
}
26+
/>
27+
<Route
28+
path="/blog/:postId"
29+
element={
30+
<Suspense fallback={null}>
31+
<AsyncBlogPost />
32+
</Suspense>
33+
}
34+
/>
35+
{/* Redirect unmatched routes to home page, replacing history stack. */}
36+
<Route path="*" element={<Navigate to="/" replace />} />
37+
</Routes>
38+
</BrowserRouter>
5239
</ThemeProvider>
5340
);
5441
};

website/src/components/ResultsList.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import * as d3 from 'd3';
22
import React from 'react';
3-
import LazyLoad from 'react-lazyload';
43
import styled from 'styled-components';
54

65
import defaultPageThumbnail from '../images/defaultPageThumbnail.png';
76
import {WikipediaPage, WikipediaPageId} from '../types';
7+
import {LazyLoadWrapper} from './common/LazyLoadWrapper';
88

99
const ResultsListWrapper = styled.div`
1010
margin: 0 auto;
@@ -146,17 +146,16 @@ export const ResultsList: React.FC<{
146146
const maxResultsToDisplay = 50;
147147
const numHiddenPaths = paths.length - maxResultsToDisplay;
148148

149-
// Only display a limited number of results, lazily loading all of them.
150-
const resultsListItems = paths.slice(0, maxResultsToDisplay).map((path, i) => (
151-
<LazyLoad once={true} offset={200} key={i}>
152-
<ResultListItem path={path} pagesById={pagesById} />
153-
</LazyLoad>
154-
));
149+
const resultsListItems = paths
150+
.slice(0, maxResultsToDisplay)
151+
.map((path, i) => <ResultListItem key={i} path={path} pagesById={pagesById} />);
155152

156153
return (
157154
<>
158155
<ResultsListHeader>Individual paths</ResultsListHeader>
159-
<ResultsListWrapper>{resultsListItems}</ResultsListWrapper>
156+
<LazyLoadWrapper fallback={null}>
157+
<ResultsListWrapper>{resultsListItems}</ResultsListWrapper>
158+
</LazyLoadWrapper>
160159
{numHiddenPaths > 0 && (
161160
<ResultsListOtherPathsText>
162161
Not showing {numHiddenPaths} more path{numHiddenPaths !== 1 && 's'}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import React, {Suspense, useEffect, useRef, useState} from 'react';
2+
3+
export const LazyLoadWrapper: React.FC<{
4+
readonly children: React.ReactNode;
5+
readonly fallback: React.ReactNode;
6+
readonly rootMargin?: string;
7+
}> = (args) => {
8+
const {children, fallback, rootMargin = '200px'} = args;
9+
10+
const [isVisible, setIsVisible] = useState(false);
11+
const ref = useRef<HTMLDivElement>(null);
12+
13+
useEffect(() => {
14+
const observer = new IntersectionObserver(
15+
([entry]) => {
16+
if (entry.isIntersecting) {
17+
setIsVisible(true);
18+
observer.disconnect();
19+
}
20+
},
21+
{rootMargin}
22+
);
23+
24+
if (ref.current) {
25+
observer.observe(ref.current);
26+
}
27+
28+
return () => observer.disconnect();
29+
}, [rootMargin]);
30+
31+
return (
32+
<div ref={ref}>
33+
{isVisible ? <Suspense fallback={fallback}>{children}</Suspense> : fallback}
34+
</div>
35+
);
36+
};

website/src/resources/particles.config.json

Lines changed: 0 additions & 82 deletions
This file was deleted.

website/tsconfig.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
"moduleResolution": "bundler",
1010
"isolatedModules": true,
1111

12+
// TODO: Remove this once migrating off styled-components.
13+
"skipLibCheck": true,
14+
1215
// Miscellaneous configuration.
1316
"jsx": "react-jsx", // Use React JSX.
1417
"strict": true, // Enable strict type checking.

0 commit comments

Comments
 (0)