Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: laravel/jetstream
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.3.3
Choose a base ref
...
head repository: laravel/jetstream
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v4.0.0
Choose a head ref
  • 6 commits
  • 32 files changed
  • 3 contributors

Commits on Aug 24, 2023

  1. [4.x] Upgrade guide (#1363)

    * Adds upgrade guide
    
    * Rewording
    
    * Update UPGRADE.md
    
    * Revert action message changes
    
    * Update UPGRADE.md
    
    * Update UPGRADE.md
    
    ---------
    
    Co-authored-by: Taylor Otwell <taylor@laravel.com>
    nunomaduro and taylorotwell authored Aug 24, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f580f92 View commit details
  2. [4.x] Migrates to Livewire v3.x (#1360)

    * Uses Livewire 3 on composer
    
    * Uses Livewire upgrade script
    
    * Removes alpine
    
    * Updates livewire path
    
    * Migrates events
    
    * Migrates "action-message"
    
    * Fixes wrong .live convertions
    
    * Fixes wrong `.live`
    
    * Fixes style
    
    * Fixes 2FA form
    
    * Fixes `DeleteTeamTest` test
    
    * Fixes events
    
    * Fix event name
    
    * Fixes banner
    
    * Adds missing styles and scripts
    
    * Uses non stable version of Livewire
    
    * Reverts
    
    * Uses dev-main
    
    * Pins to 3.x
    
    * Improves access to banner details
    
    * Fixes dispatch calls
    
    * Fixes installation
    
    * Revert `emit` change
    
    * Revert `emit` change
    
    * Reverts changes on events
    
    * Reverts `x-init`
    
    * Style
    
    * Adds missing migrations
    nunomaduro authored Aug 24, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1ecddaa View commit details
  3. Update CHANGELOG

    nunomaduro authored and github-actions[bot] committed Aug 24, 2023
    Copy the full SHA
    c152d5d View commit details
  4. Copy the full SHA
    1a25456 View commit details
  5. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f521cd1 View commit details
  6. Updates 4.x alias

    nunomaduro authored Aug 24, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a790bdd View commit details
Showing with 118 additions and 79 deletions.
  1. +5 −1 CHANGELOG.md
  2. +42 −0 UPGRADE.md
  3. +2 −2 composer.json
  4. +7 −7 src/ConfirmsPasswords.php
  5. +1 −4 src/Console/InstallCommand.php
  6. +2 −2 src/Http/Livewire/ApiTokenManager.php
  7. +2 −0 src/Http/Livewire/DeleteTeamForm.php
  8. +1 −1 src/Http/Livewire/DeleteUserForm.php
  9. +2 −2 src/Http/Livewire/LogoutOtherBrowserSessionsForm.php
  10. +1 −1 src/Http/Livewire/TeamMemberManager.php
  11. +1 −1 src/Http/Livewire/UpdatePasswordForm.php
  12. +3 −3 src/Http/Livewire/UpdateProfileInformationForm.php
  13. +2 −2 src/Http/Livewire/UpdateTeamNameForm.php
  14. +8 −8 src/InteractsWithBanner.php
  15. +0 −9 stubs/livewire/resources/js/app.js
  16. +6 −6 stubs/livewire/resources/views/api/api-token-manager.blade.php
  17. +1 −1 stubs/livewire/resources/views/components/action-message.blade.php
  18. +4 −6 stubs/livewire/resources/views/components/banner.blade.php
  19. +2 −2 stubs/livewire/resources/views/components/confirms-password.blade.php
  20. +1 −1 stubs/livewire/resources/views/components/form-section.blade.php
  21. +1 −1 stubs/livewire/resources/views/components/modal.blade.php
  22. +5 −0 stubs/livewire/resources/views/layouts/guest.blade.php
  23. +2 −2 stubs/livewire/resources/views/profile/delete-user-form.blade.php
  24. +2 −2 stubs/livewire/resources/views/profile/logout-other-browser-sessions-form.blade.php
  25. +1 −1 stubs/livewire/resources/views/profile/two-factor-authentication-form.blade.php
  26. +3 −3 stubs/livewire/resources/views/profile/update-password-form.blade.php
  27. +3 −3 stubs/livewire/resources/views/profile/update-profile-information-form.blade.php
  28. +1 −1 stubs/livewire/resources/views/teams/create-team-form.blade.php
  29. +1 −1 stubs/livewire/resources/views/teams/delete-team-form.blade.php
  30. +4 −4 stubs/livewire/resources/views/teams/team-member-manager.blade.php
  31. +1 −1 stubs/livewire/resources/views/teams/update-team-name-form.blade.php
  32. +1 −1 stubs/livewire/vite.config.js
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Release Notes

## [Unreleased](https://github.com/laravel/jetstream/compare/v3.3.2...3.x)
## [Unreleased](https://github.com/laravel/jetstream/compare/v3.3.3...3.x)

## [v3.3.3](https://github.com/laravel/jetstream/compare/v3.3.2...v3.3.3) - 2023-08-23

- Fix memory leak and potential caching issue in https://github.com/laravel/jetstream/pull/1366

## [v3.3.2](https://github.com/laravel/jetstream/compare/v3.3.1...v3.3.2) - 2023-08-21

42 changes: 42 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,47 @@
# Upgrade Guide

## Upgrading from Jetstream 3.x to Jetstream 4.x

> **Note**
> This upgrade guide only discusses upgrading to Jetstream 4.x. Upgrading your Laravel, Tailwind, Livewire, or Inertia installations is outside the scope of this documentation and is not strictly required in order to use Jetstream 4.x. Please consult the upgrade guides for those libraries for information on their upgrade process.
- [Changes Common To Both Stacks](#jetstream-4x-changes-common-to-both-stacks)
- [Livewire Stack Upgrade Guide](#jetstream-4x-livewire-stack)

### Jetstream 4.x Changes Common To Both Stacks

#### Dependency Versions

You should upgrade your `laravel/jetstream` dependency to `^4.0` within your application's `composer.json` file. Then, run the `composer update` command:

composer update

### Jetstream 4.x Livewire Stack

This upgrade guide assumes you have already upgraded your application to Livewire 3.x and ran the `php artisan livewire:upgrade` command against the views published by Jetstream.

#### Alpine Script

As you may know, Livewire 3 ships with Alpine by default, so you do not need to include it in your application's `resources/js/app.js` file.

You should include `@livewireStyles` and `@livewireScripts` in your application's `resources/views/layouts/guest.blade.php` file since Alpine is used by "guest" components published by Jetstream:

```diff
<!-- Scripts -->
@vite(['resources/css/app.css', 'resources/js/app.js'])
+
+ <!-- Styles -->
+ @livewireStyles
</head>
<body>
<div class="font-sans text-gray-900 dark:text-gray-100 antialiased">
{{ $slot }}
</div>
+
+ @livewireScripts
</body>
```

## Upgrading from Jetstream 2.x to Jetstream 3.x

> **Note**
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@
"require-dev": {
"inertiajs/inertia-laravel": "^0.6.5",
"laravel/sanctum": "^3.0",
"livewire/livewire": "^2.12",
"livewire/livewire": "^3.0",
"mockery/mockery": "^1.0",
"orchestra/testbench": "^8.0",
"phpstan/phpstan": "^1.10",
@@ -44,7 +44,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "3.x-dev"
"dev-master": "4.x-dev"
},
"laravel": {
"providers": [
14 changes: 7 additions & 7 deletions src/ConfirmsPasswords.php
Original file line number Diff line number Diff line change
@@ -41,16 +41,16 @@ public function startConfirmingPassword(string $confirmableId)
$this->resetErrorBag();

if ($this->passwordIsConfirmed()) {
return $this->dispatchBrowserEvent('password-confirmed', [
'id' => $confirmableId,
]);
return $this->dispatch('password-confirmed',
id: $confirmableId,
);
}

$this->confirmingPassword = true;
$this->confirmableId = $confirmableId;
$this->confirmablePassword = '';

$this->dispatchBrowserEvent('confirming-password');
$this->dispatch('confirming-password');
}

/**
@@ -80,9 +80,9 @@ public function confirmPassword()

session(['auth.password_confirmed_at' => time()]);

$this->dispatchBrowserEvent('password-confirmed', [
'id' => $this->confirmableId,
]);
$this->dispatch('password-confirmed',
id: $this->confirmableId,
);

$this->stopConfirmingPassword();
}
5 changes: 1 addition & 4 deletions src/Console/InstallCommand.php
Original file line number Diff line number Diff line change
@@ -155,7 +155,7 @@ protected function configureSession()
protected function installLivewireStack()
{
// Install Livewire...
if (! $this->requireComposerPackages('livewire/livewire:^2.11')) {
if (! $this->requireComposerPackages('livewire/livewire:^3.0')) {
return false;
}

@@ -175,8 +175,6 @@ protected function installLivewireStack()
return [
'@tailwindcss/forms' => '^0.5.2',
'@tailwindcss/typography' => '^0.5.0',
'alpinejs' => '^3.0.6',
'@alpinejs/focus' => '^3.10.5',
'autoprefixer' => '^10.4.7',
'postcss' => '^8.4.14',
'tailwindcss' => '^3.1.0',
@@ -251,7 +249,6 @@ protected function installLivewireStack()

// Assets...
copy(__DIR__.'/../../stubs/resources/css/app.css', resource_path('css/app.css'));
copy(__DIR__.'/../../stubs/livewire/resources/js/app.js', resource_path('js/app.js'));

// Tests...
$stubs = $this->getTestStubsPath();
4 changes: 2 additions & 2 deletions src/Http/Livewire/ApiTokenManager.php
Original file line number Diff line number Diff line change
@@ -103,7 +103,7 @@ public function createApiToken()
$this->createApiTokenForm['name'] = '';
$this->createApiTokenForm['permissions'] = Jetstream::$defaultPermissions;

$this->emit('created');
$this->dispatch('created');
}

/**
@@ -118,7 +118,7 @@ protected function displayTokenValue($token)

$this->plainTextToken = explode('|', $token->plainTextToken, 2)[1];

$this->dispatchBrowserEvent('showing-token-modal');
$this->dispatch('showing-token-modal');
}

/**
2 changes: 2 additions & 0 deletions src/Http/Livewire/DeleteTeamForm.php
Original file line number Diff line number Diff line change
@@ -50,6 +50,8 @@ public function deleteTeam(ValidateTeamDeletion $validator, DeletesTeams $delete

$deleter->delete($this->team);

$this->team = null;

return $this->redirectPath($deleter);
}

2 changes: 1 addition & 1 deletion src/Http/Livewire/DeleteUserForm.php
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@ public function confirmUserDeletion()

$this->password = '';

$this->dispatchBrowserEvent('confirming-delete-user');
$this->dispatch('confirming-delete-user');

$this->confirmingUserDeletion = true;
}
4 changes: 2 additions & 2 deletions src/Http/Livewire/LogoutOtherBrowserSessionsForm.php
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ public function confirmLogout()
{
$this->password = '';

$this->dispatchBrowserEvent('confirming-logout-other-browser-sessions');
$this->dispatch('confirming-logout-other-browser-sessions');

$this->confirmingLogout = true;
}
@@ -71,7 +71,7 @@ public function logoutOtherBrowserSessions(StatefulGuard $guard)

$this->confirmingLogout = false;

$this->emit('loggedOut');
$this->dispatch('loggedOut');
}

/**
2 changes: 1 addition & 1 deletion src/Http/Livewire/TeamMemberManager.php
Original file line number Diff line number Diff line change
@@ -116,7 +116,7 @@ public function addTeamMember()

$this->team = $this->team->fresh();

$this->emit('saved');
$this->dispatch('saved');
}

/**
2 changes: 1 addition & 1 deletion src/Http/Livewire/UpdatePasswordForm.php
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@ public function updatePassword(UpdatesUserPasswords $updater)
'password_confirmation' => '',
];

$this->emit('saved');
$this->dispatch('saved');
}

/**
6 changes: 3 additions & 3 deletions src/Http/Livewire/UpdateProfileInformationForm.php
Original file line number Diff line number Diff line change
@@ -67,9 +67,9 @@ public function updateProfileInformation(UpdatesUserProfileInformation $updater)
return redirect()->route('profile.show');
}

$this->emit('saved');
$this->dispatch('saved');

$this->emit('refresh-navigation-menu');
$this->dispatch('refresh-navigation-menu');
}

/**
@@ -81,7 +81,7 @@ public function deleteProfilePhoto()
{
Auth::user()->deleteProfilePhoto();

$this->emit('refresh-navigation-menu');
$this->dispatch('refresh-navigation-menu');
}

/**
4 changes: 2 additions & 2 deletions src/Http/Livewire/UpdateTeamNameForm.php
Original file line number Diff line number Diff line change
@@ -47,9 +47,9 @@ public function updateTeamName(UpdatesTeamNames $updater)

$updater->update($this->user, $this->team, $this->state);

$this->emit('saved');
$this->dispatch('saved');

$this->emit('refresh-navigation-menu');
$this->dispatch('refresh-navigation-menu');
}

/**
16 changes: 8 additions & 8 deletions src/InteractsWithBanner.php
Original file line number Diff line number Diff line change
@@ -12,10 +12,10 @@ trait InteractsWithBanner
*/
protected function banner($message)
{
$this->dispatchBrowserEvent('banner-message', [
'style' => 'success',
'message' => $message,
]);
$this->dispatch('banner-message',
style: 'success',
message: $message,
);
}

/**
@@ -26,9 +26,9 @@ protected function banner($message)
*/
protected function dangerBanner($message)
{
$this->dispatchBrowserEvent('banner-message', [
'style' => 'danger',
'message' => $message,
]);
$this->dispatch('banner-message',
style: 'danger',
message: $message,
);
}
}
9 changes: 0 additions & 9 deletions stubs/livewire/resources/js/app.js

This file was deleted.

12 changes: 6 additions & 6 deletions stubs/livewire/resources/views/api/api-token-manager.blade.php
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
<!-- Token Name -->
<div class="col-span-6 sm:col-span-4">
<x-label for="name" value="{{ __('Token Name') }}" />
<x-input id="name" type="text" class="mt-1 block w-full" wire:model.defer="createApiTokenForm.name" autofocus />
<x-input id="name" type="text" class="mt-1 block w-full" wire:model="createApiTokenForm.name" autofocus />
<x-input-error for="name" class="mt-2" />
</div>

@@ -25,7 +25,7 @@
<div class="mt-2 grid grid-cols-1 md:grid-cols-2 gap-4">
@foreach (Laravel\Jetstream\Jetstream::$permissions as $permission)
<label class="flex items-center">
<x-checkbox wire:model.defer="createApiTokenForm.permissions" :value="$permission"/>
<x-checkbox wire:model="createApiTokenForm.permissions" :value="$permission"/>
<span class="ml-2 text-sm text-gray-600 dark:text-gray-400">{{ $permission }}</span>
</label>
@endforeach
@@ -94,7 +94,7 @@
@endif

<!-- Token Value Modal -->
<x-dialog-modal wire:model="displayingToken">
<x-dialog-modal wire:model.live="displayingToken">
<x-slot name="title">
{{ __('API Token') }}
</x-slot>
@@ -119,7 +119,7 @@ class="mt-4 bg-gray-100 px-4 py-2 rounded font-mono text-sm text-gray-500 w-full
</x-dialog-modal>

<!-- API Token Permissions Modal -->
<x-dialog-modal wire:model="managingApiTokenPermissions">
<x-dialog-modal wire:model.live="managingApiTokenPermissions">
<x-slot name="title">
{{ __('API Token Permissions') }}
</x-slot>
@@ -128,7 +128,7 @@ class="mt-4 bg-gray-100 px-4 py-2 rounded font-mono text-sm text-gray-500 w-full
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
@foreach (Laravel\Jetstream\Jetstream::$permissions as $permission)
<label class="flex items-center">
<x-checkbox wire:model.defer="updateApiTokenForm.permissions" :value="$permission"/>
<x-checkbox wire:model="updateApiTokenForm.permissions" :value="$permission"/>
<span class="ml-2 text-sm text-gray-600 dark:text-gray-400">{{ $permission }}</span>
</label>
@endforeach
@@ -147,7 +147,7 @@ class="mt-4 bg-gray-100 px-4 py-2 rounded font-mono text-sm text-gray-500 w-full
</x-dialog-modal>

<!-- Delete Token Confirmation Modal -->
<x-confirmation-modal wire:model="confirmingApiTokenDeletion">
<x-confirmation-modal wire:model.live="confirmingApiTokenDeletion">
<x-slot name="title">
{{ __('Delete API Token') }}
</x-slot>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@props(['on'])

<div x-data="{ shown: false, timeout: null }"
x-init="@this.on('{{ $on }}', () => { clearTimeout(timeout); shown = true; timeout = setTimeout(() => { shown = false }, 2000); })"
x-init="@this.on('{{ $on }}', () => { clearTimeout(timeout); shown = true; timeout = setTimeout(() => { shown = false }, 2000); })"
x-show.transition.out.opacity.duration.1500ms="shown"
x-transition:leave.opacity.duration.1500ms
style="display: none;"
10 changes: 4 additions & 6 deletions stubs/livewire/resources/views/components/banner.blade.php
Original file line number Diff line number Diff line change
@@ -4,12 +4,10 @@
:class="{ 'bg-indigo-500': style == 'success', 'bg-red-700': style == 'danger', 'bg-gray-500': style != 'success' && style != 'danger' }"
style="display: none;"
x-show="show && message"
x-init="
document.addEventListener('banner-message', event => {
style = event.detail.style;
message = event.detail.message;
show = true;
});
x-on:banner-message.window="
style = event.detail.style;
message = event.detail.message;
show = true;
">
<div class="max-w-screen-xl mx-auto py-2 px-3 sm:px-6 lg:px-8">
<div class="flex items-center justify-between flex-wrap">
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@
</span>

@once
<x-dialog-modal wire:model="confirmingPassword">
<x-dialog-modal wire:model.live="confirmingPassword">
<x-slot name="title">
{{ $title }}
</x-slot>
@@ -26,7 +26,7 @@
<div class="mt-4" x-data="{}" x-on:confirming-password.window="setTimeout(() => $refs.confirmable_password.focus(), 250)">
<x-input type="password" class="mt-1 block w-3/4" placeholder="{{ __('Password') }}" autocomplete="current-password"
x-ref="confirmable_password"
wire:model.defer="confirmablePassword"
wire:model="confirmablePassword"
wire:keydown.enter="confirmPassword" />

<x-input-error for="confirmable_password" class="mt-2" />
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
</x-section-title>

<div class="mt-5 md:mt-0 md:col-span-2">
<form wire:submit.prevent="{{ $submit }}">
<form wire:submit="{{ $submit }}">
<div class="px-4 py-5 bg-white dark:bg-gray-800 sm:p-6 shadow {{ isset($actions) ? 'sm:rounded-tl-md sm:rounded-tr-md' : 'sm:rounded-md' }}">
<div class="grid grid-cols-6 gap-6">
{{ $form }}
2 changes: 1 addition & 1 deletion stubs/livewire/resources/views/components/modal.blade.php
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
@endphp

<div
x-data="{ show: @entangle($attributes->wire('model')).defer }"
x-data="{ show: @entangle($attributes->wire('model')) }"
x-on:close.stop="show = false"
x-on:keydown.escape.window="show = false"
x-show="show"
Loading