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

[10.x] Use HtmlString in Vite fake #49163

Merged
merged 2 commits into from Nov 28, 2023
Merged

Conversation

jasonvarga
Copy link
Contributor

@jasonvarga jasonvarga commented Nov 28, 2023

The change in #49150 has started to break our test suite.

Since that PR, the faked Vite instance now implements Htmlable, so we're now seeing a lot of Call to member function toHtml() on string from this line:

return $this->__invoke($this->entryPoints)->toHtml();

Since toHtml() is expecting __invoke to return an HtmlString, that's what this PR is doing.

We don't use the @vite directive (the error doesn't happen if you do). We use the facade essentially like this:

{{ Vite::withEntryPoints(['path/to/file.css']) }}

For the test I just slapped on ->toHtml() the same way you do that in https://github.com/laravel/framework/blob/10.x/tests/Foundation/FoundationViteTest.php

@jasonvarga jasonvarga changed the title Use HtmlString in Vite fake [10.x] Use HtmlString in Vite fake Nov 28, 2023
@taylorotwell taylorotwell merged commit b6cb872 into laravel:10.x Nov 28, 2023
20 checks passed
@jasonvarga jasonvarga deleted the patch-1 branch November 28, 2023 18:37
@jasonvarga
Copy link
Contributor Author

Thanks for the quick turnaround.

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.

None yet

2 participants