Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps-dev): upgrade inertiajs to 1.0.0 #227

Merged
merged 1 commit into from
Jan 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 23 additions & 63 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
"@alpinejs/persist": "^3.10.5",
"@ckpack/vue-color": "^1.3.0",
"@headlessui/vue": "^1.7.7",
"@inertiajs/inertia": "^0.11.1",
"@inertiajs/inertia-vue3": "^0.6.0",
"@inertiajs/progress": "^0.2.7",
"@inertiajs/vue3": "^1.0.0",
"@tailwindcss/aspect-ratio": "^0.4.2",
"@tailwindcss/forms": "^0.5.3",
"@tailwindcss/line-clamp": "^0.4.2",
Expand Down
14 changes: 9 additions & 5 deletions resources/js/admin.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { createApp, h } from 'vue';
import { createInertiaApp, Head, Link } from '@inertiajs/inertia-vue3';
import { createInertiaApp, Head, Link } from '@inertiajs/vue3';
import { ZiggyVue } from 'ziggy-js/dist/vue';
import mitt from 'mitt';
import VueClickAway from 'vue3-click-away';

import registerComponents from '@/plugins/registerComponents';
import progress from '@/plugins/progress';
import i18n from '@/plugins/i18n';

import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers';
Expand All @@ -18,17 +17,22 @@ createInertiaApp({
`./pages/${name}.vue`,
import.meta.globEager('./pages/**/*.vue')
),
setup({ el, app, props, plugin }) {
createApp({ render: () => h(app, props) })
setup({ el, App, props, plugin }) {
createApp({ render: () => h(App, props) })
.use(ZiggyVue)
.use(i18n)
.use(plugin)
.use(registerComponents)
.use(progress)
.use(VueClickAway)
.component('InertiaHead', Head)
.component('InertiaLink', Link)
.provide('bus', mitt())
.mount(el);
},
progress: {
delay: 250,
color: '#3B82F6',
includeCSS: true,
showSpinner: true,
},
});
4 changes: 2 additions & 2 deletions resources/js/components/Blocks/BlockItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@

<script>
import { computed, ref } from 'vue';
import { usePage } from '@inertiajs/inertia-vue3';
import { usePage } from '@inertiajs/vue3';
import { useLocale } from '@/helpers';
import get from 'lodash/get';

Expand Down Expand Up @@ -186,7 +186,7 @@
);

const icon = computed(() => {
const block = usePage().props.value.model.allowed_blocks.find(
const block = usePage().props.model.allowed_blocks.find(
({ type }) => type === props.component
);

Expand Down
4 changes: 2 additions & 2 deletions resources/js/components/Blocks/BlockList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@

<script>
import { computed } from 'vue';
import { usePage } from '@inertiajs/inertia-vue3';
import { usePage } from '@inertiajs/vue3';
import cloneDeep from 'lodash/cloneDeep';
import Draggable from 'vuedraggable';

Expand Down Expand Up @@ -116,7 +116,7 @@
emits: ['update:blocks'],
setup(props) {
const allowedBlocks = computed(
() => usePage().props.value.model.allowed_blocks
() => usePage().props.model.allowed_blocks
);

const addBlock = (type) => {
Expand Down
6 changes: 3 additions & 3 deletions resources/js/components/FlashToast.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@

<script>
import { watch, computed, ref, nextTick } from 'vue';
import { usePage } from '@inertiajs/inertia-vue3';
import { usePage } from '@inertiajs/vue3';
import { transChoice } from 'laravel-vue-i18n';

import isEmpty from 'lodash/isEmpty';
Expand All @@ -87,8 +87,8 @@
setTimeout(hide, props.closeAfter);
};

const flash = computed(() => usePage().props.value.flash);
const errors = computed(() => usePage().props.value.errors);
const flash = computed(() => usePage().props.flash);
const errors = computed(() => usePage().props.errors);

watch(
[flash, errors],
Expand Down
4 changes: 2 additions & 2 deletions resources/js/components/Form/Container.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
import { computed, onUnmounted, watch } from 'vue';
import { useForm, useLocale, route } from '@/helpers';
import { trans } from 'laravel-vue-i18n';
import { Inertia } from '@inertiajs/inertia';
import { router } from '@inertiajs/vue3';

export default {
name: 'FormContainer',
Expand Down Expand Up @@ -163,7 +163,7 @@
* @see https://inertiajs.com/events#removing-listeners
*/
onUnmounted(
Inertia.on('before', (event) => {
router.on('before', (event) => {
if (
form.isDirty &&
event.detail.visit.method === 'get' &&
Expand Down
4 changes: 2 additions & 2 deletions resources/js/components/Form/Field.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

<script>
import { computed } from 'vue';
import { usePage } from '@inertiajs/inertia-vue3';
import { usePage } from '@inertiajs/vue3';
import { defineInput, useLocale } from '@/helpers';

export default defineInput({
Expand All @@ -67,7 +67,7 @@
const { hasMultipleLocales, nextLocale } = useLocale(props);

const errors = computed(() => {
const initialErrors = usePage().props.value.errors;
const initialErrors = usePage().props.errors;

if (!props.locale && initialErrors.hasOwnProperty(props.name)) {
return [initialErrors[props.name]];
Expand Down
8 changes: 4 additions & 4 deletions resources/js/components/Layout/Authenticated.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@

<script>
import { computed } from 'vue';
import { usePage } from '@inertiajs/inertia-vue3';
import { usePage } from '@inertiajs/vue3';
import { route } from '@/helpers';
import { isLoaded } from 'laravel-vue-i18n';

Expand Down Expand Up @@ -104,15 +104,15 @@
});

const mainMenu = computed(() =>
buildMenu(usePage().props.value.navigation.primary)
buildMenu(usePage().props.navigation.primary)
);

const secondaryMenu = computed(() =>
buildMenu(usePage().props.value.navigation.secondary)
buildMenu(usePage().props.navigation.secondary)
);

const settingsMenu = computed(() =>
buildMenu(usePage().props.value.navigation.settings)
buildMenu(usePage().props.navigation.settings)
);

return {
Expand Down
10 changes: 4 additions & 6 deletions resources/js/components/Media/Uploader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

<script>
import { ref, computed } from 'vue';
import { usePage } from '@inertiajs/inertia-vue3';
import { usePage } from '@inertiajs/vue3';
import { useDropZone } from '@vueuse/core';

export default {
Expand All @@ -72,20 +72,18 @@
emits: ['upload'],
setup(props, { emit }) {
const allowedExtensions = computed(() =>
usePage().props.value.mediaLibrary.allowedExtensions[
usePage().props.mediaLibrary.allowedExtensions[
props.currentType
].join(', ')
);

const allowedMimeTypes = computed(
() =>
usePage().props.value.mediaLibrary.allowedMimeTypes[
props.currentType
]
usePage().props.mediaLibrary.allowedMimeTypes[props.currentType]
);

const maxFileSize = computed(
() => usePage().props.value.mediaLibrary.maxFileSize
() => usePage().props.mediaLibrary.maxFileSize
);

const dropzone = ref(null);
Expand Down
10 changes: 5 additions & 5 deletions resources/js/components/MenuBuilder/Item.vue
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@

<script>
import { computed, ref, watch } from 'vue';
import { usePage } from '@inertiajs/inertia-vue3';
import { usePage } from '@inertiajs/vue3';
import { useLocale } from '@/helpers';
import { trans } from 'laravel-vue-i18n';
import get from 'lodash/get';
Expand Down Expand Up @@ -167,21 +167,21 @@
const { currentLocale } = useLocale();

const types = computed(() =>
(usePage().props.value.types || []).map((type) => ({
(usePage().props.types || []).map((type) => ({
value: type,
label: trans(`menu.item.${type}`),
}))
);

const routes = computed(() =>
(usePage().props.value.routes || []).map((route) => ({
(usePage().props.routes || []).map((route) => ({
value: route,
label: trans(`menu.item.${route}`),
}))
);

const models = computed(
() => usePage().props.value.models[props.item.type] || []
() => usePage().props.models[props.item.type] || []
);

const itemLabel = computed(() =>
Expand All @@ -201,7 +201,7 @@
const prefix = computed(() => `${props.prefix}.${props.index}`);

const errors = computed(() => {
const initialErrors = usePage().props.value.errors;
const initialErrors = usePage().props.errors;
const errors = {};

Object.keys(initialErrors).forEach((key) => {
Expand Down
Loading