Skip to content
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
29 changes: 28 additions & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
SESSION_DRIVER: file
QUEUE_CONNECTION: sync
MAIL_MAILER: log
PHP_CLI_SERVER_WORKERS: '4'
MODULO_E2E_URL: http://127.0.0.1:8000
# Asset and link URLs must match where the browser reaches the app.
APP_URL: http://127.0.0.1:8000
Expand Down Expand Up @@ -112,7 +113,7 @@ jobs:
echo "MODULO_E2E_SETUP_TOKEN=$setup_token" >> "$GITHUB_ENV"
# Deliberately not migrated or seeded: the wizard is what should
# bring an empty database up, and that is the thing under test.
npm run build
npm run build:ssr

- name: Install Playwright browser
run: npx playwright install --with-deps chromium
Expand All @@ -134,8 +135,34 @@ jobs:
exit 1

- name: Run the end-to-end tests
env:
MODULO_E2E_FIXTURES: 'true'
run: npm run test:e2e --

- name: Verify server rendering and hydration
env:
INERTIA_SSR_ENABLED: 'true'
MODULO_E2E_SSR: '1'
MODULO_E2E_URL: http://127.0.0.1:8002
APP_URL: http://127.0.0.1:8002
ASSET_URL: http://127.0.0.1:8002
run: |
set -euo pipefail
node bootstrap/ssr/ssr.js >/tmp/modulo-e2e-ssr.log 2>&1 &
ssr_pid=$!
trap 'kill "$ssr_pid" 2>/dev/null || true' EXIT
for _ in $(seq 1 15); do
if curl -fsS http://127.0.0.1:13714/health >/dev/null 2>&1; then break; fi
sleep 1
done
node scripts/check-ssr.mjs
php artisan serve --no-reload --host=127.0.0.1 --port=8002 &
for _ in $(seq 1 15); do
if curl -fsS http://127.0.0.1:8002/health >/dev/null 2>&1; then break; fi
sleep 1
done
npm run test:e2e -- ssr.spec.ts

- name: Seed and audit the compact disposable demo
env:
MODULO_DEMO: 'true'
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,9 @@ jobs:
run: npm run test:js

- name: Build client and server assets
run: npm run build:ssr
run: |
npm run build:ssr
npm run build:plugin-fixture

- name: Server rendering bundle starts
run: |
Expand All @@ -382,6 +384,7 @@ jobs:
trap 'kill "$ssr_pid" 2>/dev/null || true' EXIT
for _ in $(seq 1 10); do
if curl -fsS http://127.0.0.1:13714/health | grep -q '"status":"OK"'; then
node scripts/check-ssr.mjs
exit 0
fi
if ! kill -0 "$ssr_pid" 2>/dev/null; then break; fi
Expand Down Expand Up @@ -413,3 +416,4 @@ jobs:
- run: npm run types
- run: npm run test:js
- run: npm run build:ssr
- run: npm run build:plugin-fixture
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ build/
cookies.txt
/storage/media-library/
/storage/framework/phpstan
/storage/validation/
/playwright-report
/test-results
/blob-report
Expand Down
2 changes: 1 addition & 1 deletion app/Services/PageMeta.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* The React theme sets the same tags in the browser, but crawlers that don't
* run JavaScript and link previews (chat apps, social networks) only read the
* HTML the server sends. These are printed with Inertia's `inertia` attribute,
* HTML the server sends. These are printed with Inertia's `data-inertia` attribute,
* so the theme replaces them on load instead of doubling them. The rules
* mirror the theme's Layout: keep the two in step.
*/
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"require": {
"php": "^8.4",
"inertiajs/inertia-laravel": "^2.0",
"inertiajs/inertia-laravel": "^3.0",
"laravel/framework": "^13.0",
"laravel/tinker": "^3.0",
"league/flysystem-aws-s3-v3": "^3.0",
Expand Down
26 changes: 13 additions & 13 deletions composer.lock

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

53 changes: 7 additions & 46 deletions config/inertia.php
Original file line number Diff line number Diff line change
@@ -1,55 +1,16 @@
<?php

return [

/*
|--------------------------------------------------------------------------
| Server Side Rendering
|--------------------------------------------------------------------------
|
| These options configures if and how Inertia uses Server Side Rendering
| to pre-render each initial request made to your application's pages
| so that server rendered HTML is delivered for the user's browser.
|
| See: https://inertiajs.com/server-side-rendering
|
*/

'ssr' => [
'enabled' => false,
'url' => 'http://127.0.0.1:13714',
// 'bundle' => base_path('bootstrap/ssr/ssr.mjs'),

'enabled' => env('INERTIA_SSR_ENABLED', false),
'url' => env('INERTIA_SSR_URL', 'http://127.0.0.1:13714'),
],
'pages' => [
'ensure_pages_exist' => false,
'paths' => [resource_path('js/pages')],
'extensions' => ['js', 'jsx', 'svelte', 'ts', 'tsx', 'vue'],
],

/*
|--------------------------------------------------------------------------
| Testing
|--------------------------------------------------------------------------
|
| The values described here are used to locate Inertia components on the
| filesystem. For instance, when using `assertInertia`, the assertion
| attempts to locate the component as a file relative to the paths.
|
*/

'testing' => [

'ensure_pages_exist' => true,

'page_paths' => [
resource_path('js/pages'),
],

'page_extensions' => [
'js',
'jsx',
'svelte',
'ts',
'tsx',
'vue',
],

],

];
1 change: 1 addition & 0 deletions config/tooling/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export default [
'docs/.vitepress/dist',
'docs/.vitepress/cache',
'coverage',
'storage/validation',
],
},
prettier, // Turn off all rules that might conflict with Prettier
Expand Down
9 changes: 8 additions & 1 deletion config/tooling/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,12 @@
},
"jsx": "react-jsx"
},
"include": ["../../resources/js/**/*.ts", "../../resources/js/**/*.d.ts", "../../resources/js/**/*.tsx", "../../resources/themes/**/*.tsx"]
"include": [
"../../resources/js/**/*.ts",
"../../resources/js/**/*.d.ts",
"../../resources/js/**/*.tsx",
"../../resources/themes/**/*.tsx",
"../../tests/Fixtures/plugin-sdk/*.tsx",
"../../packages/plugin-sdk/ui.d.ts"
]
}
2 changes: 1 addition & 1 deletion config/tooling/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default defineConfig(({ command, isSsrBuild }) => ({
port: 5173,
},
build: {
target: process.env.VITE_BUILD_TARGET || 'es2020',
target: process.env.VITE_BUILD_TARGET || 'es2022',
minify: process.env.VITE_BUILD_MINIFY !== 'false',
sourcemap: process.env.VITE_BUILD_SOURCEMAP === 'true',
rolldownOptions: {
Expand Down
7 changes: 7 additions & 0 deletions docs/plugin-frontend.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ cannot resolve, so that recipe never worked.)

Use the preset in `packages/plugin-sdk` (`@modulo/plugin-sdk`):

The current build uses Node 24 LTS, Vite 8, the React Vite plugin 6, and
Inertia React 3. The preset also accepts Vite 6/7 configurations for existing
plugin build pipelines. React and Inertia remain external imports: install
updates to the core and its generated SDK shims together, then rebuild plugins
independently. Existing component registration and import-map interfaces remain
unchanged. Builds target ES2022; browsers must support that baseline.

```js
// vite.config.js in your plugin
import react from '@vitejs/plugin-react';
Expand Down
Loading
Loading