Skip to content

Commit

Permalink
Merge pull request #40 from beromir/feat/inertia-v1
Browse files Browse the repository at this point in the history
[TASK] Upgrade Inertia to v1.0
  • Loading branch information
beromir authored Jan 15, 2023
2 parents 590dd75 + bbdb620 commit 70646e1
Show file tree
Hide file tree
Showing 43 changed files with 496 additions and 612 deletions.
790 changes: 362 additions & 428 deletions composer.lock

Large diffs are not rendered by default.

178 changes: 65 additions & 113 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
"build": "vite build"
},
"devDependencies": {
"@inertiajs/inertia": "^0.11",
"@inertiajs/inertia-svelte": "^0.8",
"@inertiajs/progress": "^0.2.7",
"@sveltejs/vite-plugin-svelte": "^1.4.0",
"@tailwindcss/forms": "^0.5.2",
"@tailwindcss/typography": "^0.5.2",
"autoprefixer": "^10.4.13",
"axios": "^0.27.2",
"inter-ui": "^3.19.3",
"laravel-vite-plugin": "^0.7.1",
Expand All @@ -20,8 +19,9 @@
"svelte-loader": "^3.1.2",
"swagger-ui": "^4.15.5",
"tailwindcss": "^3.0.24",
"vite": "^3.2.5",
"@sveltejs/vite-plugin-svelte": "^1.4.0",
"autoprefixer": "^10.4.13"
"vite": "^3.2.5"
},
"dependencies": {
"@inertiajs/svelte": "^1.0.0"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<script>
import {inertia} from '@inertiajs/inertia-svelte';
import {route} from "@/utils";
import {inertia} from '@inertiajs/svelte';
import BreadcrumbNavItem from "@/Components/BreadcrumbNavigation/BreadcrumbNavItem.svelte";
export let navigationNameForSr = '';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import {inertia} from "@inertiajs/inertia-svelte";
import {inertia} from "@inertiajs/svelte";
export let link = '';
export let title = '';
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Components/LinkList/ListItem.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script>
import {route} from "@/utils";
import {inertia} from "@inertiajs/inertia-svelte";
import {inertia} from "@inertiajs/svelte";
export let link = {};
export let withShadow = true;
Expand Down
4 changes: 2 additions & 2 deletions resources/js/Components/Navigation/DesktopMenuItem.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script>
import {inertia} from "@inertiajs/inertia-svelte";
import {page} from '@inertiajs/inertia-svelte';
import {inertia} from "@inertiajs/svelte";
import {page} from '@inertiajs/svelte';
export let title;
export let url;
Expand Down
4 changes: 2 additions & 2 deletions resources/js/Components/Navigation/MobileMenuItem.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script>
import {inertia} from "@inertiajs/inertia-svelte";
import {page} from '@inertiajs/inertia-svelte';
import {inertia} from "@inertiajs/svelte";
import {page} from '@inertiajs/svelte';
import {createEventDispatcher} from "svelte";
const dispatch = createEventDispatcher();
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Components/Pagination.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import { inertia } from '@inertiajs/inertia-svelte';
import { inertia } from '@inertiajs/svelte';
export let links = [];
</script>
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Jetstream/AuthenticationCardLogo.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import {inertia} from '@inertiajs/inertia-svelte';
import {inertia} from '@inertiajs/svelte';
</script>

<a href="/" use:inertia>
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Jetstream/ConfirmsPassword.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import JetInput from './Input.svelte';
import JetInputError from './InputError.svelte';
import JetSecondaryButton from './SecondaryButton.svelte';
import {useForm} from "@inertiajs/inertia-svelte";
import {useForm} from "@inertiajs/svelte";
import {route} from "@/utils";
const dispatch = createEventDispatcher();
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Jetstream/DropdownLink.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import {inertia} from '@inertiajs/inertia-svelte';
import {inertia} from '@inertiajs/svelte';
export let href;
export let type = 'button';
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Jetstream/NavLink.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import {inertia} from '@inertiajs/inertia-svelte';
import {inertia} from '@inertiajs/svelte';
export let href;
export let active;
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Layouts/AppLayout/AppLayout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</script>

<script>
import {inertia, page} from '@inertiajs/inertia-svelte';
import {inertia, page} from '@inertiajs/svelte';
import LinkModal from "@/Partials/LinkModal.svelte";
import DeleteLinkModal from "@/Partials/DeleteLinkModal.svelte";
import {route, dispatchCustomEvent, clickOutside} from '@/utils';
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Layouts/GuestLayout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</script>

<script>
import {page} from '@inertiajs/inertia-svelte';
import {page} from '@inertiajs/svelte';
let appName = $page.props.appName;
</script>
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Pages/API/Partials/ApiTokenManager.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import JetLabel from '@/Jetstream/Label.svelte';
import JetSecondaryButton from '@/Jetstream/SecondaryButton.svelte';
import JetSectionBorder from '@/Jetstream/SectionBorder.svelte';
import {page, useForm} from "@inertiajs/inertia-svelte";
import {page, useForm} from "@inertiajs/svelte";
import {route} from "@/utils";
export let tokens;
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Pages/Auth/ConfirmPassword.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import JetInput from '@/Jetstream/Input.svelte';
import JetLabel from '@/Jetstream/Label.svelte';
import JetValidationErrors from '@/Jetstream/ValidationErrors.svelte';
import {useForm} from "@inertiajs/inertia-svelte";
import {useForm} from "@inertiajs/svelte";
import {route} from "@/utils";
$title = 'Secure Area';
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Pages/Auth/ForgotPassword.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import JetInput from '@/Jetstream/Input.svelte';
import JetLabel from '@/Jetstream/Label.svelte';
import JetValidationErrors from '@/Jetstream/ValidationErrors.svelte';
import {useForm} from "@inertiajs/inertia-svelte";
import {useForm} from "@inertiajs/svelte";
import {route} from "@/utils";
$title = 'Forgot Password';
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Pages/Auth/Login.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</script>

<script>
import {inertia, useForm} from '@inertiajs/inertia-svelte';
import {inertia, useForm} from '@inertiajs/svelte';
import JetAuthenticationCard from '@/Jetstream/AuthenticationCard.svelte'
import JetAuthenticationCardLogo from '@/Jetstream/AuthenticationCardLogo.svelte'
import JetButton from '@/Jetstream/Button.svelte'
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Pages/Auth/Register.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</script>

<script>
import {inertia, useForm} from '@inertiajs/inertia-svelte';
import {inertia, useForm} from '@inertiajs/svelte';
import JetAuthenticationCard from '@/Jetstream/AuthenticationCard.svelte'
import JetAuthenticationCardLogo from '@/Jetstream/AuthenticationCardLogo.svelte'
import JetButton from '@/Jetstream/Button.svelte'
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Pages/Auth/ResetPassword.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import JetInput from '@/Jetstream/Input.svelte';
import JetLabel from '@/Jetstream/Label.svelte';
import JetValidationErrors from '@/Jetstream/ValidationErrors.svelte';
import {useForm} from "@inertiajs/inertia-svelte";
import {useForm} from "@inertiajs/svelte";
import {route} from "@/utils";
export let email = '';
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Pages/Auth/TwoFactorChallenge.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import JetInput from '@/Jetstream/Input.svelte';
import JetLabel from '@/Jetstream/Label.svelte';
import JetInputError from '@/Jetstream/InputError.svelte';
import {useForm} from "@inertiajs/inertia-svelte";
import {useForm} from "@inertiajs/svelte";
import {tick} from 'svelte';
import {route} from "@/utils";
Expand Down
3 changes: 1 addition & 2 deletions resources/js/Pages/Auth/VerifyEmail.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
import JetAuthenticationCard from '@/Jetstream/AuthenticationCard.svelte';
import JetAuthenticationCardLogo from '@/Jetstream/AuthenticationCardLogo.svelte';
import JetButton from '@/Jetstream/Button.svelte';
import {useForm} from "@inertiajs/inertia-svelte";
import {useForm, inertia} from "@inertiajs/svelte";
import {route} from "@/utils";
import {inertia} from '@inertiajs/inertia-svelte';
export let status = '';
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Pages/Groups/Partials/GroupsGrid.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script>
import {route} from "@/utils";
import {inertia} from '@inertiajs/inertia-svelte';
import {inertia} from '@inertiajs/svelte';
export let groups = [];
</script>
Expand Down
4 changes: 2 additions & 2 deletions resources/js/Pages/Groups/Partials/NewGroup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import {createEventDispatcher} from 'svelte';
import Button from "@/Components/Buttons/Button.svelte";
import Input from '@/Components/Inputs/Input.svelte';
import {useForm} from "@inertiajs/inertia-svelte";
import {route, dispatchCustomEvent} from "@/utils";
import {useForm} from "@inertiajs/svelte";
import {route} from "@/utils";
import {refreshGroups} from "@/stores";
import GroupSelectMenu from "@/Partials/GroupSelectMenu.svelte";
Expand Down
8 changes: 4 additions & 4 deletions resources/js/Pages/Links/Index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
</script>

<script>
import {inertia} from '@inertiajs/inertia-svelte';
import {inertia} from '@inertiajs/svelte';
import Pagination from "@/Components/Pagination.svelte";
import {Inertia} from "@inertiajs/inertia";
import {router} from '@inertiajs/svelte';
import {dispatchCustomEvent, route, toggleValueInArray} from "@/utils";
import Badge from "@/Components/Badge.svelte";
import Main from "@/Layouts/AppLayout/Partials/Main.svelte";
Expand Down Expand Up @@ -66,7 +66,7 @@
searchString = null;
}
Inertia.get(route(route().current(), {
router.get(route(route().current(), {
tags: filteredTags,
search: searchString,
}), {}, {
Expand All @@ -76,7 +76,7 @@
}
function bulkEditLinks(action) {
Inertia.post('/bulk-edit-links', {
router.post('/bulk-edit-links', {
action: action,
links: selectedLinks,
groups: selectedGroups,
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Pages/Profile/Partials/DeleteUserForm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import JetInput from '@/Jetstream/Input.svelte'
import JetInputError from '@/Jetstream/InputError.svelte'
import JetSecondaryButton from '@/Jetstream/SecondaryButton.svelte'
import {useForm} from "@inertiajs/inertia-svelte";
import {useForm} from "@inertiajs/svelte";
import {route} from "@/utils";
let confirmingUserDeletion = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import JetInput from '@/Jetstream/Input.svelte'
import JetInputError from '@/Jetstream/InputError.svelte'
import JetSecondaryButton from '@/Jetstream/SecondaryButton.svelte'
import {useForm} from "@inertiajs/inertia-svelte";
import {useForm} from "@inertiajs/svelte";
import {route} from "@/utils";
export let sessions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
import JetInput from '@/Jetstream/Input.svelte';
import JetInputError from '@/Jetstream/InputError.svelte';
import JetLabel from '@/Jetstream/Label.svelte';
import {page, useForm} from "@inertiajs/inertia-svelte";
import {Inertia} from "@inertiajs/inertia";
import {page, useForm, router} from "@inertiajs/svelte";
export let requiresConfirmation;
Expand All @@ -29,7 +28,7 @@
function enableTwoFactorAuthentication() {
enabling = true
Inertia.post('/user/two-factor-authentication', {}, {
router.post('/user/two-factor-authentication', {}, {
preserveScroll: true,
onSuccess: () => Promise.all([
showQrCode(),
Expand Down Expand Up @@ -87,7 +86,7 @@
function disableTwoFactorAuthentication() {
disabling = true
Inertia.delete('/user/two-factor-authentication', {
router.delete('/user/two-factor-authentication', {
preserveScroll: true,
onSuccess: () => {
disabling = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import JetInput from '@/Jetstream/Input.svelte';
import JetInputError from '@/Jetstream/InputError.svelte';
import JetLabel from '@/Jetstream/Label.svelte';
import {useForm} from "@inertiajs/inertia-svelte";
import {useForm} from "@inertiajs/svelte";
import {route} from "@/utils";
let passwordInput;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
import JetInputError from '@/Jetstream/InputError.svelte';
import JetLabel from '@/Jetstream/Label.svelte';
import JetSecondaryButton from '@/Jetstream/SecondaryButton.svelte';
import {page, useForm} from "@inertiajs/inertia-svelte";
import {page, useForm, router} from "@inertiajs/svelte";
import {route} from "@/utils";
import {Inertia} from "@inertiajs/inertia";
// import JetActionMessage from '@/Jetstream/ActionMessage.vue';
export let user = {};
Expand Down Expand Up @@ -53,7 +52,7 @@
}
function deletePhoto() {
Inertia.delete(route('current-user-photo.destroy'), {
router.delete(route('current-user-photo.destroy'), {
preserveScroll: true,
onSuccess: () => {
photoPreview = null;
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Pages/Profile/Show.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import UpdatePasswordForm from '@/Pages/Profile/Partials/UpdatePasswordForm.svelte'
import UpdateProfileInformationForm from '@/Pages/Profile/Partials/UpdateProfileInformationForm.svelte'
import Main from "@/Layouts/AppLayout/Partials/Main.svelte";
import {page} from "@inertiajs/inertia-svelte";
import {page} from "@inertiajs/svelte";
export let confirmsTwoFactorAuthentication;
export let sessions;
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Pages/SingleGroup/Partials/LinkList.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script>
import {route} from "@/utils";
import {inertia} from '@inertiajs/inertia-svelte';
import {inertia} from '@inertiajs/svelte';
export let links = [];
</script>
Expand Down
5 changes: 2 additions & 3 deletions resources/js/Pages/SingleLink/Index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
import {dispatchCustomEvent, route} from "@/utils";
import Main from "@/Layouts/AppLayout/Partials/Main.svelte";
import Badge from "@/Components/Badge.svelte";
import {Inertia} from "@inertiajs/inertia";
import {inertia} from "@inertiajs/inertia-svelte";
import {inertia, router} from "@inertiajs/svelte";
export let link = {};
Expand All @@ -31,7 +30,7 @@
}
function toggleLinkOnLaterList() {
Inertia.post(route('later.toggle-link'), {
router.post(route('later.toggle-link'), {
linkId: link.id,
})
}
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Pages/Tags/Partials/NewTag.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import {createEventDispatcher} from 'svelte';
import Button from "@/Components/Buttons/Button.svelte";
import Input from '@/Components/Inputs/Input.svelte';
import {useForm} from "@inertiajs/inertia-svelte";
import {useForm} from "@inertiajs/svelte";
import {route, dispatchCustomEvent} from "@/utils";
import {refreshTags} from "@/stores";
Expand Down
4 changes: 2 additions & 2 deletions resources/js/Partials/CommandPalette.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import {Inertia} from '@inertiajs/inertia'
import {router} from '@inertiajs/svelte'
import {fade, scale} from 'svelte/transition';
import {backIn, backOut} from 'svelte/easing';
import {delay} from "lodash";
Expand Down Expand Up @@ -50,7 +50,7 @@
function openSingleLinkPage() {
if (selectedLink) {
closeCommandPalette();
Inertia.get(route('links.show', selectedLink));
router.get(route('links.show', selectedLink));
}
}
Expand Down
4 changes: 2 additions & 2 deletions resources/js/Partials/DeleteGroupModal.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script>
import Modal from "@/Components/Modals/Modal.svelte";
import Button from "@/Components/Buttons/Button.svelte";
import {Inertia} from '@inertiajs/inertia';
import {router} from '@inertiajs/svelte';
import {route} from '@/utils';
import {refreshGroups} from "@/stores";
Expand All @@ -15,7 +15,7 @@
}
function deleteGroup() {
Inertia.delete(route('groups.destroy', group.id), {
router.delete(route('groups.destroy', group.id), {
preserveScroll: true,
onSuccess: () => {
showModal = false;
Expand Down
Loading

0 comments on commit 70646e1

Please sign in to comment.