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: v4.0.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.4
Choose a head ref
  • 6 commits
  • 6 files changed
  • 5 contributors

Commits on Oct 3, 2023

  1. Update CHANGELOG

    driesvints authored and github-actions[bot] committed Oct 3, 2023

    Unverified

    This user has not yet uploaded their public signing key.
    Copy the full SHA
    33c5f86 View commit details

Commits on Oct 17, 2023

  1. Uses actions/checkout@v4

    nunomaduro authored Oct 17, 2023
    Copy the full SHA
    332ab32 View commit details
  2. Uses actions/checkout@v4

    nunomaduro authored Oct 17, 2023
    Copy the full SHA
    48262af View commit details

Commits on Oct 18, 2023

  1. Update UpdateProfileInformationForm.vue (#1391)

    Added missing id for the photo input so that its label works as intended.
    iamcarlos94 authored Oct 18, 2023
    Copy the full SHA
    68b787a View commit details
  2. wip

    taylorotwell committed Oct 18, 2023
    Copy the full SHA
    5b445d2 View commit details
  3. Fix Livewire component premature registration (#1390)

    REF: livewire/livewire#7076 (comment)
    
    In the latest release of Livewire, Laravel Service Container is utilized for Dependency Resolution, which after testing with a new installation of Jetstream found to have a premature component registration due to a race condition.
    
    **Explaination:**
    - Previously, mechanisms were created using standard PHP object creation `(new $mechanism)`, not involving Laravel's service container, hence no service container events were triggered. `LivewireServiceProvider::registerMechanisms()`
    - With the recent change, these mechanisms are now instantiated via Laravel's IoC service container `app($mechanism)`, causing service container events to be triggered.
    - 💡 **The core of the problem** arises when the `Livewire\Mechanisms\CompileLivewireTags` mechanism is instantiated. It extends `Illuminate\View\Compilers\ComponentTagCompiler` which has a constructor dependency of `Illuminate\View\Compilers\BladeCompiler` , and its creation via the service container triggers events. On the other hand, **the `JetstreamServiceProvider` prematurely listens to this event in the service provider `register()` method**, leading to a situation where Livewire components are being registered before all necessary mechanisms are set up, particularly the `Livewire\Mechanisms\ComponentRegistry` which comes next in order after `Livewire\Mechanisms\CompileLivewireTags`.
    
    
    **Suggested fix:**
    - Move the registration of Livewire components in `JetstreamServiceProvider` to the `boot()` method, which is where it should be. This ensures all mechanisms are in place before any component registration begins. It also makes the additional event handling for BladeCompiler resolution unnecessary. `$this->callAfterResolving(BladeCompiler::class, fn () => '');`
    Omranic authored Oct 18, 2023
    Copy the full SHA
    649364c View commit details
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
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/v4.0.2...4.x)
## [Unreleased](https://github.com/laravel/jetstream/compare/v4.0.3...4.x)

## [v4.0.3](https://github.com/laravel/jetstream/compare/v4.0.2...v4.0.3) - 2023-10-02

- [4.x] Remove outdated session migration check by [@jessarcher](https://github.com/jessarcher) in https://github.com/laravel/jetstream/pull/1385

## [v4.0.2](https://github.com/laravel/jetstream/compare/v4.0.1...v4.0.2) - 2023-09-19

42 changes: 20 additions & 22 deletions src/JetstreamServiceProvider.php
Original file line number Diff line number Diff line change
@@ -35,28 +35,6 @@ class JetstreamServiceProvider extends ServiceProvider
public function register()
{
$this->mergeConfigFrom(__DIR__.'/../config/jetstream.php', 'jetstream');

$this->callAfterResolving(BladeCompiler::class, function () {
if (config('jetstream.stack') === 'livewire' && class_exists(Livewire::class)) {
Livewire::component('navigation-menu', NavigationMenu::class);
Livewire::component('profile.update-profile-information-form', UpdateProfileInformationForm::class);
Livewire::component('profile.update-password-form', UpdatePasswordForm::class);
Livewire::component('profile.two-factor-authentication-form', TwoFactorAuthenticationForm::class);
Livewire::component('profile.logout-other-browser-sessions-form', LogoutOtherBrowserSessionsForm::class);
Livewire::component('profile.delete-user-form', DeleteUserForm::class);

if (Features::hasApiFeatures()) {
Livewire::component('api.api-token-manager', ApiTokenManager::class);
}

if (Features::hasTeamFeatures()) {
Livewire::component('teams.create-team-form', CreateTeamForm::class);
Livewire::component('teams.update-team-name-form', UpdateTeamNameForm::class);
Livewire::component('teams.team-member-manager', TeamMemberManager::class);
Livewire::component('teams.delete-team-form', DeleteTeamForm::class);
}
}
});
}

/**
@@ -91,6 +69,26 @@ public function boot()
if (config('jetstream.stack') === 'inertia' && class_exists(Inertia::class)) {
$this->bootInertia();
}

if (config('jetstream.stack') === 'livewire' && class_exists(Livewire::class)) {
Livewire::component('navigation-menu', NavigationMenu::class);
Livewire::component('profile.update-profile-information-form', UpdateProfileInformationForm::class);
Livewire::component('profile.update-password-form', UpdatePasswordForm::class);
Livewire::component('profile.two-factor-authentication-form', TwoFactorAuthenticationForm::class);
Livewire::component('profile.logout-other-browser-sessions-form', LogoutOtherBrowserSessionsForm::class);
Livewire::component('profile.delete-user-form', DeleteUserForm::class);

if (Features::hasApiFeatures()) {
Livewire::component('api.api-token-manager', ApiTokenManager::class);
}

if (Features::hasTeamFeatures()) {
Livewire::component('teams.create-team-form', CreateTeamForm::class);
Livewire::component('teams.update-team-name-form', UpdateTeamNameForm::class);
Livewire::component('teams.team-member-manager', TeamMemberManager::class);
Livewire::component('teams.delete-team-form', DeleteTeamForm::class);
}
}
}

/**
Original file line number Diff line number Diff line change
@@ -90,6 +90,7 @@ const clearPhotoFileInput = () => {
<div v-if="$page.props.jetstream.managesProfilePhotos" class="col-span-6 sm:col-span-4">
<!-- Profile Photo File Input -->
<input
id="photo"
ref="photoInput"
type="file"
class="hidden"
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@
@if (Laravel\Jetstream\Jetstream::managesProfilePhotos())
<div x-data="{photoName: null, photoPreview: null}" class="col-span-6 sm:col-span-4">
<!-- Profile Photo File Input -->
<input type="file" class="hidden"
<input type="file" id="photo" class="hidden"
wire:model.live="photo"
x-ref="photo"
x-on:change="