diff --git a/CHANGELOG.md b/CHANGELOG.md index 378242a..8bce69f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,18 +1,30 @@ -## [1.0.30](https://github.com/justdlabs/inertia.ts/compare/1.0.29...1.0.30) (2024-10-16) +## [1.0.32](https://github.com/justdlabs/inertia.ts/compare/1.0.31...1.0.32) (2024-10-16) ### Bug Fixes -* fix app.tsx ([bacb103](https://github.com/justdlabs/inertia.ts/commit/bacb103bf0293d4ddaf68391a55b5337bdc59674)) +* fix routing ssr ([829693d](https://github.com/justdlabs/inertia.ts/commit/829693d03508e0f483c157e988c5350cd04dd39b)) -## [1.0.29](https://github.com/justdlabs/inertia.ts/compare/1.0.28...1.0.29) (2024-10-16) +## [1.0.31](https://github.com/justdlabs/inertia.ts/compare/1.0.30...1.0.31) (2024-10-16) + + +### Bug Fixes + +* add run to composer.json ([ad00c97](https://github.com/justdlabs/inertia.ts/commit/ad00c975d4cb8ee502fb03c920cd2b1122adb9f9)) +## [1.0.30](https://github.com/justdlabs/inertia.ts/compare/1.0.29...1.0.30) (2024-10-16) + +### Bug Fixes + +- fix app.tsx ([bacb103](https://github.com/justdlabs/inertia.ts/commit/bacb103bf0293d4ddaf68391a55b5337bdc59674)) + +## [1.0.29](https://github.com/justdlabs/inertia.ts/compare/1.0.28...1.0.29) (2024-10-16) ### Bug Fixes -* add ziggy location to inertia middleware ([a40dbc6](https://github.com/justdlabs/inertia.ts/commit/a40dbc68fe0650f9f6b8756067932521e45f805b)) +- add ziggy location to inertia middleware ([a40dbc6](https://github.com/justdlabs/inertia.ts/commit/a40dbc68fe0650f9f6b8756067932521e45f805b)) ## [1.0.28](https://github.com/justdlabs/inertia.ts/compare/1.0.27...1.0.28) (2024-10-14) diff --git a/composer.json b/composer.json index 3f3a834..f1e5348 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "justd/laravel", - "version": "1.0.30", + "version": "1.0.32", "type": "project", "description": "The skeleton application for the Laravel framework.", "keywords": [ @@ -61,6 +61,10 @@ "npm install", "npm uninstall husky", "npm run dev " + ], + "dev": [ + "Composer\\Config::disableProcessTimeout", + "npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1\" \"php artisan pail\" \"npm run dev\" --names=server,queue,logs,vite" ] }, "extra": { diff --git a/package-lock.json b/package-lock.json index fa5a761..366f122 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { "name": "inertia.ts", - "version": "1.0.30", + "version": "1.0.32", "lockfileVersion": 3, "requires": true, "packages": { "": { - "version": "1.0.30", + "version": "1.0.32", "dependencies": { "clsx": "^2.1.1", "framer-motion": "^11.3.31", diff --git a/package.json b/package.json index 71ab220..fb3819e 100644 --- a/package.json +++ b/package.json @@ -80,5 +80,5 @@ } } }, - "version": "1.0.30" + "version": "1.0.32" } diff --git a/resources/js/app.tsx b/resources/js/app.tsx index 60b852c..ff6bc25 100644 --- a/resources/js/app.tsx +++ b/resources/js/app.tsx @@ -1,31 +1,31 @@ -import '../css/app.css' -import './bootstrap' +import '../css/app.css'; +import './bootstrap'; -import { Ziggy } from '@/ziggy' -import { createInertiaApp } from '@inertiajs/react' -import { Providers } from './providers' -import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers' -import { createRoot, hydrateRoot } from 'react-dom/client' -import { useRoute } from 'ziggy-js' +import { Ziggy } from '@/ziggy'; +import { createInertiaApp } from '@inertiajs/react'; +import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers'; +import { createRoot, hydrateRoot } from 'react-dom/client'; +import { useRoute } from 'ziggy-js'; +import { Providers } from './providers'; -const appName = import.meta.env.VITE_APP_NAME || 'Irsyad' +const appName = import.meta.env.VITE_APP_NAME || 'Irsyad'; createInertiaApp({ title: (title) => (title ? `${title} / ${appName}` : appName), resolve: (name) => resolvePageComponent(`./pages/${name}.tsx`, import.meta.glob('./pages/**/*.tsx')), setup({ el, App, props }) { - window.route = useRoute(Ziggy as any) + window.route = useRoute(Ziggy as any); const appElement = ( - ) + ); if (import.meta.env.SSR) { - hydrateRoot(el, appElement) - return + hydrateRoot(el, appElement); + return; } - createRoot(el).render(appElement) + createRoot(el).render(appElement); }, progress: false -}) +}); diff --git a/resources/js/ssr.tsx b/resources/js/ssr.tsx index 65a6cd3..eba6d3a 100644 --- a/resources/js/ssr.tsx +++ b/resources/js/ssr.tsx @@ -1,11 +1,10 @@ -import { createInertiaApp } from '@inertiajs/react'; -import createServer from '@inertiajs/react/server'; -import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers'; -import ReactDOMServer from 'react-dom/server'; -import { route, RouteName } from 'ziggy-js'; - +import { Ziggy as ziggy } from '@/ziggy' +import { createInertiaApp } from '@inertiajs/react' +import createServer from '@inertiajs/react/server' +import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers' +import ReactDOMServer from 'react-dom/server' +import { route, type RouteName } from 'ziggy-js' const appName = import.meta.env.VITE_APP_NAME || 'Laravel'; - createServer((page) => createInertiaApp({ page, @@ -15,13 +14,14 @@ createServer((page) => setup: ({ App, props }) => { // @ts-expect-error global.route = (name, params, absolute) => + // @ts-expect-error route(name, params as any, absolute, { - // @ts-expect-error - ...page.props.ziggy, + ...ziggy, // @ts-expect-error location: new URL(page.props.ziggy.location) - }); - return ; + }) + + return } }) -); +)