Skip to content

Commit 9d07d31

Browse files
committed
use Leaflet v2
1 parent 374882f commit 9d07d31

33 files changed

+1827
-1450
lines changed

.swcrc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
"syntax": "typescript",
55
"tsx": true
66
},
7-
"target": "es2020"
7+
"target": "es2022",
8+
"transform": {
9+
"react": {
10+
"runtime": "automatic"
11+
}
12+
}
813
}
914
}

biome.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.0.4/schema.json",
2+
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
33
"assist": { "actions": { "source": { "organizeImports": "on" } } },
44
"formatter": {
55
"enabled": true,
@@ -12,11 +12,7 @@
1212
},
1313
"javascript": {
1414
"formatter": {
15-
"arrowParentheses": "always",
1615
"bracketSameLine": true,
17-
"bracketSpacing": true,
18-
"jsxQuoteStyle": "double",
19-
"quoteProperties": "asNeeded",
2016
"quoteStyle": "single",
2117
"semicolons": "asNeeded",
2218
"trailingCommas": "all"

example/App.tsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,15 @@
11
import type { LatLngTuple } from 'leaflet'
2-
import React from 'react'
32
import { MapContainer, Marker, Popup, TileLayer } from 'react-leaflet'
43

5-
const position: LatLngTuple = [51.505, -0.09,]
4+
const position: LatLngTuple = [51.505, -0.09]
65

76
export default function App() {
87
return (
98
<MapContainer center={position} zoom={13} scrollWheelZoom={false}>
10-
<TileLayer
11-
attribution='&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
12-
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
13-
/>
9+
<TileLayer url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" />
1410
<Marker position={position}>
15-
<Popup>
16-
A pretty CSS3 popup. <br />
17-
</Popup>
11+
<Popup>A pretty CSS3 popup.</Popup>
1812
</Marker>
1913
</MapContainer>
2014
)
21-
}
15+
}

example/index.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
.leaflet-container {
22
height: 400px;
3-
}
3+
}

example/index.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
<head>
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6-
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css"
7-
integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY="
8-
crossorigin=""/>
6+
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" />
97
<title>React-Leaflet example</title>
108
</head>
119
<body>

example/main.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import React from 'react'
2-
import ReactDOM from 'react-dom/client'
1+
import { StrictMode } from 'react'
2+
import { createRoot } from 'react-dom/client'
33

4-
import App from './App.tsx'
4+
import App from './App.js'
55
import './index.css'
66

77
// biome-ignore lint/style/noNonNullAssertion: DOM root exists
8-
ReactDOM.createRoot(document.getElementById('root')!).render(
9-
<React.StrictMode>
8+
createRoot(document.getElementById('root')!).render(
9+
<StrictMode>
1010
<App />
11-
</React.StrictMode>,
12-
)
11+
</StrictMode>,
12+
)

example/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
"start": "vite"
88
},
99
"dependencies": {
10-
"react": "^19.0.0",
11-
"react-dom": "^19.0.0",
10+
"react": "^19.1.1",
11+
"react-dom": "^19.1.1",
1212
"react-leaflet": "workspace:^"
1313
},
1414
"devDependencies": {
15-
"@types/react": "^19.1.8",
16-
"@types/react-dom": "^19.1.6",
17-
"@vitejs/plugin-react": "^4.5.2",
18-
"typescript": "^5.7.2",
19-
"vite": "^6.0.3"
15+
"@types/react": "^19.1.9",
16+
"@types/react-dom": "^19.1.7",
17+
"@vitejs/plugin-react": "^4.7.0",
18+
"typescript": "^5.9.2",
19+
"vite": "^7.0.6"
2020
}
2121
}

example/tsconfig.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"compilerOptions": {
3+
"jsx": "react-jsx",
4+
"jsxImportSource": "react",
5+
"lib": ["dom", "es2024"],
6+
"moduleResolution": "node",
7+
"strict": true,
8+
"target": "es2024",
9+
"baseUrl": "./",
10+
"paths": {
11+
"react-leaflet": ["../packages/react-leaflet/src"]
12+
}
13+
},
14+
"include": ["./**/*"]
15+
}

package.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,31 @@
33
"version": "1.0.0",
44
"private": true,
55
"type": "module",
6-
"packageManager": "pnpm@10.12.1",
6+
"packageManager": "pnpm@10.14.0",
77
"scripts": {
8-
"lint": "biome check --write ./packages",
9-
"lint:ci": "biome ci ./packages",
10-
"test": "turbo run test:unit",
8+
"lint": "biome check --write ./example ./packages",
9+
"lint:ci": "biome ci ./example ./packages",
10+
"test": "pnpm run -r test:unit",
1111
"build": "turbo run build:clean && pnpm run -r build:types && turbo run build:js"
1212
},
1313
"devDependencies": {
14-
"@biomejs/biome": "^2.0.4",
14+
"@biomejs/biome": "^2.1.3",
1515
"@skypack/package-check": "^0.2.2",
16-
"@swc/cli": "^0.7.7",
17-
"@swc/core": "^1.12.5",
18-
"@swc/jest": "^0.2.37",
16+
"@swc/cli": "^0.7.8",
17+
"@swc/core": "^1.13.3",
18+
"@swc/jest": "^0.2.39",
1919
"@testing-library/react": "^16.1.0",
2020
"@types/jest": "^30.0.0",
21-
"@types/leaflet": "^1.9.15",
21+
"@types/leaflet": "^1.9.20",
2222
"@types/warning": "^3.0.0",
2323
"del-cli": "^6.0.0",
24-
"jest": "^30.0.2",
25-
"jest-environment-jsdom": "^30.0.2",
24+
"jest": "^30.0.5",
25+
"jest-environment-jsdom": "^30.0.5",
2626
"leaflet": "^1.9.3",
27-
"react": "^19.0.0",
28-
"react-dom": "^19.0.0",
29-
"turbo": "^2.5.4",
30-
"typescript": "^5.7.2"
27+
"react": "^19.1.1",
28+
"react-dom": "^19.1.1",
29+
"turbo": "^2.5.5",
30+
"typescript": "^5.9.2"
3131
},
3232
"jest": {
3333
"projects": [

packages/core/__tests__/components.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { jest } from '@jest/globals'
22
import { act, render, screen } from '@testing-library/react'
33
import { StrictMode, useEffect, useRef } from 'react'
4-
import * as React from 'react'
54

65
import {
76
createContainerComponent,

0 commit comments

Comments
 (0)