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

Laravel 11.x #112

Merged
merged 4 commits into from
Oct 16, 2024
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
20 changes: 16 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
6 changes: 5 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down Expand Up @@ -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": {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,5 @@
}
}
},
"version": "1.0.30"
"version": "1.0.32"
}
30 changes: 15 additions & 15 deletions resources/js/app.tsx
Original file line number Diff line number Diff line change
@@ -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 = (
<Providers>
<App {...props} />
</Providers>
)
);
if (import.meta.env.SSR) {
hydrateRoot(el, appElement)
return
hydrateRoot(el, appElement);
return;
}

createRoot(el).render(appElement)
createRoot(el).render(appElement);
},
progress: false
})
});
24 changes: 12 additions & 12 deletions resources/js/ssr.tsx
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -15,13 +14,14 @@ createServer((page) =>
setup: ({ App, props }) => {
// @ts-expect-error
global.route<RouteName> = (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 <App {...props} />;
})

return <App {...props} />
}
})
);
)
Loading