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

Remove final from render #105

Merged
merged 4 commits into from
May 27, 2024
Merged

Remove final from render #105

merged 4 commits into from
May 27, 2024

Conversation

deanmcpherson
Copy link
Contributor

Can we please remove final from the render method?

I'm playing with adding support for rendering react/vue components inside of volt components with https://github.com/ijpatricio/mingle, but naturally it needs to be able to hijack the render method to function.

I can't think of any reasons why removing the final keyword would be a breaking change here.

Ditch phpstan ignores
allow variables to be preserved if manually added
@@ -79,9 +79,11 @@ protected function requirePath(string $path): void
: $variable;
}, get_defined_vars());
})();
CompileContext::instance()->variables = array_merge(CompileContext::instance()->variables, $variables);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this unrelated change made?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@taylorotwell sorry, yep this was needed further down the track of my implementation. The mingle lib needs a component method defined to point to the react/vue component it should render, and I wanted to add it automatically as I'm extracting the component from the blade file itself (see https://github.com/deanmcpherson/mingle/blob/main/src/Mingle.php), but variables added to the default array before this is run were getting overridden here.

@taylorotwell taylorotwell marked this pull request as draft May 22, 2024 14:59
@driesvints driesvints marked this pull request as ready for review May 23, 2024 06:32
@@ -116,7 +116,7 @@ protected function registerTestingMacros(): void
$component = FragmentMap::get($component);
}

return $this->assertSeeLivewire($component); // @phpstan-ignore-line
return $this->assertSeeLivewire($component);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this change made?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The static analysis in the github action for the PR threw an error because there was nothing to ignore anymore. I suspect the original suppression was because of the use of final? Happy to revert

@taylorotwell taylorotwell merged commit 5973b3e into livewire:main May 27, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants