Skip to content

Commit c5f8897

Browse files
Copilotlimonte
andauthored
Upgrade to Livewire 4 (#1)
* Initial plan * Upgrade to Livewire 4.0.1 Co-authored-by: limonte <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: limonte <[email protected]>
1 parent e572706 commit c5f8897

File tree

4 files changed

+11
-48
lines changed

4 files changed

+11
-48
lines changed

.github/copilot-instructions.md

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ The Laravel Boost guidelines are specifically curated by Laravel maintainers for
88
## Foundational Context
99
This application is a Laravel application and its main Laravel ecosystems package & versions are below. You are an expert with them all. Ensure you abide by these specific packages & versions.
1010

11-
- php - 8.5.2
11+
- php - 8.4.16
1212
- laravel/framework (LARAVEL) - v12
1313
- laravel/prompts (PROMPTS) - v0
14-
- livewire/livewire (LIVEWIRE) - v3
14+
- livewire/livewire (LIVEWIRE) - v4
1515
- laravel/mcp (MCP) - v0
1616
- laravel/pint (PINT) - v1
1717
- laravel/sail (SAIL) - v1
@@ -219,41 +219,6 @@ protected function isAccessible(User $user, ?string $path = null): bool
219219
->assertSeeLivewire(CreatePost::class);
220220
</code-snippet>
221221
222-
=== livewire/v3 rules ===
223-
224-
## Livewire 3
225-
226-
### Key Changes From Livewire 2
227-
- These things changed in Livewire 3, but may not have been updated in this application. Verify this application's setup to ensure you conform with application conventions.
228-
- Use `wire:model.live` for real-time updates, `wire:model` is now deferred by default.
229-
- Components now use the `App\Livewire` namespace (not `App\Http\Livewire`).
230-
- Use `$this->dispatch()` to dispatch events (not `emit` or `dispatchBrowserEvent`).
231-
- Use the `components.layouts.app` view as the typical layout path (not `layouts.app`).
232-
233-
### New Directives
234-
- `wire:show`, `wire:transition`, `wire:cloak`, `wire:offline`, `wire:target` are available for use. Use the documentation to find usage examples.
235-
236-
### Alpine
237-
- Alpine is now included with Livewire; don't manually include Alpine.js.
238-
- Plugins included with Alpine: persist, intersect, collapse, and focus.
239-
240-
### Lifecycle Hooks
241-
- You can listen for `livewire:init` to hook into Livewire initialization, and `fail.status === 419` for the page expiring:
242-
243-
<code-snippet name="Livewire Init Hook Example" lang="js">
244-
document.addEventListener('livewire:init', function () {
245-
Livewire.hook('request', ({ fail }) => {
246-
if (fail && fail.status === 419) {
247-
alert('Your session expired');
248-
}
249-
});
250-
251-
Livewire.hook('message.failed', (message, component) => {
252-
console.error(message);
253-
});
254-
});
255-
</code-snippet>
256-
257222
=== pint/core rules ===
258223
259224
## Laravel Pint Code Formatter

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"php": "^8.2",
1313
"laravel/framework": "^12.0",
1414
"laravel/tinker": "^2.10.1",
15-
"livewire/livewire": "^3.7",
15+
"livewire/livewire": "^4.0",
1616
"sweetalert2/laravel": "^1.2"
1717
},
1818
"require-dev": {

composer.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/views/welcome.blade.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
@livewireStyles
54
</head>
65
<body>
76
<livewire:counter />
8-
@livewireScripts
97
@include('sweetalert2::index')
108
</body>
119
</html>

0 commit comments

Comments
 (0)