Skip to content

Commit 3d4ad27

Browse files
committed
Replace lodash-es with es-toolkit and bump ECMAScript version to 2022
1 parent 11930ca commit 3d4ad27

37 files changed

+74
-102
lines changed

.github/workflows/es2020-compatibility.yml renamed to .github/workflows/es2022-compatibility.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: Compatibility Checks
22
on: [push, pull_request]
33
jobs:
4-
es2020-compatibility:
5-
name: ES2020 (${{ matrix.adapter }})
4+
es2022-compatibility:
5+
name: ES2022 (${{ matrix.adapter }})
66
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
77
runs-on: ubuntu-24.04
88
timeout-minutes: 15
@@ -34,5 +34,5 @@ jobs:
3434
if: matrix.adapter != 'core'
3535
run: pnpm -r --filter ./packages/core build
3636

37-
- name: Validate ES2020 compatibility
38-
run: pnpm -r --filter ./packages/${{ matrix.adapter }}* es2020-check
37+
- name: Validate ES2022 compatibility
38+
run: pnpm -r --filter ./packages/${{ matrix.adapter }}* es2022-check

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,8 @@ For changes prior to v1.0.0, see the [legacy releases](https://legacy.inertiajs.
300300
* Fix for Form Component in Svelte when resetting use input/button by [@pascalbaljet](https://github.com/pascalbaljet) in https://github.com/inertiajs/inertia/pull/2525
301301
* Improve Link component `as` prop by [@pascalbaljet](https://github.com/pascalbaljet) in https://github.com/inertiajs/inertia/pull/2524
302302
* [v2.x] fix: type error by changing page props type to `any` by [@peaklabs-dev](https://github.com/peaklabs-dev) in https://github.com/inertiajs/inertia/pull/2520
303-
* Revert to back to Lodash to retain ES2020 compatibility by [@pascalbaljet](https://github.com/pascalbaljet) in https://github.com/inertiajs/inertia/pull/2527
304-
* Verify ES2020 compatibility in CI by [@pascalbaljet](https://github.com/pascalbaljet) in https://github.com/inertiajs/inertia/pull/2530
303+
* Revert to back to Lodash to retain ES2022 compatibility by [@pascalbaljet](https://github.com/pascalbaljet) in https://github.com/inertiajs/inertia/pull/2527
304+
* Verify ES2022 compatibility in CI by [@pascalbaljet](https://github.com/pascalbaljet) in https://github.com/inertiajs/inertia/pull/2530
305305
* [Vue] Fixing action attribute on Form Component when using Wayfinder by [@nicolagianelli](https://github.com/nicolagianelli) in https://github.com/inertiajs/inertia/pull/2532
306306
* Make package.json structure in Svelte package Consistent as Vue and React by [@kresnasatya](https://github.com/kresnasatya) in https://github.com/inertiajs/inertia/pull/2529
307307
* Remove Svelte 5-next version constraint by [@pascalbaljet](https://github.com/pascalbaljet) in https://github.com/inertiajs/inertia/pull/2533

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"dev:test-app:react": "pnpx concurrently -c \"#c4b5fd,#ffa800\" \"cd tests/app && PACKAGE=react pnpm serve:watch\" \"cd packages/react/test-app && pnpm run dev\" --names=server,vite",
1414
"dev:test-app:svelte": "pnpx concurrently -c \"#c4b5fd,#ffa800\" \"cd tests/app && PACKAGE=svelte pnpm serve:watch\" \"cd packages/svelte/test-app && pnpm run dev\" --names=server,vite",
1515
"dev:test-app:vue": "pnpx concurrently -c \"#c4b5fd,#ffa800\" \"cd tests/app && PACKAGE=vue3 pnpm serve:watch\" \"cd packages/vue3/test-app && pnpm run dev\" --names=server,vite",
16-
"es2020-check": "pnpm -r --filter './packages/*' es2020-check",
16+
"es2022-check": "pnpm -r --filter './packages/*' es2022-check",
1717
"lint:test-app": "pnpm -r --filter './packages/*/test-app' lint",
1818
"lint:test-app:react": "cd packages/react/test-app && pnpm run lint",
1919
"lint:test-app:svelte": "cd packages/svelte/test-app && pnpm run lint",
@@ -41,4 +41,4 @@
4141
"optionalDependencies": {
4242
"@rollup/rollup-linux-x64-gnu": "^4.53.3"
4343
}
44-
}
44+
}

packages/core/build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const config = {
99
bundle: true,
1010
minify: false,
1111
sourcemap: withDeps ? false : true,
12-
target: 'es2020',
12+
target: 'es2022',
1313
plugins: [
1414
...(withDeps ? [] : [nodeExternalsPlugin()]),
1515
{

packages/core/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,11 @@
5050
"dev": "pnpx concurrently -c \"#ffcf00,#3178c6\" \"pnpm dev:build\" \"pnpm dev:types\" --names build,types",
5151
"dev:build": "./build.js --watch",
5252
"dev:types": "tsc --watch --preserveWatchOutput",
53-
"es2020-check": "pnpm build:with-deps && es-check es2020 \"dist/index.esm.js\" --checkFeatures --module --noCache --verbose"
53+
"es2022-check": "pnpm build:with-deps && es-check es2022 \"dist/index.esm.js\" --checkFeatures --module --noCache --verbose"
5454
},
5555
"dependencies": {
56-
"@types/lodash-es": "^4.17.12",
5756
"axios": "^1.13.2",
58-
"lodash-es": "^4.17.21",
57+
"es-toolkit": "^1.42.0",
5958
"qs": "^6.14.0"
6059
},
6160
"devDependencies": {
@@ -68,4 +67,4 @@
6867
"esbuild-node-externals": "^1.20.1",
6968
"typescript": "^5.9.3"
7069
}
71-
}
70+
}

packages/core/src/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { get, has, set } from 'lodash-es'
1+
import { get, has, set } from 'es-toolkit/compat'
22
import { InertiaAppConfig } from './types'
33

44
// Generate all possible nested paths

packages/core/src/formObject.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { get, set } from 'lodash-es'
1+
import { get, set } from 'es-toolkit/compat'
22
import { isFile } from './files'
33
import { FormDataConvertible } from './types'
44

packages/core/src/history.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { cloneDeep, isEqual } from 'lodash-es'
1+
import { cloneDeep, isEqual } from 'es-toolkit/compat'
22
import { decryptHistory, encryptHistory, historySessionStorageKeys } from './encryption'
33
import { page as currentPage } from './page'
44
import Queue from './queue'

packages/core/src/prefetched.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { cloneDeep } from 'lodash-es'
1+
import { cloneDeep } from 'es-toolkit/compat'
22
import { objectsAreEqual } from './objectUtils'
33
import { Response } from './response'
44
import { timeToMs } from './time'

packages/core/src/response.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { AxiosResponse } from 'axios'
2-
import { get, isEqual, set } from 'lodash-es'
2+
import { get, isEqual, set } from 'es-toolkit/compat'
33
import { config, router } from '.'
44
import dialog from './dialog'
55
import {

0 commit comments

Comments
 (0)