From a50e4c852694588da5689650abda3f67791e503f Mon Sep 17 00:00:00 2001 From: antoine Date: Tue, 17 Dec 2024 16:24:52 +0100 Subject: [PATCH] Update inertia --- composer.json | 6 ++-- demo/composer.json | 2 +- demo/composer.lock | 28 ++++++++--------- package-lock.json | 32 +++++++++---------- package.json | 2 +- resources/js/form/components/useFormTabs.ts | 7 +---- tests-e2e/site/composer.json | 6 ++-- tests-e2e/site/composer.lock | 35 ++++++++++----------- 8 files changed, 54 insertions(+), 64 deletions(-) diff --git a/composer.json b/composer.json index c2d8959b4..90367c5fd 100644 --- a/composer.json +++ b/composer.json @@ -16,15 +16,15 @@ "ext-dom": "*", "blade-ui-kit/blade-icons": "^1.6", "code16/laravel-content-renderer": "^1.1", - "inertiajs/inertia-laravel": "^1.0", + "inertiajs/inertia-laravel": "^2.0", "intervention/image": "^3.4", "intervention/image-laravel": "^1.2", "laravel/framework": "^11.0", + "laravel/prompts": "0.*", "league/commonmark": "^2.4", "masterminds/html5": "^2.8", "spatie/image-optimizer": "^1.6", - "tightenco/ziggy": "^2.0", - "laravel/prompts": "0.*" + "tightenco/ziggy": "^2.0" }, "require-dev": { "brianium/paratest": "^7.0", diff --git a/demo/composer.json b/demo/composer.json index e23f49e8f..d65649d18 100644 --- a/demo/composer.json +++ b/demo/composer.json @@ -7,7 +7,7 @@ "blade-ui-kit/blade-icons": "^1.6", "code16/laravel-content-renderer": "^1.2", "guzzlehttp/guzzle": "^7.2", - "inertiajs/inertia-laravel": "^1.0", + "inertiajs/inertia-laravel": "^2.0", "intervention/image": "^3.4", "intervention/image-laravel": "^1.2", "laravel/framework": "^11.0", diff --git a/demo/composer.lock b/demo/composer.lock index 31460a8af..c8955d43b 100644 --- a/demo/composer.lock +++ b/demo/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "78ff09439db90d1096dcf9a61d00901f", + "content-hash": "dd087c87d1557269d23566a4007c223a", "packages": [ { "name": "bacon/bacon-qr-code", @@ -1305,28 +1305,29 @@ }, { "name": "inertiajs/inertia-laravel", - "version": "v1.3.2", + "version": "v2.0.0", "source": { "type": "git", "url": "https://github.com/inertiajs/inertia-laravel.git", - "reference": "7e6a030ffab315099782a4844a2175455f511c68" + "reference": "0259e37f802bc39c814c42ba92c04ada17921f70" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/inertiajs/inertia-laravel/zipball/7e6a030ffab315099782a4844a2175455f511c68", - "reference": "7e6a030ffab315099782a4844a2175455f511c68", + "url": "https://api.github.com/repos/inertiajs/inertia-laravel/zipball/0259e37f802bc39c814c42ba92c04ada17921f70", + "reference": "0259e37f802bc39c814c42ba92c04ada17921f70", "shasum": "" }, "require": { "ext-json": "*", - "laravel/framework": "^8.74|^9.0|^10.0|^11.0", - "php": "^7.3|~8.0.0|~8.1.0|~8.2.0|~8.3.0|~8.4.0", - "symfony/console": "^5.3|^6.0|^7.0" + "laravel/framework": "^10.0|^11.0", + "php": "^8.1.0", + "symfony/console": "^6.2|^7.0" }, "require-dev": { + "laravel/pint": "^1.16", "mockery/mockery": "^1.3.3", - "orchestra/testbench": "^6.45|^7.44|^8.25|^9.3", - "phpunit/phpunit": "^8.0|^9.5.8|^10.4", + "orchestra/testbench": "^8.0|^9.2", + "phpunit/phpunit": "^10.4|^11.0", "roave/security-advisories": "dev-master" }, "suggest": { @@ -1338,9 +1339,6 @@ "providers": [ "Inertia\\ServiceProvider" ] - }, - "branch-alias": { - "dev-master": "1.x-dev" } }, "autoload": { @@ -1369,7 +1367,7 @@ ], "support": { "issues": "https://github.com/inertiajs/inertia-laravel/issues", - "source": "https://github.com/inertiajs/inertia-laravel/tree/v1.3.2" + "source": "https://github.com/inertiajs/inertia-laravel/tree/v2.0.0" }, "funding": [ { @@ -1377,7 +1375,7 @@ "type": "github" } ], - "time": "2024-12-05T14:52:50+00:00" + "time": "2024-12-13T02:48:29+00:00" }, { "name": "intervention/gif", diff --git a/package-lock.json b/package-lock.json index 4e2a177b6..16793f9ec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "@googlemaps/js-api-loader": "^1.16.8", "@headlessui/vue": "^1.7.19", "@heroicons/vue": "^2.0.18", - "@inertiajs/vue3": "^1.2.0", + "@inertiajs/vue3": "^2.0.0", "@tiptap/core": "^2.2.2", "@tiptap/extension-character-count": "^2.2.2", "@tiptap/extension-code-block": "^2.2.2", @@ -2725,22 +2725,21 @@ } }, "node_modules/@inertiajs/core": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@inertiajs/core/-/core-1.2.0.tgz", - "integrity": "sha512-6U0gqCPbGGGMcLoDm+ckKipc5gptZMmfVFfPGdO7vlO7yipWf1RD+TKkcZGJklFvfgFMKwK2VPw8GAv1OctuQA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@inertiajs/core/-/core-2.0.0.tgz", + "integrity": "sha512-2kvlk731NjwfXUku/ZoXsZNcOzx985icHtTC1dgN+8sAZtJfEg9QBrQ7sBjeLYiWtKgobJdwwpeDaexEneAtLQ==", "dependencies": { "axios": "^1.6.0", "deepmerge": "^4.0.0", - "nprogress": "^0.2.0", "qs": "^6.9.0" } }, "node_modules/@inertiajs/vue3": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@inertiajs/vue3/-/vue3-1.2.0.tgz", - "integrity": "sha512-Y6AsvwIK/E1pQKAMp8B7i99CbNApcTYb7j8R+TXM/AFQG6yBlQ1Qb9oFMItb6VimXSnDyfO4+FWe/JPLk9OIVA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@inertiajs/vue3/-/vue3-2.0.0.tgz", + "integrity": "sha512-U38EM8jqlfX2WmVK/vJWZr+jD71qvnmNPnUuZ+4mS2QNFdNmUeg2M/HbLmvR4WLWsxIl+7GYQySy4sW3tu/uTA==", "dependencies": { - "@inertiajs/core": "1.2.0", + "@inertiajs/core": "2.0.0", "lodash.clonedeep": "^4.5.0", "lodash.isequal": "^4.5.0" }, @@ -25783,22 +25782,21 @@ "requires": {} }, "@inertiajs/core": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@inertiajs/core/-/core-1.2.0.tgz", - "integrity": "sha512-6U0gqCPbGGGMcLoDm+ckKipc5gptZMmfVFfPGdO7vlO7yipWf1RD+TKkcZGJklFvfgFMKwK2VPw8GAv1OctuQA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@inertiajs/core/-/core-2.0.0.tgz", + "integrity": "sha512-2kvlk731NjwfXUku/ZoXsZNcOzx985icHtTC1dgN+8sAZtJfEg9QBrQ7sBjeLYiWtKgobJdwwpeDaexEneAtLQ==", "requires": { "axios": "^1.6.0", "deepmerge": "^4.0.0", - "nprogress": "^0.2.0", "qs": "^6.9.0" } }, "@inertiajs/vue3": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@inertiajs/vue3/-/vue3-1.2.0.tgz", - "integrity": "sha512-Y6AsvwIK/E1pQKAMp8B7i99CbNApcTYb7j8R+TXM/AFQG6yBlQ1Qb9oFMItb6VimXSnDyfO4+FWe/JPLk9OIVA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@inertiajs/vue3/-/vue3-2.0.0.tgz", + "integrity": "sha512-U38EM8jqlfX2WmVK/vJWZr+jD71qvnmNPnUuZ+4mS2QNFdNmUeg2M/HbLmvR4WLWsxIl+7GYQySy4sW3tu/uTA==", "requires": { - "@inertiajs/core": "1.2.0", + "@inertiajs/core": "2.0.0", "lodash.clonedeep": "^4.5.0", "lodash.isequal": "^4.5.0" } diff --git a/package.json b/package.json index e3ee59ccf..81323d475 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "@googlemaps/js-api-loader": "^1.16.8", "@headlessui/vue": "^1.7.19", "@heroicons/vue": "^2.0.18", - "@inertiajs/vue3": "^1.2.0", + "@inertiajs/vue3": "^2.0.0", "@tiptap/core": "^2.2.2", "@tiptap/extension-character-count": "^2.2.2", "@tiptap/extension-code-block": "^2.2.2", diff --git a/resources/js/form/components/useFormTabs.ts b/resources/js/form/components/useFormTabs.ts index 18c822adf..7b5d01f16 100644 --- a/resources/js/form/components/useFormTabs.ts +++ b/resources/js/form/components/useFormTabs.ts @@ -14,12 +14,7 @@ export function useFormTabs(props: { form: FormData }) { if(props.form.layout.tabbed && props.form.layout.tabs.length > 1) { watch(selectedTabSlug, () => { const url = location.origin + location.pathname + `?tab=${selectedTabSlug.value}`; - // @ts-ignore - router.page.url = url; - // @ts-ignore - history.replaceState(router.page, null, url); - // todo inertia v2 router.page doesn't exist so we will have to hack with popstate event - // window.dispatchEvent(new PopStateEvent('popstate')); + router.replace({ url, preserveState: true }); }, { immediate: true }); } diff --git a/tests-e2e/site/composer.json b/tests-e2e/site/composer.json index dea398af9..25bc577ab 100644 --- a/tests-e2e/site/composer.json +++ b/tests-e2e/site/composer.json @@ -7,9 +7,10 @@ "license": "MIT", "require": { "php": "^8.2", + "ext-json": "*", "blade-ui-kit/blade-icons": "^1.7", "code16/laravel-content-renderer": "^1.2", - "inertiajs/inertia-laravel": "^1.3", + "inertiajs/inertia-laravel": "^2.0", "intervention/image": "^3.9", "intervention/image-laravel": "^1.3", "laravel/framework": "^11.31", @@ -17,8 +18,7 @@ "spatie/laravel-db-snapshots": "^2.6", "spatie/laravel-ray": "^1.37", "spatie/laravel-translatable": "^6.8", - "tightenco/ziggy": "^2.4", - "ext-json": "*" + "tightenco/ziggy": "^2.4" }, "require-dev": { "fakerphp/faker": "^1.23", diff --git a/tests-e2e/site/composer.lock b/tests-e2e/site/composer.lock index 4841ad394..0df661832 100644 --- a/tests-e2e/site/composer.lock +++ b/tests-e2e/site/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "6d322510e7a88ba7a2ee9462abb7fcdd", + "content-hash": "e58b8dc749b5298f3fa8f7c2e50a156c", "packages": [ { "name": "blade-ui-kit/blade-icons", @@ -1201,28 +1201,29 @@ }, { "name": "inertiajs/inertia-laravel", - "version": "v1.3.1", + "version": "v2.0.0", "source": { "type": "git", "url": "https://github.com/inertiajs/inertia-laravel.git", - "reference": "c4026af538c21355a11c4f90f2a9e0bad7abd88d" + "reference": "0259e37f802bc39c814c42ba92c04ada17921f70" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/inertiajs/inertia-laravel/zipball/c4026af538c21355a11c4f90f2a9e0bad7abd88d", - "reference": "c4026af538c21355a11c4f90f2a9e0bad7abd88d", + "url": "https://api.github.com/repos/inertiajs/inertia-laravel/zipball/0259e37f802bc39c814c42ba92c04ada17921f70", + "reference": "0259e37f802bc39c814c42ba92c04ada17921f70", "shasum": "" }, "require": { "ext-json": "*", - "laravel/framework": "^8.74|^9.0|^10.0|^11.0", - "php": "^7.3|~8.0.0|~8.1.0|~8.2.0|~8.3.0|~8.4.0", - "symfony/console": "^5.3|^6.0|^7.0" + "laravel/framework": "^10.0|^11.0", + "php": "^8.1.0", + "symfony/console": "^6.2|^7.0" }, "require-dev": { + "laravel/pint": "^1.16", "mockery/mockery": "^1.3.3", - "orchestra/testbench": "^6.45|^7.44|^8.25|^9.3", - "phpunit/phpunit": "^8.0|^9.5.8|^10.4", + "orchestra/testbench": "^8.0|^9.2", + "phpunit/phpunit": "^10.4|^11.0", "roave/security-advisories": "dev-master" }, "suggest": { @@ -1234,9 +1235,6 @@ "providers": [ "Inertia\\ServiceProvider" ] - }, - "branch-alias": { - "dev-master": "1.x-dev" } }, "autoload": { @@ -1265,7 +1263,7 @@ ], "support": { "issues": "https://github.com/inertiajs/inertia-laravel/issues", - "source": "https://github.com/inertiajs/inertia-laravel/tree/v1.3.1" + "source": "https://github.com/inertiajs/inertia-laravel/tree/v2.0.0" }, "funding": [ { @@ -1273,7 +1271,7 @@ "type": "github" } ], - "time": "2024-11-14T14:22:48+00:00" + "time": "2024-12-13T02:48:29+00:00" }, { "name": "intervention/gif", @@ -10437,12 +10435,13 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": "^8.2" + "php": "^8.2", + "ext-json": "*" }, - "platform-dev": [], + "platform-dev": {}, "plugin-api-version": "2.6.0" }